/* ============================================================================
   OmegaTrack — Brand v2 token layer.  Loaded LAST (after app.css) so the brand
   palette, Poppins font and light-default theme override the base dark theme.
   Dark remains available via html[data-theme="dark"] (toggle kept).
   ============================================================================ */

/* ---- Brand accents (apply in BOTH themes) -------------------------------- */
:root {
    /* Primary — indigo */
    --accent-primary: #4645E4;
    --accent-primary-hover: #3736B6;
    --accent-gradient: linear-gradient(135deg, #4645E4, #3736B6);
    --accent-glow: rgba(70, 69, 228, 0.28);
    --border-active: rgba(70, 69, 228, 0.5);

    /* Navy scale */
    --brand-navy-1: #3736B6;
    --brand-navy-2: #282887;
    --brand-navy-3: #1C1C64;
    --brand-navy-4: #131340;

    /* Secondary — orange (hovers, secondary buttons, download CTA) */
    --accent-secondary: #FF8430;
    --accent-secondary-hover: #E96F1D;
    --accent-secondary-bg: rgba(255, 132, 48, 0.12);

    /* Keep auth/legacy aliases in sync */
    --primary: #4645E4;
    --primary-hover: #3736B6;
}

/* ---- LIGHT theme = default (overrides app.css dark :root) ----------------- */
:root,
html[data-theme="light"] {
    --bg-primary: #f6f7fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f2f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-input: #ffffff;

    --border-color: rgba(28, 28, 100, 0.10);

    --text-primary: #1c1c64;   /* navy ink */
    --text-secondary: #4b5563;
    --text-muted: #8a92a6;

    --shadow-sm: 0 1px 2px rgba(28, 28, 100, 0.06);
    --shadow-md: 0 4px 12px rgba(28, 28, 100, 0.08);
    --shadow-lg: 0 8px 24px rgba(28, 28, 100, 0.12);
    --shadow-glow: 0 0 30px rgba(70, 69, 228, 0.12);
}

/* ---- DARK theme (toggle) — restore dark surfaces, keep brand accents ------ */
html[data-theme="dark"] {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2130;
    --bg-card-hover: #252840;
    --bg-glass: rgba(30, 33, 48, 0.8);
    --bg-input: #151722;

    --border-color: rgba(255, 255, 255, 0.06);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(70, 69, 228, 0.15);
}

/* ---- Poppins everywhere -------------------------------------------------- */
body,
button,
input,
select,
textarea,
.sidebar-brand h2 {
    font-family: 'Poppins', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Orange = working secondary ------------------------------------------ */
.btn-secondary,
.btn-orange,
.btn-download,
a.download-btn,
a.btn-download {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: #ffffff;
}
.btn-secondary:hover,
.btn-orange:hover,
.btn-download:hover,
a.download-btn:hover,
a.btn-download:hover {
    background: var(--accent-secondary-hover);
    border-color: var(--accent-secondary-hover);
    color: #ffffff;
}

/* ---- Brand logo mark ----------------------------------------------------- */
.sidebar-brand .brand-icon img,
.auth-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.auth-logo img {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
}

/* ---- Mobile safety net --------------------------------------------------- */
.main-content { min-width: 0; }

@media (max-width: 768px) {
    /* collapse multi-column inline grids to a single column */
    [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .main-content { margin-left: 0 !important; margin-right: 0 !important; }
}
