:root {
  --emerald: #025E45;
  --emerald-dark: #014331;
  --emerald-light: #0A7B5C;
  --emerald-soft: #E6F4EF;
  --amber: #D97706;
  --amber-light: #F59E0B;
  --amber-soft: #FEF3C7;
  --navy: #0F233C;
  --bg: #F4F7F5;
  --surface: #FFFFFF;
  --surface-alt: #EEF3F0;
  --border: #DCE5DF;
  --text: #14261F;
  --muted: #526B61;
  --danger: #B91C1C;
  --danger-bg: #FEE2E2;
  --success: #047857;
  --success-bg: #D1FAE5;
  --info: #1D4ED8;
  --info-bg: #DBEAFE;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(2, 94, 69, 0.07);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, "IRANSans", Tahoma, "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--emerald);
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--emerald);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid var(--emerald-soft);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Header & Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 2px 8px rgba(2, 94, 69, 0.2);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--emerald);
  margin: 0;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
  min-height: 40px;
}

.nav-btn:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.nav-btn.active {
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 700;
}

.nav-badge {
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 84px;
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card-soft {
  background: var(--emerald-soft);
  border: 1px solid #C2E5D8;
  border-radius: var(--radius);
  padding: 16px;
}

.card-amber {
  background: var(--amber-soft);
  border: 1px solid #FCD34D;
  border-radius: var(--radius);
  padding: 16px;
}

.card-navy {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.row-gap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Hero Banner */
.hero {
  background: linear-gradient(135deg, var(--emerald-dark) 0%, var(--emerald) 65%, var(--emerald-light) 100%);
  color: #fff;
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 14px 32px rgba(2, 94, 69, 0.22);
  position: relative;
  overflow: hidden;
}

.hero-pill {
  display: inline-block;
  background: var(--amber-light);
  color: #3E2000;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.4;
}

.hero p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 680px;
  font-size: 14.5px;
}

/* Buttons & Inputs */
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--emerald);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald-dark);
}

.btn-amber {
  background: var(--amber);
  color: #fff;
}

.btn-amber:hover:not(:disabled) {
  background: #B45309;
}

.btn-outline {
  background: transparent;
  color: var(--emerald);
  border: 1.5px solid var(--emerald);
}

.btn-outline:hover:not(:disabled) {
  background: var(--emerald-soft);
}

.btn-white {
  background: #fff;
  color: var(--emerald-dark);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--emerald);
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

/* Badges / Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--info-bg);
  color: var(--info);
}

.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--amber-soft); color: #92400E; }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-muted { background: var(--surface-alt); color: var(--muted); }

/* Job & Category Cards */
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cat-card:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card:hover {
  border-color: var(--emerald);
  box-shadow: 0 8px 26px rgba(2, 94, 69, 0.11);
}

.job-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.job-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.thumb-lg {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--emerald);
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* Chip selectors */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip.selected {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

/* Sub-tabs inside panels */
.subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

/* Chat bubbles */
.chat-box {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
}

.msg-me {
  align-self: flex-start;
  background: var(--emerald);
  color: #fff;
}

.msg-other {
  align-self: flex-end;
  background: #fff;
  border: 1px solid var(--border);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 26, 20, 0.55);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-panel {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

/* Toast */
#toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 92vw;
}

.toast {
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--emerald);
}

/* FAQ Accordion */
details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}

details.faq summary {
  font-weight: 700;
  cursor: pointer;
}

details.faq p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.ltr-num {
  direction: ltr;
  display: inline-block;
}

/* Responsive */
@media (max-width: 820px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 20px; }
  .nav-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .nav-btn { white-space: nowrap; }
}
