/* Shared design tokens + base controls for the dashboard and its login page.
   Palette: data-viz reference instance (validated). Light is the base; the dark
   steps are chosen for the dark surface, not flipped, and are declared under
   both the OS media query and the explicit [data-theme] scope so the in-page
   toggle wins either way. */
:root {
  color-scheme: light;

  --page:        #f4f6f9;
  --surface:     #fcfcfb;
  --surface-2:   #eef1f5;
  --text:        #0b0b0b;
  --text-2:      #52514e;
  --muted:       #898781;
  --grid:        #e1e0d9;
  --axis:        #c3c2b7;
  --border:      rgba(11, 11, 11, .10);
  --border-firm: rgba(11, 11, 11, .16);

  /* Renessans Ta'lim Universiteti — the seal (frontend/img/logo-*.png).
     Sampled straight off the artwork; these three are the identity and are
     used verbatim for chrome, never for data. */
  --brand-navy:      #133654;
  --brand-navy-deep: #0d2740;
  --brand-navy-soft: #1d4a72;
  --brand-gold:      #f5be17;
  --brand-gold-deep: #c8980a;
  --brand-maroon:    #751712;

  /* Chart slots: the brand hues re-stepped onto the lightness/chroma targets
     the palette checks require (the seal's navy sits at OKLCH L 0.32 — far
     below the categorical band, so it reads as "almost black" in a chart).
     Fixed order, assigned by entity, never by rank. Validated in both modes;
     in light mode the gold slot is below 3:1 on the surface, so every chart
     using it ships visible labels (donut legend: name + value + share) and a
     table view — the relief rule. */
  --series-1:    #0075c9;   /* seal navy, hue 248 */
  --series-2:    #dfa800;   /* seal gold, hue 87  */
  --series-3:    #d02d25;   /* seal maroon, hue 28 */
  --series-4:    #009c8f;
  --series-5:    #8c51d9;
  --series-6:    #1e9400;
  --series-rest: #898781;
  --accent-ink:  #004579;
  --good:        #0ca30c;
  --warning:     #fab219;
  --critical:    #d03b3b;

  /* ordered 1..5 answer scale: one hue (the seal's navy), light -> dark */
  --ord-1: #63abec;  --ord-2: #4890cf;  --ord-3: #2c76b4;
  --ord-4: #095d98;  --ord-5: #004579;

  --shadow-1: 0 1px 2px rgba(11, 11, 11, .05);
  --shadow-2: 0 6px 24px -8px rgba(11, 11, 11, .18), 0 1px 2px rgba(11, 11, 11, .06);
  --ring:     0 0 0 3px color-mix(in oklab, var(--brand-navy) 30%, transparent);

  --r-sm: 7px;  --r-md: 10px;  --r-lg: 14px;
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;  --sp-5: 22px;  --sp-6: 30px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page:        #0d0d0d;
    --surface:     #1a1a19;
    --surface-2:   #232321;
    --text:        #fff;
    --text-2:      #c3c2b7;
    --muted:       #898781;
    --grid:        #2c2c2a;
    --axis:        #383835;
    --border:      rgba(255, 255, 255, .10);
    --border-firm: rgba(255, 255, 255, .18);
    --series-1:    #0084e2;
    --series-2:    #b88a00;
    --series-3:    #d02d25;
    --series-4:    #00a396;
    --series-5:    #8f54dc;
    --series-6:    #279a00;
    --series-rest: #898781;
    --accent-ink:  #7ec4ff;
    --ord-1: #7ec4ff;  --ord-2: #61a9ea;  --ord-3: #468ece;
    --ord-4: #2b74b2;  --ord-5: #065b97;
    --shadow-1: none;
    --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:        #0d0d0d;
  --surface:     #1a1a19;
  --surface-2:   #232321;
  --text:        #fff;
  --text-2:      #c3c2b7;
  --muted:       #898781;
  --grid:        #2c2c2a;
  --axis:        #383835;
  --border:      rgba(255, 255, 255, .10);
  --border-firm: rgba(255, 255, 255, .18);
  --series-1:  #0084e2;
  --series-2:  #b88a00;
  --series-3:  #d02d25;
  --series-4:  #00a396;
  --series-5:  #8f54dc;
  --series-6:  #279a00;
  --series-rest: #898781;
  --accent-ink:  #7ec4ff;
  --ord-1: #7ec4ff;  --ord-2: #61a9ea;  --ord-3: #468ece;
  --ord-4: #2b74b2;  --ord-5: #065b97;
  --shadow-1: none;
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -.012em; }
p { margin: 0; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------- brand mark */
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand__mark {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
  background: #fff;                       /* the seal's outer ring is navy — it
                                             needs a light disc behind it */
  padding: 1px; display: block;
}
.brand__name { font-size: 15px; font-weight: 640; letter-spacing: -.015em; line-height: 1.2; }
.brand__sub  { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* the seal's navy is the identity colour: chrome wears it, data never does */
.btn--brand { background: var(--brand-navy); border-color: transparent; color: #fff; }
.btn--brand:hover:not(:disabled) { background: var(--brand-navy-soft); }

/* --------------------------------------------------------------- controls */
.btn {
  font: inherit; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border-firm); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: default; }
/* `display` on .btn beats the UA rule for [hidden], so say it explicitly */
.btn[hidden], [hidden] { display: none !important; }
.btn--primary { background: var(--brand-navy); border-color: transparent; color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-navy-soft); }
.btn--icon  { width: 34px; height: 34px; padding: 0; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 4px 9px; font-size: 12px; }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text-2); }
.btn--block { width: 100%; padding: 11px 14px; font-size: 14px; }

.input {
  font: inherit; font-size: 14px; width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-firm); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--brand-navy-soft); box-shadow: var(--ring); }
.input::placeholder { color: var(--muted); }

.label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
