/* ==========================================================================
   Skins de couleurs de l'espace connecté (Paramètres du cabinet).
   Le thème « kontyo » est celui défini dans app.css / app-shell.css ;
   chaque skin ne redéfinit que les jetons de couleur, à l'écran seulement.
   ========================================================================== */

@media screen {
    :root[data-theme="clair"] {
        color-scheme: light;
        --green: #1E9A5E;
        --green-strong: #17804D;
        --bg: #F6F8FB;
        --surface: #FFFFFF;
        --text: #0E2A47;
        --muted: #5B6B7F;
        --border: #E2E8F0;
        --accent-soft: #E7F6EE;
        --on-accent: #FFFFFF;
        --btn-bg: var(--navy);
        --btn-text: #FFFFFF;
        --shadow: 0 1px 2px rgba(14, 42, 71, .06), 0 12px 32px rgba(14, 42, 71, .08);
        --danger: #C0392B;
        --danger-soft: #FDECEA;
        --warning: #9A5B00;
        --warning-soft: #FFF4E0;
        --info: #1F4F8F;
        --info-soft: #E6EEFA;
        --sidebar-bg: #0E2A47;
    }

    :root[data-theme="clair"] .status-todo { background: #FFF4E0; color: #9A5B00; }
    :root[data-theme="clair"] .status-review { background: #E6EEFA; color: #1F4F8F; }

    :root[data-theme="ocean"] {
        --green: #22B8CF;
        --green-strong: #1597AB;
        --bg: #071A24;
        --surface: #0C2633;
        --text: #E6F3F7;
        --muted: #94B3C0;
        --border: #18394A;
        --accent-soft: #0E3540;
        --on-accent: #032027;
        --sidebar-bg: #04121A;
        --sidebar-text: #A9C6D2;
    }

    :root[data-theme="prune"] {
        --green: #A78BFA;
        --green-strong: #8B6CF0;
        --bg: #140F22;
        --surface: #1E1730;
        --text: #EEE9F7;
        --muted: #A99DC0;
        --border: #2F2547;
        --accent-soft: #2A2048;
        --on-accent: #1A0F33;
        --sidebar-bg: #0D0918;
        --sidebar-text: #C3B8D9;
    }

    :root[data-theme="ardoise"] {
        --green: #F59E0B;
        --green-strong: #D97F06;
        --bg: #121417;
        --surface: #1B1E23;
        --text: #ECEDEF;
        --muted: #A0A6AF;
        --border: #2A2E35;
        --accent-soft: #33270F;
        --on-accent: #231500;
        --info-soft: #1C2633;
        --sidebar-bg: #0B0C0E;
        --sidebar-text: #B4B9C1;
    }
}

/* Choix du thème dans les paramètres */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.theme-choix {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
}
.theme-choix:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.theme-choix input { position: absolute; opacity: 0; pointer-events: none; }
.theme-choix:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.theme-apercu {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: 1fr 10px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--apercu-bg);
    box-shadow: 0 0 0 1px rgba(127, 127, 127, .25);
}
.theme-apercu i:nth-child(1) { grid-row: 1 / 3; background: var(--apercu-sidebar); }
.theme-apercu i:nth-child(2) { margin: 8px 8px 0; border-radius: 4px 4px 0 0; background: var(--apercu-surface); }
.theme-apercu i:nth-child(3) { margin: 0 8px 4px; border-radius: 3px; background: var(--apercu-accent); width: 40%; }

/* ==========================================================================
   Marque AGEXCO 06 (cabinet) : bleu #0060BE et gris #9C9C9C du logo.
   S'applique à l'espace connecté du cabinet (thème choisi dans Paramètres)
   et aux pages de connexion ouvertes via /connexion?theme=agexco.
   ========================================================================== */

@media screen {
    :root[data-theme="agexco"] {
        color-scheme: light;
        --navy: #0A3466;
        --green: #0060BE;
        --green-strong: #004A94;
        --bg: #F3F6FA;
        --surface: #FFFFFF;
        --text: #0F1F33;
        --muted: #5F6B7A;
        --border: #DCE4EE;
        --accent-soft: #E6EFF9;
        --on-accent: #FFFFFF;
        --btn-bg: #0060BE;
        --btn-text: #FFFFFF;
        --shadow: 0 1px 2px rgba(15, 31, 51, .06), 0 12px 32px rgba(0, 96, 190, .10);
        --danger: #C0392B;
        --danger-soft: #FDECEA;
        --warning: #9A5B00;
        --warning-soft: #FFF4E0;
        --info: #0060BE;
        --info-soft: #E6EFF9;
        --sidebar-bg: #0A3466;
        --sidebar-text: #C9D8EE;
        --sidebar-active: rgba(255, 255, 255, .12);
    }

    :root[data-theme="agexco"] .status-todo { background: #FFF4E0; color: #9A5B00; }
    :root[data-theme="agexco"] .status-review { background: #E6EFF9; color: #0060BE; }
    :root[data-theme="agexco"] .btn:hover { background: #004A94; }
    :root[data-theme="agexco"] a:not(.btn):not(.brand):not(.nav-link):hover { color: #0060BE; }

    /* Page de connexion */
    :root[data-theme="agexco"] .auth {
        background:
            radial-gradient(ellipse at 15% 0%, rgba(0, 96, 190, .10), transparent 55%),
            radial-gradient(ellipse at 100% 100%, rgba(156, 156, 156, .14), transparent 50%),
            #F3F6FA;
    }
    :root[data-theme="agexco"] .auth-card .card {
        border-top: 4px solid #0060BE;
        box-shadow: var(--shadow);
    }
    :root[data-theme="agexco"] .auth-card input:focus {
        border-color: #0060BE;
        outline: 2px solid rgba(0, 96, 190, .2);
    }
}

/* Logo de cabinet (connexion et barre latérale) */
.brand-cabinet { flex-direction: column; gap: 6px; }
.brand-cabinet img { width: auto; height: auto; border-radius: 0; box-shadow: none !important; }
.auth-card .brand-cabinet img { max-width: 220px; max-height: 150px; }
.sidebar .brand-cabinet { align-items: flex-start; padding: 6px 8px 16px; }
.sidebar .brand-cabinet img { max-width: 150px; max-height: 70px; }
.brand-propulse { font-size: .75rem; font-weight: 500; letter-spacing: .02em; color: var(--muted); }
