/* ============================================================
   Taha OS — 2026 liquid-glass design system (RTL / Persian)
   Light: warm pearl · Dark: navy/plum
   ============================================================ */

:root {
  --bg: #f7f8fb;
  --bg-2: #eef1f8;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: #f1f3f9;
  --glass: rgba(255, 255, 255, 0.64);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --border: rgba(23, 32, 66, 0.09);
  --border-lum: rgba(255, 255, 255, 0.9);
  --text: #131a2e;
  --text-2: #48536f;
  --text-3: #7c869f;
  --brand: #4f46e5;
  --brand-soft: rgba(79, 70, 229, 0.1);
  --cyan: #0e94b0;
  --cyan-soft: rgba(14, 148, 176, 0.1);
  --teal: #0d9488;
  --emerald: #0a9b6c;
  --emerald-soft: rgba(10, 155, 108, 0.1);
  --coral: #ef5d43;
  --coral-soft: rgba(239, 93, 67, 0.1);
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.1);
  --gold: #c78a12;
  --gold-soft: rgba(199, 138, 18, 0.12);
  --indigo: #4f5dd0;
  --indigo-soft: rgba(79, 93, 208, 0.1);
  --mint: #0d9488;
  --mint-soft: rgba(13, 148, 136, 0.1);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.09);
  --shadow: 0 18px 46px -22px rgba(35, 46, 90, 0.28);
  --shadow-sm: 0 8px 22px -12px rgba(35, 46, 90, 0.18);
  --overlay: rgba(24, 30, 55, 0.42);
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --rail-w: 96px;
}

html.dark {
  --bg: #0b1020;
  --bg-2: #0e1428;
  --surface: rgba(21, 28, 53, 0.82);
  --surface-solid: #151c35;
  --surface-2: #101731;
  --glass: rgba(17, 24, 46, 0.6);
  --glass-strong: rgba(17, 24, 46, 0.86);
  --border: rgba(150, 163, 255, 0.13);
  --border-lum: rgba(170, 182, 255, 0.22);
  --text: #edf0fc;
  --text-2: #aab3d4;
  --text-3: #767fa1;
  --brand: #8b86ff;
  --brand-soft: rgba(139, 134, 255, 0.14);
  --cyan: #38d3ea;
  --cyan-soft: rgba(56, 211, 234, 0.12);
  --teal: #2dd4bf;
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.12);
  --coral: #ff8a70;
  --coral-soft: rgba(255, 138, 112, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --gold: #f3c04e;
  --gold-soft: rgba(243, 192, 78, 0.13);
  --indigo: #93a2ff;
  --indigo-soft: rgba(147, 162, 255, 0.13);
  --mint: #5eead4;
  --mint-soft: rgba(94, 234, 212, 0.12);
  --rose: #fb7185;
  --rose-soft: rgba(251, 113, 133, 0.12);
  --shadow: 0 22px 55px -24px rgba(0, 0, 0, 0.65);
  --shadow-sm: 0 10px 26px -14px rgba(0, 0, 0, 0.5);
  --overlay: rgba(4, 7, 18, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Estedad', 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

.num, .kpi-value, td, .pill, .chip, .stat-big { font-variant-numeric: tabular-nums; }

.hidden { display: none !important; }

::selection { background: var(--brand); color: #fff; }

/* ---------- Ambient background mesh / orbs ---------- */
.bg-mesh { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-mesh .orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.orb-a { width: 480px; height: 480px; top: -140px; inset-inline-start: -120px; background: radial-gradient(circle, var(--brand-soft), transparent 70%); }
.orb-b { width: 520px; height: 520px; top: 20%; inset-inline-end: -160px; background: radial-gradient(circle, var(--cyan-soft), transparent 70%); }
.orb-c { width: 420px; height: 420px; bottom: -120px; inset-inline-start: 30%; background: radial-gradient(circle, var(--violet-soft), transparent 70%); }
html:not(.dark) .bg-mesh .orb { opacity: 0.9; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-solid { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-md); }
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border-lum);
  box-shadow: var(--shadow);
}
.inner-scroll {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ---------- Scrollbars ---------- */
.scroll-thin::-webkit-scrollbar { width: 5px; height: 5px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--border-lum); border-radius: 99px; }
.scroll-thin { scrollbar-width: thin; }

/* ---------- Side rail (desktop) ---------- */
.side-rail {
  position: fixed;
  inset-inline-start: 16px;
  top: 16px;
  bottom: 16px;
  width: var(--rail-w);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px;
  z-index: 60;
}
.rail-logo {
  width: 52px; height: 52px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(145deg, #4f46e5, #7c3aed 55%, #0891b2);
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, 0.55);
}
.rail-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 26px; width: 100%; }
.rail-link {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: 16px; text-decoration: none;
  color: var(--text-3); font-size: 10px; font-weight: 600;
  transition: all 0.2s ease;
}
.rail-link svg, .rail-link i.lucide { width: 19px; height: 19px; }
.rail-link:hover { color: var(--text); background: var(--surface-2); }
.rail-link.active { color: var(--brand); background: var(--brand-soft); }
.rail-health {
  margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 9px; color: var(--text-3); text-align: center;
}
.health-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 4px var(--surface-2);
}
.health-dot.ok { background: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-soft), 0 0 12px var(--emerald); }
.health-dot.err { background: var(--rose); box-shadow: 0 0 0 4px var(--rose-soft); }

/* ---------- Top command bar ---------- */
.app-shell { margin-inline-start: calc(var(--rail-w) + 34px); padding: 16px 26px 40px; max-width: 1460px; }
.topbar {
  border-radius: 22px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
}
.topbar .brand-mini { display: none; align-items: center; gap: 10px; }
.brand-mini .mark {
  width: 38px; height: 38px; border-radius: 13px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  background: linear-gradient(145deg, #4f46e5, #0891b2);
}
.brand-mini .t { font-weight: 800; font-size: 13px; }
.brand-mini .s { font-size: 10px; color: var(--text-3); }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.topbar-row .search-box {
  justify-self: start;
  width: min(420px, 100%);
}
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.search-box input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 12.5px; color: var(--text); min-width: 60px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box > svg, .search-box > i.lucide { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.search-results {
  position: absolute; top: calc(100% + 8px); inset-inline: 0;
  border-radius: 18px; padding: 8px; max-height: 320px; overflow-y: auto;
  display: none; z-index: 70;
}
.search-results.open { display: block; }
.sr-group { font-size: 10px; font-weight: 700; color: var(--text-3); padding: 6px 10px 4px; }
.sr-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; border-radius: 12px;
  font-family: inherit; font-size: 12px; color: var(--text); cursor: pointer; text-align: right;
}
.sr-item:hover, .sr-item:focus-visible { background: var(--brand-soft); outline: none; }
.sr-item .meta { font-size: 10px; color: var(--text-3); margin-inline-start: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-weight: 700; font-size: 12px;
  border: 1px solid transparent; border-radius: 14px;
  padding: 9px 16px; cursor: pointer; text-decoration: none;
  transition: all 0.18s ease; color: var(--text); background: var(--surface-2);
}
.btn svg, .btn i.lucide { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, #4f46e5, #6d5df3); color: #fff; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.6); }
.btn-cyan { background: linear-gradient(135deg, #0e94b0, #0d9488); color: #fff; }
.btn-emerald { background: linear-gradient(135deg, #0a9b6c, #34b98a); color: #fff; }
.btn-violet { background: linear-gradient(135deg, #7c3aed, #9d5cf5); color: #fff; }
.btn-danger { background: var(--rose-soft); color: var(--rose); border-color: transparent; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-lum); }
.btn-icon { padding: 9px; border-radius: 12px; }
.btn-sm { padding: 6px 11px; font-size: 11px; border-radius: 11px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-lum); }
.icon-btn.danger:hover { color: var(--rose); border-color: var(--rose); background: var(--rose-soft); }
.icon-btn svg, .icon-btn i.lucide { width: 15px; height: 15px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  display: none;
  position: fixed; bottom: 12px; inset-inline: 14px; z-index: 60;
  border-radius: 24px; padding: 8px;
  justify-content: space-around; align-items: center;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-3); font-size: 9.5px; font-weight: 600; text-decoration: none;
  padding: 7px 10px; border-radius: 15px; min-width: 48px;
}
.bottom-nav a svg, .bottom-nav a i.lucide { width: 18px; height: 18px; }
.bottom-nav a.active { color: var(--brand); background: var(--brand-soft); }

/* ---------- Sections ---------- */
main { display: flex; flex-direction: column; gap: 64px; padding-top: 26px; }
.section { scroll-margin-top: 96px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.section-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 99px; margin-bottom: 8px;
}
.section-badge svg, .section-badge i.lucide { width: 13px; height: 13px; }
.section-title { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.section-sub { font-size: 12px; color: var(--text-2); margin: 6px 0 0; line-height: 1.8; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.id-cyan .section-badge { background: var(--cyan-soft); color: var(--cyan); }
.id-emerald .section-badge { background: var(--emerald-soft); color: var(--emerald); }
.id-violet .section-badge { background: var(--violet-soft); color: var(--violet); }
.id-indigo .section-badge { background: var(--indigo-soft); color: var(--indigo); }
.id-mint .section-badge { background: var(--mint-soft); color: var(--mint); }

/* ---------- Overview bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.hero-panel {
  grid-column: span 12; border-radius: 28px; padding: 30px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; align-items: center;
  position: relative; overflow: hidden;
}
.hero-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; margin: 14px 0 10px; letter-spacing: -0.025em; line-height: 1.35; }
.hero-title .grad { background: linear-gradient(120deg, var(--brand), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 13px; color: var(--text-2); line-height: 2; margin: 0 0 18px; max-width: 480px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-svg-wrap { display: flex; align-items: center; justify-content: center; min-height: 240px; }
.hero-svg { width: 100%; max-width: 430px; height: auto; }
.sv-stop-a { stop-color: var(--brand); }
.sv-stop-b { stop-color: var(--cyan); }
.sv-stop-glow { stop-color: var(--gold); }
.sv-stroke { stroke: var(--border-lum); }
.sv-arch-line { fill: none; stroke: var(--brand); stroke-width: 1.6; opacity: 0.85; }
.sv-arch-line2 { fill: none; stroke: var(--cyan); stroke-width: 1.3; opacity: 0.6; }
.sv-arch-fill { fill: var(--brand-soft); stroke: var(--border-lum); stroke-width: 1; }
.sv-min { fill: var(--surface-2); stroke: var(--border-lum); stroke-width: 1.2; }
.sv-star { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: 0.9; }
.sv-lamp { fill: var(--gold); opacity: 0.9; }
.sv-cord { stroke: var(--text-3); stroke-width: 1; opacity: 0.5; }
.sv-floor { stroke: var(--border-lum); stroke-width: 1.2; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; padding: 4px 11px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2);
}
.badge svg, .badge i.lucide { width: 12px; height: 12px; }
.badge.verified { background: var(--emerald-soft); color: var(--emerald); border-color: transparent; }
.badge.demo { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.badge.estimate { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge.rose { background: var(--rose-soft); color: var(--rose); border-color: transparent; }

.side-stack { grid-column: span 12; display: flex; flex-direction: column; gap: 18px; }
.chart-card { padding: 20px; }
.chart-card h4 { margin: 0 0 4px; font-size: 13px; font-weight: 800; }
.chart-card .hint { font-size: 10.5px; color: var(--text-3); margin: 0 0 12px; }
.chart-box { position: relative; height: 210px; }
.chart-box.tall { height: 460px; }

.kpi-row { grid-column: span 12; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpi-card { border-radius: 24px; padding: 20px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.kpi-icon { width: 36px; height: 36px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.kpi-icon svg, .kpi-icon i.lucide { width: 17px; height: 17px; }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 12px; letter-spacing: -0.02em; }
.kpi-sub { font-size: 10.5px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.latest-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.latest-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; }
.latest-item .v { font-weight: 800; }

/* ---------- Chips / filters ---------- */
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); transition: all 0.15s;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--brand); color: #fff; border-color: transparent; }
.id-cyan .chip.active { background: var(--cyan); }
.id-emerald .chip.active { background: var(--emerald); }
.id-violet .chip.active { background: var(--violet); }

/* ---------- Inputs ---------- */
.field label { display: block; font-size: 11px; color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
.input, .field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: 12.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px;
  padding: 10px 12px; outline: none; transition: border-color 0.15s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
select.input option { background: var(--surface-solid); color: var(--text); }

/* ---------- Centers ---------- */
.centers-chart-panel { padding: 22px; margin-bottom: 20px; }
.centers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 18px; }
.center-card { padding: 22px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.center-card::before {
  content: ''; position: absolute; top: 0; inset-inline-start: 22px; width: 88px; height: 46px;
  border: 1.5px solid var(--cyan); border-bottom: none; border-radius: 90px 90px 0 0;
  opacity: 0.28; pointer-events: none;
}
.center-card::after {
  content: ''; position: absolute; top: 0; inset-inline-start: 40px; width: 52px; height: 28px;
  border: 1.5px solid var(--cyan); border-bottom: none; border-radius: 60px 60px 0 0;
  opacity: 0.16; pointer-events: none;
}
.center-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-top: 30px; }
.center-name { font-size: 15.5px; font-weight: 800; margin: 0; }
.center-meta { font-size: 10.5px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.center-meta svg, .center-meta i.lucide { width: 11px; height: 11px; }
.center-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.center-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.center-stat { text-align: center; padding: 9px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.center-stat .v { font-size: 16px; font-weight: 800; display: block; }
.center-stat .k { font-size: 9.5px; color: var(--text-3); }
.center-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-col { padding: 12px; display: flex; flex-direction: column; }
.mini-col-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.mini-col-head svg, .mini-col-head i.lucide { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 4px; }
.mini-list { display: flex; flex-direction: column; gap: 7px; max-height: 190px; overflow-y: auto; padding-inline-end: 2px; }
.mini-item { padding: 8px 10px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); font-size: 11px; }
.mini-item .n { font-weight: 700; }
.mini-item .m { font-size: 9.5px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.mini-item.clickable { cursor: pointer; transition: border-color 0.15s; }
.mini-item.clickable:hover { border-color: var(--emerald); }
.mini-empty { font-size: 10.5px; color: var(--text-3); text-align: center; padding: 22px 8px; }
.analysis-box { border-radius: 14px; padding: 12px; font-size: 11px; line-height: 1.9; }
.analysis-box .ttl { font-weight: 700; font-size: 10.5px; display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.analysis-box.ok { background: var(--emerald-soft); }
.analysis-box.ok .ttl { color: var(--emerald); }
.analysis-box.warn { background: var(--gold-soft); }
.analysis-box.warn .ttl { color: var(--gold); }
.analysis-box.none { background: var(--surface-2); border: 1px dashed var(--border-lum); color: var(--text-3); }
.center-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.center-foot .acts { display: flex; gap: 6px; }
.demo-mark { font-size: 9px; color: var(--gold); font-weight: 700; }

/* ---------- Growth studio ---------- */
.growth-layout { display: grid; grid-template-columns: 330px 1fr; gap: 18px; align-items: start; }
.roster-panel { padding: 16px; position: sticky; top: 96px; }
.roster-search { margin-bottom: 12px; }
.roster-list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; }
.roster-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: right;
  padding: 10px 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-family: inherit; color: var(--text);
  transition: all 0.15s;
}
.roster-item:hover { border-color: var(--emerald); }
.roster-item.active { border-color: var(--emerald); background: var(--emerald-soft); }
.roster-av {
  width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
  background: linear-gradient(140deg, var(--emerald), var(--teal));
}
.roster-item .nm { font-size: 12.5px; font-weight: 700; }
.roster-item .mt { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.workbench { display: flex; flex-direction: column; gap: 18px; }
.wb-profile { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.wb-id { display: flex; align-items: center; gap: 14px; }
.wb-av { width: 58px; height: 58px; border-radius: 20px; color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, var(--emerald), var(--cyan)); }
.wb-name { font-size: 17px; font-weight: 800; margin: 0; }
.wb-sub { font-size: 11px; color: var(--text-2); margin-top: 4px; }
.wb-traits { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 7px 11px; margin-top: 9px; line-height: 1.8; }
.wb-att { text-align: center; }
.wb-att .v { font-size: 24px; font-weight: 800; color: var(--emerald); }
.wb-att .k { font-size: 10px; color: var(--text-3); }
.wb-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dims { display: flex; flex-direction: column; gap: 14px; }
.dim-row .dim-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.dim-row .dim-top .val { font-weight: 800; }
.dim-row input[type=range] { width: 100%; accent-color: var(--emerald); }
.dim-row.edu input[type=range] { accent-color: var(--indigo); }
.dim-row.psy input[type=range] { accent-color: var(--cyan); }
.dim-row.rel input[type=range] { accent-color: var(--gold); }
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; }
.tl-item { display: flex; gap: 11px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.tl-ico { width: 30px; height: 30px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--cyan-soft); color: var(--cyan); }
.tl-ico svg, .tl-ico i.lucide { width: 14px; height: 14px; }
.tl-item .tt { font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.tl-item .dt { font-size: 10px; color: var(--text-3); }
.tl-item .ds { font-size: 11px; color: var(--text-2); margin-top: 4px; line-height: 1.8; }
.tl-item .tg { font-size: 9.5px; color: var(--text-3); margin-top: 6px; display: flex; gap: 8px; }
.event-form { padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; }
.event-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* ---------- Academy ---------- */
.academy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.cat-card { padding: 20px; display: flex; flex-direction: column; }
.cat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.cat-ico { width: 42px; height: 42px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-ico svg, .cat-ico i.lucide { width: 19px; height: 19px; }
.cat-name { font-size: 13.5px; font-weight: 800; margin: 0; }
.cat-count { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.course-list { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; padding-inline-end: 2px; }
.course-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; }
.course-item .tt { font-weight: 700; }
.course-item .ds { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.course-item .acts { display: flex; gap: 4px; flex-shrink: 0; }
.course-item .acts .icon-btn { width: 28px; height: 28px; border-radius: 9px; }
.course-item .acts .icon-btn svg, .course-item .acts .icon-btn i.lucide { width: 12px; height: 12px; }
.cat-foot { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); }

/* ---------- Staff repository ---------- */
.staff-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-controls .input, .staff-controls select { width: auto; min-width: 150px; }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; max-height: 540px; }
table.repo { width: 100%; border-collapse: collapse; font-size: 12px; text-align: right; }
table.repo thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-solid); color: var(--text-2);
  font-size: 10.5px; font-weight: 700; padding: 12px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.repo tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
table.repo tbody tr:hover { background: var(--surface-2); }
table.repo .nm { font-weight: 700; color: var(--text); }
table.repo .acts { display: flex; gap: 4px; justify-content: center; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); }
.pager .pg-btns { display: flex; gap: 6px; }

/* ---------- People directory (glass luxury cards) ---------- */
.ppl-card { padding: 16px; }
.ppl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
  max-height: 508px; overflow-y: auto; padding: 4px; }
.pcard {
  position: relative; border-radius: 20px; padding: 18px 14px 14px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border-lum); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform .2s, box-shadow .2s; overflow: hidden; cursor: default;
}
.pcard::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--pc, var(--indigo)), transparent); opacity: .8; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pav { width: 56px; height: 56px; border-radius: 17px; padding: 2.5px; margin-bottom: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--pc, var(--indigo)), var(--pc2, var(--violet)));
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--pc, var(--indigo)) 55%, transparent); }
.pav > div { width: 100%; height: 100%; border-radius: 14px; background: var(--surface-solid);
  display: grid; place-items: center; font-size: 20px; font-weight: 800; color: var(--pc, var(--indigo)); overflow: hidden; }
.pav svg { width: 62%; height: 62%; display: block; }
.pav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pname { font-size: 12.5px; font-weight: 800; }
.prole { font-size: 9.5px; font-weight: 700; margin-top: 5px; padding: 3px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--pc, var(--indigo)) 12%, transparent); color: var(--pc, var(--indigo)); }
.pmeta { font-size: 9.5px; color: var(--text-3); margin-top: 8px; display: flex; align-items: center; gap: 4px; max-width: 100%; }
.pmeta svg, .pmeta i.lucide { width: 11px; height: 11px; flex-shrink: 0; }
.pmeta > *:not(svg):not(i) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pphone { font-size: 10.5px; color: var(--text-2); margin-top: 4px; font-variant-numeric: tabular-nums; direction: ltr; }
.pacts { display: flex; gap: 6px; margin-top: 11px; opacity: 0; transition: opacity .15s; }
.pcard:hover .pacts, .pcard:focus-within .pacts { opacity: 1; }
.pacts .icon-btn { width: 27px; height: 27px; border-radius: 9px; }
.pacts .icon-btn svg, .pacts .icon-btn i.lucide { width: 12px; height: 12px; }

/* ---------- Audit ---------- */
.audit-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.audit-counts { grid-column: span 12; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.audit-count { padding: 16px; text-align: center; border-radius: 20px; }
.audit-count .v { font-size: 23px; font-weight: 800; display: block; }
.audit-count .k { font-size: 10px; color: var(--text-3); margin-top: 4px; display: block; }
.audit-panel { padding: 20px; }
.audit-panel h4 { margin: 0 0 4px; font-size: 13px; font-weight: 800; }
.audit-panel .hint { font-size: 10.5px; color: var(--text-3); margin: 0 0 12px; line-height: 1.8; }
.legend-list { display: flex; flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: flex-start; gap: 10px; font-size: 11px; line-height: 1.8; }
.legend-item .badge { flex-shrink: 0; }
.alloc-bar { height: 12px; border-radius: 99px; overflow: hidden; display: flex; background: var(--surface-2); border: 1px solid var(--border); }
.alloc-bar .a { background: linear-gradient(90deg, var(--emerald), var(--teal)); }
.alloc-bar .b { background: var(--gold-soft); border-inline-start: 1px dashed var(--gold); }
.alloc-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--text-2); margin-top: 10px; flex-wrap: wrap; }
.alloc-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: 5px; vertical-align: -1px; }

/* ---------- Modals / sheets ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: var(--overlay);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  border-radius: 26px; padding: 24px;
  background: var(--surface-solid); border: 1px solid var(--border-lum);
  box-shadow: var(--shadow);
  transform: translateY(14px) scale(0.98); transition: transform 0.22s ease;
}
.overlay.open .modal { transform: none; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.modal-head h3 svg, .modal-head h3 i.lucide { width: 17px; height: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--border); }

.sheet-wrap { position: fixed; inset: 0; z-index: 90; background: var(--overlay); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 0.22s; }
.sheet-wrap.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 94vw);
  background: var(--surface-solid); border-inline-start: 1px solid var(--border-lum);
  padding: 24px; overflow-y: auto;
  transform: translateX(-40px); transition: transform 0.25s ease;
}
[dir="rtl"] .sheet { transform: translateX(-40px); }
.sheet-wrap.open .sheet { transform: none; }
.detail-block { padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; }
.detail-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 5px 0; }
.detail-row .k { color: var(--text-3); }
.detail-row .v { font-weight: 700; text-align: left; }
.quick-add-list { display: flex; flex-direction: column; gap: 9px; }
.quick-add-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  padding: 13px; border-radius: 18px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-family: inherit; color: var(--text);
  transition: all 0.15s;
}
.quick-add-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick-add-item .qi { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-add-item .qi svg, .quick-add-item .qi i.lucide { width: 18px; height: 18px; }
.quick-add-item .t { font-size: 12.5px; font-weight: 700; }
.quick-add-item .s { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* ---------- Toasts ---------- */
#toast-container {
  position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 120;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-radius: 16px; font-size: 12px; font-weight: 700;
  color: #fff; box-shadow: var(--shadow); pointer-events: auto;
  animation: toast-in 0.28s ease both; max-width: 340px;
}
.toast.success { background: linear-gradient(135deg, #0a9b6c, #0d9488); }
.toast.error { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.toast svg, .toast i.lucide { width: 16px; height: 16px; flex-shrink: 0; }
.toast.bye { opacity: 0; transform: translateY(8px); transition: all 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Skeletons ---------- */
.skeleton {
  border-radius: 16px;
  background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-solid) 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Reveal & motion ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.revealed { opacity: 1; transform: none; }
.float-slow { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.empty-state { text-align: center; color: var(--text-3); font-size: 11.5px; padding: 34px 12px; }

/* ---------- 2026 Interactive Transition Portals ---------- */
.section-transition {
  --tr-accent: var(--cyan);
  --tr-soft: var(--cyan-soft);
  margin: 54px 0 68px;
  width: 100%;
  position: relative;
  scroll-margin-top: 140px;
}
.transition-centers { --tr-accent: var(--cyan); --tr-soft: var(--cyan-soft); }
.transition-growth { --tr-accent: var(--emerald); --tr-soft: var(--emerald-soft); }
.transition-academy { --tr-accent: var(--violet); --tr-soft: var(--violet-soft); }
.transition-staff { --tr-accent: var(--indigo); --tr-soft: var(--indigo-soft); }
.transition-audit { --tr-accent: var(--mint); --tr-soft: var(--mint-soft); }

.portal-card {
  border-radius: 28px;
  padding: 24px 28px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-lum);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tr-accent), transparent);
  opacity: 0.7;
}
.portal-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tr-accent) 60%, var(--border-lum));
  box-shadow: 0 24px 50px -18px color-mix(in srgb, var(--tr-accent) 25%, transparent);
}

.portal-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 28px;
  align-items: center;
}
.portal-visual {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-svg {
  width: 100%;
  height: auto;
  max-height: 240px;
  color: var(--tr-accent);
  filter: drop-shadow(0 14px 28px color-mix(in srgb, var(--tr-accent) 18%, transparent));
}
html.dark .portal-svg {
  filter: drop-shadow(0 16px 36px color-mix(in srgb, var(--tr-accent) 26%, transparent));
}

.portal-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
}
.portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tr-soft);
  color: var(--tr-accent);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 8px;
}
.portal-tag svg, .portal-tag i.lucide { width: 14px; height: 14px; }

.portal-title {
  margin: 4px 0 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.45;
}
.portal-desc {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.9;
}

.portal-motion-bar {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 14px;
}
.portal-progress-track {
  height: 4px;
  background: var(--surface-solid);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 9px;
}
.portal-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--tr-soft), var(--tr-accent));
  border-radius: 99px;
  transition: width 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-transition.active-portal .portal-progress-fill {
  width: 100%;
}
.portal-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.portal-timer-label {
  font-size: 11px;
  color: var(--tr-accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.portal-timer-label svg, .portal-timer-label i.lucide { width: 13px; height: 13px; }
.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tr-accent);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 4px 14px -3px color-mix(in srgb, var(--tr-accent) 50%, transparent);
}
.btn-portal svg, .btn-portal i.lucide { width: 13px; height: 13px; }
.btn-portal:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

/* ---------- SVG Elements & Animations ---------- */
/* 1. Centers Portal */
.tr-min-body { fill: var(--surface-solid); stroke: var(--border-lum); stroke-width: 1.4; }
.tr-min-top { fill: var(--tr-accent); opacity: 0.8; }
.tr-beacon { fill: var(--gold); }
.tr-balcony { fill: var(--tr-soft); stroke: var(--border-lum); stroke-width: 1; }
.tr-arch-outer { fill: none; stroke: url(#portalArchGrad); stroke-width: 2.2; }
.tr-arch-mid { fill: none; stroke: var(--tr-accent); stroke-width: 1.5; opacity: 0.7; }
.tr-arch-inner { fill: var(--tr-soft); stroke: var(--border-lum); stroke-width: 1.2; opacity: 0.6; }
.tr-shamsah rect { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.tr-star-core { fill: var(--tr-accent); opacity: 0.9; }
.tr-star-eye { fill: #fff; }
.tr-cord { stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 2 2; }
.tr-lantern { fill: var(--surface-solid); stroke: var(--gold); stroke-width: 1.4; }
.tr-lantern-glow { fill: var(--gold); filter: drop-shadow(0 0 4px var(--gold)); }
.tr-ground-line { stroke: var(--tr-accent); stroke-width: 1.4; opacity: 0.45; }
.tr-ground-line-sub { stroke: var(--border-lum); stroke-width: 1; opacity: 0.3; }

/* 2. Growth Portal */
.tr-wave-left, .tr-wave-right { fill: none; stroke: var(--emerald); stroke-width: 1.8; stroke-linecap: round; opacity: 0.5; }
.tr-wave-dot { fill: var(--emerald); }
.tr-gyro-ring-outer { fill: none; stroke: var(--emerald); stroke-width: 1.6; stroke-dasharray: 6 4; opacity: 0.45; }
.tr-gyro-ring-mid { fill: none; stroke: var(--emerald); stroke-width: 2; opacity: 0.8; }
.tr-gyro-ring-inner { fill: none; stroke: var(--teal); stroke-width: 1.4; opacity: 0.6; }
.tr-tick { stroke: var(--emerald); stroke-width: 1.6; }
.tr-dim-node { fill: var(--surface-solid); stroke: var(--emerald); stroke-width: 1.8; }
.tr-dim-node.dim-edu { stroke: var(--indigo); }
.tr-dim-node.dim-beh { stroke: var(--emerald); }
.tr-dim-node.dim-psy { stroke: var(--cyan); }
.tr-dim-node.dim-rel { stroke: var(--gold); }
.tr-dim-lbl { fill: var(--text); font-size: 8.5px; font-weight: 800; font-family: inherit; }
.tr-radar-line { stroke: var(--emerald); stroke-width: 1.6; }
.tr-core-prism { fill: var(--emerald-soft); stroke: var(--emerald); stroke-width: 1.8; }
.tr-core-glow { fill: var(--emerald); }

/* 3. Academy Portal */
.tr-sun-ray { stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; opacity: 0.35; stroke-dasharray: 4 3; }
.tr-pillar-orbit { fill: none; stroke: var(--violet); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0.4; }
.tr-pillar-sphere { stroke: #fff; stroke-width: 1.5; }
.tr-pillar-sphere.p1 { fill: var(--violet); }
.tr-pillar-sphere.p2 { fill: var(--gold); }
.tr-pillar-sphere.p3 { fill: var(--emerald); }
.tr-pillar-sphere.p4 { fill: var(--indigo); }
.tr-pillar-sphere.p5 { fill: var(--coral); }
.tr-page-right, .tr-page-left { fill: var(--violet-soft); stroke: var(--violet); stroke-width: 2; }
.tr-page-leaf-right, .tr-page-leaf-left { fill: var(--surface-solid); stroke: var(--border-lum); stroke-width: 1.2; opacity: 0.8; }
.tr-spine-line { stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; }
.tr-gold-star-a, .tr-gold-star-b { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.tr-gold-star-core { fill: var(--gold); }
.tr-crystal-shard { fill: var(--violet); opacity: 0.65; }

/* 4. Staff Portal */
.tr-net-ripple { fill: none; stroke: var(--indigo); stroke-width: 1.2; opacity: 0.35; }
.tr-net-line { stroke: var(--indigo); stroke-width: 1.8; opacity: 0.6; }
.tr-net-subline { stroke: var(--border-lum); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.4; }
.tr-coach-halo { fill: var(--indigo-soft); stroke: var(--indigo); stroke-width: 1.6; }
.tr-coach-disc { fill: var(--surface-solid); stroke: var(--border-lum); stroke-width: 1.4; }
.tr-coach-head { fill: var(--indigo); }
.tr-coach-torso { fill: var(--indigo); opacity: 0.85; }
.tr-hex-spark { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: 0.85; }
.tr-role-bg { fill: var(--surface-solid); stroke: var(--border-lum); stroke-width: 1.5; }
.tr-role-bg.role-lead { stroke: var(--cyan); }
.tr-role-bg.role-coach { stroke: var(--emerald); }
.tr-role-bg.role-peer { stroke: var(--indigo); }
.tr-role-bg.role-supp { stroke: var(--coral); }
.tr-role-bg.role-edu { stroke: var(--violet); }
.tr-role-bg.role-psy { stroke: var(--gold); }
.tr-role-head, .tr-role-torso { fill: var(--text-2); }
.tr-edge-node { fill: var(--indigo); opacity: 0.7; }

/* 5. Audit Portal */
.tr-audit-wire { stroke: var(--mint); stroke-width: 1.6; stroke-linecap: round; opacity: 0.55; }
.tr-capsule-bg { fill: var(--surface-solid); stroke: var(--border); stroke-width: 1.2; }
.tr-cap-dot { fill: var(--text-3); }
.tr-cap-dot.verified { fill: var(--emerald); }
.tr-cap-dot.demo { fill: var(--gold); }
.tr-cap-dot.estimate { fill: var(--coral); }
.tr-cap-text { fill: var(--text-2); font-size: 8.5px; font-weight: 700; font-family: inherit; }
.tr-shield-ring-outer { fill: none; stroke: var(--mint); stroke-width: 1.5; stroke-dasharray: 8 5; opacity: 0.5; }
.tr-ring-pip { fill: var(--mint); }
.tr-shield-ring-inner { fill: none; stroke: var(--teal); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0.4; }
.tr-shield-facets { fill: var(--mint-soft); stroke: var(--mint); stroke-width: 2.2; }
.tr-shield-core { fill: var(--surface-solid); stroke: var(--border-lum); stroke-width: 1.3; opacity: 0.75; }
.tr-scan-laser { stroke: var(--emerald); stroke-width: 2; opacity: 0.75; filter: drop-shadow(0 0 5px var(--emerald)); }
.tr-check-halo { fill: var(--emerald-soft); stroke: var(--emerald); stroke-width: 1.5; }
.tr-check-mark { fill: none; stroke: var(--emerald); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

/* Keyframe Animations */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes pulse-aura {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.1); opacity: 0.55; }
}
@keyframes pulse-core {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes pulse-check {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px var(--emerald)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 8px var(--emerald)); }
}
@keyframes float-lamp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes float-shard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes scan-laser {
  0%, 100% { transform: translateY(-38px); opacity: 0.2; }
  50% { transform: translateY(38px); opacity: 0.9; }
}
@keyframes flow-dashes {
  to { stroke-dashoffset: -28; }
}
@keyframes ripple-expand {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
@keyframes sunburst-glow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.65; }
}
@keyframes beacon-flicker {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

@media (prefers-reduced-motion: no-preference) {
  .anim-spin-slow { animation: spin-slow 24s linear infinite; transform-box: fill-box; transform-origin: center; }
  .anim-spin-reverse { animation: spin-reverse 18s linear infinite; transform-box: fill-box; transform-origin: center; }
  .anim-radar-sweep { animation: radar-sweep 4.2s linear infinite; transform-box: fill-box; transform-origin: center; }
  .anim-pulse-aura { animation: pulse-aura 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-pulse-core { animation: pulse-core 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-pulse-check { animation: pulse-check 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-float-lamp { animation: float-lamp 3.5s ease-in-out infinite; }
  .anim-float-lamp-delay { animation: float-lamp 3.5s ease-in-out 1.75s infinite; }
  .anim-float-shard { animation: float-shard 3.6s ease-in-out infinite; }
  .anim-float-shard-delay { animation: float-shard 3.6s ease-in-out 1.8s infinite; }
  .anim-scan-laser { animation: scan-laser 3.2s ease-in-out infinite; }
  .anim-pulse-flow { stroke-dasharray: 8 6; animation: flow-dashes 2s linear infinite; }
  .anim-ripple { animation: ripple-expand 3.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-ripple-delay { animation: ripple-expand 3.2s ease-out 1.6s infinite; transform-box: fill-box; transform-origin: center; }
  .anim-sunburst { animation: sunburst-glow 4s ease-in-out infinite; }
  .anim-beacon { animation: beacon-flicker 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-beam-cone { animation: sunburst-glow 3.5s ease-in-out infinite; }
}

/* ---------- Responsive ---------- */
@media (min-width: 1025px) {
  .hero-panel { grid-column: span 7; }
  .side-stack { grid-column: span 5; }
}
@media (max-width: 1024px) {
  .side-rail { display: none; }
  .app-shell { margin-inline-start: 0; padding: 12px 14px 96px; }
  .nav-dock { top: 10px; }
  .topbar .brand-mini { display: flex; }
  .bottom-nav { display: flex; }
  .hero-panel { grid-template-columns: 1fr; padding: 22px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .growth-layout { grid-template-columns: 1fr; }
  .roster-panel { position: static; }
  .wb-charts { grid-template-columns: 1fr; }
  .audit-counts { grid-template-columns: repeat(3, 1fr); }
  .centers-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .center-cols { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi-row { gap: 10px; }
  .kpi-card { padding: 15px; }
  .kpi-value { font-size: 23px; }
  .audit-counts { grid-template-columns: repeat(2, 1fr); }
  .btn .btn-txt { display: none; }
}

/* ============================================================
   Vertical stacked architecture — sticky topbar + scroll-spy nav
   ============================================================ */
.side-rail, .bottom-nav { display: none !important; }

.app-shell {
  margin: 0 auto;
  max-width: 1460px;
  width: 100%;
  padding: 14px 22px 70px;
}

.topbar {
  position: relative;
  z-index: 56;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 22px;
}
.topbar-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.topbar .brand-mini { display: flex; }
.brand-mini .mark {
  background: conic-gradient(from 210deg, var(--brand), var(--cyan), var(--brand));
  box-shadow: 0 6px 16px -6px var(--brand);
}
.health-line { display: inline-flex; align-items: center; gap: 6px; }
.health-line .health-dot { box-shadow: none; width: 8px; height: 8px; }

/* capsule nav — sliding accent pill */
.module-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  scrollbar-width: none;
  --glider-accent: var(--brand);
}
.module-nav::-webkit-scrollbar { display: none; }
.nav-glider {
  position: absolute;
  top: 4px; bottom: 4px;
  right: auto; left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--brand-soft);
  background: color-mix(in srgb, var(--glider-accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--glider-accent) 30%, transparent);
  transition: left .4s cubic-bezier(.55,.1,.15,1), width .4s cubic-bezier(.55,.1,.15,1),
              background .35s ease, border-color .35s ease;
  pointer-events: none;
  will-change: left, width;
}
.module-link {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 13px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: color .2s;
  --link-accent: var(--brand);
}
.module-link svg, .module-link i.lucide { width: 14px; height: 14px; }
.module-link:hover { color: var(--text); transform: none; }
.module-link.active {
  color: var(--link-accent);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.module-link.active svg, .module-link.active i.lucide { color: var(--link-accent); }
.module-link[data-target="overview-section"] { --link-accent: var(--brand); }
.module-link[data-target="centers-section"]  { --link-accent: var(--cyan); }
.module-link[data-target="growth-section"]   { --link-accent: var(--emerald); }
.module-link[data-target="academy-section"]  { --link-accent: var(--violet); }
.module-link[data-target="staff-section"]    { --link-accent: var(--indigo); }
.module-link[data-target="audit-section"]    { --link-accent: var(--mint); }

/* sticky dock: capsule nav + pinned quick-add button */
.nav-dock {
  position: sticky;
  top: 10px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 10px;
}
.nav-dock .module-nav { flex: 1 1 auto; }
.nav-add-btn {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px -6px var(--brand);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.nav-add-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -8px var(--brand); }
.nav-add-btn:active { transform: none; }
.nav-add-btn svg, .nav-add-btn i.lucide { width: 18px; height: 18px; }

/* hairline scroll-progress under the bar */
.top-progress {
  position: absolute;
  right: 18px; left: 18px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}
.top-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--brand), var(--violet));
  transition: width .12s linear;
}

/* sections stack vertically; inner lists keep their own scroll */
.module-page { scroll-margin-top: 76px; }
.module-body { min-height: 0; }

/* ---------- Tabbed page mode: each module = one page ---------- */
.module-page { display: none; }
.module-page.page-active {
  display: block;
  animation: pageIn .42s cubic-bezier(.2,.7,.2,1) both;
}
.section-transition { display: none; }
.section-transition.page-intro {
  display: block;
  margin: 2px 0 30px;
}
.section-transition .portal-progress-track,
.section-transition .portal-timer-label { display: none; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* prevent grid blowout from canvas / flex children min-content */
.growth-layout > *, .wb-charts > *, .bento > *, .workbench > *,
.audit-grid > *, .centers-grid > *, .academy-grid > * { min-width: 0; }
.chart-box { overflow: hidden; }
.chart-box canvas { max-width: 100%; }

/* ---------- Per-card inner scroll & row actions ---------- */
.mini-col-head .head-actions { display: inline-flex; align-items: center; gap: 5px; }
.mini-col-head .icon-btn { width: 26px; height: 26px; border-radius: 9px; }
.mini-col-head .icon-btn svg, .mini-col-head .icon-btn i.lucide { width: 12px; height: 12px; margin: 0; }
.mini-item { position: relative; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-main { min-width: 0; flex: 1; }
.mini-main-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: right;
  font-family: inherit;
  cursor: pointer;
}
.mini-acts { display: flex; gap: 4px; flex-shrink: 0; }
.mini-acts .icon-btn { width: 26px; height: 26px; border-radius: 9px; }
.mini-acts .icon-btn svg, .mini-acts .icon-btn i.lucide { width: 12px; height: 12px; }
.scores-panel .section-head, .timeline-panel .section-head { margin-bottom: 10px !important; }

/* ---------- Donors / pledges / ledger ---------- */
.id-rose .section-badge { background: var(--rose-soft); color: var(--rose); }
#donors-section, .transition-donors { --rose: var(--gold); --rose-soft: var(--gold-soft); }
#donors-section .id-rose .section-badge { background: var(--gold-soft); color: var(--gold); }
.transition-donors { --tr-accent: var(--gold); --tr-soft: var(--gold-soft); }
.module-link[data-target="donors-section"] { --link-accent: var(--gold); }
.tr-ring { fill: none; stroke: var(--rose); stroke-width: 1.4; opacity: 0.4; }
.tr-ring.spin-b { stroke-dasharray: 5 5; opacity: 0.3; }
.tr-diamond { fill: none; stroke: var(--rose); stroke-width: 1.6; opacity: 0.5; }
.tr-diamond.dim { stroke: var(--gold); opacity: 0.35; }
.tr-donor-node { fill: var(--surface-solid); stroke: var(--rose); stroke-width: 1.8; }
.tr-donor-node.dim { stroke: var(--gold); opacity: 0.6; }
.tr-donor-hands { fill: none; stroke: var(--rose); stroke-width: 1.6; stroke-linecap: round; }
.tr-flow-line { stroke: var(--rose); stroke-width: 1.3; stroke-dasharray: 5 5; opacity: 0.4; }

.donor-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.dkpi { border-radius: 18px; padding: 14px 16px; }
.dkpi-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--text-2); }
.dkpi-ic { width: 15px; height: 15px; color: var(--dk, var(--rose)); }
.dkpi-v { font-size: 23px; font-weight: 800; margin-top: 8px; }
.dkpi-s { font-size: 10px; color: var(--text-3); margin-top: 4px; }

.dpanel { border-radius: 22px; padding: 18px 20px; margin-bottom: 18px; }
.dpanel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dpanel-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.dpanel-title svg, .dpanel-title i.lucide { width: 17px; height: 17px; color: var(--rose); }
.dpanel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.donor-tools { flex-wrap: nowrap; }
.donor-tools #donor-search { width: 150px; flex-shrink: 1; min-width: 100px; }
.donor-tools .chip-group { display: flex; gap: 6px; flex-shrink: 0; }
.dpanel-tools .input { padding: 7px 11px; font-size: 11px; border-radius: 11px; }
.dpanel-hint { font-size: 10.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.dpanel-hint svg, .dpanel-hint i.lucide { width: 12px; height: 12px; }

/* donor level board — 4 lanes A/B/C/D */
.level-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lvl-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 10px; min-height: 120px; min-width: 0; }
.lvl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.lvl-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; }
.lvl-dot { width: 9px; height: 9px; border-radius: 50%; }
.lvl-col[data-lvl="A"] .lvl-dot { background: linear-gradient(135deg,#c8d6f0,#7d92b8); box-shadow: 0 0 7px #8b9ec7; }
.lvl-col[data-lvl="B"] .lvl-dot { background: linear-gradient(135deg,#f5c451,var(--gold)); box-shadow: 0 0 6px var(--gold); }
.lvl-col[data-lvl="C"] .lvl-dot { background: #94a3b8; }
.lvl-col[data-lvl="D"] .lvl-dot { background: #b45309; }
.lvl-col[data-lvl="A"] .lvl-tag { color: #8b9ec7; }
.lvl-col[data-lvl="B"] .lvl-tag { color: var(--gold); }
.lvl-col[data-lvl="C"] .lvl-tag { color: #94a3b8; }
.lvl-col[data-lvl="D"] .lvl-tag { color: #b45309; }
.lvl-col[data-lvl="A"] { border-color: color-mix(in srgb, #8b9ec7 40%, var(--border)); }
.lvl-count { font-size: 10px; color: var(--text-3); }
.lvl-list { max-height: 376px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.lvl-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.lvl-list .donor-card:last-child { margin-bottom: 0; }
.donor-card {
  background: var(--surface-1, var(--glass-solid));
  border: 1px solid var(--border); border-radius: 13px;
  padding: 9px 11px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.donor-card:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.donor-card.inactive { opacity: 0.55; }
.donor-card .dnr-row { display: flex; align-items: center; gap: 8px; }
.donor-card .dnr-ava { width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--gold) 13%, var(--surface-2)); color: var(--gold); }
.donor-card .dnr-name { font-size: 12px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donor-card .dnr-meta { font-size: 10px; color: var(--text-3); margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.donor-card .dnr-meta svg { width: 10px; height: 10px; }
.donor-card .dnr-acts { display: flex; gap: 3px; flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.donor-card:hover .dnr-acts, .donor-card:focus-within .dnr-acts { opacity: 1; }
.donor-card .dnr-acts .icon-btn { width: 24px; height: 24px; border-radius: 8px; }
.donor-card .dnr-acts .icon-btn svg { width: 11px; height: 11px; }
.dnr-st { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dnr-st.on { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.dnr-st.off { background: var(--text-3); }
.dnr-flags { display: flex; gap: 18px; }
.dnr-flags .flag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; cursor: pointer; }

/* ---------- Donor profile ---------- */
.dprof { max-width: 880px; padding: 0 !important; }
.dprof-close { position: absolute; top: 12px; left: 12px; z-index: 5;
  background: rgba(255,255,255,.2); color: #fff; border: none; }
.dprof-grid { display: grid; grid-template-columns: 258px 1fr; min-height: 480px; }
.dprof-side { display: flex; flex-direction: column; border-inline-end: 1px solid var(--border); }
.dprof-hero { position: relative; overflow: hidden; padding: 26px 18px 20px; text-align: center;
  background: linear-gradient(160deg, var(--dc1), var(--dc2)); color: #fff; }
.dprof-orb { position: absolute; width: 170px; height: 170px; border-radius: 50%;
  background: rgba(255,255,255,.13); top: -80px; inset-inline-end: -50px; }
.dprof-orb.b { width: 100px; height: 100px; top: auto; bottom: -50px; inset-inline-start: -30px; background: rgba(255,255,255,.1); }
.dprof-ava { width: 82px; height: 82px; border-radius: 26px; object-fit: cover; position: relative; z-index: 1;
  background: rgba(255,255,255,.22); border: 2px solid rgba(255,255,255,.5); padding: 6px; }
.dprof-hero h3 { margin: 10px 0 7px; font-size: 16px; font-weight: 900; position: relative; z-index: 1; text-shadow: 0 1px 6px rgba(0,0,0,.18); }
.dprof-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; position: relative; z-index: 1; }
.dprof-score { position: relative; z-index: 1; width: 72px; height: 72px; margin: 14px auto 0; }
.dprof-score svg { width: 72px; height: 72px; }
.dprof-score b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 900; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.25); }
.dprof-cinfo { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.dpci { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--text-2); }
.dpci svg { width: 13px; height: 13px; color: var(--gold); flex-shrink: 0; }
.dpci b { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dpci a { margin-inline-start: auto; font-size: 9px; font-weight: 800; color: var(--brand); text-decoration: none;
  background: var(--brand-soft); border-radius: 7px; padding: 3px 8px; }
.dpci a + a { margin-inline-start: 0; }
.dprof-side-acts { margin-top: auto; padding: 12px 14px; border-top: 1px dashed var(--border); display: flex; gap: 6px; }
.dprof-main { display: flex; flex-direction: column; min-width: 0; }
.dprof-main .dprof-kpis { padding-top: 16px; }
.dprof .dprof-tabs { padding-top: 12px; }
.dprof .dprof-body { flex: 1; }
.dp-alert { display: flex; gap: 9px; align-items: center; margin-bottom: 10px; font-size: 11px;
  background: var(--coral-soft); border: 1px solid color-mix(in srgb, var(--coral) 30%, transparent); border-radius: 12px; padding: 9px 12px; color: var(--coral); }
.dp-alert svg { width: 15px; height: 15px; flex-shrink: 0; }
.dp-alert b { display: block; font-size: 11px; }
.dp-alert span { font-size: 9.5px; opacity: .85; }
.dp-cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.dp-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 11px 13px; margin-bottom: 10px; }
.dp-cards2 .dp-box { margin-bottom: 0; }
.dp-box-t { font-size: 11px; font-weight: 800; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.dp-box-t svg { width: 14px; height: 14px; color: var(--gold); }
.dpc-chart { display: flex; align-items: flex-end; gap: 5px; height: 90px; }
.dpc-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.dpc-bar-f { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; min-height: 3px;
  background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 55%, transparent)); }
.dpc-bar span { font-size: 7.5px; color: var(--text-3); }
.dp-rel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp-rel > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; }
.dp-rel span { display: block; font-size: 9px; color: var(--text-3); margin-bottom: 3px; }
.dp-rel b { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dp-tl { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.dp-tl:last-child { border-bottom: 0; }
.dp-tl svg { width: 13px; height: 13px; color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.dp-tl b { font-size: 11px; display: block; }
.dp-tl span { font-size: 9.5px; color: var(--text-3); }
.dprof-id h3 { margin: 0 0 7px; font-size: 17px; font-weight: 900; text-shadow: 0 1px 6px rgba(0,0,0,.18); }
.dp-chip { font-size: 10px; font-weight: 700; border-radius: 999px; padding: 3px 9px; display: inline-flex; align-items: center; gap: 4px; }
.dp-chip { font-size: 10px; font-weight: 700; border-radius: 999px; padding: 3px 9px; display: inline-flex; align-items: center; gap: 4px; }
.dp-chip.glass { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); color: #fff; backdrop-filter: blur(6px); }
.dprof-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
.dp-tool { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 10.5px; font-weight: 700;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 6px 11px; cursor: pointer; text-decoration: none; transition: .15s; }
.dp-tool svg { width: 13px; height: 13px; }
.dp-tool:hover { border-color: var(--gold); color: var(--gold); }
.dp-tool.danger:hover { border-color: var(--coral); color: var(--coral); }
.dp-next { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700;
  color: var(--coral); background: var(--coral-soft); border-radius: 999px; padding: 5px 11px; }
.dp-next svg { width: 12px; height: 12px; }
.dp-sep { border-top: 1px dashed var(--border); margin: 12px 0; }
.dp-cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dp-cmp-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.dp-cmp-box > span { display: block; font-size: 9.5px; color: var(--text-3); margin-bottom: 5px; }
.dp-cmp-box b { font-size: 14px; font-variant-numeric: tabular-nums; }
.dp-cmp-box .dp-bar-track { margin-top: 8px; }
.dp-cmp { font-size: 9px; font-weight: 800; margin-inline-start: 6px; }
.dp-cmp.up { color: var(--emerald); }
.dp-cmp.down { color: var(--coral); }
.dp-avg { display: block; font-size: 9px; color: var(--text-3); margin-top: 4px; }
.dprof-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 14px 18px 0; }
.dpk { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 6px; text-align: center; }
.dpk span { display: block; font-size: 8.5px; color: var(--text-3); margin-bottom: 4px; }
.dpk b { font-size: 12px; font-variant-numeric: tabular-nums; }
.dprof-tabs { display: flex; gap: 4px; padding: 14px 18px 0; border-bottom: 2px solid var(--border); }
.dprof-tab { background: none; border: none; padding: 8px 10px; font: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 5px; }
.dprof-tab i { font-style: normal; font-size: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 5px; }
.dprof-tab.on { color: var(--gold); border-bottom-color: var(--gold); }
.dprof-tab.on i { background: color-mix(in srgb, var(--gold) 15%, transparent); color: var(--gold); border-color: transparent; }
.dprof-body { padding: 14px 18px 18px; min-height: 150px; }
.dprof-pane { display: none; }
.dprof-pane.on { display: block; }
.dp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dpi { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; }
.dpi svg { width: 15px; height: 15px; color: var(--gold); flex-shrink: 0; }
.dpi span { display: block; font-size: 9px; color: var(--text-3); margin-bottom: 2px; }
.dpi b { font-size: 11px; font-weight: 700; word-break: break-all; }
.dp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; margin-bottom: 7px; }
.dp-row-main b { display: block; font-size: 11.5px; margin-bottom: 3px; }
.dp-date { font-size: 9.5px; color: var(--text-3); }
.dp-date.bad { color: var(--coral); font-weight: 800; }
.dp-row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dp-amt { font-size: 12px; font-weight: 800; color: var(--gold); }
.dp-note { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; font-size: 11px; line-height: 1.8; color: var(--text-2);
  background: color-mix(in srgb, var(--gold) 7%, var(--surface-2)); border: 1px dashed color-mix(in srgb, var(--gold) 40%, var(--border)); border-radius: 12px; padding: 10px 12px; }
.dp-note svg { width: 14px; height: 14px; color: var(--gold); flex-shrink: 0; margin-top: 3px; }
.dprof-score { position: relative; z-index: 1; width: 60px; height: 60px; flex-shrink: 0; }
.dprof-score svg { width: 60px; height: 60px; }
.dprof-score b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.25); }
.dp-stars { display: flex; gap: 2px; margin-top: 7px; }
.dp-star { width: 14px; height: 14px; color: rgba(255,255,255,.5); cursor: pointer; transition: .12s; }
.dp-star.on { color: #fff; fill: #fff; filter: drop-shadow(0 0 4px rgba(255,255,255,.7)); }
.dp-star:hover { transform: scale(1.2); }
.dp-int-form { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.dp-int-form .input { flex: 1; min-width: 100px; padding: 6px 9px; font-size: 10.5px; border-radius: 9px; }
.dp-int-form select.input { flex: 0 0 auto; }
.dp-int-form .btn { padding: 6px 14px; font-size: 10.5px; border-radius: 9px; }
.dp-int-note { display: block; font-size: 10px; color: var(--text-2); margin-top: 3px; }
.dp-row-main svg { width: 12px; height: 12px; color: var(--gold); vertical-align: -2px; }
.dp-analysis { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.dp-verdict { font-size: 13px; font-weight: 900; margin-bottom: 12px; }
.dp-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.dp-bar > span { width: 95px; font-size: 10.5px; color: var(--text-2); flex-shrink: 0; }
.dp-bar-track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.dp-bar-fill { height: 100%; border-radius: 99px; transition: width .5s ease; }
.dp-bar b { font-size: 10px; width: 42px; text-align: left; flex-shrink: 0; }
.dp-hint { font-size: 9.5px; color: var(--text-3); margin-top: 8px; display: flex; gap: 5px; align-items: center; }
.dp-hint svg { width: 12px; height: 12px; color: var(--gold); }
@media (max-width: 700px) {
  .dprof-grid { grid-template-columns: 1fr; }
  .dprof-side { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .dprof-kpis { grid-template-columns: repeat(2, 1fr); }
  .dp-grid, .dp-cards2, .dp-cmp-grid { grid-template-columns: 1fr; }
}
.act-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--text-3); cursor: pointer; }
.act-toggle input { accent-color: var(--emerald); width: 13px; height: 13px; cursor: pointer; }

/* pledges kanban */
.pledge-board { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 36px) / 4); gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; -ms-overflow-style: none; }
.pledge-board::-webkit-scrollbar { display: none; width: 0; height: 0; }
.kb-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 10px; min-height: 140px; transition: border-color .18s, background .18s; }
.kb-col.dragover { border-color: var(--kb-accent); background: color-mix(in srgb, var(--kb-accent) 8%, var(--surface-2)); }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.kb-col-title { font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.kb-col-title svg, .kb-col-title i.lucide { width: 13px; height: 13px; color: var(--kb-accent); }
.kb-sum { font-size: 9.5px; color: var(--text-3); }
.kb-card {
  position: relative;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--kb-accent, var(--gold));
  border-radius: 13px; padding: 10px 11px; margin-bottom: 8px; cursor: grab;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.kb-card:active { cursor: grabbing; }
.kb-card:hover { border-color: var(--kb-accent, var(--border-lum)); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.kb-card.dragging { opacity: 0.45; }
.kb-card .kb-title { font-size: 11.5px; font-weight: 800; padding-inline-end: 40px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card .kb-donor { font-size: 10px; color: var(--text-3); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.kb-tel { color: var(--cyan); text-decoration: none; direction: ltr; }
.kb-tel:hover { text-decoration: underline; }
.kb-card .kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px;
  padding-top: 7px; border-top: 1px dashed var(--border); }
.kb-amount { font-size: 12.5px; color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.kb-amount svg { width: 13px; height: 13px; }
.kb-due { font-size: 9.5px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.kb-due.overdue { color: var(--coral); background: var(--coral-soft); border-color: transparent; font-weight: 800; }
.kb-card .kb-acts { position: absolute; top: 7px; inset-inline-end: 8px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.kb-card:hover .kb-acts, .kb-card:focus-within .kb-acts { opacity: 1; }
.kb-card .kb-acts .icon-btn { width: 22px; height: 22px; border-radius: 7px; }
.kb-card .kb-acts .icon-btn svg { width: 11px; height: 11px; }
#donors-section .kb-col[data-stage="overdue"] { --kb-accent: var(--coral); }
#donors-section .kb-due.overdue { color: var(--coral); }
.kb-col[data-stage="collected"] { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 7%, var(--surface-2)), var(--surface-2)); }
.kb-list { max-height: 448px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.kb-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.kb-list .kb-card:last-child { margin-bottom: 0; }
.kb-empty { font-size: 10px; color: var(--text-3); text-align: center; padding: 14px 6px; border: 1px dashed var(--border); border-radius: 12px; }

/* ---------- HR org board ---------- */
.hr-board { display: grid; grid-auto-flow: column; grid-auto-columns: 215px; gap: 11px; overflow-x: auto; padding-bottom: 6px; }
.hr-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; min-height: 160px; max-height: 460px; transition: border-color .18s, background .18s; }
.hr-col.dragover { border-color: var(--hr-accent); background: color-mix(in srgb, var(--hr-accent) 8%, var(--surface-2)); }
.hr-col-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; padding-bottom: 7px; border-bottom: 2px solid color-mix(in srgb, var(--hr-accent) 40%, var(--border)); }
.hr-col-title { font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; }
.hr-col-title svg, .hr-col-title i.lucide { width: 13px; height: 13px; color: var(--hr-accent); }
.hr-col-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.hr-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 8px 10px; cursor: grab; transition: .15s; }
.hr-card:hover { border-color: var(--hr-accent); transform: translateY(-1px); }
.hr-card.dragging { opacity: .45; }
.hr-card:active { cursor: grabbing; }
.hr-card .hr-name { font-size: 11px; font-weight: 800; padding-inline-end: 24px; }
.hr-card .hr-meta { font-size: 9px; color: var(--text-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-card .hr-view { position: absolute; top: 6px; inset-inline-end: 6px; width: 20px; height: 20px; border-radius: 6px; opacity: 0; transition: opacity .15s; }
.hr-card .hr-view svg { width: 11px; height: 11px; }
.hr-card:hover .hr-view { opacity: 1; }

/* ---------- Centers org chart ---------- */
.centers-org { display: grid; grid-auto-flow: column; grid-auto-columns: 340px; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.org-center { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 11px 12px; }
.org-center.has-gaps { border-color: color-mix(in srgb, var(--rose) 40%, var(--border)); }
.org-center-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.org-center-head b { font-size: 12px; }
.org-gap { font-size: 9px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.org-gap.bad { background: var(--rose-soft); color: var(--rose); }
.org-gap.ok { background: var(--emerald-soft); color: var(--emerald); }
.org-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.org-slot { border: 1px dashed var(--border); border-radius: 10px; padding: 6px 8px; min-height: 46px; transition: .15s; }
.org-slot.dragover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface-2)); }
.org-slot.empty { border-color: color-mix(in srgb, var(--rose) 55%, var(--border)); background: color-mix(in srgb, var(--rose) 5%, var(--surface-2)); }
.org-role { font-size: 9px; font-weight: 800; color: var(--text-3); display: block; margin-bottom: 4px; }
.org-slot.empty .org-role { color: var(--rose); }
.org-occ { display: flex; flex-wrap: wrap; gap: 4px; }
.org-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; cursor: grab; }
.org-chip svg { width: 10px; height: 10px; color: var(--text-3); }
.org-chip:hover { border-color: var(--brand); }
.org-chip.dragging { opacity: .45; }
.org-vacant { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 800; color: var(--rose); }
.org-vacant svg { width: 11px; height: 11px; }

.chip-group { display: inline-flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.chip-group .chip { border: none; background: transparent; padding: 4px 12px; font-size: 10.5px; }
.chip-group .chip.active { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.08); color: var(--text-1); border: 1px solid var(--border); }
.org-head-side { display: inline-flex; align-items: center; gap: 6px; }
.org-power { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border); background: transparent; display: grid; place-items: center; cursor: pointer; transition: .15s; }
.org-power svg { width: 11px; height: 11px; }
.org-power.on { color: var(--emerald); } .org-power.on:hover { background: var(--rose-soft); color: var(--rose); border-color: var(--rose); }
.org-power.off { color: var(--text-3); } .org-power.off:hover { background: var(--emerald-soft); color: var(--emerald); border-color: var(--emerald); }
.org-center.inactive { opacity: .55; }
.org-center.inactive .org-slot { opacity: .8; }
.org-scroll-wrap { position: relative; }
.org-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .15s;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.25); }
.org-nav svg { width: 16px; height: 16px; }
.org-nav-r { inset-inline-start: -8px; }
.org-nav-l { inset-inline-end: -8px; }
.org-scroll-wrap:hover .org-nav { opacity: 1; pointer-events: auto; }
.org-nav:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-50%) scale(1.08); }
.kb-lvl { font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }

/* ledger */
/* ---------- Accounting workspace ---------- */
.ac-panel { padding: 20px 20px 22px; }
.ac-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ac-title { display: flex; align-items: center; gap: 12px; }
.ac-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #d97706); color: #fff; box-shadow: 0 6px 18px -6px var(--gold); }
.ac-logo svg { width: 22px; height: 22px; }
.ac-sub { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.ac-actions { display: flex; gap: 8px; }
.ac-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; text-decoration: none; transition: .15s; }
.ac-btn:hover { border-color: var(--gold); color: var(--text-1); }
.ac-btn svg { width: 14px; height: 14px; }
.ac-btn-primary { background: linear-gradient(135deg, var(--gold), #d97706); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -4px var(--gold); }
.ac-btn-primary:hover { color: #fff; filter: brightness(1.08); }

.ac-cards { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.ac-card { border-radius: 16px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface-2); position: relative; overflow: hidden; }
.ac-card::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; }
.ac-card.in::before { background: var(--emerald); }
.ac-card.out::before { background: var(--rose); }
.ac-card.bal { background: linear-gradient(135deg, var(--gold-soft, rgba(217,119,6,.12)), var(--surface-2)); border-color: color-mix(in srgb, var(--gold) 35%, var(--border)); }
.ac-card.bal::before { background: var(--gold); }
.ac-card .t { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); font-weight: 700; }
.ac-card .t svg { width: 14px; height: 14px; }
.ac-card.in .t svg { color: var(--emerald); } .ac-card.out .t svg { color: var(--rose); } .ac-card.bal .t svg { color: var(--gold); }
.ac-card .v { font-size: 21px; font-weight: 800; margin-top: 7px; font-variant-numeric: tabular-nums; }
.ac-card.in .v { color: var(--emerald); } .ac-card.out .v { color: var(--rose); }
.ac-card .s { font-size: 9.5px; color: var(--text-3); margin-top: 4px; }

.ac-body { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; align-items: start; }
.ac-journal { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ac-toolbar { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.ac-field { display: flex; flex-direction: column; gap: 4px; }
.ac-field label { font-size: 9px; color: var(--text-3); font-weight: 700; }
.ac-field .input { padding: 6px 9px; font-size: 11px; border-radius: 8px; }
.ac-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ac-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.ac-box h3 { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--text-2); margin-bottom: 10px; }
.ac-box h3 svg { width: 14px; height: 14px; color: var(--gold); }
.db-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 10.5px; }
.db-row:last-child { border-bottom: none; }
.db-name { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-amt { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.db-amt.pos { color: var(--emerald); } .db-amt.neg { color: var(--rose); }
.mb-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 9.5px; color: var(--text-3); }
.mb-track { height: 8px; border-radius: 99px; background: var(--rose-soft); overflow: hidden; position: relative; }
.mb-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--emerald), #34d399); }
.mb-val { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text-2); }
.ac-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.ac-cats .chip { font-size: 9.5px; }

.chk-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.chk-row:last-child { border-bottom: none; }
.chk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chk-info b { font-size: 10.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk-info span { font-size: 9px; color: var(--text-3); }
.chk-amt { font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.chk-late { font-size: 8px; font-weight: 800; color: var(--rose); background: var(--rose-soft); border-radius: 6px; padding: 1px 6px; }
.chk-acts { display: flex; gap: 4px; flex-shrink: 0; }
.chk-btn { width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: .15s; }
.chk-btn svg { width: 12px; height: 12px; }
.chk-btn.ok { color: var(--emerald); } .chk-btn.ok:hover { background: var(--emerald-soft); border-color: var(--emerald); }
.chk-btn.bad { color: var(--rose); } .chk-btn.bad:hover { background: var(--rose-soft); border-color: var(--rose); }
.chk-state { font-size: 8.5px; font-weight: 800; border-radius: 6px; padding: 1px 6px; }
.chk-state.pending { background: var(--gold-soft, rgba(217,119,6,.12)); color: var(--gold); }
.chk-state.cashed { background: var(--emerald-soft); color: var(--emerald); }
.chk-state.bounced { background: var(--rose-soft); color: var(--rose); }

#checks-pending, #donor-balances { max-height: 210px; overflow-y: auto; scrollbar-width: thin; }
#monthly-bars { max-height: 210px; overflow-y: auto; scrollbar-width: thin; }
#cat-chips { max-height: 160px; overflow-y: auto; scrollbar-width: thin; }

.ledger-wrap { overflow: auto; min-height: 340px; border: 1px solid var(--border); border-radius: 14px; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 700px; }
.ledger-table th { text-align: right; font-size: 10px; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.ledger-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ledger-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.ledger-table tbody tr:hover { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.ledger-table tr:last-child td { border-bottom: none; }
.ledger-table .num { font-variant-numeric: tabular-nums; font-weight: 800; }
.ledger-table .num.in { color: var(--emerald); }
.ledger-table .num.out { color: var(--rose); }
.ledger-table .num.dash { color: var(--text-3); font-weight: 400; }
.doc-no { display: inline-flex; align-items: center; gap: 5px; }
.doc-no .n { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 2px 8px; font-weight: 800; }
.kind-pill { font-size: 9.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.kind-pill.receipt { background: var(--emerald-soft); color: var(--emerald); }
.kind-pill.payment { background: var(--rose-soft); color: var(--rose); }
.doc-auto { font-size: 8.5px; color: var(--gold); font-weight: 700; }

/* ---------- میز کار روزانه حسابداری ---------- */
.ac-desk { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-bottom: 14px; }
.quick-box .quick-row { display: grid; grid-template-columns: 1.4fr .8fr 1.1fr .9fr auto auto; gap: 8px; align-items: center; }
.quick-row .input { padding: 8px 10px; font-size: 11px; }
.quick-row .btn { padding: 8px 12px; font-size: 11px; white-space: nowrap; }
.icon-btn.ok { color: var(--emerald); }
.icon-btn.ok:hover { color: var(--emerald); border-color: var(--emerald); background: var(--emerald-soft); }

.task-list { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; }
.task-sum { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--text-2); padding: 6px 8px; margin-bottom: 6px; border-radius: 9px; background: color-mix(in srgb, var(--emerald) 7%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--emerald) 30%, transparent); }
.task-sum svg { width: 13px; height: 13px; color: var(--emerald); }
.task-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid transparent; }
.task-row:hover { background: var(--surface); border-color: var(--border); }
.task-row > svg { width: 14px; height: 14px; color: var(--indigo); flex-shrink: 0; }
.task-row.late > svg { color: var(--coral); }
.task-row.check > svg { color: var(--gold); }
.task-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.task-info b { font-size: 10.5px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-info span { font-size: 9px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-acts { display: flex; gap: 3px; flex-shrink: 0; }
.task-acts .icon-btn { width: 22px; height: 22px; border-radius: 7px; }
.task-acts .icon-btn svg { width: 11px; height: 11px; }

.recv-box { margin-bottom: 14px; }
.recv-list { display: flex; flex-direction: column; gap: 2px; max-height: 480px; overflow-y: auto; }
.recv-row { display: grid; grid-template-columns: minmax(0,1fr) 92px 96px 88px 104px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; }
.recv-row:hover { background: var(--surface); border-color: var(--border); }
.recv-row.late { border-color: color-mix(in srgb, var(--coral) 30%, transparent); background: color-mix(in srgb, var(--coral) 4%, transparent); }
.recv-row.recv-head { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border: 1px solid var(--border); padding: 5px 10px; }
.recv-head b, .recv-head span { font-size: 9px; color: var(--text-3); font-weight: 800; }
.recv-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.recv-name { font-size: 11px; color: var(--text-1); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recv-name:hover { color: var(--brand); }
.recv-title { font-size: 9px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recv-amt { font-size: 11px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.recv-due { font-size: 9.5px; color: var(--text-3); white-space: nowrap; text-align: center; }
.recv-due.bad { color: var(--coral); font-weight: 700; }
.recv-amt { text-align: center; }
.recv-row .dp-chip { justify-self: center; }
.recv-acts { display: flex; gap: 3px; justify-content: flex-end; }
.recv-acts .ph { width: 22px; height: 22px; flex-shrink: 0; }
.recv-acts .icon-btn { width: 22px; height: 22px; border-radius: 7px; }
.recv-acts .icon-btn svg { width: 11px; height: 11px; }
.recv-acts a.icon-btn { display: grid; place-items: center; text-decoration: none; }
.recv-row .dp-chip { font-size: 8.5px; padding: 2px 7px; }

/* برد روابط — ستون‌های CRM */
.bs-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; max-height: 300px; overflow-y: auto; }
.bs-row { display: grid; grid-template-columns: minmax(0,1.6fr) 1fr .9fr auto; gap: 7px; align-items: center; }
.bs-row .input { padding: 7px 9px; font-size: 11px; }
.bs-add { width: 100%; justify-content: center; font-size: 11px; }
.modal-note { font-size: 10.5px; color: var(--text-3); line-height: 1.8; margin: 0 0 8px; }
.contact-card .kb-title { padding-inline-end: 0; }
.contact-card .kb-acts { opacity: 1; }
.contact-card .kb-acts .icon-btn { width: 20px; height: 20px; border-radius: 6px; }
.contact-card .kb-acts .icon-btn svg { width: 10px; height: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .academy-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .donor-kpis { grid-template-columns: repeat(3, 1fr); }
  .level-board {
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }
  .lvl-col { scroll-snap-align: start; }
  .ac-body { grid-template-columns: 1fr; }
  .ac-side { flex-direction: row; flex-wrap: wrap; }
  .ac-side .ac-box { flex: 1 1 220px; }
  .ac-cards { grid-template-columns: repeat(2, 1fr); }
  .ac-desk { grid-template-columns: 1fr; }
  .ledger-wrap { max-height: 70vh; flex: none; }
}

@media (max-width: 860px) {
  .app-shell { padding: 10px 12px 60px; }
  .topbar { padding: 10px; }
  .nav-dock { top: 8px; gap: 6px; }
  .topbar-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .topbar-row .search-box { width: 100%; }
  .brand-mini .s { display: none; }
  .module-page { scroll-margin-top: 66px; }
  .module-page .section-head { align-items: flex-start; }
  .section-title { font-size: 17px; }
  .section-sub { font-size: 11px; }
  .centers-chart-panel .chart-box.tall { height: 320px; }
  .growth-layout { grid-template-columns: minmax(0, 1fr); }
  .academy-grid { grid-template-columns: 1fr; }
  .audit-counts { grid-template-columns: repeat(3, 1fr); }
  .staff-controls { width: 100%; }
  .staff-controls .input, .staff-controls select { min-width: 0; flex: 1 1 130px; }
  .section-transition { margin: 38px 0 46px; }
  .portal-card { padding: 18px 16px; }
  .portal-grid { grid-template-columns: 1fr; gap: 16px; }
  .portal-visual { min-height: 160px; }
  .portal-svg { max-height: 180px; }
  .portal-title { font-size: 16px; }
  .portal-desc { font-size: 11px; margin-bottom: 12px; }
  .portal-ctrl { flex-direction: column; align-items: stretch; gap: 8px; }
  .btn-portal { justify-content: center; width: 100%; }
}

@media (max-width: 560px) {
  .topbar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-row .brand-mini { display: none; }
  .module-link { padding: 7px 11px; font-size: 10.5px; }
  .nav-add-btn { width: 36px; height: 36px; }
  .center-cols { grid-template-columns: 1fr; }
  .audit-counts { grid-template-columns: repeat(2, 1fr); }
  .donor-kpis { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .dkpi { min-width: 0; padding: 11px 12px; }
  .dkpi-v { font-size: 18px; }
  .level-board { grid-template-columns: repeat(4, minmax(215px, 82vw)); }
  .ac-cards { grid-template-columns: 1fr 1fr; }
  .ac-card.bal { grid-column: 1 / -1; }
  .pledge-board, .ledger-wrap, .dpanel { min-width: 0; }
  .quick-box .quick-row { grid-template-columns: 1fr 1fr; }
  .recv-row { grid-template-columns: minmax(0,1fr) auto; }
  .recv-acts { grid-column: 1 / -1; }
}
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .centers-chart-panel .chart-box.tall { height: 300px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==== STAFF PROFILE MODAL — premium redesign ==== */
.profile-modal { width: min(920px, 96vw); max-height: 94vh; overflow-y: auto; overflow-x: hidden; padding: 0;
  display: flex; flex-direction: column; border-radius: 26px; position: relative;
  box-shadow: 0 40px 90px -30px rgba(15,10,60,.45), 0 0 0 1px var(--border-lum); }
.pf-close { position: absolute; top: 14px; left: 14px; z-index: 6;
  background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px); }
.pf-close:hover { background: rgba(255,255,255,.3); }
.pf-head { position: relative; padding: 22px 26px; z-index: 3; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--indigo), var(--violet) 55%, #a855f7);
  border-radius: 26px 26px 0 0; }
.pf-cover-mesh { position: absolute; inset: 0; pointer-events: none; }
.pf-cover-mesh svg { width: 100%; height: 100%; display: block; }
.pf-id { display: flex; align-items: center; gap: 15px; width: 100%; position: relative; z-index: 1; }
.pf-avatar-ring { width: 68px; height: 68px; border-radius: 20px; flex-shrink: 0; padding: 3px;
  background: rgba(255,255,255,.28);
  box-shadow: 0 8px 22px -6px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.2); }
.pf-avatar { width: 100%; height: 100%; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center; font-size: 25px; font-weight: 800; color: var(--indigo);
  background: rgba(255,255,255,.94); text-shadow: none; }
.pf-avatar svg { width: 60%; height: 60%; display: block; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-id-txt { padding-bottom: 0; flex: 1; min-width: 0; }
.pf-id-txt b { font-size: 19px; font-weight: 800; display: block; margin-bottom: 10px; letter-spacing: -.2px;
  color: #fff; text-shadow: 0 1px 8px rgba(30,10,70,.35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 10px; row-gap: 10px; margin-top: 8px; }
.pf-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 7px 15px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo);
  border: 1px solid color-mix(in srgb, var(--indigo) 25%, transparent);
  line-height: 1.6; white-space: nowrap; }
.pf-chip svg { width: 12px; height: 12px; }
.pf-head .pf-chip { background: rgba(255,255,255,.16); color: #fff;
  border-color: rgba(255,255,255,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pf-head .pf-chip-center { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.32); }
.pf-head .pf-chip-status { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.32); }
.pf-chip-center { background: var(--cyan-soft); color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 25%, transparent); }
.pf-chip-status { background: var(--emerald-soft); color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 25%, transparent); }
.pf-tabs { display: flex; gap: 6px; padding: 14px 26px 12px;
  position: sticky; top: 0; z-index: 8; background: var(--surface-solid);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 8px 16px -8px rgba(15,10,60,.28); }
.pf-tab { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--border); background: var(--surface-2);
  padding: 9px 15px; font-size: 12px; font-weight: 700; color: var(--text-3); cursor: pointer;
  border-radius: 12px; font-family: inherit; transition: .18s; }
.pf-tab svg { width: 14px; height: 14px; }
.pf-tab:hover { color: var(--text-1); background: var(--surface); }
.pf-tab[data-pf-tab="id"] { border-color: color-mix(in srgb, var(--indigo) 45%, transparent); color: var(--indigo); background: var(--indigo-soft); }
.pf-tab[data-pf-tab="job"] { border-color: color-mix(in srgb, var(--cyan) 45%, transparent); color: var(--cyan); background: var(--cyan-soft); }
.pf-tab[data-pf-tab="path"] { border-color: color-mix(in srgb, var(--emerald) 45%, transparent); color: var(--emerald); background: var(--emerald-soft); }
.pf-tab[data-pf-tab="notes"] { border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold); background: var(--gold-soft); }
.pf-tab[data-pf-tab="history"] { border-color: color-mix(in srgb, var(--violet) 45%, transparent); color: var(--violet); background: var(--violet-soft); }
.pf-tab.active { color: #fff; }
.pf-tab.active[data-pf-tab="id"] { background: linear-gradient(135deg, var(--indigo), #6d63f0); box-shadow: 0 6px 16px -6px rgba(79,93,208,.55); }
.pf-tab.active[data-pf-tab="job"] { background: linear-gradient(135deg, var(--cyan), #12a8c9); box-shadow: 0 6px 16px -6px rgba(14,148,176,.55); }
.pf-tab.active[data-pf-tab="path"] { background: linear-gradient(135deg, var(--emerald), #0db083); box-shadow: 0 6px 16px -6px rgba(10,155,108,.55); }
.pf-tab.active[data-pf-tab="notes"] { background: linear-gradient(135deg, var(--gold), #d89a1e); box-shadow: 0 6px 16px -6px rgba(199,138,18,.55); }
.pf-tab.active[data-pf-tab="history"] { background: linear-gradient(135deg, var(--violet), #9a5cf5); box-shadow: 0 6px 16px -6px rgba(124,58,237,.55); }
.pf-body { padding: 18px 26px 20px; flex: 1; }
.pf-pane { display: none; flex-direction: column; gap: 14px; }
.pf-pane.active { display: flex; animation: pfFade .28s ease; }
@keyframes pfFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pf-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  padding: 15px 17px 17px; box-shadow: 0 2px 10px rgba(0,0,0,.04); transition: box-shadow .18s, border-color .18s; }
.pf-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.06); border-color: color-mix(in srgb, var(--indigo) 18%, var(--border)); }
.pf-card-t { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800;
  color: var(--indigo); margin-bottom: 13px; padding-bottom: 10px; border-bottom: 1.5px dashed var(--border); }
.pf-card-t svg { width: 15px; height: 15px; }
.pf-steps-badge { margin-inline-start: auto; font-size: 10.5px; font-weight: 800; color: var(--emerald);
  background: var(--emerald-soft); padding: 3px 10px; border-radius: 999px; border: 0; }
.pf-birth-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }

/* vertical timeline */
.pf-timeline { position: relative; display: flex; flex-direction: column; gap: 4px; padding-inline-start: 4px; }
.pf-tl-item { position: relative; display: flex; gap: 12px; padding: 7px 0; }
.pf-tl-item::before { content: ''; position: absolute; right: 15px; top: 34px; bottom: -4px; width: 2px;
  background: var(--border); }
.pf-tl-item:last-child::before { display: none; }
.pf-tl-item.done::before { background: linear-gradient(var(--emerald), color-mix(in srgb, var(--emerald) 40%, transparent)); }
.pf-tl-dot { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--surface); border: 2px solid var(--border); color: var(--text-3); }
.pf-tl-dot svg { width: 14px; height: 14px; }
.pf-tl-item.done .pf-tl-dot { background: var(--emerald); border-color: var(--emerald); color: #fff;
  box-shadow: 0 0 0 4px var(--emerald-soft); }
.pf-tl-card { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pf-tl-item.done .pf-tl-card { background: var(--emerald-soft); border-color: color-mix(in srgb, var(--emerald) 30%, transparent); }
.pf-tl-card b { font-size: 12px; font-weight: 700; color: var(--text-1); }
.pf-tl-val { font-size: 11px; font-weight: 700; color: var(--emerald); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 180px; }
.pf-tl-empty { font-size: 10.5px; color: var(--text-3); }

/* mode toggling: create vs edit */
.profile-modal.mode-create .pf-edit-only { display: none !important; }
.profile-modal.mode-edit .pf-create-only { display: none !important; }
.modal-foot.pf-edit-only { justify-content: space-between; }
.pf-autosave-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); }
.pf-autosave-hint svg { width: 13px; height: 13px; }

/* ==== field "stickers" — self-contained, type-aware, inline-editable ==== */
:root { --slate: #64748b; }
[data-theme="dark"] { --slate: #93a0bd; }
.pf-slate-soft, .pf-tint-slate { --tint: var(--slate); --tint-soft: rgba(100,116,139,.12); }
.pf-tint-cyan { --tint: var(--cyan); --tint-soft: var(--cyan-soft); }
.pf-tint-indigo { --tint: var(--indigo); --tint-soft: var(--indigo-soft); }
.pf-tint-violet { --tint: var(--violet); --tint-soft: var(--violet-soft); }
.pf-tint-emerald { --tint: var(--emerald); --tint-soft: var(--emerald-soft); }
.pf-tint-gold { --tint: var(--gold); --tint-soft: var(--gold-soft); }
.pf-tint-rose { --tint: var(--rose); --tint-soft: var(--rose-soft); }
.pf-tint-coral { --tint: var(--coral); --tint-soft: var(--coral-soft); }
.pf-tint-mint { --tint: var(--mint); --tint-soft: var(--mint-soft); }

.pf-itemlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.pf-field { position: relative; border: 1px solid var(--border); border-radius: 13px; background: var(--surface);
  padding: 10px 11px 10px; display: flex; flex-direction: column; gap: 5px; transition: box-shadow .15s, border-color .15s, transform .15s; }
.pf-field:hover { box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--tint) 35%, transparent);
  border-color: color-mix(in srgb, var(--tint) 30%, var(--border)); transform: translateY(-1px); }
.pf-field-wide { grid-column: 1 / -1; }
.pf-field-top { display: flex; align-items: center; justify-content: space-between; }
.pf-field-icon { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); }
.pf-field-icon svg { width: 13px; height: 13px; }
.pf-field-edit { width: 22px; height: 22px; border-radius: 7px; border: none; background: transparent;
  color: var(--text-3); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: .15s; }
.pf-field:hover .pf-field-edit { opacity: 1; }
.pf-field-edit svg { width: 12px; height: 12px; }
.pf-field-edit:hover { background: var(--tint-soft); color: var(--tint); }
.pf-field-label { font-size: 10px; font-weight: 700; color: var(--text-3); }
.pf-fv { font-size: 12.5px; font-weight: 700; color: var(--text-1); word-break: break-word; line-height: 1.5; }
.pf-fv-empty { color: var(--text-3); font-weight: 500; font-style: italic; font-size: 11px; }
.pf-fv-mono { direction: ltr; unicode-bidi: plaintext; display: block; text-align: right; font-family: 'JetBrains Mono', monospace, inherit; letter-spacing: .3px; }
.pf-fv-chip { display: inline-block; background: var(--tint-soft); color: var(--tint); padding: 2px 9px; border-radius: 999px; font-size: 11px; }
.pf-field.editing { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.pf-field-act { display: flex; gap: 3px; }
.pf-field-save, .pf-field-cancel { width: 22px; height: 22px; border-radius: 7px; border: none;
  display: grid; place-items: center; cursor: pointer; }
.pf-field-save svg, .pf-field-cancel svg { width: 12px; height: 12px; }
.pf-field-save { background: var(--emerald); color: #fff; }
.pf-field-save:hover { filter: brightness(1.1); }
.pf-field-cancel { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.pf-field-cancel:hover { color: var(--rose); border-color: var(--rose); }
.pf-field.saving .pf-field-save { opacity: .5; pointer-events: none; }
.pf-field-input, .pf-field-edit-row textarea { width: 100%; font-family: inherit; font-size: 12px; padding: 6px 8px;
  border: 1.5px solid var(--tint); border-radius: 8px; background: var(--surface); color: var(--text-1); }
.pf-field-edit-row textarea { resize: vertical; min-height: 64px; }
.pf-birthdate-inputs { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 4px; }
.pf-birthdate-inputs input { font-family: inherit; font-size: 11.5px; padding: 6px 6px; text-align: center;
  border: 1.5px solid var(--tint); border-radius: 7px; background: var(--surface); color: var(--text-1); }

/* history/session log list */
.pf-loglist { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; padding-inline-end: 2px; }
.pf-log-item { display: flex; gap: 11px; }
.pf-log-dot { width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.pf-log-dot svg { width: 14px; height: 14px; }
.pf-log-card { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 12px; }
.pf-log-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-log-top b { font-size: 12px; font-weight: 700; }
.pf-log-top span { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.pf-log-sub { font-size: 10.5px; color: var(--cyan); display: block; margin-top: 3px; }
.pf-log-card p { font-size: 10.5px; color: var(--text-2); margin: 5px 0 0; line-height: 1.6; }
.pf-log-empty { font-size: 11px; color: var(--text-3); text-align: center; padding: 18px 0; }

.profile-modal .modal-foot { border-top: 1px solid var(--border); padding: 14px 26px;
  position: sticky; bottom: 0; background: var(--surface); z-index: 8; margin-top: 0; }
.profile-modal .btn-primary { background: linear-gradient(135deg, var(--indigo), var(--violet)); border: none; }
.profile-modal form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
@media (max-width: 640px) {
  .pf-tabs { overflow-x: auto; padding-inline-end: 26px; }
  .pf-tab { white-space: nowrap; }
  .pf-tab span { display: none; }
  .pf-tab svg { width: 17px; height: 17px; }
  .pf-cover { height: 92px; }
  .pf-avatar-ring { width: 68px; height: 68px; border-radius: 20px; }
  .pf-avatar { border-radius: 17px; font-size: 24px; }
  .pf-id-txt b { font-size: 16px; }
}

/* ---------- Jalali datepicker ---------- */
.jdp { position: fixed; z-index: 9999; width: 242px; padding: 10px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid);
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(15,23,42,.25)); }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-head .icon-btn { width: 24px; height: 24px; border-radius: 8px; }
.jdp-head .icon-btn svg { width: 12px; height: 12px; }
.jdp-tt { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.jdp-tt b { font-size: 12px; font-weight: 900; }
.jdp-y { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); font-weight: 800; }
.jdp-y button { border: none; background: var(--surface-2); border-radius: 6px; width: 16px; height: 16px; font-size: 11px; cursor: pointer; color: var(--text-2); line-height: 1; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-wd { font-size: 8.5px; color: var(--text-3); text-align: center; font-weight: 800; padding: 3px 0; }
.jdp-d { border: none; background: none; font: inherit; font-size: 10.5px; border-radius: 8px;
  padding: 4px 0; cursor: pointer; color: var(--text); text-align: center; }
.jdp-d:hover { background: var(--brand-soft); color: var(--brand); }
.jdp-d.today { border: 1px dashed var(--brand); }
.jdp-d.sel { background: var(--brand); color: #fff; font-weight: 800; }
.jdp-foot { display: flex; gap: 6px; margin-top: 8px; }
.jdp-foot button { flex: 1; border: 1px solid var(--border); background: var(--surface-2); font: inherit;
  font-size: 9.5px; font-weight: 700; border-radius: 8px; padding: 5px; cursor: pointer; color: var(--text-2); }
.jdp-foot button:hover { border-color: var(--brand); color: var(--brand); }
input.jdate { cursor: pointer; }
