/* ==========================================================================
   Design Tokens — School Management System
   Theme: Navy Blue & White
   Two surface languages used across the app:
     - Claymorphism  → Login screen only
     - Glassmorphism → Dashboard + all module screens
   ========================================================================== */

:root {
  /* ---- Core palette (Navy Blue & White) ---- */
  --navy-950: #050b1a;
  --navy-900: #0a1530;
  --navy-800: #0f1f45;
  --navy-700: #16305f;
  --navy-600: #1e4180;
  --navy-500: #2c5aa8;
  --blue-400: #4a7fd6;
  --blue-300: #7ba6ea;
  --ice-100: #eaf1fb;
  --white: #ffffff;

  /* ---- Background gradient (dark navy, used behind glass + clay) ---- */
  --bg-gradient: radial-gradient(1200px 800px at 10% -10%, var(--navy-700) 0%, transparent 60%),
                 radial-gradient(1000px 700px at 110% 10%, var(--blue-400) 0%, transparent 55%),
                 linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 45%, var(--navy-800) 100%);

  /* ---- Text ---- */
  --text-primary: var(--ice-100);
  --text-muted: #a9bcdb;
  --text-on-light: var(--navy-900);

  /* ---- Glassmorphism surface (dashboard / modules) ---- */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-strong: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(var(--shadow-rgb), 0.45);
  --glass-blur: 16px;

  /* ---- Claymorphism surface (login only) ---- */
  --clay-bg: #e7edf9;
  --clay-shadow-light: #ffffff;
  --clay-shadow-dark: #b9c8e6;
  --clay-accent: linear-gradient(145deg, var(--navy-600), var(--blue-400));

  /* ---- Status colors ---- */
  --success: #35c98f;
  --warning: #e8b64a;
  --danger: #ef5b6b;
  --info: var(--blue-300);

  /* ---- Theme helper tokens (themes below override these) ---- */
  --surface-rgb: 255, 255, 255;      /* faint lines / hover tints drawn on the page */
  --shadow-rgb: 3, 9, 26;            /* shadows + scrims */
  --accent-rgb: 74, 127, 214;        /* = --blue-400, for translucent accent fills */
  --accent-strong-rgb: 44, 90, 168;  /* = --navy-500 */
  --accent-2-rgb: 123, 166, 234;     /* = --blue-300 */
  --nav-active-text: var(--white);   /* text on the active sidebar item */
  --panel-solid: var(--navy-800);    /* opaque panel (sticky table header) */
  --topbar-backdrop: var(--navy-900);/* solid strip behind the topbar */
  color-scheme: dark;

  /* ---- Clay style surface tokens (used only when style = Clay) ---- */
  --cs-bg: var(--navy-800);                                    /* clay surface == page colour */
  --cs-bg-strong: color-mix(in srgb, var(--navy-800) 86%, white);
  --cs-hi: rgba(255, 255, 255, 0.08);                          /* light (top-left) shadow */
  --cs-lo: rgba(var(--shadow-rgb), 0.7);                       /* dark (bottom-right) shadow */

  /* ---- Radius / spacing scale ---- */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;

  /* ---- Typography ---- */
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* ---- Layout ---- */
  --sidebar-width: 200px;
  --sidebar-width-collapsed: 76px;
  --topbar-height: 68px;
}


/* ==========================================================================
   THEMES — the user picks one from the topbar (see assets/js/theme.js).
   The default "Navy Blue" is the :root block above. Every other theme only
   overrides the tokens below, so nothing else in the app needs to change.
   To add a theme: copy a block, change the values, and add its id/name to
   THEMES in assets/js/theme.js.
   ========================================================================== */

:root[data-theme="emerald"] {
  --navy-950: #04140e; --navy-900: #072118; --navy-800: #0b3023;
  --navy-700: #11503a; --navy-600: #187a58; --navy-500: #1f9a70;
  --blue-400: #34c08f; --blue-300: #7fe0b9; --ice-100: #e8faf2;
  --text-muted: #a3cfbd;
  --accent-rgb: 52, 192, 143; --accent-strong-rgb: 31, 154, 112; --accent-2-rgb: 127, 224, 185;
  --shadow-rgb: 2, 15, 10;
  --clay-bg: #e4f3ec; --clay-shadow-dark: #b3d3c3;
}

:root[data-theme="purple"] {
  --navy-950: #0d0617; --navy-900: #160a2a; --navy-800: #22103f;
  --navy-700: #38196b; --navy-600: #5226a0; --navy-500: #6d36c9;
  --blue-400: #9b6cf0; --blue-300: #c3a6fa; --ice-100: #f1eafd;
  --text-muted: #c4b4e0;
  --accent-rgb: 155, 108, 240; --accent-strong-rgb: 109, 54, 201; --accent-2-rgb: 195, 166, 250;
  --shadow-rgb: 10, 4, 22;
  --clay-bg: #eee8f9; --clay-shadow-dark: #cbbde6;
}

:root[data-theme="crimson"] {
  --navy-950: #17060a; --navy-900: #26090f; --navy-800: #3a0f19;
  --navy-700: #5e1626; --navy-600: #8c1f38; --navy-500: #b32a4a;
  --blue-400: #e04f6f; --blue-300: #f2a0b3; --ice-100: #fdecef;
  --text-muted: #dbb2bb;
  --accent-rgb: 224, 79, 111; --accent-strong-rgb: 179, 42, 74; --accent-2-rgb: 242, 160, 179;
  --shadow-rgb: 20, 3, 8;
  --clay-bg: #f9e8ec; --clay-shadow-dark: #e3bcc6;
}

:root[data-theme="graphite"] {
  --navy-950: #0a0c10; --navy-900: #12151c; --navy-800: #1b2029;
  --navy-700: #2a3140; --navy-600: #3d4759; --navy-500: #55627a;
  --blue-400: #8b9bb5; --blue-300: #c0cadb; --ice-100: #eef1f6;
  --text-muted: #a9b2c2;
  --accent-rgb: 139, 155, 181; --accent-strong-rgb: 85, 98, 122; --accent-2-rgb: 192, 202, 219;
  --shadow-rgb: 0, 0, 0;
  --clay-bg: #e8ebf1; --clay-shadow-dark: #bcc3d1;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-gradient: radial-gradient(1000px 700px at 10% -10%, #dce8fb 0%, transparent 60%),
                 radial-gradient(900px 600px at 110% 10%, #c7dcf7 0%, transparent 55%),
                 linear-gradient(160deg, #f7faff 0%, #eef3fb 100%);
  --text-primary: #0f1f45;
  --text-muted: #55688c;
  --blue-300: #2c5aa8;               /* labels / small accents need to be darker on light */
  --accent-2-rgb: 44, 90, 168;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(30, 65, 128, 0.18);
  --glass-shadow: 0 8px 32px rgba(30, 65, 128, 0.15);
  --surface-rgb: 15, 31, 69;
  --shadow-rgb: 30, 65, 128;
  --nav-active-text: var(--navy-700);
  --panel-solid: #ffffff;
  --topbar-backdrop: #eef3fb;
  --cs-bg: #e7edf9;
  --cs-bg-strong: #f2f6fd;
  --cs-hi: #ffffff;
  --cs-lo: rgba(143, 168, 214, 0.65);
}


/* ==========================================================================
   SURFACE STYLE — Glass (default) or Clay, chosen from the same picker.
   <html data-style="clay"> turns on Claymorphism: soft, opaque, puffy
   surfaces with a light + dark shadow pair instead of blur + borders.
   It only re-points the glass tokens used all over the app; the few
   component-level touches (inputs, buttons, pressed states) live in
   assets/css/surface-clay.css. Works with every colour theme above.
   ========================================================================== */

:root[data-style="clay"] {
  --bg-gradient: var(--cs-bg);
  --glass-bg: var(--cs-bg);
  --glass-bg-strong: var(--cs-bg-strong);
  --glass-border: transparent;
  --glass-blur: 0px;
  --glass-shadow: -7px -7px 16px var(--cs-hi), 7px 7px 16px var(--cs-lo);
  --panel-solid: var(--cs-bg);
  --topbar-backdrop: var(--cs-bg);
  --radius-sm: 14px;
  --radius-md: 24px;
}
