/* The panel's foundations: its font (served from the panel itself), colours, sizes and the base text.
   layout.css (the app shell) and components.css (cards, buttons, forms...) build on these names only. */

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;               /* one variable file holds every weight */
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces and text */
  --bg:#f6f5fb; --surface:#fff; --surface-2:#f3f1fa; --surface-3:#faf9fe;
  --ink:#14122b; --ink-2:#3b3a52; --muted:#5f5e76;
  --line:#ebe8f4; --line-2:#dcd7ec;
  /* brand: violet and indigo, a pink spark for counts */
  --primary:#1b1840; --accent:#6d28d9; --accent-2:#4f46e5; --accent-ink:#fff; --accent-soft:#f1ecfe; --spark:#db2777;
  --grad:linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --brand-grad:linear-gradient(135deg, #8B5CF6 0%, #6D28D9 55%, #4C1D95 100%);   /* the logo's tile (app/static/brand) */
  --grad-side:linear-gradient(180deg, #1b1840 0%, #231f55 60%, #2a1760 100%);
  /* states: always with an icon or text too, never colour alone */
  --ok:#047857; --ok-soft:#e7f7f0; --warn:#b45309; --warn-soft:#fdf3e2; --bad:#b91c1c; --bad-soft:#fdecec;
  --info:#1d4ed8; --info-soft:#e8effd;
  /* shape and depth */
  --radius:16px; --radius-sm:10px;
  --shadow:0 1px 2px rgba(20,18,43,.04), 0 8px 24px -14px rgba(20,18,43,.12);
  --shadow-lg:0 16px 36px -14px rgba(76,29,149,.28);
  --glow:0 8px 20px -8px rgba(109,40,217,.55);
  /* spacing: a 4px step */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;
  /* type scale: 12 13 15 16 22 28 */
  --t-xs:12px; --t-sm:13px; --t-base:15px; --t-md:16px; --t-lg:22px; --t-xl:28px;
  --side:232px; --ease:cubic-bezier(.2,.7,.2,1);
  /* small parts named once, so the themes below can change them */
  --field:#fff; --hover-line:#c9b8f7; --soft-line:#e2d8fd; --soft-hover:#e9e0fd; --glass:rgba(255,255,255,.94);
  --bad-line:#fecaca; --bad-ink:#7f1d1d; --warn-line:#fde68a; --warn-ink:#78350f; --info-line:#bfdbfe; --info-ink:#1e3a8a;
  color-scheme:light;
}

/* «نیمه‌تاریک» and «تاریک» (the person's menu; base.html sets data-theme before the page is drawn). Deep violet-grey
   surfaces, never pure black; text at least 4.5:1 on them; the accent a lighter violet so it reads on dark. */
:root[data-theme="dim"], :root[data-theme="dark"] {
  --ink:#EEEDFF; --ink-2:#CFCCEE; --muted:#A6A3CC; --primary:#EEEDFF;
  --accent:#B39DFA; --accent-2:#A5B4FC; --accent-ink:#fff; --accent-soft:rgba(139,92,246,.18); --spark:#F472B6;
  --ok:#34D399; --ok-soft:rgba(52,211,153,.14); --warn:#FBBF24; --warn-soft:rgba(251,191,36,.13);
  --bad:#F87171; --bad-soft:rgba(248,113,113,.14); --info:#7DB4FB; --info-soft:rgba(96,165,250,.14);
  --shadow:0 1px 2px rgba(0,0,0,.35), 0 10px 26px -14px rgba(0,0,0,.65); --shadow-lg:0 18px 40px -14px rgba(0,0,0,.75);
  --glow:0 8px 22px -8px rgba(139,92,246,.75);
  --hover-line:#6F5CB5; --soft-line:#3E3570; --soft-hover:rgba(139,92,246,.28);
  --bad-line:rgba(248,113,113,.38); --bad-ink:#FECACA; --warn-line:rgba(251,191,36,.38); --warn-ink:#FDE68A;
  --info-line:rgba(96,165,250,.38); --info-ink:#BFDBFE;
  color-scheme:dark;
}
:root[data-theme="dim"] {
  --bg:#17162A; --surface:#201E38; --surface-2:#292747; --surface-3:#1C1A32; --line:#312E52; --line-2:#3E3A66;
  --field:#1A1830; --glass:rgba(23,22,42,.9);
}
:root[data-theme="dark"] {
  --bg:#0B0A16; --surface:#141228; --surface-2:#1C1938; --surface-3:#100E20; --line:#26233F; --line-2:#34305A;
  --field:#100E20; --glass:rgba(11,10,22,.88);
}
:root[data-theme="dim"] body, :root[data-theme="dark"] body {
  background:radial-gradient(1000px 560px at 105% -10%, rgba(124,58,237,.16), transparent 60%), var(--bg);
}
:root[data-theme="dim"] ::selection, :root[data-theme="dark"] ::selection { background:#5B21B6; color:#fff; }
:root[data-theme="dim"] *, :root[data-theme="dark"] * { scrollbar-color:#4A4475 transparent; }

* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
html, body { overflow-x:clip; }
body { margin:0; color:var(--ink); font:var(--t-base)/1.8 "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
       background:radial-gradient(1000px 560px at 105% -10%, rgba(124,58,237,.07), transparent 60%), var(--bg);
       background-attachment:fixed; }
a { color:var(--accent); text-decoration:none; transition:color .15s var(--ease); }
a:hover { color:var(--accent-2); }
::selection { background:#ddd6fe; color:#1e1b4b; }
:focus-visible { outline:3px solid #8b5cf6; outline-offset:2px; border-radius:6px; }
* { scrollbar-width:thin; scrollbar-color:#cfc6ea transparent; }
.ic { flex:none; vertical-align:-3px; }
.num, td.num, .stat b, code { font-variant-numeric:tabular-nums; }
.muted { color:var(--muted); font-size:var(--t-sm); }
.ok { color:var(--ok); } .bad { color:var(--bad); } .warn { color:var(--warn); }
hr { border:0; border-top:1px solid var(--line); margin:var(--s4) 0; }
code { background:var(--surface-2); padding:1px 6px; border-radius:4px; direction:ltr; display:inline-block; font-size:var(--t-sm); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
}
