/* =====================================================
   IPO HISAB KITAB — DESIGN TOKENS (tokens.css)
   The one place a colour, radius, shadow, z-index, easing
   or font is defined. Loaded BEFORE app.css by
   13_header/sidebar.php and by the standalone pages
   (login, forgot-password, logout, 404, offline, index).
   app.css and every page reference these by var() only —
   a raw hex anywhere else is a defect (tools/audit/css_hex_lint.php).
   Extracted from app.css §0 on 2026-09-10 (design plan Phase 2).
   Light is the default; the dark theme remaps the SEMANTIC
   tokens in app.css (dark sections) and the gain/loss pair below.
   ===================================================== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
    /* brand */
    --brand-900: #081f44;  --brand-800: #0b2f63;  --brand-700: #0d3c78;
    --brand-600: #1251a8;  --brand-500: #1f6fe0;  --brand-400: #4c8dff;
    --brand-200: #bfd4f7;  --brand-100: #e4eefc;  --brand-50:  #f2f6fd;
    --brand-rgb: 31,111,224;
    --accent-500: #ff9f1c; --accent-400: #ffd166; --accent-100: #fff4d6;
    /* neutrals */
    --n-900: #0f172a; --n-800: #1e293b; --n-700: #334155; --n-600: #475569;
    --n-500: #64748b; --n-400: #94a3b8; --n-300: #cbd5e1; --n-200: #e2e8f0;
    --n-100: #f1f5f9; --n-50:  #f8fafc;
    /* semantic (switched by dark theme) */
    --app-bg: #f3f5f9;  --app-surface: #ffffff;  --app-surface-2: #f8fafc;
    --app-border: #e2e8f0;  --app-text: #0f172a;  --app-muted: #64748b;
    --app-primary: var(--brand-500);  --app-primary-deep: var(--brand-700);
    /* gain / loss — the ONE source of truth for figures (Phase 4 aliases
       .negative / .text-loss / .text-gain / getCol() to these) */
    --gain: #146c34;  --gain-bg: #e0f8e9;
    --loss: #b91c1c;  --loss-bg: #fee2e2;
    /* sidebar — the navy rail stays dark in both themes */
    --sb-bg-1: #0d1a2d; --sb-bg-2: #0a1420;
    --sb-text: #b7c3d6; --sb-text-dim: #7286a3; --sb-sub-text: #9db0cb;
    /* log / terminal boxes (always dark, both themes) */
    --log-bg: #0f172a; --log-text: #cbd5e1; --log-ok: #86efac; --log-warn: #fcd34d; --log-bad: #fca5a5;
    /* shape + depth */
    --r-sm: .375rem; --r-md: .625rem; --r-lg: .875rem; --r-xl: 1.125rem;
    --sh-xs: 0 1px 2px rgba(15,23,42,.05);
    --sh-sm: 0 1px 2px rgba(15,23,42,.05), 0 2px 8px rgba(15,23,42,.05);
    --sh-md: 0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.06);
    --sh-lg: 0 12px 32px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.06);
    --sh-up: 0 -4px 16px rgba(15,23,42,.08);   /* bars fixed to the bottom of the screen */
    /* z-index scale — every z-index in app.css maps to one of these */
    --z-sticky: 10;      /* sticky table head */
    --z-sticky-2: 20;    /* sticky first column over the head */
    --z-chrome: 1000;    /* header, bottom nav */
    --z-drawer: 1040;    /* sidebar drawer + its dimmer (below Bootstrap's modal 1055) */
    --z-modal: 1055;     /* the mobile bottom sheet; equals Bootstrap's .modal */
    --z-dropdown: 1060;  /* dropdown / select2 / checkbox-dropdown panels */
    --z-popover: 1080;   /* row-info popups, install banner */
    --z-toast: 2000;     /* toasts, flash */
    --z-critical: 2100;  /* security alert, captcha prompt */
    /* motion */
    --t-fast: .15s; --t-base: .25s;
    --ease: cubic-bezier(.2, .8, .2, 1);
    /* type */
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    /* Bootstrap 5.3 hooks */
    --bs-font-sans-serif: var(--font-sans);
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--app-text);
    --bs-primary: var(--brand-500);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 18,81,168;
    --bs-link-hover-color: var(--brand-700);
    --bs-link-hover-color-rgb: 13,60,120;
    --bs-border-color: var(--app-border);
    --bs-border-radius: var(--r-md);
    --bs-border-radius-sm: var(--r-sm);
    --bs-border-radius-lg: var(--r-lg);
    --bs-border-radius-xl: var(--r-xl);
    --bs-focus-ring-color: rgba(var(--brand-rgb), .22);
}
/* dark theme: gain/loss tones that keep AA on the dark surfaces */
:root[data-theme="dark"] {
    --gain: #4ade80;  --gain-bg: rgba(34,197,94,.16);
    --loss: #f87171;  --loss-bg: rgba(248,113,113,.16);
}
