/* ============================================
   BAZ - Base : variables, reset, utilitaires
   Ne jamais coder une couleur en dur hors palette : utiliser ces tokens.
   ============================================ */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f7f6fa;
    --bg-input: #f1f0f5;
    --bg-sidebar: #f3f2f7;
    --bg-tertiary: #eaeaef;

    --border: #e4e3eb;
    --border-light: #d2d1dc;

    --text-primary: #1a1a2e;
    --text-secondary: #474759;
    --text-muted: #69697c;

    /* Accent du compte actif (surcharge par head.php). Toutes les variantes derivent
       de --accent via color-mix() : le branding par compte suit sans JS. */
    --accent: #3d1f7c;
    --accent-dark:    color-mix(in srgb, var(--accent) 78%, black);
    --accent-hover:   color-mix(in srgb, var(--accent) 86%, black);
    --accent-light:   color-mix(in srgb, var(--accent) 60%, white);
    --accent-soft:    color-mix(in srgb, var(--accent) 11%, transparent);
    --accent-softer:  color-mix(in srgb, var(--accent) 6%, transparent);
    --accent-glow:    color-mix(in srgb, var(--accent) 18%, transparent);

    --green: #16a34a;
    --green-dot: #10b981;
    --red: #dc2626;
    --orange: #d97706;
    --blue: #2563eb;

    --success: #16a34a;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #d97706;

    --sidebar-width: 244px;
    --sidebar-collapsed: 60px;
    --topbar-height: 64px;

    --radius-sm: 7px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.05);
    --shadow: 0 4px 16px rgba(26, 26, 46, 0.07);
    --shadow-lg: 0 16px 48px rgba(26, 26, 46, 0.16);

    --transition: all 0.18s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.45;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Utilitaires */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.85em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body.body-standalone { align-items: center; justify-content: center; background: var(--bg-secondary); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
