/* =====================================================================
   Akiba — système visuel de l'Admin Panel.
   Jetons d'abord, composants ensuite : les pages n'écrivent pas de couleurs
   en dur. Lisibilité avant décoration (CLAUDE.md §14 : faible littératie,
   montants lisibles, code couleur constant).
   ===================================================================== */

:root {
    /* Marque : le teal d'Akiba, repris du mobile et de l'icône. */
    --brand: #0F766E;
    --brand-dark: #115E59;
    --brand-light: #F0FDFA;
    --brand-dim: #99F6E4;

    /* Accent : l'or des montants et des mises en avant. */
    --accent: #D97706;
    --accent-dark: #B45309;
    --accent-light: #FEF3C7;

    /* Barre latérale */
    --sb-bg: #0F172A;
    --sb-w: 264px;
    --sb-hover: rgba(255, 255, 255, 0.06);
    --sb-active-bg: rgba(20, 184, 166, 0.18);
    --sb-active-text: #5EEAD4;
    --sb-text: rgba(255, 255, 255, 0.64);
    --sb-border: rgba(255, 255, 255, 0.07);

    /* Surfaces */
    --surface: #F1F5F9;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --border-focus: var(--brand-dim);

    /* Texte */
    --text: #0F172A;
    --text-muted: #64748B;
    --text-subtle: #94A3B8;

    /* Sémantique */
    --danger: #DC2626;
    --danger-light: #FEF2F2;
    --warning: #D97706;
    --warning-light: #FFFBEB;
    --success: #059669;
    --success-light: #ECFDF5;
    --info: #0891B2;
    --info-light: #ECFEFF;

    /* Géométrie */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 5px;

    /* Ombres */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);

    /* Mouvement */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur: 150ms;
}

body {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--surface);
    color: var(--text);
}

/* ─── BARRE LATÉRALE ────────────────────────────────────────────────── */
.akiba-sidebar {
    background: var(--sb-bg);
    border: none !important;
    width: var(--sb-w);
}

.akiba-sidebar .mud-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sb-brand {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--sb-border);
}

.sb-brand-name {
    font-size: 21px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.sb-brand-sub {
    font-size: 11.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.34);
    margin-top: 4px;
    line-height: 1.3;
}

.sb-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255, 255, 255, 0.36);
    padding: 14px 20px 4px;
}

.akiba-sidebar .mud-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1px 10px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    color: var(--sb-text) !important;
    font-size: 14px;
    font-weight: 500;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.akiba-sidebar .mud-nav-link:hover {
    background: var(--sb-hover);
    color: rgba(255, 255, 255, 0.88) !important;
}

.akiba-sidebar .mud-nav-link.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-text) !important;
    font-weight: 600;
}

.akiba-sidebar .mud-nav-link .mud-icon-root {
    font-size: 18px;
    opacity: 0.8;
}

.akiba-sidebar .mud-nav-link.active .mud-icon-root {
    opacity: 1;
}

.sb-footer {
    margin-top: auto;
    padding: 12px 14px 16px;
    border-top: 1px solid var(--sb-border);
}

.sb-user {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
    line-height: 1.3;
}

.sb-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.46);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sb-signout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 11px;
    border: 1px solid var(--sb-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.sb-signout:hover {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(248, 113, 113, 0.4);
    color: #FCA5A5;
}

/* ─── BANDEAU DE PAGE ───────────────────────────────────────────────── */
.page-hero {
    background: linear-gradient(135deg, #134E4A 0%, var(--brand) 58%, #0891B2 100%);
    border-radius: 18px;
    padding: 1.4rem 1.75rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.page-hero::before,
.page-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.page-hero::before {
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.06);
}

.page-hero::after {
    right: 70px;
    bottom: -55px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.04);
}

.ph-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.ph-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.4px;
    overflow-wrap: anywhere;
}

.ph-sub {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.25rem;
}

.ph-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ─── CARTES DE CHIFFRES ────────────────────────────────────────────── */
.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--brand-light);
    color: var(--brand);
}

.kpi-icon-teal { background: #CCFBF1; color: #0F766E; }
.kpi-icon-amber { background: #FEF3C7; color: #B45309; }
.kpi-icon-green { background: #D1FAE5; color: #047857; }
.kpi-icon-red { background: #FEE2E2; color: #B91C1C; }
.kpi-icon-blue { background: #DBEAFE; color: #1D4ED8; }
.kpi-icon-purple { background: #EDE9FE; color: #6D28D9; }

.kpi-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    /* Pas d'espacement négatif : il écrasait l'espace fine des milliers (« 1190000 CDF »). */
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    /* Les montants restent lisibles même très longs (CDF sans décimales). */
    overflow-wrap: anywhere;
}

.kpi-sub {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ─── COMPOSANTS MUDBLAZOR ALIGNÉS SUR LES JETONS ───────────────────── */
.mud-paper {
    border-radius: var(--radius) !important;
}

.mud-table-container th {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted) !important;
    background: #F8FAFC;
    white-space: nowrap;
}

.mud-table-container td {
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.mud-table-row:hover td {
    background: var(--brand-light);
}

.mud-chip {
    font-size: 12px !important;
    font-weight: 600 !important;
}

.mud-button-root {
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0;
}

/* ─── PAGES DE COMPTE (rendu statique, sans MudBlazor) ──────────────── */
.akiba-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #0F172A 0%, #134E4A 55%, #0F766E 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(2, 20, 24, 0.38);
    padding: 34px 30px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
}

.auth-card h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.auth-tagline {
    margin: 4px 0 26px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.auth-card label {
    display: block;
    margin-top: 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input:not([type]) {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.auth-card .auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
}

.auth-card .auth-remember input {
    width: auto;
    margin: 0;
}

.auth-card button[type="submit"] {
    width: 100%;
    margin-top: 24px;
    padding: 13px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.auth-card button[type="submit"]:hover {
    background: var(--brand-dark);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.3);
}

.auth-error {
    margin-bottom: 18px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: var(--danger-light);
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 0.86rem;
    font-weight: 600;
}

.auth-back {
    display: block;
    margin-top: 18px;
    text-align: center;
    color: var(--brand);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

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

.auth-languages {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.auth-languages a {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.auth-languages a:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.validation-message {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 500;
}

/* ─── TÉLÉPHONES ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .page-hero {
        padding: 1.1rem 1.25rem;
        border-radius: 14px;
    }

    .ph-title {
        font-size: 1.2rem;
    }

    .kpi-card {
        padding: 16px;
        gap: 12px;
    }

    .kpi-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .kpi-value {
        font-size: 21px;
    }
}

/* Boutons posés sur le bandeau : lisibles sur le dégradé, sans casser le thème MudBlazor. */
.ph-actions .mud-button-root {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
}

.ph-actions .mud-button-root:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
}

.ph-actions .mud-button-filled {
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-dark);
    border-color: transparent;
    font-weight: 700;
}

.ph-actions .mud-button-filled:hover {
    background: #fff;
    color: var(--brand-dark);
}

.ph-actions .mud-icon-root {
    color: inherit;
}

/* ─── TUILES DE CHIFFRES ────────────────────────────────────────────────
   Un chiffre = une couleur, tenue d'un écran à l'autre : on repère sa ligne
   sans la lire (§14, faible littératie). */
/* Rangée de tuiles : autant de colonnes que la largeur en permet, toutes de même taille. */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 12px;
    margin-bottom: 1.25rem;
}

.stat-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 84px;
    padding: 13px 15px;
    border-radius: var(--radius);
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.stat-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-tile::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -45px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.st-teal { background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%); }
.st-blue { background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%); }
.st-amber { background: linear-gradient(135deg, #B45309 0%, #F59E0B 100%); }
.st-red { background: linear-gradient(135deg, #B91C1C 0%, #EF4444 100%); }
.st-green { background: linear-gradient(135deg, #047857 0%, #10B981 100%); }
.st-purple { background: linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%); }
.st-slate { background: linear-gradient(135deg, #334155 0%, #64748B 100%); }

.st-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.st-body {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.st-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.st-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 2px;
}

.st-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 3px;
}

/* ─── CARTES À EN-TÊTE COLORÉ ───────────────────────────────────────── */
.section-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.1px;
}

.section-head .mud-icon-root {
    color: #fff;
    font-size: 19px;
}

.section-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.section-body {
    padding: 16px;
}

/* ─── ACCÈS RAPIDE ──────────────────────────────────────────────────── */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.quick-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.quick-item:hover {
    border-color: var(--brand-dim);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    text-decoration: none;
}

.quick-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .st-value { font-size: 20px; }
    .kpi-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
}

/* ─── FILTRES DANS LE BANDEAU ───────────────────────────────────────── */
.ph-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0.9rem;
    position: relative;
    z-index: 1;
}

.ph-chip {
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.ph-chip:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
}

.ph-chip.active {
    background: #fff;
    border-color: #fff;
    color: var(--brand-dark);
    font-weight: 700;
}

.ph-select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    max-width: 230px;
    cursor: pointer;
}

.ph-select option {
    color: var(--text);
    background: #fff;
}

.ph-filters .ph-spacer {
    flex: 1 1 auto;
}

/* Sous-menu du menu latéral : même grammaire que les entrées principales, en retrait. */
.akiba-sidebar .mud-nav-group .mud-nav-link {
    padding-left: 34px;
    font-size: 13px;
}

.akiba-sidebar .mud-nav-group > .mud-nav-link {
    padding-left: 11px;
    font-size: 13.5px;
}

.akiba-sidebar .mud-nav-group .mud-nav-link-expand-icon {
    color: rgba(255, 255, 255, 0.4);
}

/* Onglets sur fond blanc d'un bloc : soulignement discret, pas de cadre. */
.section-body .mud-tabs-toolbar {
    background: transparent;
    border-bottom: 1px solid var(--border);
}



/* ─── TYPOGRAPHIE COMMUNE ───────────────────────────────────────────────
   Échelle unique (cf. thème de MainLayout) : 14px texte courant, 13px
   secondaire, 12px minimum. Les composants MudBlazor qui dérogeaient
   (onglets en capitales, alertes, en-têtes de panneaux) s'y alignent. */
.mud-tab {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    min-width: 0 !important;
    padding: 10px 16px !important;
}

.mud-tab .mud-icon-root {
    font-size: 1.15rem;
}

.mud-alert-message {
    font-size: 0.875rem;
    line-height: 1.5;
}

.mud-expand-panel .mud-expand-panel-header {
    font-size: 0.9375rem;
    font-weight: 600;
}

.mud-input-helper-text {
    font-size: 0.75rem !important;
}

.mud-table-pagination-caption,
.mud-table-pagination-select .mud-select-input {
    font-size: 0.8125rem !important;
}

.mud-tooltip {
    font-size: 0.75rem;
}

/* Titre de bloc posé sur le fond de page (hors carte) : même voix que l'en-tête des cartes. */
.block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.1px;
}

.block-title .mud-icon-root {
    color: var(--brand);
    font-size: 1.2rem;
}

/* ─── BANDEAU : RETOUR ET PASTILLES ─────────────────────────────────── */
.ph-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ph-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.ph-back:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.ph-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Les pastilles de statut gardent leurs couleurs, sur un fond blanc pour rester lisibles sur le dégradé. */
.ph-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ph-badges .mud-chip {
    margin: 0;
    background: rgba(255, 255, 255, 0.94) !important;
}

.ph-actions .mud-menu .mud-button-root {
    padding: 0.35rem 0.85rem;
}

/* ─── ONGLETS DE PAGE (fiche AVEC) ──────────────────────────────────── */
.page-tabs > .mud-tabs-tabbar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    margin-bottom: 1rem;
}

.page-tabs > .mud-tabs-tabbar .mud-tab.mud-tab-active {
    color: var(--brand);
}

/* Le contenu d'un onglet ne doit jamais recouvrir la barre : la grille MudBlazor a des marges négatives. */
.page-tabs > .mud-tabs-panels {
    padding: 0;
    overflow: visible;
}

.page-tabs > .mud-tabs-panels > .mud-tabs-panel > .mud-grid:first-child {
    margin-top: 0;
}

/* ─── BARRE DE FILTRES ──────────────────────────────────────────────── */
.filter-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    padding: 12px 14px 4px;
    margin-bottom: 1.25rem;
}

/* ─── LISTE CLÉ / VALEUR ────────────────────────────────────────────── */
.kv-table td {
    padding: 7px 4px !important;
    vertical-align: top;
    border-color: var(--border) !important;
}

.kv-table td:first-child {
    color: var(--text-muted);
}

.kv-table td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

@media (max-width: 767px) {
    .ph-title { font-size: 1.25rem; }
    .kv-table td:last-child { white-space: normal; }
}

/* ─── GRAPHIQUES ────────────────────────────────────────────────────── */
.chart-axis {
    position: relative;
    height: 20px;
    margin-top: 2px;
}

.chart-tick {
    position: absolute;
    top: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.chart-tick-middle { transform: translateX(-50%); }
.chart-tick-end { transform: translateX(-100%); }

/* ─── ÉTAT VIDE / PAGE INTROUVABLE / ERREUR ─────────────────────────── */
.empty-state {
    max-width: 520px;
    margin: 8vh auto 0;
    padding: 40px 28px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-light);
    color: var(--brand);
}

.empty-state-icon .mud-icon-root { font-size: 32px; }

.empty-state-icon-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.empty-state-title {
    margin: 0 0 8px;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}

.empty-state-text {
    margin: 0 0 22px;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.empty-state-ref {
    margin: -10px 0 20px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ─── AIDE : ÉTAPES NUMÉROTÉES ──────────────────────────────────────── */
.help-steps {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.help-steps li {
    position: relative;
    padding: 9px 0 9px 42px;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text);
    counter-increment: step;
    border-bottom: 1px solid #F1F5F9;
}

.help-steps li:last-child { border-bottom: none; }

.help-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ligne sélectionnée d'un tableau (profil ouvert en dessous). */
.mud-table-row.mud-selected-item td {
    background: var(--brand-light);
}

/* Texte atténué (légendes, clés techniques). « mud-secondary-text » donne la couleur secondaire (or), pas un gris. */
.text-muted {
    color: var(--text-muted) !important;
}

/* Tableaux de chiffres : un code ou un montant ne se coupe jamais en deux lignes ; le tableau défile plutôt. */
.table-nowrap td {
    white-space: nowrap;
}

/* Champs : même corps que le texte courant (14px), libellés compris. */
.mud-input,
.mud-input-label,
.mud-select .mud-select-input,
.mud-list-item-text,
.mud-menu-item-text {
    font-size: 0.875rem !important;
}

/* ─── TABLEAUX EMPILÉS (téléphone) ──────────────────────────────────────
   En dessous du point de rupture, MudTable pose chaque cellule sur une ligne :
   libellé à gauche, valeur à droite. Aucune valeur ne doit forcer la largeur,
   sinon le tableau déborde et les valeurs sortent de l'écran. */
/* Breakpoint.Sm : empilé sous 960 px. */
@media (max-width: 959.98px) {
    .mud-sm-table table {
        width: 100%;
        table-layout: fixed;
    }

    .mud-sm-table .mud-table-cell {
        white-space: normal !important;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 12px;
        overflow-wrap: anywhere;
        text-align: right;
    }

    .mud-sm-table .mud-table-cell::before {
        text-align: left;
        color: var(--text-muted);
        font-weight: 600;
    }

    .mud-sm-table .mud-table-cell > .mud-input-control {
        flex: 1 1 160px;
        max-width: 100%;
    }

    .mud-sm-table .mud-chip {
        max-width: 100%;
        height: auto;
        min-height: 24px;
        white-space: normal;
    }
}

/* Breakpoint.Xs (défaut de MudTable) : empilé sous 600 px. */
@media (max-width: 599.98px) {
    .mud-xs-table table {
        width: 100%;
        table-layout: fixed;
    }

    .mud-xs-table .mud-table-cell {
        white-space: normal !important;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 12px;
        overflow-wrap: anywhere;
        text-align: right;
    }

    .mud-xs-table .mud-table-cell::before {
        text-align: left;
        color: var(--text-muted);
        font-weight: 600;
    }

    .mud-xs-table .mud-table-cell > .mud-input-control {
        flex: 1 1 160px;
        max-width: 100%;
    }

    .mud-xs-table .mud-chip {
        max-width: 100%;
        height: auto;
        min-height: 24px;
        white-space: normal;
    }
}

/* ─── CONNEXION : présentation d'Akiba à gauche, formulaire à droite ─── */
.akiba-auth:has(> .lg) {
    display: block;
    padding: 0;
    background: #fff;
}

.lg {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow-x: hidden;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

.lg .lp-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.lg-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 48px;
    color: #E6F4F1;
    background:
        radial-gradient(520px 320px at 0% 100%, rgba(245, 158, 11, 0.22), transparent 60%),
        radial-gradient(600px 380px at 100% 0%, rgba(94, 234, 212, 0.18), transparent 60%),
        linear-gradient(150deg, #072B28 0%, #0A3D39 45%, #0F766E 100%);
}

.lg-intro-inner {
    width: 100%;
    max-width: 500px;
}

.lg-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 20px;
    background: #fff;
    color: #0B1220;
    text-decoration: none;
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.55);
}

.lg-brand img {
    width: 40px;
    height: auto;
    padding: 6px 8px;
    border-radius: 16px;
    background: #E8F5F3;
}

.lg-brand span {
    display: flex;
    flex-direction: column;
}

.lg-brand strong {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #0A3D39;
}

.lg-brand em {
    font-size: 14px;
    color: #5B6B7F;
}

.lg-kicker {
    margin: 18px 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5EEAD4;
}

.lg-rule {
    display: block;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: #F59E0B;
}

.lg-lead {
    margin: 16px 0 18px;
    font-size: 15px;
    line-height: 1.55;
    color: #E6F4F1;
}

.lg-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}

.lg-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    font-weight: 500;
    color: #fff;
}

.lg-point-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #5EEAD4;
}

.lg-copy {
    margin: 22px 0 0;
    font-size: 12px;
    color: rgba(230, 244, 241, 0.7);
}

.lg-copy a {
    color: inherit;
    font-weight: 700;
}

.lg-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    background: #fff;
}

.lg-form {
    width: 100%;
    max-width: 420px;
}

.lg-form h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: #0A3D39;
}

.lg-subtitle {
    margin: 6px 0 20px;
    font-size: 15px;
    color: #5B6B7F;
}

.lg-form label:not(.lg-remember) {
    display: block;
    margin: 14px 0 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: #0B1220;
}

.lg-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1.5px solid #D9E1E8;
    border-radius: 14px;
    background: #F6F8FA;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lg-field:focus-within {
    border-color: #0F766E;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.lg-field-icon {
    display: inline-flex;
    color: #5B6B7F;
}

.lg-field input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: #0B1220;
}

.lg-reveal {
    display: inline-flex;
    padding: 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #5B6B7F;
    cursor: pointer;
}

.lg-reveal:hover {
    background: #E8F5F3;
    color: #0F766E;
}

.lg-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 500;
    color: #0B1220;
}

.lg-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin-top: 18px;
    border: none;
    border-radius: 14px;
    background: #0A3D39;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 30px -14px rgba(10, 61, 57, 0.7);
    transition: background 0.15s ease, transform 0.15s ease;
}

.lg-submit:hover {
    background: #0F766E;
    transform: translateY(-1px);
}

.lg-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #BBF7D0;
    background: #F0FDF4;
    color: #166534;
    font-size: 14px;
    font-weight: 600;
}

.lg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 14px;
}

.lg-foot a {
    color: #0F766E;
    font-weight: 600;
    text-decoration: none;
}

.lg-foot nav {
    display: flex;
    gap: 4px;
}

.lg-foot nav a {
    padding: 5px 10px;
    border-radius: 20px;
    color: #5B6B7F;
}

.lg-foot nav a.is-active,
.lg-foot nav a:hover {
    background: #E8F5F3;
    color: #0F766E;
}

@media (max-width: 900px) {
    .lg {
        grid-template-columns: minmax(0, 1fr);
    }

    .lg-intro {
        padding: 28px 16px 24px;
    }

    .lg-kicker,
    .lg-rule,
    .lg-lead,
    .lg-points,
    .lg-copy {
        display: none;
    }

    .lg-panel {
        align-items: flex-start;
        padding: 28px 16px 40px;
    }

    .lg-form h1 {
        font-size: 30px;
    }
}
