/* ============================================================================
 * ops-console v0.2.0 — theme.css combiné
 * - Section 1 : Design system ops-console (classes .cc-*, variables --cc-*)
 * - Section 2 : Auth-module vendor (classes .auth-*, variables --auth-*)
 * Aucun conflit grâce aux préfixes distincts.
 * ============================================================================ */

/* ============== SECTION 1 : ops-console ============== */
/* ==========================================================================
 * ops-console — theme.css (v0.1.0)
 * Design system commun à toutes les pages du LBO Command Center
 * Couleurs et tailles via CSS variables → personnalisables par client (white-label)
 * ========================================================================== */

:root {
    /* === Palette === */
    --cc-primary: #1f2937;
    --cc-primary-light: #374151;
    --cc-accent: #3b82f6;
    --cc-accent-hover: #2563eb;
    --cc-accent-light: #dbeafe;
    --cc-success: #10b981;
    --cc-success-bg: #d1fae5;
    --cc-warning: #f59e0b;
    --cc-warning-bg: #fef3c7;
    --cc-warning-text: #92400e;
    --cc-danger: #ef4444;
    --cc-danger-bg: #fee2e2;
    --cc-danger-text: #991b1b;
    --cc-info: #6366f1;
    --cc-info-bg: #e0e7ff;

    /* === Texte === */
    --cc-text: #111827;
    --cc-text-soft: #6b7280;
    --cc-text-muted: #9ca3af;
    --cc-text-on-dark: rgba(255,255,255,0.7);

    /* === Fonds === */
    --cc-bg: #f9fafb;
    --cc-bg-card: #ffffff;
    --cc-bg-hover: #f3f4f6;

    /* === Bordures === */
    --cc-border: #e5e7eb;
    --cc-border-focus: #3b82f6;
    --cc-border-light: #f3f4f6;

    /* === Espacements === */
    --cc-radius-sm: 4px;
    --cc-radius: 8px;
    --cc-radius-lg: 12px;

    /* === Ombres === */
    --cc-shadow: 0 1px 3px rgba(0,0,0,0.05);
    --cc-shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.05);
    --cc-shadow-lg: 0 4px 12px rgba(0,0,0,0.08);

    /* === Typographie === */
    --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
    --cc-font-mono: "SF Mono", Menlo, Consolas, monospace;
}

/* === Reset === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--cc-font);
    background: var(--cc-bg);
    color: var(--cc-text);
    font-size: 14px;
    line-height: 1.5;
}

/* === App layout === */
.app { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
    width: 240px;
    background: var(--cc-primary);
    color: white;
    padding: 24px 0;
    flex-shrink: 0;
}
.sidebar__brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 24px;
}
.sidebar__brand-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.sidebar__brand-tag { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.1em; }
.sidebar__nav { list-style: none; }
.sidebar__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 24px; color: var(--cc-text-on-dark);
    cursor: pointer; transition: all 0.15s;
    font-size: 14px;
    text-decoration: none;
}
.sidebar__item:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar__item.is-active { background: var(--cc-accent); color: white; }
.sidebar__icon { width: 18px; text-align: center; }
.sidebar__divider { height: 1px; background: rgba(255,255,255,0.1); margin: 16px 24px; }
.sidebar__badge {
    margin-left: auto; background: var(--cc-warning); color: white;
    font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 600;
}

/* === Main / Topbar / Content === */
.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
    background: white; border-bottom: 1px solid var(--cc-border);
    padding: 12px 32px;
    display: flex; justify-content: space-between; align-items: center;
}
.topbar__title { font-size: 18px; font-weight: 600; }
.topbar__user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--cc-text-soft); }
.topbar__avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--cc-accent); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.content { padding: 32px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* === Breadcrumb === */
.breadcrumb { font-size: 13px; color: var(--cc-text-soft); margin-bottom: 16px; }
.breadcrumb a { color: var(--cc-accent); text-decoration: none; }

/* === Page header === */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 32px;
}
.page-header__title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.page-header__desc { color: var(--cc-text-soft); font-size: 14px; }
.page-header__actions { display: flex; gap: 8px; }

/* === Tags === */
.tag {
    display: inline-block; padding: 2px 10px;
    border-radius: 4px; font-size: 11px; font-weight: 500;
    background: var(--cc-bg); color: #4b5563;
    margin-right: 4px;
}

/* === Boutons === */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--cc-border);
    background: white; color: var(--cc-text);
    border-radius: var(--cc-radius);
    cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 500;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.btn:hover { background: var(--cc-bg); }
.btn--primary { background: var(--cc-accent); color: white; border-color: var(--cc-accent); }
.btn--primary:hover { background: var(--cc-accent-hover); border-color: var(--cc-accent-hover); }
.btn--danger { color: var(--cc-danger); border-color: #fecaca; }
.btn--danger:hover { background: var(--cc-danger-bg); }
.btn--lg { padding: 11px 20px; font-size: 14px; }

/* === KPI Cards === */
.kpis { display: flex; gap: 16px; margin-bottom: 32px; }
.kpi {
    flex: 1;
    background: var(--cc-bg-card);
    border-radius: var(--cc-radius);
    padding: 20px;
    border: 1px solid var(--cc-border);
    box-shadow: var(--cc-shadow);
}
.kpi__label {
    font-size: 12px; color: var(--cc-text-soft);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.kpi__value { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.kpi__value.is-success { color: var(--cc-success); }
.kpi__value.is-warning { color: var(--cc-warning); }
.kpi__value.is-danger { color: var(--cc-danger); }
.kpi__value.sm { font-size: 22px; }
.kpi__trend { font-size: 12px; color: var(--cc-text-soft); }
.kpi__trend.is-up { color: var(--cc-success); }
.kpi__trend.is-warning { color: var(--cc-warning); }
.kpi__trend.is-danger { color: var(--cc-danger); }

/* === Section === */
.section { margin-bottom: 32px; }
.section__header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.section__title {
    font-size: 14px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--cc-text-soft);
}
.section__link { font-size: 13px; color: var(--cc-accent); text-decoration: none; }

/* === Card === */
.card {
    background: var(--cc-bg-card);
    border-radius: var(--cc-radius);
    border: 1px solid var(--cc-border);
    box-shadow: var(--cc-shadow);
}

/* === Alert === */
.alert {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 16px 20px;
    border-left: 4px solid var(--cc-warning);
    background: var(--cc-warning-bg);
    border-radius: var(--cc-radius);
    margin-bottom: 16px;
}
.alert--danger { border-left-color: var(--cc-danger); background: var(--cc-danger-bg); }
.alert--info { border-left-color: var(--cc-info); background: var(--cc-info-bg); }
.alert--success { border-left-color: var(--cc-success); background: var(--cc-success-bg); }
.alert__icon { font-size: 20px; line-height: 1; }
.alert__title { font-weight: 600; margin-bottom: 4px; }
.alert__body { font-size: 13px; color: var(--cc-text-soft); }
.alert__cta { margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--cc-warning); }

/* === Tables === */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    text-align: left; padding: 12px 20px; font-weight: 500;
    color: var(--cc-text-soft); border-bottom: 1px solid var(--cc-border);
    background: var(--cc-bg);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}
td { padding: 12px 20px; border-bottom: 1px solid var(--cc-border); }
tr:last-child td { border-bottom: none; }
tr.is-warning { background: rgba(251, 191, 36, 0.05); }
tr.is-danger { background: rgba(239, 68, 68, 0.05); }

/* === Badges === */
.badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 4px; font-size: 11px; font-weight: 500;
}
.badge--ok { background: var(--cc-success-bg); color: #065f46; }
.badge--warning { background: var(--cc-warning-bg); color: var(--cc-warning-text); }
.badge--danger { background: var(--cc-danger-bg); color: var(--cc-danger-text); }
.badge--info { background: var(--cc-info-bg); color: #4338ca; }
.badge--neutral { background: var(--cc-bg); color: var(--cc-text-soft); }

/* === Dots de statut === */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot--ok { background: var(--cc-success); }
.dot--warning { background: var(--cc-warning); }
.dot--danger { background: var(--cc-danger); }
.dot--muted { background: var(--cc-text-muted); }

/* === Forms === */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--cc-text); margin-bottom: 6px;
}
.form-help { font-size: 12px; color: var(--cc-text-muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    font-size: 14px; font-family: inherit;
    background: var(--cc-bg-card); color: var(--cc-text);
    transition: all 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--cc-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-input::placeholder { color: var(--cc-text-muted); }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }

/* === Filtres + recherche === */
.toolbar {
    display: flex; gap: 8px; margin-bottom: 16px;
    align-items: center;
}
.toolbar__search {
    flex: 1; max-width: 280px;
    padding: 8px 14px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    font-size: 13px;
}
.toolbar__filter {
    padding: 8px 14px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius);
    background: white; font-size: 13px;
    cursor: pointer;
}
.toolbar__count { color: var(--cc-text-muted); font-size: 13px; margin-left: auto; }

/* === Footer summary line === */
.list-footer {
    padding: 12px 20px; background: var(--cc-bg);
    border-top: 1px solid var(--cc-border);
    font-size: 12px; color: var(--cc-text-soft);
    border-radius: 0 0 var(--cc-radius) var(--cc-radius);
}

/* ============== SECTION 2 : auth-module vendor ============== */
/* ============================================================
   AUTH MODULE — Theme CSS (v1.0.0)
   ============================================================
   Toutes les couleurs et tailles sont définies via CSS variables.
   Pour personnaliser : créez un theme.custom.css qui surcharge.
   ============================================================ */

:root {
    /* === COULEURS === */
    --auth-primary: #2563eb;
    --auth-primary-hover: #1d4ed8;
    --auth-primary-light: #dbeafe;

    --auth-success: #10b981;
    --auth-success-bg: #d1fae5;
    --auth-warning: #f59e0b;
    --auth-warning-bg: #fef3c7;
    --auth-danger: #ef4444;
    --auth-danger-bg: #fee2e2;

    --auth-text: #111827;
    --auth-text-light: #6b7280;
    --auth-text-muted: #9ca3af;

    --auth-bg: #ffffff;
    --auth-bg-alt: #f9fafb;
    --auth-bg-card: #ffffff;

    --auth-border: #e5e7eb;
    --auth-border-focus: #3b82f6;

    /* === ESPACEMENTS === */
    --auth-radius-sm: 4px;
    --auth-radius: 8px;
    --auth-radius-lg: 12px;

    --auth-spacing-xs: 4px;
    --auth-spacing-sm: 8px;
    --auth-spacing-md: 16px;
    --auth-spacing-lg: 24px;
    --auth-spacing-xl: 32px;

    /* === TYPOGRAPHIE === */
    --auth-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --auth-font-mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --auth-size-sm: 13px;
    --auth-size-base: 15px;
    --auth-size-md: 17px;
    --auth-size-lg: 20px;
    --auth-size-xl: 28px;

    /* === OMBRES === */
    --auth-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --auth-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --auth-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --auth-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

    /* === TRANSITIONS === */
    --auth-transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET LÉGER
   ============================================================ */

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

body.auth-page {
    margin: 0;
    padding: 0;
    font-family: var(--auth-font);
    font-size: var(--auth-size-base);
    line-height: 1.5;
    color: var(--auth-text);
    background: var(--auth-bg-alt);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--auth-spacing-lg);
}

/* ============================================================
   CONTAINER CENTRAL
   ============================================================ */

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--auth-bg-card);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-lg);
    overflow: hidden;
}

.auth-container--wide {
    max-width: 540px;
}

.auth-header {
    padding: var(--auth-spacing-xl) var(--auth-spacing-xl) var(--auth-spacing-md);
    text-align: center;
}

.auth-logo {
    max-height: 48px;
    margin-bottom: var(--auth-spacing-md);
}

.auth-title {
    margin: 0 0 var(--auth-spacing-xs);
    font-size: var(--auth-size-xl);
    font-weight: 600;
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 0;
    color: var(--auth-text-light);
    font-size: var(--auth-size-sm);
}

.auth-body {
    padding: var(--auth-spacing-lg) var(--auth-spacing-xl) var(--auth-spacing-xl);
}

.auth-footer {
    padding: var(--auth-spacing-md) var(--auth-spacing-xl);
    background: var(--auth-bg-alt);
    border-top: 1px solid var(--auth-border);
    text-align: center;
    font-size: var(--auth-size-sm);
    color: var(--auth-text-light);
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */

.auth-form-group {
    margin-bottom: var(--auth-spacing-md);
}

.auth-form-group:last-of-type {
    margin-bottom: var(--auth-spacing-lg);
}

.auth-label {
    display: block;
    margin-bottom: var(--auth-spacing-xs);
    font-size: var(--auth-size-sm);
    font-weight: 500;
    color: var(--auth-text);
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    font-size: var(--auth-size-base);
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    transition: var(--auth-transition);
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-input[disabled] {
    background: var(--auth-bg-alt);
    color: var(--auth-text-muted);
    cursor: not-allowed;
}

.auth-input--error {
    border-color: var(--auth-danger);
}

.auth-input--error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--auth-spacing-md);
}

@media (max-width: 480px) {
    .auth-form-row {
        grid-template-columns: 1fr;
    }
}

.auth-help-text {
    margin-top: var(--auth-spacing-xs);
    font-size: 12px;
    color: var(--auth-text-light);
}

/* ============================================================
   BOUTONS
   ============================================================ */

.auth-btn {
    display: inline-block;
    padding: 11px 20px;
    font-size: var(--auth-size-base);
    font-weight: 500;
    font-family: inherit;
    color: var(--auth-bg);
    background: var(--auth-primary);
    border: none;
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: var(--auth-transition);
    text-decoration: none;
    text-align: center;
}

.auth-btn:hover {
    background: var(--auth-primary-hover);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

.auth-btn:disabled {
    background: var(--auth-text-muted);
    cursor: not-allowed;
}

.auth-btn--full {
    width: 100%;
}

.auth-btn--secondary {
    color: var(--auth-text);
    background: var(--auth-bg-alt);
    border: 1px solid var(--auth-border);
}

.auth-btn--secondary:hover {
    background: var(--auth-border);
}

.auth-btn--danger {
    background: var(--auth-danger);
}

.auth-btn--danger:hover {
    background: #dc2626;
}

/* ============================================================
   ALERTES & MESSAGES
   ============================================================ */

.auth-alert {
    padding: 12px 16px;
    margin-bottom: var(--auth-spacing-md);
    border-radius: var(--auth-radius);
    font-size: var(--auth-size-sm);
    border: 1px solid transparent;
}

.auth-alert--success {
    color: #065f46;
    background: var(--auth-success-bg);
    border-color: #6ee7b7;
}

.auth-alert--error {
    color: #991b1b;
    background: var(--auth-danger-bg);
    border-color: #fca5a5;
}

.auth-alert--warning {
    color: #92400e;
    background: var(--auth-warning-bg);
    border-color: #fde68a;
}

.auth-alert--info {
    color: #1e3a8a;
    background: var(--auth-primary-light);
    border-color: #93c5fd;
}

/* ============================================================
   LINKS UTILITAIRES
   ============================================================ */

.auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-link--small {
    font-size: var(--auth-size-sm);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */

.profile-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--auth-spacing-md);
    align-items: center;
    padding: var(--auth-spacing-sm) 0;
    border-bottom: 1px solid var(--auth-border);
}

.profile-grid:last-child {
    border-bottom: none;
}

.profile-label {
    color: var(--auth-text-light);
    font-weight: 500;
    font-size: var(--auth-size-sm);
}

.profile-value {
    color: var(--auth-text);
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--auth-spacing-xs);
}

.profile-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    background: var(--auth-primary-light);
    color: var(--auth-primary-hover);
}

/* ============================================================
   PASSWORD HINT
   ============================================================ */

.password-hint {
    margin-top: var(--auth-spacing-xs);
    padding: 8px 12px;
    background: var(--auth-bg-alt);
    border-radius: var(--auth-radius-sm);
    font-size: 12px;
    color: var(--auth-text-light);
}

.password-hint ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.password-hint li {
    margin: 2px 0;
}

.password-hint li.ok {
    color: var(--auth-success);
}

.password-hint li.ko {
    color: var(--auth-text-light);
}

/* ============== Patches v0.3.0 ============== */
.dot--neutral { background: var(--cc-text-muted); }
.section__more {
    font-size: 13px;
    color: var(--cc-accent);
    text-decoration: none;
    font-weight: 500;
}
.section__more:hover { text-decoration: underline; }

/* KPI value variants étendus pour dashboard */
.kpi__value.is-danger { color: var(--cc-danger); }

/* Table responsive helper */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--cc-border); }
table th { background: var(--cc-bg); font-weight: 600; color: var(--cc-text-soft); }
