/* ══════════════════════════════════════════════════════════════
   Design tokens

   Colour tokens are split in two on purpose:
   - the brand ramp (primary/accent/semantic) is fixed and identical in
     both themes, so a chart or a badge keeps its meaning;
   - the surface ramp (bg/surface/text/border/shadow) is what the theme
     swaps. Only that second group is redefined further down.

   Never give a colour its only definition inside the dark blocks — an
   element styled that way renders one theme's text on the other's ground.
   ══════════════════════════════════════════════════════════════ */
:root {
  /* brand — theme-independent */
  --primary: #0D1B3D;
  --primary-mid: #102A43;
  --primary-lit: #B7C4DC;
  --primary-pale: #EAF0F8;
  --accent: #0097A7;
  --accent-light: #41C7C7;
  --accent-pale: #E0F4F6;
  --accent-deep: #006D77;
  --success: #2EAD68;
  --green-lit: #DCF3E6;
  --orange: #d97706;
  --red: #dc2626;
  --red-lit: #FDE8E8;
  --red-text: #B91C1C;

  /* surface — swapped by the theme */
  --surface: #FFFFFF;
  --bg: #F6F8FB;
  --bg2: #EDF1F7;
  --border: #E6EAF0;
  --border-soft: rgba(13,27,61,.07);
  --text: #172033;
  --text-mid: #4A5468;
  --text-muted: #6B7280;
  --on-dark: #FFFFFF;          /* text on the gradient hero, both themes */
  --shadow: 0 1px 3px rgba(13,27,61,.05), 0 1px 2px rgba(13,27,61,.06);
  --shadow-md: 0 4px 16px rgba(13,27,61,.06), 0 2px 6px rgba(13,27,61,.04);
  --shadow-lg: 0 12px 40px rgba(13,27,61,.10), 0 4px 12px rgba(13,27,61,.05);
  --shadow-glow: 0 0 30px rgba(0,151,167,.15);
  --glass: rgba(255,255,255,.8);
  --glass-border: rgba(230,234,240,.9);

  /* Foregrounds for the tinted backgrounds. Those tints go dark in the dark
     theme, so text on them has to lighten with them — six rules used to pair a
     deep brand colour with its own tint and became dark-on-dark. */
  --strong: #0D1B3D;           /* emphatic text on a normal surface */
  --success-text: #1F7A4C;     /* --success is too light to read on a surface */
  --warn-text: #96460A;        /* "needs attention" text; #B45309 measured 4.38:1 */
  --accent-text: #00707C;      /* likewise --accent / --accent-light */
  --on-tint: #0D1B3D;          /* on --primary-pale */
  --on-tint-accent: #0097A7;   /* on --accent-pale */
  --on-tint-success: #1F7A4C;  /* on --green-lit */

  /* type scale */
  --step--1: .78rem;
  --step-0: .875rem;
  --step-1: 1.05rem;
  --step-2: 1.35rem;
  --step-3: 1.8rem;
  --step-4: 2.4rem;

  /* spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* stacking order — these used to be magic numbers */
  --z-nav: 200;
  --z-dropdown: 300;
  --z-modal: 400;
  --z-toast: 500;

  --radius: 16px;
  --radius-sm: 10px;
}

/* Dark: the OS preference, unless the reader explicitly chose light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #151C28;
    --bg: #0E141D;
    --bg2: #1B2432;
    --border: #27313F;
    --border-soft: rgba(255,255,255,.06);
    --text: #E6EAF0;
    --text-mid: #B3BCCA;
    --text-muted: #8A94A3;
    --primary-pale: #1B2432;
    --accent-pale: #10333A;
    --green-lit: #16301F;
    --red-lit: #331A1A;
    --shadow: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 16px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.4);
    --glass: rgba(21,28,40,.82);
    --glass-border: rgba(39,49,63,.9);
    --strong: #F2F5F9;
    --success-text: #6FD79B;
    --warn-text: #F0B657;
    --accent-text: #4FD1DA;
    --on-tint: #B7C4DC;
    --on-tint-accent: #4FD1DA;
    --on-tint-success: #6FD79B;
  }
}

/* Dark: chosen explicitly, which must win over a light OS too. */
:root[data-theme="dark"] {
  --surface: #151C28;
  --bg: #0E141D;
  --bg2: #1B2432;
  --border: #27313F;
  --border-soft: rgba(255,255,255,.06);
  --text: #E6EAF0;
  --text-mid: #B3BCCA;
  --text-muted: #8A94A3;
  --primary-pale: #1B2432;
  --accent-pale: #10333A;
  --green-lit: #16301F;
  --red-lit: #331A1A;
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.4);
  --glass: rgba(21,28,40,.82);
  --glass-border: rgba(39,49,63,.9);
  /* These four were defined only in the prefers-color-scheme block above, so
     picking dark from the toggle on a light OS left them at their light values
     — dark text on the newly dark surfaces. Every token the media query
     redefines has to be redefined here too. */
  --strong: #F2F5F9;
  --success-text: #6FD79B;
  --warn-text: #F0B657;
  --accent-text: #4FD1DA;
  --on-tint: #B7C4DC;
  --on-tint-accent: #4FD1DA;
  --on-tint-success: #6FD79B;
}

* { font-family: 'Vazirmatn', Tahoma, sans-serif; box-sizing: border-box; }

body {
  background: var(--bg); color: var(--text); margin: 0;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.navbar {
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(1.8);
  -webkit-backdrop-filter: blur(12px) saturate(1.8);
  border-bottom: 1px solid var(--glass-border);
  padding: 10px 0;
  position: sticky; top: 0; z-index: 200;
  will-change: backdrop-filter, transform;
  transform: translateZ(0);
  contain: paint;
}
/* The gradient used to sit on .navbar-brand itself, but background-clip:text
   with a transparent fill would swallow the inlined mark too. It moves to the
   wordmark, leaving the mark free to take its own colour. */
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}
/* The mark is a gradient tile now, so it carries its own ground and needs no
   per-theme colour — only the lift on hover. */
.brand-mark {
  flex: none;
  border-radius: 7px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.navbar-brand:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,27,61,.28);
}

.nav-link {
  color: var(--text-mid) !important;
  font-size: .82rem; font-weight: 600;
  padding: 7px 14px !important;
  border-radius: var(--radius-sm);
  transition: .2s;
  text-decoration: none;
  position: relative;
}
.nav-link:hover {
  background: var(--primary-pale);
  color: var(--on-tint) !important;
}
.nav-link.active {
  background: var(--primary-pale);
  color: var(--on-tint) !important;
  font-weight: 700;
}
.navbar-toggler {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(0,151,167,.15);
}
@media (min-width: 992px) {
  .nav-main-links, .nav-auth { flex-direction: row; align-items: center; gap: 4px; }
}
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-top: 10px;
    padding: 10px 12px;
  }
  .navbar-collapse .nav-link {
    display: block;
    padding: 11px 14px !important;
    font-size: .88rem;
  }
  .nav-auth {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 10px;
  }
  .nav-register { text-align: center; }
}

/* ── Hero ── */
.hero {
  background:
    radial-gradient(circle at 35% 30%, rgba(0,151,167,0.35), transparent 35%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 55%, var(--accent-deep) 100%);
  color: #fff;
  padding: 56px 0 48px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 88%, rgba(65,199,199,.16) 0%, transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.05) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(65,199,199,.5), transparent);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: 2.05rem; font-weight: 900; margin-bottom: 12px;
  letter-spacing: -.01em;
  text-shadow: 0 2px 20px rgba(0,0,0,.25);
  line-height: 1.6;
}
.hero p { font-size: .9rem; opacity: .8; margin: 0; font-weight: 400; line-height: 2; }
.hero .btn-light {
  background: #fff; color: var(--primary); border: none;
}
.hero .btn-light:hover { background: #EAF0F8; color: var(--primary); }
.hero .btn-outline-light {
  background: transparent; border: 1px solid rgba(255,255,255,.55); color: #fff;
}
.hero .btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }

/* ── Stats page: filter bar ── */
.stats-filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  box-shadow: var(--shadow);
}
/* Stats filters: checkbox dropdowns (year / month / platform). */
.sf-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sf-title { font-size: .8rem; font-weight: 800; color: var(--text-mid); display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 4px; }
.sf-drop { position: relative; }
.sf-btn {
  display: inline-flex; align-items: center; gap: 8px; min-width: 150px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: .8rem; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.sf-btn:hover { border-color: var(--accent); }
.sf-key { font-weight: 800; color: var(--text-muted); }
.sf-key::after { content: ':'; }
.sf-val { font-weight: 700; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-chev { margin-inline-start: auto; font-size: .7rem; color: var(--text-muted); transition: transform .2s; }
.sf-drop.open .sf-chev { transform: rotate(180deg); }
.sf-drop.open .sf-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); background: var(--surface); }
.sf-drop.has-value .sf-btn { background: var(--accent-pale); border-color: var(--accent); }
.sf-drop.has-value .sf-val { color: var(--accent-text); }

.sf-panel {
  display: none; position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: var(--z-dropdown);
  width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px;
}
.sf-wide .sf-panel { width: 270px; }
.sf-drop.open .sf-panel { display: block; animation: sfIn .14s ease-out; }
@keyframes sfIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.sf-search { position: relative; margin-bottom: 6px; }
.sf-search i { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--text-muted); }
.sf-search input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--bg);
  padding: 6px 30px 6px 10px; font: inherit; font-size: .78rem; color: var(--text); outline: none;
}
.sf-search input:focus { border-color: var(--accent); background: var(--surface); }

.sf-list { display: flex; flex-direction: column; gap: 2px; }
.sf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 4px; }
.sf-scroll { max-height: 260px; overflow-y: auto; }
.sf-scroll { scrollbar-width: thin; scrollbar-color: var(--primary-lit) transparent; }
.sf-scroll::-webkit-scrollbar { width: 6px; }
.sf-scroll::-webkit-scrollbar-thumb { background: var(--primary-lit); border-radius: 99px; }
.sf-opt {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px;
  font-size: .8rem; color: var(--text); cursor: pointer; user-select: none; margin: 0;
}
.sf-opt:hover { background: var(--bg); }
.sf-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sf-box {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; border: 1.5px solid var(--primary-lit);
  display: inline-flex; align-items: center; justify-content: center; transition: .12s; background: var(--surface);
}
.sf-box i { font-size: .72rem; color: #fff; opacity: 0; transform: scale(.6); transition: .12s; }
.sf-opt input:checked + .sf-box { background: var(--accent); border-color: var(--accent); }
.sf-opt input:checked + .sf-box i { opacity: 1; transform: none; }
.sf-opt input:focus-visible + .sf-box { box-shadow: 0 0 0 3px var(--accent-pale); }
.sf-opt input:checked ~ .sf-text { font-weight: 700; }

.sf-actions { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sf-actions button { flex: 1; border-radius: 8px; padding: 6px; font: inherit; font-size: .76rem; font-weight: 800; cursor: pointer; }
.sf-apply { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.sf-apply:hover { background: var(--accent-deep); }
.sf-clear { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }
.sf-clear:hover { border-color: var(--text-muted); }

.sf-reset { font-size: .76rem; font-weight: 700; color: var(--red-text); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; }
.sf-reset:hover { text-decoration: underline; color: var(--red-text); }

@media (max-width: 576px) {
  .sf-drop, .sf-btn { width: 100%; }
  .sf-panel, .sf-wide .sf-panel { width: 100%; }
  .sf-reset { margin-inline-start: 0; }
}

/* ── Stats page: sectioned sidebar ── */
.stats-shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: var(--sp-4);
  align-items: start;
}
.stats-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2);
  box-shadow: var(--shadow);
  position: sticky;
  top: 84px;                 /* clears the sticky navbar */
}
.stats-nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 10px var(--sp-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-mid);
  font-size: var(--step-0);
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.stats-nav-link .ico {
  flex: none; width: 1.3em; text-align: center;
  color: var(--text-muted); font-weight: 400;
}
.stats-nav-link .n {
  margin-inline-start: auto;
  font-size: var(--step--1);
  color: var(--text-muted);
  font-weight: 600;
}
.stats-nav-link:hover { background: var(--bg2); color: var(--strong); }
.stats-nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stats-nav-link.is-active { background: var(--primary); color: var(--on-dark); }
.stats-nav-link.is-active .ico,
.stats-nav-link.is-active .n { color: var(--on-dark); opacity: .8; }

.stats-section { display: none; }
.stats-section.is-active { display: block; }
.stats-ch-title { font-size: var(--step-0); font-weight: 800; margin: 0 0 var(--sp-2); }
.stats-ch-sub {
  font-size: var(--step--1); color: var(--text-muted);
  margin: -4px 0 var(--sp-3); line-height: 1.8;
}

@media (max-width: 991.98px) {
  /* the rail becomes a scrolling row of chips above the charts */
  .stats-shell { grid-template-columns: 1fr; }
  .stats-nav {
    flex-direction: row;
    position: static;
    overflow-x: auto;
    padding: var(--sp-2);
  }
  .stats-nav-link { width: auto; white-space: nowrap; }
  .stats-nav-link .n { display: none; }
}

/* ── Collapsible filters (phones only) ── */
.lst-filters-toggle {
  display: none;                 /* tablet and up: the row is always open */
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  margin-top: var(--sp-3);
  padding: 10px var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text-mid);
  font-size: var(--step-0);
  font-weight: 700;
  cursor: pointer;
}
.lst-filters-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lst-filters-caret { margin-inline-start: auto; transition: transform .2s ease; }
.lst-filters-toggle[aria-expanded="true"] .lst-filters-caret { transform: rotate(180deg); }
.lst-filters-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
@media (max-width: 767.98px) {
  .lst-filters-toggle { display: flex; }
  .lst-filter-card .lst-filters-row { display: none; }
  .lst-filter-card .lst-filters-row.is-open { display: flex; }
}

/* Honour the reader's motion setting. AOS, the card entrance and the progress
   shimmer all ran unconditionally before this. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-aos] { opacity: 1 !important; transform: none !important; }
}

/* ── Page head ──
   The compact header for inner pages. The full .hero above belongs to the
   landing page, where its numbers are news; everywhere else it repeated the
   same three figures and cost ~250px of desktop and ~470px of phone before any
   content. On the projects page those numbers also appear a few hundred pixels
   lower, in the filter badge and the status tabs. */
.page-head {
  background:
    radial-gradient(circle at 30% 40%, rgba(0,151,167,.30), transparent 45%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 60%, var(--accent-deep) 100%);
  color: var(--on-dark);
  padding: var(--sp-4) 0;
  margin-bottom: var(--sp-5);
  position: relative;
}
.page-head::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(65,199,199,.5), transparent);
}
.page-head-inner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
}
.page-head h1 {
  font-size: var(--step-2);
  font-weight: 800;
  margin: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.page-head h1 i { font-size: var(--step-1); opacity: .85; }
.page-head p {
  font-size: var(--step--1);
  opacity: .82;
  margin: 0;
  line-height: 1.9;
}
@media (max-width: 575.98px) {
  .page-head { padding: var(--sp-3) 0; margin-bottom: var(--sp-4); }
  .page-head h1 { font-size: var(--step-1); }
  .page-head p { display: none; }   /* the title alone carries it on a phone */
}

.stat-card {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px; padding: 18px 14px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: .25s;
}
.stat-card:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(65,199,199,.45);
  transform: translateY(-2px);
}
.stat-card .val { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.stat-card .lbl { font-size: .68rem; opacity: .65; margin-top: 6px; font-weight: 500; }

/* ── Filters (legacy) ── */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-tab {
  padding: 6px 16px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-mid);
  font-size: .8rem; font-weight: 600;
  text-decoration: none; transition: .15s;
}
.filter-tab:hover { border-color: var(--strong); color: var(--strong); }
.filter-tab.active {
  background: var(--primary); color: #fff;
  border-color: var(--strong);
  box-shadow: 0 2px 8px rgba(13,27,61,.25);
}
.form-control, .form-select {
  border-color: var(--border) !important;
  font-size: .85rem !important;
  box-shadow: none !important;
}
.btn-primary {
  background: var(--primary) !important; border: none !important;
  font-size: .85rem !important; font-weight: 700 !important;
}

/* ═══════════════════════════════════════════
   List Page Filters
   ═══════════════════════════════════════════ */
.lst-filter-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px 26px;
  margin-top: -24px;
  margin-bottom: 22px;
  position: relative;
  z-index: 10;
}
.lst-search-row {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.lst-search-box {
  flex: 1;
  display: flex; align-items: center;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0 16px;
  transition: .25s;
}
.lst-search-box:focus-within {
  border-color: var(--strong);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0,151,167,.12);
}
.lst-search-box i {
  color: var(--text-muted); font-size: 1rem;
  margin-left: 10px;
}
.lst-search-box input {
  flex: 1;
  border: none; background: transparent;
  padding: 12px 10px;
  font-size: .88rem; font-weight: 500;
  color: var(--text);
  outline: none;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.lst-search-box input::placeholder { color: var(--text-muted); }
.lst-search-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 9px 22px;
  font-size: .8rem; font-weight: 700;
  cursor: pointer;
  transition: .2s;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(13,27,61,.25);
}
.lst-search-btn:hover {
  box-shadow: 0 4px 16px rgba(13,27,61,.32);
  transform: translateY(-1px);
}

.lst-total-badge {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--primary-pale), #d7efe6);
  color: var(--strong);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: .82rem; font-weight: 800;
  white-space: nowrap;
  border: 1px solid var(--primary-lit);
}

.lst-filters-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.lst-filter-item {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  min-height: 40px;
  font-size: .82rem;
  transition: .2s;
}
.lst-filter-item:hover { border-color: var(--primary-lit); }
.lst-filter-item i { color: var(--strong); font-size: .88rem; flex-shrink: 0; }
.lst-filter-item select,
.lst-filter-item input {
  border: none; background: transparent;
  font-size: .8rem; font-weight: 600;
  color: var(--text);
  padding: 8px 4px;
  outline: none;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  min-width: 95px;
}
.lst-filter-range { gap: 4px; }
.lst-filter-range input { width: 65px; min-width: 55px; text-align: center; }
.lst-range-sep { font-size: .72rem; color: var(--text-muted); font-weight: 600; }

.lst-clear-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 700;
  color: var(--red);
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  text-decoration: none;
  transition: .2s;
}
.lst-clear-btn:hover {
  background: #fee2e2; color: #b91c1c;
  transform: translateY(-1px);
}

/* Guest gate under the plan list — page one is free, the rest is an account.
   Colours come from the site's own tokens so the button follows light and dark
   like every other surface. */
.lst-gate {
  margin-top: 32px;
  text-align: center;
}
.lst-gate-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 34px;
  border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 800;
  color: #fff;
  background: var(--primary);
  border: none;
  text-decoration: none;
  transition: .2s;
}
.lst-gate-btn:hover {
  color: #fff;
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(13, 27, 61, .22);
}

@media (max-width: 575px) {
  .lst-gate-btn { width: 100%; justify-content: center; padding: 12px 20px; }
}

/* Status Tabs */
.lst-status-tabs {
  display: flex; gap: 10px; margin-bottom: 24px;
}
.lst-stab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: .84rem; font-weight: 700;
  text-decoration: none;
  transition: .25s;
  box-shadow: var(--shadow);
}
.lst-stab i { font-size: .88rem; }
.lst-stab:hover {
  border-color: var(--primary-lit);
  color: var(--on-tint);
  background: var(--primary-pale);
  transform: translateY(-1px);
}
.lst-stab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(13,27,61,.25);
}
.lst-stab-green.active {
  background: linear-gradient(135deg, #059669, var(--success));
  box-shadow: 0 4px 16px rgba(16,185,129,.3);
}
.lst-stab-blue.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.lst-stab-count {
  font-size: .68rem; font-weight: 800;
  padding: 2px 9px; border-radius: 10px;
  background: rgba(255,255,255,.25);
}

/* Empty State */
.lst-empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}
.lst-empty i { color: var(--border); margin-bottom: 16px; }
.lst-empty h5 { font-weight: 800; color: var(--text); margin-bottom: 8px; }
.lst-empty p { font-size: .85rem; margin: 0; }

/* Pagination */
.pagination .page-link {
  border-color: var(--border); color: var(--text-mid);
  font-size: .82rem; border-radius: var(--radius-sm) !important;
  margin: 0 3px;
  padding: 8px 14px;
  transition: .2s;
  font-weight: 600;
}
.pagination .page-link:hover {
  background: var(--primary-pale); color: var(--on-tint);
  border-color: var(--primary-lit);
  transform: translateY(-1px);
}
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(13,27,61,.25);
}

/* Select2 RTL */
.select2-container { direction: rtl; font-family: 'Vazirmatn', Tahoma, sans-serif; }
.select2-container--default .select2-selection--single {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  height: 40px !important;
  padding: 5px 12px !important;
  background: var(--bg) !important;
  transition: .2s !important;
}
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(0,151,167,.12) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 28px !important;
  font-size: .82rem !important; font-weight: 600 !important;
  color: var(--text) !important;
  padding: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
  left: 8px !important; right: auto !important;
}
.select2-dropdown {
  border-color: var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
}
.select2-results__option {
  font-size: .82rem !important;
  padding: 10px 16px !important;
  transition: .15s !important;
}
.select2-container--default .select2-results__option--selected {
  background: var(--primary-pale) !important;
  color: var(--on-tint) !important;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid)) !important;
}
.select2-search--dropdown .select2-search__field {
  border-radius: 8px !important;
  border-color: var(--border) !important;
  font-size: .82rem !important;
  padding: 8px 12px !important;
}

@media (max-width: 768px) {
  .lst-search-row { flex-direction: column; }
  .lst-total-badge { align-self: flex-start; }
  .lst-filters-row { gap: 8px; }
  .lst-filter-item { flex: 1; min-width: calc(50% - 8px); }
  .lst-status-tabs { flex-wrap: wrap; gap: 8px; }
  .hero { padding: 38px 0 34px; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: .82rem; }
  .stat-card { padding: 14px 10px; }
  .stat-card .val { font-size: 1.4rem; }
  .lst-filter-card { padding: 16px; }
  .detail-body { padding: 20px 18px; }
}

/* ═══════════════════════════════════════════
   Project Card
   ═══════════════════════════════════════════ */
.card-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.card-link:hover { color: inherit; }

.pcard {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
  padding: 0;
  height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  animation: fadeUp .4s ease both;   /* was a second .pcard rule 175 lines below */
}
.pcard::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity .3s;
}
.pcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.pcard:hover::before { opacity: 1; }

/* Head */
.pcard-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px 0;
}
.pcard-platform {
  font-size: .68rem; font-weight: 700; color: #fff;
  padding: 4px 14px; border-radius: 20px;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.pcard-status {
  font-size: .64rem; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  display: flex; align-items: center;
}
.st-collecting {
  background: var(--green-lit);
  color: var(--on-tint-success);
  border: 1px solid #B5E3C9;
}
.st-funded {
  background: var(--primary-pale);
  color: var(--on-tint);
  border: 1px solid var(--primary-lit);
}

/* Body */
.pcard-title {
  font-size: .86rem; font-weight: 800; line-height: 1.75;
  color: var(--text); margin: 12px 18px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 46px;
}
.pcard-company {
  font-size: .72rem; color: var(--text-muted); font-weight: 500;
  margin: 3px 18px 0; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Highlights */
.pcard-highlights {
  display: flex; gap: 0; margin: 0;
  border-bottom: 1px solid var(--border);
}
.hl-box {
  flex: 1; padding: 13px 16px;
  display: flex; flex-direction: column;
  justify-content: center;
}
.hl-box + .hl-box { border-right: 1px solid var(--border); }
.hl-label { font-size: .62rem; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.hl-val { font-size: .84rem; font-weight: 800; color: var(--text); }
.hl-issuer { font-size: .78rem; font-weight: 700; color: var(--strong); }
.hl-unknown { color: var(--text-muted) !important; font-weight: 500 !important; }
.hl-row { display: flex; justify-content: space-between; align-items: baseline; }
.hl-row + .hl-row { margin-top: 6px; }

.hl-profit { text-align: center; background: linear-gradient(180deg, rgba(46,173,104,.04), rgba(46,173,104,.09)); }
.hl-profit .hl-label { margin-bottom: 3px; }
.hl-profit .hl-val {
  color: var(--success-text); font-size: 1.35rem; letter-spacing: -.5px;
  font-weight: 900;
}
.hl-guarantee .hl-val { color: var(--strong); font-size: .78rem; }
.hl-guarantee .hl-row .hl-label { margin-bottom: 0; }

/* Metrics */
.pcard-metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.metric {
  padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.metric:nth-child(odd) { border-left: 1px solid var(--border); }
.metric:nth-last-child(-n+2) { border-bottom: none; }
.metric-lbl { font-size: .64rem; color: var(--text-muted); font-weight: 500; }
.metric-val { font-size: .8rem; font-weight: 800; color: var(--text); }

/* Progress */
.pcard-progress { padding: 16px 20px 0; }
.pbar-track {
  height: 24px; border-radius: 12px;
  background: var(--bg); overflow: hidden;
  border: 1px solid var(--border);
}
.pbar-fill {
  height: 100%; border-radius: 12px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: flex-end;
  min-width: 36px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.pbar-fill.complete {
  background: linear-gradient(90deg, #059669 0%, var(--success) 50%, #06d6a0 100%);
}
.pbar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.pbar-pct {
  font-size: .66rem; font-weight: 800; color: #fff;
  position: relative; z-index: 1; padding: 0 10px;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pbar-details {
  display: flex; justify-content: space-between; margin-top: 8px;
}
.pbar-item-lbl { font-size: .58rem; color: var(--text-muted); display: block; }
.pbar-item-val { font-size: .72rem; font-weight: 800; color: var(--text); }

/* Card Footer */
.pcard-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px 16px;
  margin-top: auto;
}
.pcard-date { font-size: .66rem; color: var(--text-muted); font-weight: 500; }
.pcard-cta {
  font-size: .7rem; font-weight: 800; color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--accent-pale);
  background: var(--accent-pale);
  border-radius: 8px; padding: 4px 12px;
  transition: .18s;
}
.pcard:hover .pcard-cta { background: var(--accent); color: #fff; }
.pcard-extlink {
  font-size: .68rem; font-weight: 700; color: var(--strong);
  cursor: pointer;
  transition: .15s;
  display: flex; align-items: center; gap: 4px;
}
.pcard-extlink:hover { color: var(--accent); }

/* Animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.col:nth-child(1) .pcard { animation-delay: .03s; }
.col:nth-child(2) .pcard { animation-delay: .08s; }
.col:nth-child(3) .pcard { animation-delay: .13s; }
.col:nth-child(4) .pcard { animation-delay: .18s; }
.col:nth-child(5) .pcard { animation-delay: .23s; }
.col:nth-child(6) .pcard { animation-delay: .28s; }

/* ── Detail Page ── */
.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.detail-hero {
  position: relative;
  height: 200px;
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; font-weight: 900;
  color: rgba(255,255,255,.9);
}
.detail-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.04), rgba(0,0,0,.35));
}
.detail-body { padding: 28px 32px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin-top: 20px;
}
.info-item {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px 16px; border: 1px solid var(--border);
  transition: .2s;
}
.info-item:hover { border-color: var(--primary-lit); }
.info-item .lbl {
  font-size: .68rem; color: var(--text-muted);
  margin-bottom: 4px; font-weight: 500;
}
.info-item .val { font-size: .88rem; font-weight: 700; color: var(--text); }

/* Stats page */
.card {
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
}

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-mid);
  font-size: var(--step-0);
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.theme-toggle:hover {
  background: var(--bg2);
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 991.98px) {
  /* in the drawer it sits in a row of full-width links, so give it a label edge */
  .theme-toggle { margin: 6px 14px; }
}

/* ── Nav Auth ── */
.nav-divider {
  width: 1px; height: 20px;
  background: var(--border);
  margin: 0 6px;
}
.nav-register {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid)) !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
  padding: 7px 18px !important;
  box-shadow: 0 2px 8px rgba(13,27,61,.20);
  transition: .2s !important;
}
.nav-register:hover {
  box-shadow: 0 4px 14px rgba(13,27,61,.30) !important;
  transform: translateY(-1px);
}
.nav-logout {
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

/* ── Auth Pages ── */
.auth-container {
  display: flex; justify-content: center; align-items: center;
  min-height: 60vh; padding: 40px 16px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
}
.auth-header {
  text-align: center; margin-bottom: 28px;
}
.auth-header h2 {
  font-size: 1.3rem; font-weight: 900;
  color: var(--text); margin-bottom: 6px;
}
.auth-header p {
  font-size: .82rem; color: var(--text-muted); margin: 0;
}
.auth-field { margin-bottom: 18px; }
.auth-field label {
  display: block;
  font-size: .78rem; font-weight: 600;
  color: var(--text-mid); margin-bottom: 6px;
}
.auth-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: .88rem;
  background: var(--bg);
  color: var(--text);
  transition: .25s;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.auth-input:focus {
  outline: none;
  border-color: var(--strong);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0,151,167,.12);
}
.otp-input {
  text-align: center;
  letter-spacing: .6em;
  font-size: 1.2rem;
}
.auth-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .9rem; font-weight: 700;
  cursor: pointer;
  transition: .25s;
  margin-top: 8px;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  display: block; text-align: center; text-decoration: none;
  box-shadow: 0 2px 10px rgba(13,27,61,.25);
}
.auth-btn:hover {
  box-shadow: 0 4px 20px rgba(13,27,61,.32);
  transform: translateY(-1px);
  color: #fff;
}
.auth-btn-outline {
  background: transparent;
  color: var(--text-mid);
  border: 2px solid var(--border);
  box-shadow: none;
}
.auth-btn-outline:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-muted);
  box-shadow: none;
  transform: none;
}
.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: .82rem;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--strong);
  font-weight: 700;
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }
.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: .8rem;
  color: #dc2626;
}
.auth-error p { margin: 0; }
.field-error {
  display: block;
  font-size: .72rem;
  color: #dc2626;
  margin-top: 4px;
}

/* ── Profile ── */
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.8rem; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(13,27,61,.25);
}
.profile-info { margin: 24px 0; }
/* The editable half of the profile sits under the read-only facts */
.profile-form { margin-top: 22px; text-align: right; }
.profile-form .auth-btn { margin-top: 6px; }

.profile-row {
  display: flex; justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.profile-row:last-child { border-bottom: none; }
.profile-label { color: var(--text-muted); font-weight: 500; }
.profile-value { color: var(--text); font-weight: 700; }

/* ── Platform Cards ── */
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 26px;
  height: 100%;
  transition: .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.platform-card::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0; transition: opacity .3s;
}
.platform-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.platform-card:hover::before { opacity: 1; }
.platform-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.platform-name {
  font-size: .98rem; font-weight: 800; color: var(--text); margin: 0;
}
.platform-badge {
  font-size: .65rem; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  background: var(--bg); color: var(--text-muted);
  border: 1px solid var(--border);
}
.platform-badge.active {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #059669;
  border-color: #a7f3d0;
}
.platform-stats {
  display: flex; gap: 0;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.platform-stat {
  flex: 1; text-align: center;
  padding: 14px 10px;
}
.platform-stat + .platform-stat {
  border-right: 1px solid var(--border);
}
.platform-stat-val {
  display: block;
  font-size: 1rem; font-weight: 900; color: var(--strong);
}
.platform-stat-lbl {
  display: block;
  font-size: .6rem; color: var(--text-muted); margin-top: 3px; font-weight: 500;
}

/* Platform Actions */
.platform-actions {
  display: flex; gap: 10px;
  margin-top: 18px;
}
.platform-btn {
  flex: 1; text-align: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .82rem; font-weight: 700;
  text-decoration: none;
  transition: .25s;
}
.platform-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  box-shadow: 0 2px 8px rgba(13,27,61,.20);
}
.platform-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(13,27,61,.30);
  transform: translateY(-1px);
  color: #fff;
}
.platform-btn-outline {
  background: transparent; color: var(--text-mid);
  border: 2px solid var(--border);
}
.platform-btn-outline:hover {
  background: var(--primary-pale); color: var(--on-tint);
  border-color: var(--primary-lit);
}
.platform-btn-accent {
  background: var(--accent-pale); color: var(--on-tint-accent);
  border: 2px solid transparent;
}
.platform-btn-accent:hover {
  background: var(--accent); color: #fff;
}
@media (max-width: 420px) {
  .platform-actions { flex-wrap: wrap; }
  .platform-actions .platform-btn { flex: 1 1 100%; }
}

/* ── Platform Detail ── */
.pd-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 26px;
  height: 100%;
}
.pd-card-title {
  font-size: .9rem; font-weight: 800;
  color: var(--text); margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pd-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.pd-info-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pd-info-item:nth-child(odd) { padding-left: 12px; }
.pd-info-item:nth-child(even) { padding-right: 12px; border-right: 1px solid var(--border); }
.pd-info-item:nth-last-child(-n+2) { border-bottom: none; }
.pd-info-label {
  display: block;
  font-size: .68rem; font-weight: 500; color: var(--text-muted);
  margin-bottom: 4px;
}
.pd-info-value {
  display: block;
  font-size: .88rem; font-weight: 800; color: var(--text);
}
.pd-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.pd-stat-box {
  background: var(--bg);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  border: 1px solid var(--border);
  transition: .2s;
}
.pd-stat-box:hover { border-color: var(--primary-lit); }
.pd-stat-val {
  font-size: 1.5rem; font-weight: 900; color: var(--strong);
  line-height: 1;
}
.pd-stat-lbl {
  font-size: .65rem; color: var(--text-muted);
  margin-top: 6px;
}
.pd-mini-stats {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pd-mini {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: var(--text-mid); font-weight: 600;
}
.pd-mini-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Guarantee Breakdown */
.pd-guarantee-grid { display: flex; flex-direction: column; gap: 12px; }
.pd-guarantee-item { display: flex; flex-direction: column; gap: 5px; }
.pd-guarantee-bar {
  height: 8px; border-radius: 4px;
  background: var(--bg2); overflow: hidden;
}
.pd-guarantee-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  min-width: 4px;
}
.pd-guarantee-info { display: flex; justify-content: space-between; }
.pd-guarantee-name { font-size: .78rem; font-weight: 600; color: var(--text); }
.pd-guarantee-count { font-size: .72rem; font-weight: 700; color: var(--text-muted); }

/* ── Compare Launch Button ── */
.cmp-launch-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 12px;
  font-size: .84rem; font-weight: 700;
  text-decoration: none;
  transition: .25s;
  box-shadow: 0 2px 12px rgba(13,27,61,.25);
}
.cmp-launch-btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,27,61,.32);
}

/* ── Platform Compare Page ── */
.cmp-back-btn {
  padding: 8px 18px;
  background: transparent;
  color: var(--text-mid);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: .82rem; font-weight: 700;
  text-decoration: none;
  transition: .2s;
}
.cmp-back-btn:hover {
  background: var(--primary-pale); color: var(--on-tint);
  border-color: var(--primary-lit);
}

.cmp-select-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px 26px;
  margin-bottom: 24px;
}
.cmp-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cmp-platform-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cmp-chip {
  display: inline-flex; align-items: center;
  padding: 7px 18px;
  border-radius: 22px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: .8rem; font-weight: 600;
  cursor: pointer;
  transition: .2s;
  user-select: none;
}
.cmp-chip input { display: none; }
.cmp-chip:hover {
  border-color: var(--primary-lit);
  color: var(--on-tint);
  background: var(--primary-pale);
}
.cmp-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(13,27,61,.25);
}

/* Compare Table */
.cmp-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.cmp-th-label {
  background: var(--bg);
  padding: 16px 20px;
  font-weight: 800;
  color: var(--text);
  font-size: .8rem;
  border-bottom: 2px solid var(--border);
  position: sticky; right: 0;
  min-width: 180px;
  text-align: right;
}
.cmp-th-platform {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff;
  padding: 16px 20px;
  font-weight: 700;
  font-size: .84rem;
  border-bottom: 2px solid var(--border);
  text-align: center;
  min-width: 155px;
}
.cmp-th-platform:nth-child(even) {
  background: linear-gradient(135deg, var(--primary-mid), var(--accent));
}
.cmp-td-label {
  padding: 14px 20px;
  font-weight: 600;
  color: var(--text-mid);
  font-size: .8rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; right: 0;
  text-align: right;
}
.cmp-td-val {
  padding: 14px 20px;
  font-weight: 800;
  color: var(--text);
  font-size: .9rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.cmp-td-val.cmp-profit { color: var(--success-text); }
.cmp-td-val.cmp-success { color: var(--strong); }
.cmp-td-val.cmp-date { font-size: .76rem; color: var(--text-muted); font-weight: 600; direction: ltr; }

.cmp-badge-green {
  display: inline-block;
  padding: 3px 12px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #059669;
  border-radius: 14px;
  font-size: .76rem; font-weight: 700;
}
.cmp-badge-blue {
  display: inline-block;
  padding: 3px 12px;
  background: linear-gradient(135deg, var(--primary-pale), #d7efe6);
  color: var(--strong);
  border-radius: 14px;
  font-size: .76rem; font-weight: 700;
}

.cmp-td-guarantees {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center;
}
.cmp-guarantee-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .68rem; font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}
.cmp-guarantee-tag small { color: var(--text-muted); font-weight: 700; }

/* Compare Charts */
.cmp-chart-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px;
}
.cmp-chart-title {
  font-size: .88rem; font-weight: 800;
  color: var(--text); margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Compare Empty State */
.cmp-empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}
.cmp-empty svg { margin-bottom: 18px; opacity: .5; }
.cmp-empty h5 {
  font-weight: 800; color: var(--text);
  margin-bottom: 8px; font-size: 1.05rem;
}
.cmp-empty p { font-size: .85rem; color: var(--text-muted); margin: 0; }

/* ═══════════════════════════════════════════
   Sankey-style Guarantee Flow
   ═══════════════════════════════════════════ */
.sankey-flow {
  display: flex;
  gap: 0;
  align-items: flex-start;
  overflow-x: auto;
  padding: 8px 0;
}

/* Source (left) */
.sankey-source {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  align-items: center;
  align-self: center;
}
.sankey-source-box {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  padding: 22px 20px;
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 20px rgba(13,27,61,.25);
  position: relative;
}
.sankey-source-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
  opacity: .8;
}
.sankey-source-label {
  display: block;
  font-size: .68rem; font-weight: 600;
  opacity: .7;
  margin-bottom: 4px;
}
.sankey-source-val {
  display: block;
  font-size: 1.15rem; font-weight: 900;
  line-height: 1.2;
}
.sankey-source-count {
  display: block;
  font-size: .7rem; font-weight: 600;
  opacity: .6;
  margin-top: 4px;
}

/* Branches (right side) */
.sankey-branches {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 0;
}

/* Each branch row */
.sankey-branch {
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Connector line from source to node */
.sankey-connector {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.sankey-connector::before {
  content: '';
  position: absolute;
  top: 50%; right: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--primary-lit), var(--border));
}
.sankey-connector::after {
  content: '';
  position: absolute;
  top: 50%; right: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px var(--primary-pale);
}
.sankey-line {
  display: none;
}

/* Guarantee Type Node */
.sankey-node {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: .25s;
}
.sankey-node:hover {
  border-color: var(--primary-lit);
  box-shadow: var(--shadow-md);
}
.sankey-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
}
.sankey-node-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.sankey-node-type {
  font-size: .88rem; font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.sankey-node-stats {
  display: flex; gap: 16px; align-items: center;
}
.sankey-node-vol {
  font-size: .82rem; font-weight: 800;
  color: var(--strong);
}
.sankey-node-vol small {
  font-size: .65rem; font-weight: 600;
  color: var(--text-muted);
}
.sankey-node-pct {
  font-size: .75rem; font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.sankey-node-count {
  font-size: .72rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 8px;
}

/* Expand Button */
.sankey-expand-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--strong);
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .25s;
  flex-shrink: 0;
}
.sankey-expand-btn:hover {
  background: var(--primary-pale);
  border-color: var(--primary-lit);
}
.sankey-expand-btn.expanded {
  background: var(--primary);
  color: #fff;
  border-color: var(--strong);
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(13,27,61,.25);
}

/* Node progress bar */
.sankey-node-bar {
  height: 4px;
  background: var(--bg);
}
.sankey-node-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 0 4px 4px 0;
  min-width: 4px;
  transition: width .5s;
}

/* Expandable Issuers List */
.sankey-issuers {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg), var(--surface));
  padding: 6px 0;
}
.sankey-issuer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  transition: .15s;
  border-bottom: 1px solid rgba(0,0,0,.03);
}
.sankey-issuer:last-child { border-bottom: none; }
.sankey-issuer:hover { background: var(--primary-pale); }
.sankey-issuer-info {
  display: flex; align-items: center; gap: 8px;
}
.sankey-issuer-info i {
  color: var(--accent);
  font-size: .8rem;
}
.sankey-issuer-name {
  font-size: .8rem; font-weight: 700;
  color: var(--text);
}
.sankey-issuer-pct {
  font-size: .68rem; font-weight: 800;
  color: var(--on-tint-accent);
  background: var(--accent-pale);
  padding: 1px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.sankey-issuer-stats {
  display: flex; gap: 14px; align-items: center;
}
.sankey-issuer-vol {
  font-size: .78rem; font-weight: 800;
  color: var(--success-text);
}
.sankey-issuer-vol small {
  font-size: .62rem; font-weight: 600;
  color: var(--text-muted);
}
.sankey-issuer-count {
  font-size: .68rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .sankey-flow { flex-direction: column; }
  .sankey-source { width: 100%; }
  .sankey-connector { width: 100%; height: 24px; }
  .sankey-connector::before {
    top: 0; right: 50%;
    width: 2px; height: 100%;
  }
  .sankey-connector::after {
    top: auto; bottom: 0; right: 50%;
    transform: translateX(50%);
  }
  .sankey-node-main { flex-direction: column; gap: 6px; align-items: flex-start; }
  .sankey-node-stats { gap: 10px; }
}

/* ═══════════════════════════════════════════
   Guarantee Overview — 3-Level Tree
   ═══════════════════════════════════════════ */
.gar-filter-bar {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 22px;
  margin-top: -24px;
  margin-bottom: 24px;
  position: relative; z-index: 10;
}
.gar-tree { display: flex; flex-direction: column; gap: 12px; }

/* ── Level 1: Guarantee Type ── */
.gar-l1 {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: .25s;
}
.gar-l1:hover { box-shadow: var(--shadow-lg); }
.gar-l1-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  transition: .15s;
}
.gar-l1-header:hover { background: var(--bg); }
.gar-l1-right {
  display: flex; align-items: center; gap: 14px;
}
.gar-l1-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-pale), #d7efe6);
  color: var(--strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.gar-l1-name {
  display: block;
  font-size: .95rem; font-weight: 800; color: var(--text);
}
.gar-l1-sub {
  display: block;
  font-size: .72rem; font-weight: 500; color: var(--text-muted);
  margin-top: 2px;
}
.gar-l1-left {
  display: flex; align-items: center; gap: 14px;
  flex-shrink: 0;
}
.gar-minibar {
  width: 120px; height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.gar-minibar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  min-width: 3px;
  transition: width .5s;
}

/* Toggle Button */
.gar-toggle {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: .7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .25s;
  flex-shrink: 0;
}
.gar-toggle:hover {
  border-color: var(--primary-lit);
  color: var(--strong);
}
.gar-toggle.open {
  background: var(--primary);
  color: #fff;
  border-color: var(--strong);
  transform: rotate(-90deg);
}
.gar-toggle.sm {
  width: 24px; height: 24px;
  border-radius: 6px;
  font-size: .6rem;
}
.gar-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 8px;
}

/* Percentage Badges */
.gar-pct-badge {
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.gar-pct-badge.l1 {
  font-size: .82rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 2px 8px rgba(13,27,61,.20);
}
.gar-pct-badge.l2 {
  font-size: .74rem;
  color: var(--on-tint-accent);
  background: var(--accent-pale);
  border: 1px solid rgba(201,147,47,.2);
}
.gar-pct-badge.l3 {
  font-size: .68rem;
  color: var(--on-tint-success);
  background: var(--green-lit);
  border: 1px solid rgba(16,185,129,.2);
}

/* ── Level 2: Issuers ── */
.gar-l2-wrap {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg), var(--surface));
}
.gar-l2 {
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.gar-l2:last-child { border-bottom: none; }
.gar-l2-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px 12px 44px;
  cursor: pointer;
  transition: .15s;
}
.gar-l2-header:hover { background: var(--primary-pale); }
.gar-l2-right {
  display: flex; align-items: center; gap: 10px;
}
.gar-l2-connector {
  width: 20px; height: 2px;
  background: var(--border);
  flex-shrink: 0;
}
.gar-l2-icon {
  color: var(--accent);
  font-size: .85rem;
  flex-shrink: 0;
}
.gar-l2-name {
  font-size: .84rem; font-weight: 700; color: var(--text);
}
.gar-l2-sub {
  font-size: .68rem; font-weight: 500; color: var(--text-muted);
  margin-right: 8px;
}
.gar-l2-info {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.gar-l2-left {
  flex-shrink: 0;
}
.gar-l2-empty {
  padding: 20px 44px;
  font-size: .8rem; color: var(--text-muted);
  font-weight: 500;
}

/* ── Level 3: Platforms ── */
.gar-l3-wrap {
  background: rgba(13,27,61,.02);
  border-top: 1px solid var(--border);
}
.gar-l3 {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px 10px 80px;
  border-bottom: 1px solid rgba(0,0,0,.03);
  transition: .15s;
  cursor: pointer;
}
.gar-l3:last-child { border-bottom: none; }
.gar-l3:hover { background: rgba(13,27,61,.04); }
.gar-l3-connector {
  width: 16px; height: 2px;
  background: var(--primary-lit);
  flex-shrink: 0;
}
.gar-l3-icon {
  color: var(--strong);
  font-size: .78rem;
  flex-shrink: 0;
}
.gar-l3-name {
  font-size: .8rem; font-weight: 700; color: var(--strong);
  text-decoration: none;
  transition: .15s;
}
.gar-l3-name:hover { color: var(--accent); text-decoration: underline; }
.gar-l3-count {
  font-size: .68rem; font-weight: 600; color: var(--text-muted);
  margin-right: auto;
}
.gar-l3-vol {
  font-size: .72rem; font-weight: 700; color: var(--text-mid);
}
.gar-l3-vol small {
  font-size: .6rem; color: var(--text-muted);
}

@media (max-width: 768px) {
  .gar-l1-left { flex-direction: column; gap: 6px; align-items: flex-end; }
  .gar-minibar { width: 80px; }
  .gar-l2-header { padding-right: 22px; }
  .gar-l3 { padding-right: 44px; flex-wrap: wrap; }
  .gar-l2-info { flex-direction: column; gap: 2px; }
}

/* ── Contact ── */
.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
}
.contact-item {
  display: flex; gap: 14px; align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.contact-item:last-child { border-bottom: none; }
.contact-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-pale), #d7efe6);
  color: var(--strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.contact-value { font-size: .88rem; font-weight: 700; color: var(--text); }

/* ═══════════════════════════════════════════
   Data Management Panel
   ═══════════════════════════════════════════ */
.dm-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 20px 0 16px; flex-wrap: wrap; gap: 12px;
}
.dm-title {
  font-size: 1.2rem; font-weight: 900; color: var(--text); margin: 0;
}
.dm-subtitle {
  font-size: .78rem; color: var(--text-muted); margin: 4px 0 0;
}

/* Gap Stats */
.dm-gaps {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 16px 22px;
  margin-bottom: 14px;
}
.dm-gap-title {
  font-size: .78rem; font-weight: 700; color: var(--warn-text);
  margin-bottom: 12px;
}
.dm-gap-chips {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.dm-gap-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: .76rem; font-weight: 700;
  text-decoration: none;
  transition: .2s;
}
.dm-gap-chip:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--bg2);
}
.dm-gap-chip.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.dm-gap-num {
  font-weight: 900; font-size: .82rem;
}
.dm-gap-clear {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--red);
  text-decoration: none;
  font-size: .8rem;
  transition: .15s;
}
.dm-gap-clear:hover { background: #fee2e2; }

/* Filters */
.dm-filters {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 22px;
  margin-bottom: 16px;
}
.dm-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  flex: 1; max-width: 300px;
}
.dm-search-box i { color: var(--text-muted); font-size: .85rem; }
.dm-search-box input {
  border: none; background: transparent;
  padding: 8px 6px; font-size: .82rem;
  color: var(--text); outline: none;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  width: 100%;
}
.dm-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: .8rem; font-weight: 600;
  color: var(--text);
  background: var(--bg);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  outline: none;
}
.dm-filter-btn {
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 700;
  cursor: pointer;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  transition: .2s;
}
.dm-filter-btn:hover { box-shadow: 0 2px 10px rgba(13,27,61,.25); }

/* Table */
.dm-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}
.dm-table {
  width: 100%;
  border-collapse: collapse;
}
.dm-table thead {
  background: linear-gradient(135deg, #102A43, #0D1B3D);
}
.dm-table th {
  padding: 14px 16px;
  font-size: .74rem; font-weight: 700;
  color: rgba(255,255,255,.9);
  text-align: right;
  white-space: nowrap;
  border-bottom: 2px solid var(--primary);
}
/* The header colour comes from the gradient on <thead>, so the cells must stay
   see-through. Django admin sets its own light `thead th { background }`, which
   painted over that gradient and left white-on-white labels everywhere except
   the sticky columns — the only ones that name a background of their own. */
.dm-table thead th { background: transparent; }
.dm-table thead th.dm-th-sticky,
.dm-th-sticky {
  position: sticky; right: 0;
  z-index: 2;
  background: #102A43;
}
/* Django admin stripes every table with `tr:nth-child(odd|even)`. The header is
   a single row, so it counts as odd and got --body-bg painted straight over the
   gradient above — which is why all but the sticky columns showed white-on-white
   in the panel. The same rule also fights our own striping, so both are reset
   here before ours are restated. */
.dm-table thead tr,
.dm-table tbody tr:nth-child(odd) { background: transparent; }
.dm-table tbody tr {
  transition: .15s;
}
.dm-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,.015);
}
.dm-table tbody tr:nth-child(odd):hover,
.dm-table tbody tr:nth-child(even):hover {
  background: rgba(13,27,61,.04);
}
.dm-td-platform {
  padding: 10px 16px;
  font-size: .72rem; font-weight: 700;
  color: var(--strong);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky; right: 0;
  background: inherit;
  z-index: 1;
}
.dm-td-title {
  padding: 10px 16px;
  font-size: .78rem; font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  min-width: 200px;
  position: sticky; right: 90px;
  background: inherit;
  z-index: 1;
}

/* Editable Cell */
.dm-td-cell {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  min-width: 110px;
  position: relative;
}
.dm-td-cell.dm-empty {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.dm-cell-display {
  cursor: pointer;
  min-height: 28px;
  display: flex; align-items: center;
  border-radius: 6px;
  padding: 2px 6px;
  transition: .15s;
}
.dm-cell-display:hover {
  background: rgba(13,27,61,.06);
}
.dm-val {
  font-size: .78rem; font-weight: 600; color: var(--text);
}
.dm-placeholder {
  color: var(--orange);
  font-size: .8rem;
  opacity: .6;
}
.dm-empty .dm-cell-display:hover .dm-placeholder {
  opacity: 1;
}

/* Edit Input */
.dm-input {
  width: 100%;
  padding: 6px 10px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  font-size: .8rem; font-weight: 600;
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  box-shadow: 0 0 0 3px rgba(0,151,167,.18);
}

.dm-no-data {
  text-align: center;
  padding: 60px 20px;
  font-size: .88rem;
  color: var(--text-muted);
}
.dm-no-data i {
  font-size: 2rem;
  display: block; margin-bottom: 10px;
}

/* Toast */
.dm-toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 28px;
  border-radius: 12px;
  font-size: .82rem; font-weight: 700;
  color: #fff;
  opacity: 0;
  transition: .3s;
  z-index: 9999;
  pointer-events: none;
}
.dm-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.dm-toast.success {
  background: linear-gradient(135deg, #059669, var(--success));
  box-shadow: 0 4px 16px rgba(16,185,129,.35);
}
.dm-toast.error {
  background: linear-gradient(135deg, #dc2626, var(--red));
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
}

@media (max-width: 768px) {
  .dm-th-sticky, .dm-td-platform, .dm-td-title { position: static; }
  .dm-search-box { max-width: 100%; }
  .cmp-th-label, .cmp-td-label { position: static; }
}

/* ── Footer ── */
.site-footer {
  background: linear-gradient(180deg, #0D1B3D 0%, #081226 100%);
  color: rgba(255,255,255,.6);
  padding: 32px 0 0; margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand {
  font-size: 1.15rem; font-weight: 900;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.footer-about {
  font-size: .78rem; line-height: 1.9;
  color: rgba(255,255,255,.35); margin: 0;
}
.footer-title {
  font-size: .82rem; font-weight: 700; color: #fff;
  margin-bottom: 14px;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  color: rgba(255,255,255,.4);
  text-decoration: none;
  font-size: .8rem;
  transition: .2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-contact li {
  font-size: .8rem;
  color: rgba(255,255,255,.4);
  margin-bottom: 10px;
}
.footer-social { display: flex; gap: 10px; }
.social-link {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.45);
  display: flex; align-items: center; justify-content: center;
  transition: .25s;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.08);
}
.social-link:hover {
  background: rgba(13,27,61,.25);
  color: #fff;
  border-color: rgba(13,27,61,.32);
  transform: translateY(-2px);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 20px;
  padding: 12px 0;
  text-align: center;
}
.footer-bottom p {
  margin: 0;
  font-size: .72rem;
  color: rgba(255,255,255,.2);
}

/* ── Guarantee Tree Filter Chip ── */
.gar-tree-filter-chip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--primary-pale);
  border: 1px solid var(--primary-lit);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: .82rem; font-weight: 600;
  color: var(--text-mid);
}
.chip-val {
  background: var(--surface);
  color: var(--strong);
  border: 1px solid var(--primary-lit);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: .78rem; font-weight: 700;
}
.chip-clear {
  margin-right: auto;
  color: var(--text-muted);
  font-size: .78rem; font-weight: 600;
  text-decoration: none;
}
.chip-clear:hover { color: var(--red); }

/* ── Project Table (stats / platforms / guarantees) ── */
.proj-table-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 22px 8px;
}
.proj-table-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.proj-table-count {
  font-size: .78rem; font-weight: 700;
  color: var(--text-muted);
}
.proj-table {
  width: 100%;
  border-collapse: collapse;
}
.proj-table thead th {
  padding: 10px 14px;
  font-size: .74rem; font-weight: 700;
  color: var(--text-mid);
  text-align: right;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.proj-table tbody td {
  padding: 12px 14px;
  font-size: .82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.proj-table-title {
  font-weight: 700;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proj-table tbody tr {
  cursor: pointer;
  transition: .15s;
}
.proj-table tbody tr:hover {
  background: var(--primary-pale);
}
.proj-table-empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 14px;
  cursor: default;
}
.proj-table-empty-row:hover {
  background: transparent !important;
}

/* ── Platform star ratings ── */
.stars {
  position: relative; display: inline-block;
  font-size: .95rem; line-height: 1; letter-spacing: 2px;
  color: #cbd5e1; direction: rtl;
}
.stars::before { content: '★★★★★'; }
.stars .stars-fill {
  position: absolute; top: 0; right: 0;
  overflow: hidden; white-space: nowrap;
  color: #f59e0b; width: 0;
}
.stars .stars-fill::before { content: '★★★★★'; }
.rating-row {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; color: var(--text-mid);
}
.rating-row .rating-num { font-weight: 800; color: #f59e0b; font-size: .8rem; }

/* ── Reviews section (platform detail) ── */
.reviews-panel {
  background: var(--card, #fff); border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px; padding: 22px; margin-top: 20px;
}
.reviews-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.reviews-summary .big-num { font-size: 2rem; font-weight: 900; color: #f59e0b; line-height: 1; }
.review-item { border-top: 1px solid var(--border, #f1f5f9); padding: 12px 2px; }
.review-item .rev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.review-item .rev-name { font-weight: 700; font-size: .8rem; }
.review-item .rev-date { font-size: .68rem; color: var(--text-mid); }
.review-item .rev-text { font-size: .8rem; color: var(--text-mid); line-height: 1.9; margin: 0; }
.review-form .star-picker { display: inline-flex; flex-direction: row-reverse; gap: 4px; font-size: 1.6rem; cursor: pointer; }
.review-form .star-picker span { color: #cbd5e1; transition: .15s; }
.review-form .star-picker span.on { color: #f59e0b; }
.review-form textarea {
  width: 100%; border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
  padding: 10px 14px; font-size: .82rem; margin-top: 10px; outline: none;
  background: var(--bg, #f8fafc); resize: vertical; min-height: 80px;
}
.review-form .btn-review {
  border: none; border-radius: 10px; padding: 9px 26px; margin-top: 10px;
  background: var(--primary, #0D1B3D); color: #fff; font-weight: 800; font-size: .8rem; cursor: pointer;
}

/* ── Logo placements ── */
.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.footer-brand img { border-radius: 6px; flex: none; }

.auth-mark {
  display: block;
  margin: 0 auto var(--sp-3);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
}

/* The plan title is the page's h1; it kept the h4 size it was written at. */
.detail-title { font-size: var(--step-2); line-height: 1.6; }

/* ── Stats: chart strip that scrolls sideways (all platforms) ── */
/* The strip is wider than its card by design; the grid column holding it must
   be allowed to shrink (min-width: 0) or it widens the whole page instead. */
.stats-panels { min-width: 0; }
.chart-scroll { max-width: 100%; overflow-x: auto; direction: ltr; cursor: grab; padding-bottom: 6px;
  scrollbar-width: thin; scrollbar-color: var(--primary-lit) transparent; }
.chart-scroll.dragging { cursor: grabbing; user-select: none; }
.chart-scroll::-webkit-scrollbar { height: 8px; }
.chart-scroll::-webkit-scrollbar-thumb { background: var(--primary-lit); border-radius: 99px; }
.chart-scroll-inner { height: 340px; position: relative; }

/* ── Stats: plan list with Excel-style column filters ── */
.xt-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.xt-reset { border: 1px solid var(--border); background: transparent; color: var(--red-text); border-radius: 999px;
  padding: 4px 12px; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; }
.xt-reset:hover { border-color: var(--red-text); }
.xt-table thead th { padding: 0; }
.xt-th { display: flex; align-items: center; justify-content: flex-start; gap: 6px; width: 100%;
  background: transparent; border: none; padding: 10px 12px; font: inherit; font-weight: 800; color: inherit; cursor: pointer; text-align: start; }
.xt-th:hover { background: var(--primary-pale); }
.xt-ico { font-size: .8rem; color: var(--text-muted); }
.xt-on .xt-th { color: var(--accent-text); }
.xt-on .xt-ico, .xt-th .bi-sort-up, .xt-th .bi-sort-down { color: var(--accent); }
.xt-table tbody tr[data-id] { cursor: pointer; }
.xt-menu { position: absolute; z-index: var(--z-dropdown); width: 260px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; direction: rtl; }
.xt-sort { display: flex; gap: 6px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.xt-sort button { flex: 1; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 6px;
  font: inherit; font-size: .74rem; font-weight: 700; color: var(--text-mid); cursor: pointer; }
.xt-sort button:hover { border-color: var(--accent); color: var(--accent-text); }
.xt-range { display: flex; align-items: flex-end; gap: 6px; }
.xt-range label { flex: 1; font-size: .7rem; font-weight: 700; color: var(--text-muted); margin: 0; }
.xt-range input { display: block; width: 100%; margin-top: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  padding: 6px 8px; font: inherit; font-size: .8rem; color: var(--text); outline: none; text-align: center; }
.xt-range input:focus { border-color: var(--accent); background: var(--surface); }
.xt-unit { font-size: .7rem; color: var(--text-muted); padding-bottom: 8px; white-space: nowrap; }
.xt-all { border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; margin-bottom: 2px; }
.xt-n { margin-inline-start: auto; font-size: .68rem; color: var(--text-muted); }

/* Colour key under a chart whose bars are coloured by group */
.chart-key { display: flex; justify-content: center; gap: 16px; margin-top: 8px; font-size: .74rem; color: var(--text-mid); }
.chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Guarantees page: heading above the type → guarantor → platform tree */
.gar-section-title { font-size: .95rem; font-weight: 800; color: var(--strong); margin: 8px 0 12px; display: flex; align-items: center; gap: 8px; }

/* A chart with a fixed height (its canvas fills the box), so it looks the same
   in a narrow column and across the full page. */
.chart-box { position: relative; width: 100%; }
/* seven columns on the guarantees page: keep the headers on one line */
.xt-table thead th { white-space: nowrap; }

/* ── Guarantees page: banks against funds ── */
.gx-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; border-top: 4px solid var(--gx); height: 100%; }
.gx-bank { --gx: #0D1B3D; }
.gx-fund { --gx: #0097A7; }
.gx-side-head { display: flex; align-items: center; gap: 12px; }
.gx-side-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--gx); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.gx-side-title { font-weight: 800; font-size: 1rem; color: var(--strong); }
.gx-side-sub { font-size: .74rem; color: var(--text-muted); }
.gx-side-big { margin-inline-start: auto; font-size: 1.9rem; font-weight: 900; color: var(--strong); line-height: 1; text-align: center; }
.gx-side-big small { display: block; font-size: .68rem; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.gx-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 12px; }
.gx-facts div { background: var(--bg); border-radius: 10px; padding: 10px 8px; text-align: center; }
.gx-facts b { display: block; font-size: 1.05rem; font-weight: 800; color: var(--strong); }
.gx-facts span { font-size: .66rem; color: var(--text-muted); }
.gx-side-foot { font-size: .76rem; color: var(--text-mid); }
@media (max-width: 576px) { .gx-facts { grid-template-columns: repeat(2, 1fr); } }

/* league tables */
.gx-league-wrap { max-height: 520px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--primary-lit) transparent; }
.gx-league { width: 100%; border-collapse: collapse; font-size: .8rem; }
.gx-league thead th { position: sticky; top: 0; background: var(--surface); text-align: right; font-size: .7rem; font-weight: 800;
  color: var(--text-muted); padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
.gx-league thead small { font-weight: 500; }
.gx-league td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.gx-league tbody tr { cursor: pointer; }
.gx-league tbody tr:hover { background: var(--bg); }
.gx-league td small { display: block; color: var(--text-muted); font-size: .68rem; line-height: 1.3; }
.gx-rank { width: 28px; color: var(--text-muted); font-weight: 700; }
.gx-name { white-space: normal !important; font-weight: 700; color: var(--strong); min-width: 150px; }
.gx-bar { height: 4px; border-radius: 99px; background: var(--border); margin-top: 5px; overflow: hidden; }
.gx-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gx); }
.gx-date { color: var(--text-muted); font-size: .72rem; }
.gx-empty { text-align: center; color: var(--text-muted); padding: 20px !important; }

/* guarantor × platform matrix */
.gx-matrix-wrap { overflow-x: auto; }
.gx-matrix { border-collapse: separate; border-spacing: 3px; font-size: .76rem; margin: 0 auto; }
.gx-matrix thead th { vertical-align: bottom; padding: 0 0 6px; font-weight: 700; color: var(--text-mid); height: 96px; }
.gx-matrix thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .72rem; }
.gx-matrix tbody th { text-align: right; font-weight: 700; padding: 0 0 0 10px; white-space: nowrap; color: var(--strong);
  border-inline-start: 3px solid var(--gx); padding-inline-start: 8px; }
.gx-matrix td { width: 40px; height: 32px; text-align: center; border-radius: 6px; background: var(--bg); color: var(--text-muted); font-weight: 700; }
.gx-matrix td.on { color: var(--strong); }
.gx-matrix td.on.hot { color: #fff; }
.gx-matrix td.on.gx-bank { background: rgba(13, 27, 61, var(--h)); }
.gx-matrix td.on.gx-fund { background: rgba(0, 151, 167, var(--h)); }
.gx-matrix .gx-total { background: transparent; color: var(--strong); font-weight: 800; padding-inline-start: 8px; white-space: nowrap; }
.gx-matrix thead .gx-total { color: var(--text-muted); font-size: .7rem; height: auto; }

/* Companies page: open-fundraising list */
.co-open { display: flex; flex-direction: column; }
.co-open a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px;
  border-bottom: 1px solid var(--border); text-decoration: none; font-size: .8rem; color: var(--strong); font-weight: 700; }
.co-open a:last-child { border-bottom: none; }
.co-open a:hover span { color: var(--accent-text); }
.co-open a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-open b { color: var(--accent-text); white-space: nowrap; }
.co-open small { font-weight: 500; color: var(--text-muted); }
.xt-date { color: var(--text-muted); font-size: .76rem; white-space: nowrap; }

/* Platforms page: activity calendar (reuses the guarantor matrix) */
.pl-cal tbody th a { color: inherit; text-decoration: none; }
.pl-cal tbody th a:hover { color: var(--accent-text); }
.pl-cal thead th { height: 78px; }

/* Detail pages: a plan, a platform, a company */
.dp-head { background: radial-gradient(circle at 85% 15%, rgba(0,151,167,.32), transparent 45%),
    linear-gradient(135deg, #0D1B3D 0%, #102A43 60%, #006D77 100%);
  border-radius: 20px; padding: 26px; color: #fff; margin: 14px 0 18px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.dp-head h1 { font-size: 1.35rem; font-weight: 900; margin: 10px 0 6px; color: #fff; line-height: 1.7; }
.dp-head a { color: #fff; }
.dp-sub { font-size: .8rem; opacity: .85; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.dp-sub a { text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.5); }
.dp-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dp-chip { font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 4px 12px; text-decoration: none;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff; }
a.dp-chip:hover { background: rgba(255,255,255,.24); color: #fff; }
.dp-chip.open { background: #2EAD68; border-color: #2EAD68; }
.dp-chip.ok { background: rgba(65,199,199,.28); border-color: rgba(65,199,199,.5); }
.dp-chip.bad { background: rgba(220,38,38,.55); border-color: rgba(220,38,38,.6); }
.dp-big { text-align: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 14px 22px; min-width: 150px; }
.dp-big b { display: block; font-size: 2.1rem; font-weight: 900; line-height: 1.3; }
.dp-big span { display: block; font-size: .72rem; opacity: .85; }
.dp-big small { display: block; font-size: .68rem; opacity: .7; margin-top: 4px; }
.dp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dp-btn { font-size: .78rem; font-weight: 700; border-radius: 10px; padding: 8px 16px; text-decoration: none;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.dp-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.dp-btn.solid { background: #fff; color: #0D1B3D !important; border-color: #fff; }
.dp-btn.solid:hover { background: #E0F4F6; }

.dp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-bottom: 18px; }
.dp-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 12px; text-align: center; }
.dp-kpi b { display: block; font-size: 1.3rem; font-weight: 900; color: var(--strong); }
.dp-kpi b.teal { color: var(--accent-text); }
.dp-kpi b.green { color: var(--success-text); }
.dp-kpi b small { font-size: .7rem; font-weight: 600; color: var(--text-muted); }
.dp-kpi span { display: block; font-size: .7rem; color: var(--text-muted); margin-top: 3px; }
.dp-kpi em { display: block; font-style: normal; font-size: .66rem; color: var(--accent-text); font-weight: 700; margin-top: 2px; }

.dp-rows { display: flex; flex-direction: column; }
.dp-rows > * { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--border); font-size: .8rem; text-decoration: none; color: var(--text); }
.dp-rows > *:last-child { border-bottom: none; }
.dp-rows > a:hover > span:first-child { color: var(--accent-text); }
.dp-rows .k { color: var(--text-muted); }
.dp-rows .v, .dp-rows b { font-weight: 800; color: var(--strong); text-align: left; }
.dp-rows b.cnt { color: var(--accent-text); white-space: nowrap; }

.dp-bench { margin-bottom: 16px; }
.dp-bench:last-child { margin-bottom: 0; }
.dp-bench h6 { font-size: .78rem; font-weight: 800; margin: 0 0 6px; color: var(--text-mid); }
.dp-bar { display: grid; grid-template-columns: 96px 1fr 92px; align-items: center; gap: 8px; font-size: .74rem; margin-bottom: 4px; }
.dp-bar .who { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-bar .track { background: var(--bg); border-radius: 99px; height: 12px; overflow: hidden; }
.dp-bar .fill { height: 100%; border-radius: 99px; background: #B7C4DC; min-width: 3px; }
.dp-bar.plat .fill { background: #41C7C7; }
.dp-bar.mine .fill { background: linear-gradient(90deg, #0097A7, #006D77); }
.dp-bar.mine .who, .dp-bar.mine .val { font-weight: 800; color: var(--strong); }
.dp-bar .val { text-align: left; white-space: nowrap; color: var(--text-mid); }
.dp-bar .val small { color: var(--text-muted); font-size: .64rem; }

.dp-sibs { display: flex; flex-direction: column; }
.dp-sibs a { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 2px;
  border-bottom: 1px solid var(--border); text-decoration: none; font-size: .78rem; color: var(--text); }
.dp-sibs a:last-child { border-bottom: none; }
.dp-sibs a > span:first-child { font-weight: 700; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-sibs a:hover > span:first-child { color: var(--accent-text); }
.dp-sibs small { display: block; font-weight: 500; color: var(--text-muted); font-size: .68rem; }
.dp-sibs .r { font-weight: 800; color: var(--success-text); white-space: nowrap; }
.dp-tag { font-size: .64rem; font-weight: 800; border-radius: 99px; padding: 3px 10px; white-space: nowrap;
  background: var(--primary-pale); color: var(--on-tint); }
.dp-tag.open { background: var(--green-lit); color: var(--on-tint-success); }
.dp-tag.bad { background: var(--red-lit); color: var(--red-text); }
.dp-note { font-size: .78rem; color: var(--text-mid); margin: 10px 0 0; }
.dp-note b { color: var(--accent-text); }
@media (max-width: 576px) {
  .dp-head { padding: 20px 16px; }
  .dp-big { width: 100%; }
  .dp-bar { grid-template-columns: 70px 1fr 78px; }
  .dp-sibs a { grid-template-columns: 1fr auto; }
  .dp-sibs a > .amt { display: none; }
}

/* Plans list: checkbox-dropdown filters, rate range, sort, failed tab */
.lst-filters-row.sf-form { margin-top: 4px; }
.sf-range .sf-panel { width: 250px; }
.sf-range-row { display: flex; align-items: center; gap: 8px; }
.sf-range-row label { flex: 1; display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; color: var(--text-mid); }
.sf-range-row input { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  padding: 6px 8px; font: inherit; font-size: .8rem; text-align: center; color: var(--text); outline: none; }
.sf-range-row input:focus { border-color: var(--accent); background: var(--surface); }
.sf-range-row span { font-size: .8rem; color: var(--text-muted); }
.sf-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sf-presets button { font: inherit; font-size: .72rem; font-weight: 700; border: 1px solid var(--border); background: var(--bg);
  color: var(--text-mid); border-radius: 99px; padding: 4px 10px; cursor: pointer; }
.sf-presets button:hover { border-color: var(--accent); color: var(--accent-text); }
.sf-sort { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg);
  border-radius: 10px; padding: 0 10px; min-height: 38px; font-size: .8rem; cursor: pointer; }
.sf-sort:hover { border-color: var(--accent); }
.sf-sort i { color: var(--text-muted); }
.sf-sort select { border: none; background: transparent; font: inherit; font-weight: 700; color: var(--text); outline: none; cursor: pointer; padding: 6px 0; }
.lst-stab:not(.active) .lst-stab-count { background: var(--bg); color: var(--text-mid); }
.lst-stab-red.active { background: linear-gradient(135deg, #B91C1C, var(--red)); border-color: var(--red); color: #fff; }
.st-failed { background: var(--red-lit); color: var(--red-text); border: 1px solid rgba(220,38,38,.25); }
.hl-note { display: block; font-size: .62rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.pbar-left { color: var(--accent-text); }

/* ═══ Plan card (list + home): fixed rows so neighbouring cards line up ═══ */
.pc { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s; }
.pc:hover { color: var(--text); border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pc > * { padding-inline: 18px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 54px; padding-top: 12px; box-sizing: border-box; }
.pc-top > span { height: 26px; display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 0 11px;
  font-size: .7rem; font-weight: 700; white-space: nowrap; }
.pc-plat { background: var(--bg); border: 1px solid var(--border); color: var(--strong); max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.pc-plat i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pc-st { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.pc-st.open { background: var(--green-lit); color: var(--on-tint-success); border-color: transparent; }
.pc-st.open i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(46,173,104,.2); }
.pc-st.done { background: var(--primary-pale); color: var(--on-tint); border-color: transparent; }
.pc-st.bad { background: var(--red-lit); color: var(--red-text); border-color: transparent; }
.pc-title { font-size: .9rem; font-weight: 800; line-height: 1.7; margin: 4px 0 0; height: calc(2 * 1.7 * .9rem);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--strong); }
.pc-co { font-size: .74rem; color: var(--text-muted); margin: 4px 0 14px; height: 1.3rem; line-height: 1.3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-co i { margin-inline-end: 5px; }
.pc-stats { display: grid; grid-template-columns: 1.2fr 1fr 1fr; padding: 0 !important; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pc-stats > div { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 72px; text-align: center; padding: 0 6px; }
.pc-stats > div + div { border-inline-start: 1px solid var(--border); }
.pc-stats b { font-size: .92rem; font-weight: 800; color: var(--strong); white-space: nowrap; }
.pc-stats span { font-size: .66rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }
.pc-stats .pc-rate { background: linear-gradient(180deg, rgba(46,173,104,.05), rgba(46,173,104,.11)); }
.pc-stats .pc-rate b { font-size: 1.4rem; font-weight: 900; color: var(--success-text); line-height: 1.2; }
.pc-rate em { font-style: normal; color: var(--accent-text); font-weight: 800; }
.pc-cmp { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  height: 58px; padding-block: 0; border-bottom: 1px solid var(--border); }
.pc-cmp b { grid-row: 1 / 3; display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 32px;
  border-radius: 9px; font-size: .86rem; font-weight: 900; background: var(--bg); color: var(--text-muted); }
.pc-cmp b i { font-size: 1.1rem; margin-inline-end: -2px; }
.pc-cmp span { font-size: .74rem; font-weight: 700; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-cmp small { font-size: .66rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-cmp.none span { grid-row: 1 / 3; font-weight: 500; color: var(--text-muted); }
.pc-cmp.up b { background: var(--green-lit); color: var(--on-tint-success); }
.pc-cmp.down b { background: var(--red-lit); color: var(--red-text); }
.pc-guar { display: flex; align-items: center; gap: 7px; height: 46px; border-bottom: 1px solid var(--border); font-size: .76rem; min-width: 0; }
.pc-guar > i { color: var(--accent-text); }
.pc-guar .k { color: var(--text-muted); flex-shrink: 0; }
.pc-guar .v { font-weight: 800; color: var(--strong); margin-inline-start: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pc-guar .v small { font-weight: 600; color: var(--text-mid); font-size: .72rem; }
.pc-guar .v.muted { color: var(--text-muted); font-weight: 500; }
.pc-prog { padding-top: 14px; }
.pc-bar-row { display: flex; align-items: center; gap: 10px; }
.pc-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.pc-bar i.full { background: linear-gradient(90deg, #1F7A4C, var(--success)); }
.pc-pct { width: 40px; text-align: left; font-size: .76rem; font-weight: 800; color: var(--strong); }
.pc-amts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.pc-amts > div { display: flex; flex-direction: column; gap: 1px; }
.pc-amts > div:nth-child(2) { text-align: center; }
.pc-amts > div:nth-child(3) { text-align: left; }
.pc-amts span { font-size: .64rem; color: var(--text-muted); }
.pc-amts b { font-size: .78rem; font-weight: 800; color: var(--strong); white-space: nowrap; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 14px; padding-bottom: 14px;
  font-size: .7rem; color: var(--text-muted); height: 52px; box-sizing: border-box; margin-block-start: auto; }
.pc-prog + .pc-foot { margin-top: 12px; border-top: 1px dashed var(--border); }
.pc-foot i { margin-inline-end: 5px; }
.pc-left { font-weight: 800; color: var(--accent-text); background: var(--accent-pale); border-radius: 8px; padding: 3px 10px; }
.pc-go { font-weight: 800; color: var(--accent-text); }
.pc-go i { margin: 0 3px 0 0; transition: transform .2s; }
.pc:hover .pc-go i { transform: translateX(-3px); }

/* Plans list: every control in the filter row the same height and shape */
.lst-filters-row .sf-btn, .lst-filters-row .sf-sort { height: 40px; min-width: 168px; border-radius: 999px; padding-block: 0; }
.lst-filters-row .sf-sort { padding-inline: 14px; }
.lst-filters-row .sf-sort select { flex: 1; }
.lst-search-row { align-items: stretch; }
.lst-total-badge { min-width: 120px; justify-content: center; }
.lst-status-tabs { flex-wrap: wrap; }
.lst-stab { min-width: 170px; justify-content: center; }
@media (max-width: 767.98px) {
  .lst-stab { min-width: 0; flex: 1 1 calc(50% - 10px); padding: 9px 10px; font-size: .78rem; }
  .lst-filters-row .sf-drop, .lst-filters-row .sf-sort { flex: 1 1 100%; }
  .lst-filters-row .sf-btn { width: 100%; }
}

/* Stats: a year in the plans against a year in dollars */
.usd-facts { margin-bottom: 14px; }
.usd-lead { font-size: .9rem; line-height: 2; color: var(--text); margin: 0 0 12px; }
.usd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.usd-kpis > div { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; text-align: center; }
.usd-kpis b { display: block; font-size: 1.15rem; font-weight: 900; color: var(--strong); }
.usd-kpis span { display: block; font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.c-rate { color: var(--accent-text) !important; }
.c-usd { color: var(--warn-text) !important; }
.c-up { color: var(--success-text) !important; }
.c-down { color: var(--red-text) !important; }
.usd-note { font-size: .72rem; color: var(--text-muted); line-height: 1.9; margin: 12px 0 0; }
@media (max-width: 767.98px) { .usd-kpis { grid-template-columns: repeat(2, 1fr); } }

/* سرعت جذب — خط زیر نوار پیشرفت در صفحهٔ طرح */
.dp-fill { margin: 12px 0 0; font-size: .86rem; color: var(--text); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.dp-fill b { color: var(--accent-text); }
.dp-fill span { color: var(--text-muted); font-size: .8rem; }

/* تقویم طرح — صفحهٔ طرح */
.pc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pc-src { font-size: .7rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--green-lit); color: var(--on-tint-success); }
.pc-src.est { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.pc-note { font-size: .74rem; color: var(--text-muted); margin: 0 0 8px; line-height: 1.8; }
.pc-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.pc-chip { font-size: .76rem; padding: 4px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.pc-chip.ok b { color: var(--success-text); }
.pc-chip.bad { background: var(--red-lit); border-color: transparent; color: var(--red-text); }
.pc-list { list-style: none; margin: 0; padding: 0; position: relative; }
.pc-list::before { content: ""; position: absolute; top: 10px; bottom: 10px; right: 7px; width: 2px; background: var(--border); }
.pc-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px; gap: 10px; align-items: center;
  padding: 9px 26px 9px 0; border-bottom: 1px dashed var(--border); font-size: .82rem; }
.pc-item:last-child { border-bottom: none; }
.pc-dot { position: absolute; right: 1px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--text-muted); }
.pc-item.st-upcoming .pc-dot { border-color: var(--accent); }
.pc-item.st-done .pc-dot { background: var(--success-text); border-color: var(--success-text); }
.pc-item.st-overdue .pc-dot { background: var(--red); border-color: var(--red); }
.pc-item.st-due .pc-dot { background: #E8A93B; border-color: #E8A93B; }
.pc-item.st-cancelled .pc-dot, .pc-item.st-past .pc-dot { background: var(--border); border-color: var(--border); }
.pc-item.k-profit .pc-main b, .pc-item.k-principal .pc-main b { color: var(--strong); }
.pc-item.st-cancelled .pc-main b { text-decoration: line-through; color: var(--text-muted); }
.pc-main small { display: block; font-size: .68rem; color: var(--text-muted); }
.pc-pct { font-size: .72rem; color: var(--accent-text); font-weight: 700; }
.pc-date { font-weight: 700; white-space: nowrap; }
.pc-date small { display: block; font-weight: 400; font-size: .68rem; color: var(--accent-text); }
.pc-badge { text-align: left; }
.pc-badge .b { font-size: .68rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--bg); color: var(--text-muted); white-space: nowrap; }
.pc-badge .b.ok { background: var(--green-lit); color: var(--on-tint-success); }
.pc-badge .b.bad { background: var(--red-lit); color: var(--red-text); }
.pc-badge .b.warn { background: #FEF3D6; color: #8a5a00; }
.pc-today { position: relative; padding: 6px 26px 6px 0; }
.pc-today::before { content: ""; position: absolute; right: 0; left: 0; top: 50%; border-top: 2px solid var(--accent); }
.pc-today span { position: relative; background: var(--surface); padding-left: 8px; font-size: .7rem; font-weight: 800; color: var(--accent-text); }
@media (max-width: 640px) {
  .pc-item { grid-template-columns: minmax(0, 1fr) auto; }
  .pc-badge { grid-column: 1 / -1; text-align: right; }
  .pc-badge:empty { display: none; }
}

/* ویدیوی بالای مطلب (آموزش سایت) */
.art-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #0D1B3D; margin: 6px 0 22px; box-shadow: var(--shadow-md); }

/* ── Profile: invites ── */
.profile-page { flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.invite-card { max-width: 520px; padding: 34px 34px; text-align: right; }
.invite-card section + section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--border); }
.invite-h { font-size: 1.05rem; font-weight: 900; color: var(--strong); margin: 0 0 14px; }
.invite-note { font-size: .78rem; color: var(--text-muted); line-height: 1.9; margin: 0 0 12px; }
.invite-code { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 2px dashed var(--accent); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; }
.invite-code-label { font-size: .75rem; color: var(--text-muted); }
.invite-code bdi { font: 900 1.35rem/1 'Vazirmatn', Tahoma, monospace; letter-spacing: .14em; color: var(--strong); margin-inline-end: auto; }
.invite-link { display: flex; gap: 8px; align-items: stretch; }
.invite-link .auth-input { font-size: .76rem; padding: 10px 12px; min-width: 0; }
.invite-copy { flex: none; border: 2px solid var(--border); background: var(--surface); color: var(--strong); border-radius: 12px; padding: 0 14px;
  font: 700 .78rem 'Vazirmatn', Tahoma, sans-serif; cursor: pointer; min-height: 40px; }
.invite-copy:hover { border-color: var(--accent); color: var(--accent-text); }
.invite-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.invite-share { display: flex; gap: 8px; margin-top: 4px; }
.invite-share .auth-btn { flex: 1; font-size: .82rem; padding: 11px; }
.invite-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 14px; }
.invite-stats div { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.invite-stats b { display: block; font-size: 1.4rem; font-weight: 900; color: var(--strong); }
.invite-stats span { font-size: .72rem; color: var(--text-muted); }
.invite-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.invite-table th { text-align: right; color: var(--text-muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.invite-table td { padding: 9px 6px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.inv-on { color: #1f9d5c; font-weight: 700; }
.inv-off { color: var(--text-muted); }
.invite-empty { text-align: center; padding: 10px 0 0; }
/* login: optional invite code */
.invite-field { margin: -4px 0 14px; }
.invite-field summary { cursor: pointer; font-size: .78rem; color: var(--accent-text); font-weight: 700; list-style: none; margin-bottom: 10px; }
.invite-field summary::-webkit-details-marker { display: none; }
.invite-field[open] summary { color: var(--text-muted); }
.field-hint { display: block; font-size: .72rem; color: #1f9d5c; margin-top: 4px; }
@media (max-width: 480px) { .invite-card { padding: 26px 18px; } }

/* «دارا» — club coin */
.dara-head { display: flex; align-items: center; gap: 14px; }
.dara-head > div { flex: 1; min-width: 0; }
.dara-head .invite-h { margin-bottom: 4px; }
.dara-head .invite-note { margin: 0; }
.dara-coin { flex: none; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 900 1.5rem/1 'Vazirmatn', Tahoma, sans-serif; color: #7a4a00;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f2b632 60%, #c98a12); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15), 0 3px 10px rgba(201,138,18,.35); }
.dara-balance { flex: none; font: 900 2rem/1 'Vazirmatn', Tahoma, sans-serif; color: var(--strong); text-align: center; }
.dara-balance small { display: block; font-size: .7rem; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.dara-log { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 6px; }
.dara-log li { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--text); background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.dara-log li span:nth-child(2) { flex: 1; min-width: 0; }
.dara-log time { color: var(--text-muted); font-size: .72rem; }
.dara-amt { font-weight: 900; color: #1f9d5c; min-width: 2.2em; }
.dara-amt.neg { color: #c2453a; }
.dara-ways { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dara-ways li { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.dara-ways b { font: 900 1.05rem/1.2 'Vazirmatn', Tahoma, sans-serif; color: #B7791F; }
.dara-ways b::after { content: ' دارا'; font-size: .7rem; font-weight: 700; }
.dara-ways span { font-size: .76rem; color: var(--text); font-weight: 600; }
.dara-ways small { font-size: .7rem; color: var(--text-muted); }
.dara-ways li.done { border-color: #9ad7b8; background: rgba(31,157,92,.07); }
.dara-ways li.done span::before { content: '✓ '; color: #1f9d5c; font-weight: 900; }
/* navbar: nudge to fill in the profile until a name exists */
.nav-link.nav-complete { color: #B7791F !important; font-weight: 800; font-size: .74rem !important; white-space: nowrap; border: 1.5px dashed #E8A317; border-radius: 999px; padding: 3px 10px !important; }
.nav-link.nav-complete:hover { background: rgba(232,163,23,.1); }
.nav-link.nav-user { font-weight: 700; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-complete .nc-short { display: none; }
@media (min-width: 992px) and (max-width: 1399.98px) { .nav-complete .nc-full { display: none; } .nav-complete .nc-short { display: inline; } }

/* مستندات طرح (گزارش ارزیابی و …) در صفحهٔ طرح */
.pd-note { font-size: .74rem; color: var(--text-muted); margin: 0 0 10px; }
.pd-list { display: flex; flex-direction: column; gap: 8px; }
.pd-doc { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--strong); text-decoration: none; }
.pd-doc:hover { border-color: var(--accent); color: var(--strong); }
.pd-doc > i { font-size: 1.15rem; color: var(--text-muted); }
.pd-doc span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pd-doc b { font-size: .84rem; }
.pd-doc small { font-size: .72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-doc em { font-style: normal; font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.pd-doc.main { background: var(--accent-pale); border-color: transparent; }
.pd-doc.main > i { color: var(--accent); }

/* داراهوش: دکمهٔ زیر گزارش ارزیابی و پنجرهٔ گفتگو */
.hosh-cta { margin-top: 14px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid)); color: #fff; flex-wrap: wrap; }
.hosh-cta > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.hosh-cta b { font-size: .9rem; }
.hosh-cta b i { color: var(--accent-light); }
.hosh-cta span { font-size: .74rem; opacity: .85; line-height: 1.7; }
.hosh-open { border: 0; border-radius: 10px; padding: 9px 18px; font-weight: 800; font-size: .8rem; background: var(--accent-light); color: var(--primary); }
.hosh-open:hover { background: #fff; }
.hosh-modal { border-radius: 18px; overflow: hidden; }
.hosh-modal .modal-header { background: var(--primary); color: #fff; border: 0; }
.hosh-modal .modal-header small { opacity: .75; font-size: .72rem; }
.hosh-modal .modal-header .btn-close { filter: invert(1); }
.hosh-modal .modal-title i { color: var(--accent-light); }
.hosh-modal .modal-body { background: var(--bg); min-height: 340px; display: flex; flex-direction: column; gap: 10px; }
.hosh-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: .85rem; line-height: 1.95; }
.hosh-msg.bot { background: var(--surface, #fff); border: 1px solid var(--border); align-self: flex-start; border-top-right-radius: 4px; }
.hosh-msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-top-left-radius: 4px; white-space: pre-wrap; }
.hosh-msg.err { background: var(--red-lit); color: var(--red-text); border-color: transparent; }
.hosh-msg p { margin: 0 0 6px; } .hosh-msg p:last-child { margin: 0; }
.hosh-msg h6 { font-weight: 800; font-size: .86rem; margin: 8px 0 4px; }
.hosh-msg ul, .hosh-msg ol { margin: 0 0 6px; padding-inline-start: 20px; }
.hosh-table { overflow-x: auto; margin: 6px 0; }
.hosh-table table { border-collapse: collapse; font-size: .76rem; white-space: nowrap; }
.hosh-table th, .hosh-table td { border: 1px solid var(--border); padding: 4px 8px; }
.hosh-table th { background: var(--accent-pale); }
.hosh-msg.wait span { display: inline-block; width: 6px; height: 6px; margin-inline-end: 3px; border-radius: 50%; background: var(--accent); animation: hoshDot 1s infinite; }
.hosh-msg.wait span:nth-child(2) { animation-delay: .15s; } .hosh-msg.wait span:nth-child(3) { animation-delay: .3s; }
@keyframes hoshDot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.hosh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hosh-chips button { border: 1px solid var(--accent); background: var(--accent-pale); color: var(--accent-deep); border-radius: 99px;
  padding: 6px 14px; font-size: .78rem; font-weight: 700; }
.hosh-chips button:hover:not(:disabled) { background: var(--accent); color: #fff; }
.hosh-chips button:disabled { opacity: .5; }
.hosh-modal .modal-footer { display: block; border-top: 1px solid var(--border); }
.hosh-form { display: flex; gap: 8px; align-items: flex-end; }
.hosh-form textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; font-size: .85rem;
  background: var(--bg); color: var(--strong); }
.hosh-form button { border: 0; border-radius: 12px; width: 42px; height: 42px; background: var(--accent); color: #fff; }
.hosh-form button:disabled { opacity: .5; }
.hosh-note { font-size: .68rem; color: var(--text-muted); margin: 6px 0 0; }
