/* ==========================================================================
   Thème « atelier » du panel TAA
   Tiré du logo : rouge signal, sable, lettrage bâton très gras.
   Motif signature : les bandes de balisage rouge / blanc des dépanneuses.
   Tout est limité à body.theme-garage (en test sur la page Paramètres).
   ========================================================================== */

.theme-garage {
    /* Palette */
    --g-asphalt: #15181c;      /* fond de page */
    --g-chassis: #1b1f24;      /* barre latérale, panneaux */
    --g-panel: #22272d;        /* blocs surélevés */
    --g-field: #111418;        /* champs de saisie, console */
    --g-line: #2f353c;
    --g-line-soft: #252a30;
    --g-text: #ede8df;
    --g-text-2: #b8b2a7;
    --g-muted: #857f75;
    --g-sand: #d2ba93;         /* sable du logo */
    --g-sand-dim: #9c8c70;
    --g-signal: #d21a0e;       /* rouge du logo */
    --g-signal-hi: #e8321f;
    --g-signal-soft: rgba(210, 26, 14, 0.14);
    --g-ok: #4cb782;
    --g-ok-soft: rgba(76, 183, 130, 0.14);
    --g-warn: #e3a33b;
    --g-warn-soft: rgba(227, 163, 59, 0.14);
    --g-reflect: #f3eee6;      /* blanc rétroréfléchissant */

    --g-stripe: repeating-linear-gradient(-45deg, var(--g-signal) 0 9px, var(--g-reflect) 9px 18px);

    --g-font: 'Archivo', system-ui, sans-serif;
    --g-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

    --g-r-sm: 6px;
    --g-r-md: 10px;
    --g-r-lg: 14px;

    /* Anciennes variables du panel, réalignées sur la palette */
    --bg-body: var(--g-asphalt);
    --bg-primary: var(--g-asphalt);
    --bg-surface: var(--g-panel);
    --bg-secondary: var(--g-panel);
    --bg-tertiary: var(--g-field);
    --bg-card: var(--g-panel);
    --card-bg: var(--g-panel);
    --bg-element: var(--g-chassis);
    --border-color: var(--g-line);
    --border-light: var(--g-line-soft);
    --text-primary: var(--g-text);
    --text-secondary: var(--g-text-2);
    --text-muted: var(--g-muted);
    --accent-primary: var(--g-signal);
    --accent-hover: var(--g-signal-hi);
    --primary: var(--g-signal);
    --success: var(--g-ok);
    --danger: var(--g-signal-hi);
    --warning: var(--g-warn);

    background: var(--g-asphalt);
    color: var(--g-text);
    font-family: var(--g-font);
    font-size: 15px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

.theme-garage ::selection { background: var(--g-signal); color: #fff; }

.theme-garage a { color: var(--g-sand); }
.theme-garage a:hover { color: var(--g-reflect); }

.theme-garage :focus-visible {
    outline: 2px solid var(--g-sand);
    outline-offset: 2px;
}

.theme-garage code {
    font-family: var(--g-mono);
    font-size: 0.85em;
    color: var(--g-sand);
    background: var(--g-field);
    border: 1px solid var(--g-line-soft);
    border-radius: 4px;
    padding: 0.05em 0.35em;
}

/* --------------------------------------------------------------------------
   Structure
   -------------------------------------------------------------------------- */

.theme-garage .admin-layout {
    grid-template-columns: 264px minmax(0, 1fr);
}

.theme-garage .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--g-chassis);
    border-right: 1px solid var(--g-line-soft);
    display: flex;
    flex-direction: column;
}

/* Marque : l'écusson du logo sur une plaque sable */
.theme-garage .garage-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1.1rem;
    border-bottom: 1px solid var(--g-line-soft);
}

.theme-garage .garage-brand-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--g-text);
    text-decoration: none;
}

.theme-garage .garage-brand-badge {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--g-reflect);
    border-radius: var(--g-r-md);
    flex-shrink: 0;
}

.theme-garage .garage-brand-badge img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.theme-garage .garage-brand-text { display: flex; flex-direction: column; line-height: 1.1; }

.theme-garage .garage-brand-name {
    font-weight: 900;
    font-stretch: 125%;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    color: var(--g-reflect);
}

.theme-garage .garage-brand-sub {
    font-size: 0.8rem;
    color: var(--g-sand);
    margin-top: 0.15rem;
}

.theme-garage .garage-sidebar-close {
    display: none;
    background: none;
    border: 0;
    color: var(--g-text-2);
    font-size: 1.1rem;
    padding: 0.4rem;
    cursor: pointer;
}

/* Menu */
.theme-garage .admin-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.75rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--g-line) transparent;
}

.theme-garage .admin-menu-section {
    padding: 1.1rem 0.75rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--g-sand-dim);
}

.theme-garage .admin-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1px 0;
    padding: 0.55rem 0.75rem 0.55rem 1rem;
    border: 0;
    border-radius: var(--g-r-sm);
    color: var(--g-text-2);
    font-weight: 500;
    font-size: 0.93rem;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.theme-garage .admin-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--g-muted);
    transition: color 0.15s;
}

.theme-garage .admin-menu-item:hover {
    background: rgba(255, 255, 255, 0.035);
    color: var(--g-text);
}

.theme-garage .admin-menu-item:hover i { color: var(--g-text-2); }

/* Élément actif : bande de balisage, comme l'arrière d'une dépanneuse */
.theme-garage .admin-menu-item.active {
    background: rgba(210, 186, 147, 0.08);
    color: var(--g-reflect);
    font-weight: 600;
}

.theme-garage .admin-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 5px;
    border-radius: 2px;
    background: var(--g-stripe);
}

.theme-garage .admin-menu-item.active i { color: var(--g-sand); }

/* Employé connecté */
.theme-garage .garage-operator {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--g-line-soft);
    background: rgba(0, 0, 0, 0.18);
}

.theme-garage .garage-operator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--g-line);
    flex-shrink: 0;
}

.theme-garage .garage-operator-info { min-width: 0; flex: 1; }

.theme-garage .garage-operator-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--g-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-garage .garage-operator-grade {
    font-size: 0.78rem;
    color: var(--g-text-2);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-garage .garage-operator-grade::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--grade-color, var(--g-muted));
}

.theme-garage .garage-operator-actions { display: flex; gap: 0.15rem; }

.theme-garage .garage-operator-actions a {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--g-r-sm);
    color: var(--g-muted);
    text-decoration: none;
}

.theme-garage .garage-operator-actions a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--g-text);
}

.theme-garage .garage-scrim { display: none; }

/* --------------------------------------------------------------------------
   En-tête de page
   -------------------------------------------------------------------------- */

.theme-garage .admin-main { min-width: 0; }

.theme-garage .admin-header {
    background: rgba(21, 24, 28, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--g-line-soft);
    padding: 1.1rem 2.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-garage .garage-title {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.theme-garage .garage-title h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.1;
    font-weight: 850;
    font-stretch: 118%;
    letter-spacing: -0.005em;
    color: var(--g-reflect);
}

.theme-garage .garage-title p {
    margin: 0.2rem 0 0;
    color: var(--g-text-2);
    font-size: 0.9rem;
}

.theme-garage .garage-burger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--g-r-sm);
    border: 1px solid var(--g-line);
    background: var(--g-panel);
    color: var(--g-text);
    cursor: pointer;
    flex-shrink: 0;
}

.theme-garage .admin-header-actions { gap: 0.6rem !important; }

/* Plaques d'état (entreprise, service) : le JS du layout met ses couleurs en ligne */
.theme-garage .status-plate {
    background: var(--g-panel) !important;
    color: var(--g-text) !important;
    border: 1px solid var(--g-line);
    border-radius: 999px !important;
    padding: 0.45rem 0.9rem !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    gap: 0.5rem;
    display: inline-flex !important;
    align-items: center;
    transition: border-color 0.15s;
}

.theme-garage .status-plate:hover { border-color: var(--g-sand-dim); }
.theme-garage .status-plate .status-plate-text { display: none; }
.theme-garage .status-plate .status-plate-label { display: inline; }
.theme-garage .status-plate i { font-size: 0.8rem; }
.theme-garage .status-plate.is-on i { color: var(--g-ok); }
.theme-garage .status-plate.is-off i { color: var(--g-signal-hi); }
.theme-garage #service-timer { font-variant-numeric: tabular-nums; color: var(--g-sand); }

/* Menu utilisateur : l'identité est déjà en bas du menu latéral */
.theme-garage .admin-header .user-toggle {
    background: transparent;
    padding: 0.25rem;
    border-radius: 999px;
}

.theme-garage .admin-header .user-toggle > div,
.theme-garage .admin-header .user-toggle > .fa-chevron-down { display: none; }

.theme-garage .admin-header .user-toggle img { border-color: var(--g-line) !important; }

.theme-garage .dropdown {
    background: var(--g-panel);
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-md);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* Contenu */
.theme-garage .admin-content {
    padding: 2rem 2.25rem 4rem;
    background: transparent;
}

/* Messages flash */
.theme-garage .alerts-container .alert {
    background: var(--g-panel);
    border: 1px solid var(--g-line);
    border-left: 4px solid var(--g-sand);
    color: var(--g-text);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.theme-garage .alerts-container .alert-success { border-left-color: var(--g-ok); }
.theme-garage .alerts-container .alert-danger { border-left-color: var(--g-signal-hi); }
.theme-garage .alerts-container .alert-warning { border-left-color: var(--g-warn); }

/* --------------------------------------------------------------------------
   Composants partagés (formulaires, boutons, tableaux)
   -------------------------------------------------------------------------- */

.theme-garage .card {
    background: var(--g-chassis);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-lg);
    box-shadow: none;
    padding: 0;
    margin: 0 0 1.5rem;
    overflow: visible;
}

.theme-garage .card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--g-line-soft);
}

.theme-garage .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--g-line-soft);
}

.theme-garage .card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 750;
    font-stretch: 110%;
    color: var(--g-reflect);
}

.theme-garage .card-title i { color: var(--g-sand); }
.theme-garage .card-body { padding: 1.5rem; }

.theme-garage .card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--g-line-soft);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 0 0 var(--g-r-lg) var(--g-r-lg);
}

.theme-garage h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--g-text);
}

.theme-garage .settings-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0 2rem;
}

.theme-garage .form-group { margin-bottom: 1.2rem; }

.theme-garage .form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--g-text-2);
}

.theme-garage .form-control {
    width: 100%;
    background: var(--g-field);
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-sm);
    color: var(--g-text);
    font-family: var(--g-font);
    font-size: 0.93rem;
    padding: 0.6rem 0.8rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.theme-garage .form-control:hover { border-color: #3c434b; }

.theme-garage .form-control:focus {
    outline: none;
    border-color: var(--g-sand);
    box-shadow: 0 0 0 3px rgba(210, 186, 147, 0.16);
}

.theme-garage select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23b8b2a7' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

.theme-garage select.form-control option,
.theme-garage select.form-control optgroup {
    background: var(--g-panel);
    color: var(--g-text);
}

.theme-garage .form-text,
.theme-garage small.form-text {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--g-muted);
}

.theme-garage .text-muted { color: var(--g-muted) !important; }
.theme-garage .text-danger { color: var(--g-signal-hi) !important; }

.theme-garage input[type="checkbox"],
.theme-garage input[type="radio"] { accent-color: var(--g-signal); }

/* Boutons */
.theme-garage .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.05rem;
    border: 1px solid transparent;
    border-radius: var(--g-r-sm);
    font-family: var(--g-font);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.theme-garage .btn:hover { transform: none; box-shadow: none; }
.theme-garage .btn:active { transform: translateY(1px); }

.theme-garage .btn:disabled,
.theme-garage .btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.theme-garage .btn-primary { background: var(--g-signal); color: #fff; }
.theme-garage .btn-primary:hover:not(:disabled) { background: var(--g-signal-hi); color: #fff; }

.theme-garage .btn-secondary,
.theme-garage .btn-ghost,
.theme-garage .btn-info {
    background: var(--g-panel);
    border-color: var(--g-line);
    color: var(--g-text);
}

.theme-garage .btn-secondary:hover:not(:disabled),
.theme-garage .btn-ghost:hover:not(:disabled),
.theme-garage .btn-info:hover:not(:disabled) {
    background: #2a3037;
    border-color: #414850;
    color: var(--g-reflect);
}

.theme-garage .btn-success { background: var(--g-ok); color: #0c1d15; }
.theme-garage .btn-success:hover:not(:disabled) { background: #5cc892; color: #0c1d15; }

.theme-garage .btn-warning { background: var(--g-sand); color: #1d1a14; }
.theme-garage .btn-warning:hover:not(:disabled) { background: #e0cba7; color: #1d1a14; }

.theme-garage .btn-danger { background: transparent; border-color: rgba(232, 50, 31, 0.5); color: #ff8a7d; }
.theme-garage .btn-danger:hover:not(:disabled) { background: var(--g-signal-soft); border-color: var(--g-signal-hi); color: #ffb0a6; }

.theme-garage .btn-danger-ghost { color: #ff8a7d; }
.theme-garage .btn-danger-ghost:hover:not(:disabled) { border-color: rgba(232, 50, 31, 0.6); color: #ffb0a6; }

.theme-garage .btn-sm { padding: 0.4rem 0.7rem; font-size: 0.83rem; }
.theme-garage .btn-group { display: inline-flex; gap: 0.35rem; }

/* Pastilles */
.theme-garage .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    background: var(--g-panel);
    color: var(--g-text-2);
    border: 1px solid var(--g-line);
}

.theme-garage .badge-success { background: var(--g-ok-soft); color: #7fd6a9; border-color: rgba(76, 183, 130, 0.3); }
.theme-garage .badge-danger { background: var(--g-signal-soft); color: #ff8a7d; border-color: rgba(232, 50, 31, 0.35); }
.theme-garage .badge-warning { background: var(--g-warn-soft); color: #f0c276; border-color: rgba(227, 163, 59, 0.3); }
.theme-garage .badge-info,
.theme-garage .badge-primary { background: rgba(210, 186, 147, 0.12); color: var(--g-sand); border-color: rgba(210, 186, 147, 0.3); }

/* Alertes dans le contenu */
.theme-garage .tab-content .alert,
.theme-garage .garage-alert {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: var(--g-r-md);
    border: 1px solid var(--g-line);
    border-left-width: 4px;
    background: var(--g-panel);
    color: var(--g-text);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.theme-garage .tab-content .alert-info { border-left-color: var(--g-sand); }
.theme-garage .tab-content .alert-success { border-left-color: var(--g-ok); }
.theme-garage .tab-content .alert-warning { border-left-color: var(--g-warn); background: linear-gradient(90deg, var(--g-warn-soft), var(--g-panel) 60%); }
.theme-garage .tab-content .alert-danger,
.theme-garage .garage-alert.is-danger { border-left-color: var(--g-signal-hi); background: linear-gradient(90deg, var(--g-signal-soft), var(--g-panel) 60%); }
.theme-garage .tab-content .alert i { margin-right: 0.35rem; }

/* Tableaux */
.theme-garage .table-responsive { overflow-x: auto; }

.theme-garage .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.theme-garage .table th {
    background: transparent;
    color: var(--g-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--g-line);
}

.theme-garage .table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--g-line-soft);
    color: var(--g-text);
}

.theme-garage .table tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Chiffres des onglets Sauvegardes / Performance : lecture de tableau de bord */
.theme-garage .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    margin: 0 0 1.75rem;
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-md);
    background: var(--g-field);
    overflow: hidden;
}

.theme-garage .stat-card {
    background: transparent;
    border: 0;
    border-right: 1px solid var(--g-line-soft);
    border-radius: 0;
    box-shadow: none;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
}

.theme-garage .stat-card:last-child { border-right: 0; }
.theme-garage .stat-card::before,
.theme-garage .stat-icon { display: none; }
.theme-garage .stat-card:hover { transform: none; box-shadow: none; }

.theme-garage .stat-value {
    font-size: 1.35rem;
    font-weight: 750;
    font-stretch: 110%;
    color: var(--g-reflect);
    margin: 0.2rem 0 0;
}

.theme-garage .stat-label {
    font-size: 0.8rem;
    color: var(--g-muted);
    text-transform: none;
    letter-spacing: 0;
}

/* Barre d'actions des onglets outils */
.theme-garage .settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

/* Interrupteur de l'onglet Maintenance */
.theme-garage .switch { display: inline-flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.theme-garage .switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.theme-garage .slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--g-line);
    border-radius: 999px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.theme-garage .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    background: var(--g-reflect);
    border-radius: 50%;
    transition: transform 0.2s;
}

.theme-garage .switch input:checked + .slider { background: var(--g-signal); }
.theme-garage .switch input:checked + .slider::before { transform: translateX(20px); }
.theme-garage .switch input:focus-visible + .slider { outline: 2px solid var(--g-sand); outline-offset: 2px; }
.theme-garage .switch-label { font-weight: 600; }

/* Fenêtre de restauration (Sauvegardes) */
.theme-garage .settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 9, 11, 0.72);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.theme-garage .settings-modal-content {
    width: 520px;
    max-width: 100%;
    background: var(--g-chassis);
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-lg);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.theme-garage .settings-modal-header,
.theme-garage .settings-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.theme-garage .settings-modal-header { justify-content: space-between; border-bottom: 1px solid var(--g-line-soft); }
.theme-garage .settings-modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 750; }
.theme-garage .settings-modal-footer { justify-content: flex-end; border-top: 1px solid var(--g-line-soft); }
.theme-garage .settings-modal-body { padding: 1.25rem; }

.theme-garage .settings-modal-close {
    background: none;
    border: 0;
    font-size: 1.4rem;
    color: var(--g-text-2);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Page Paramètres : menu des sections + panneau
   -------------------------------------------------------------------------- */

.theme-garage .settings-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.theme-garage .settings-nav {
    position: sticky;
    top: 104px;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.theme-garage .settings-nav-title {
    padding: 0 0.75rem 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--g-sand-dim);
}

.theme-garage .settings-nav .tab-btn {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--g-r-md);
    color: var(--g-text-2);
    text-align: left;
    font-family: var(--g-font);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.theme-garage .settings-nav .tab-btn > i {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: var(--g-r-sm);
    background: var(--g-panel);
    color: var(--g-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s;
}

.theme-garage .tab-btn-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.theme-garage .tab-btn-label { font-weight: 600; font-size: 0.92rem; color: inherit; }

.theme-garage .tab-btn-hint {
    font-size: 0.78rem;
    color: var(--g-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-garage .settings-nav .tab-btn:hover { background: rgba(255, 255, 255, 0.03); color: var(--g-text); }

.theme-garage .settings-nav .tab-btn.active {
    background: var(--g-chassis);
    border-color: var(--g-line);
    color: var(--g-reflect);
}

.theme-garage .settings-nav .tab-btn.active > i { background: var(--g-signal); color: #fff; }

/* Témoin d'état (bot, maintenance) */
.theme-garage .tab-btn-dot {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--g-line);
    flex-shrink: 0;
}

.theme-garage .tab-btn-dot.is-ok { background: var(--g-ok); box-shadow: 0 0 0 3px var(--g-ok-soft); }
.theme-garage .tab-btn-dot.is-alert { background: var(--g-signal-hi); box-shadow: 0 0 0 3px var(--g-signal-soft); }

.theme-garage .settings-panels { min-width: 0; }

/* --------------------------------------------------------------------------
   Onglet Bot
   -------------------------------------------------------------------------- */

/* Bandeau d'état : la pièce forte de la page */
.theme-garage .bot-hero {
    position: relative;
    background: var(--g-chassis);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.theme-garage .bot-hero::before {
    content: '';
    display: block;
    height: 7px;
    background: var(--g-stripe);
    transition: opacity 0.3s;
}

.theme-garage .bot-hero[data-state="inactive"]::before,
.theme-garage .bot-hero[data-state="unknown"]::before {
    opacity: 0.25;
    filter: grayscale(1);
}

.theme-garage .bot-hero-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 1.75rem;
}

.theme-garage .bot-identity { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }

.theme-garage .bot-avatar-wrap { position: relative; flex-shrink: 0; }

.theme-garage .bot-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--g-reflect);
    object-fit: cover;
    border: 3px solid var(--g-panel);
}

.theme-garage .bot-avatar-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--g-chassis);
    background: var(--g-muted);
}

.theme-garage .bot-hero[data-state="online"] .bot-avatar-dot { background: var(--g-ok); }
.theme-garage .bot-hero[data-state="activating"] .bot-avatar-dot,
.theme-garage .bot-hero[data-state="deactivating"] .bot-avatar-dot { background: var(--g-warn); }
.theme-garage .bot-hero[data-state="failed"] .bot-avatar-dot { background: var(--g-signal-hi); }

/* Seul mouvement automatique de la page : le bot en ligne « respire » */
.theme-garage .bot-hero[data-state="online"] .bot-avatar-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--g-ok);
    animation: garage-ping 2.4s ease-out infinite;
}

@keyframes garage-ping {
    0% { transform: scale(1); opacity: 0.7; }
    80%, 100% { transform: scale(2.1); opacity: 0; }
}

.theme-garage .bot-name {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.05;
    font-weight: 900;
    font-stretch: 122%;
    color: var(--g-reflect);
    overflow-wrap: anywhere;
}

.theme-garage .bot-state {
    margin: 0.3rem 0 0;
    font-weight: 600;
    color: var(--g-text-2);
}

.theme-garage .bot-hero[data-state="online"] .bot-state { color: #7fd6a9; }
.theme-garage .bot-hero[data-state="failed"] .bot-state { color: #ff8a7d; }
.theme-garage .bot-hero[data-state="activating"] .bot-state { color: #f0c276; }

.theme-garage .bot-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.theme-garage .bot-controls .btn { padding: 0.65rem 1.1rem; }

/* Relevés, façon compteurs */
.theme-garage .bot-readout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--g-line-soft);
    background: rgba(0, 0, 0, 0.16);
}

.theme-garage .bot-readout > div {
    padding: 0.95rem 1.75rem;
    border-right: 1px solid var(--g-line-soft);
    min-width: 0;
}

.theme-garage .bot-readout > div:last-child { border-right: 0; }

.theme-garage .bot-readout dt {
    font-size: 0.8rem;
    color: var(--g-muted);
    margin-bottom: 0.15rem;
}

.theme-garage .bot-readout dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--g-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sections de la page */
.theme-garage .garage-section {
    background: var(--g-chassis);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-lg);
    padding: 1.4rem 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
}

.theme-garage .garage-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.theme-garage .garage-section h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    font-stretch: 115%;
    color: var(--g-reflect);
}

.theme-garage .garage-section-head p,
.theme-garage .garage-help summary p {
    margin: 0.2rem 0 0;
    color: var(--g-text-2);
    font-size: 0.9rem;
}

.theme-garage .garage-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.theme-garage .garage-guild-select { width: auto; min-width: 220px; }

/* Console */
.theme-garage .bot-terminal {
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-md);
    background: var(--g-field);
    overflow: hidden;
}

.theme-garage .bot-terminal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--g-line-soft);
    background: #0d1013;
    font-size: 0.8rem;
    color: var(--g-muted);
}

.theme-garage .bot-terminal-name { font-family: var(--g-mono); color: var(--g-text-2); }
.theme-garage .bot-terminal-name i { color: var(--g-sand); margin-right: 0.35rem; }
.theme-garage .bot-terminal-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.theme-garage .bot-terminal-meta span[id] { color: var(--g-text-2); font-family: var(--g-mono); }

.theme-garage .bot-terminal-meta .sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--g-line);
}

.theme-garage .bot-console {
    height: 440px;
    overflow: auto;
    padding: 0.85rem 1rem;
    font-family: var(--g-mono);
    font-size: 0.8rem;
    line-height: 1.65;
    color: #cfc9be;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: var(--g-line) transparent;
}

.theme-garage .bot-console:focus-visible { outline-offset: -2px; }
.theme-garage .bot-console .l-time { color: #5d6167; }
.theme-garage .bot-console .l-info { color: var(--g-sand); }
.theme-garage .bot-console .l-warn { color: #f0c276; }
.theme-garage .bot-console .l-error { color: #ff8a7d; }
.theme-garage .bot-console .l-empty { color: var(--g-muted); font-style: italic; }

/* Interrupteurs */
.theme-garage .garage-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--g-text);
    cursor: pointer;
    user-select: none;
}

.theme-garage .garage-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.theme-garage .garage-switch-ui {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: var(--g-line);
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.theme-garage .garage-switch-ui::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--g-reflect);
    transition: transform 0.2s;
}

.theme-garage .garage-switch input:checked + .garage-switch-ui { background: var(--g-signal); }
.theme-garage .garage-switch input:checked + .garage-switch-ui::before { transform: translateX(14px); }
.theme-garage .garage-switch input:focus-visible + .garage-switch-ui { outline: 2px solid var(--g-sand); outline-offset: 2px; }

/* Blocs de réglages */
.theme-garage .garage-block {
    padding: 1.2rem 0 0.2rem;
    border-top: 1px solid var(--g-line-soft);
}

.theme-garage .garage-block + .garage-block,
.theme-garage #botDmForm + #botConfigForm .garage-block:first-child { margin-top: 1.2rem; }

.theme-garage .garage-block-head { margin-bottom: 1rem; max-width: 70ch; }

.theme-garage .garage-block-head h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.theme-garage .garage-block-head h4 i { color: var(--g-sand); margin-right: 0.35rem; font-size: 0.9em; }

.theme-garage .garage-block-head p {
    margin: 0;
    color: var(--g-text-2);
    font-size: 0.88rem;
}

.theme-garage .garage-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.75rem;
    margin-bottom: 1rem;
}

.theme-garage .garage-checks.is-stacked { flex-direction: column; gap: 0.6rem; margin: 1rem 0; }

.theme-garage .garage-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.theme-garage .garage-actions-sticky {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--g-line-soft);
}

.theme-garage .garage-saved { color: #7fd6a9; font-size: 0.88rem; font-weight: 600; }

.theme-garage .garage-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--g-text-2);
    border: 1px dashed var(--g-line);
    border-radius: var(--g-r-md);
}

.theme-garage .garage-narrow { max-width: 360px; margin-top: 1.2rem; }

/* Un salon par type de notification */
.theme-garage .bot-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.theme-garage .bot-channel-card {
    padding: 1rem 1.1rem 1.1rem;
    background: var(--g-panel);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-md);
}

.theme-garage .bot-channel-card h5 {
    margin: 0 0 0.7rem;
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--g-text);
}

.theme-garage .bot-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 1rem;
}

/* Aide repliable */
.theme-garage .garage-help { padding: 0; }

.theme-garage .garage-help summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    list-style: none;
}

.theme-garage .garage-help summary::-webkit-details-marker { display: none; }
.theme-garage .garage-help summary > i { color: var(--g-muted); transition: transform 0.2s; }
.theme-garage .garage-help[open] summary > i { transform: rotate(180deg); }

.theme-garage .garage-help-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem 2.5rem;
    padding: 0.2rem 1.5rem 1.5rem;
}

.theme-garage .garage-commands {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.theme-garage .garage-commands dt { margin: 0; }
.theme-garage .garage-commands dd { margin: 0; color: var(--g-text-2); }
.theme-garage .garage-note { margin: 0; font-size: 0.85rem; color: var(--g-muted); max-width: 60ch; }

/* --------------------------------------------------------------------------
   Écrans moyens et mobiles
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .theme-garage .settings-shell { grid-template-columns: 1fr; gap: 1.25rem; }

    .theme-garage .settings-nav {
        position: static;
        flex-direction: row;
        gap: 0.4rem;
        overflow-x: auto;
        padding-bottom: 0.4rem;
        scrollbar-width: thin;
    }

    .theme-garage .settings-nav-group { display: contents; }
    .theme-garage .settings-nav-title { display: none; }
    .theme-garage .settings-nav .tab-btn { width: auto; flex-shrink: 0; padding: 0.45rem 0.8rem 0.45rem 0.5rem; }
    .theme-garage .tab-btn-hint { display: none; }
    .theme-garage .bot-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .theme-garage .bot-readout > div:nth-child(2) { border-right: 0; }
    .theme-garage .bot-readout > div:nth-child(-n + 2) { border-bottom: 1px solid var(--g-line-soft); }
}

@media (max-width: 960px) {
    .theme-garage .admin-layout { grid-template-columns: minmax(0, 1fr); }

    .theme-garage .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        z-index: 1200;
        transform: translateX(-102%);
        transition: transform 0.25s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .theme-garage .admin-layout.sidebar-open .admin-sidebar { transform: none; }

    .theme-garage .garage-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(8, 9, 11, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }

    .theme-garage .admin-layout.sidebar-open .garage-scrim { opacity: 1; pointer-events: auto; }
    .theme-garage .garage-sidebar-close,
    .theme-garage .garage-burger { display: grid; place-items: center; }

    .theme-garage .admin-header { padding: 0.8rem 1rem; }
    .theme-garage .garage-title h1 { font-size: 1.35rem; }
    .theme-garage .garage-title p { display: none; }
    .theme-garage .admin-content { padding: 1.25rem 1rem 3rem; }
    .theme-garage .bot-status-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .theme-garage .admin-header-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .theme-garage .bot-hero-main { padding: 1.25rem; }
    .theme-garage .bot-name { font-size: 1.5rem; }
    .theme-garage .bot-avatar { width: 52px; height: 52px; }
    .theme-garage .bot-controls { width: 100%; }
    .theme-garage .bot-controls .btn { flex: 1; padding-inline: 0.6rem; }
    .theme-garage .bot-readout > div { padding: 0.8rem 1.25rem; }
    .theme-garage .garage-section { padding: 1.1rem 1rem 1.2rem; }
    .theme-garage .garage-help summary { padding: 1.1rem 1rem; }
    .theme-garage .garage-help-body { padding: 0 1rem 1.2rem; }
    .theme-garage .garage-commands { grid-template-columns: 1fr; gap: 0.15rem; }
    .theme-garage .garage-commands dd { margin-bottom: 0.5rem; }
    .theme-garage .bot-console { height: 360px; font-size: 0.75rem; }
    .theme-garage .card-header,
    .theme-garage .card-body { padding: 1.1rem; }
    .theme-garage .card-footer { padding: 0.9rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .theme-garage *,
    .theme-garage *::before,
    .theme-garage *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Retouches après revue visuelle */
.theme-garage .bot-channel-card { display: flex; flex-direction: column; }
.theme-garage .bot-channel-card > .btn { margin-top: auto; align-self: flex-start; }
.theme-garage .bot-channel-card h5 { min-height: 2.6em; display: flex; align-items: flex-end; }

.theme-garage input[type="file"].form-control { padding: 0.4rem 0.5rem; color: var(--g-text-2); }

.theme-garage input[type="file"]::file-selector-button {
    margin-right: 0.8rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-sm);
    background: var(--g-panel);
    color: var(--g-text);
    font-family: var(--g-font);
    font-weight: 600;
    cursor: pointer;
}

.theme-garage input[type="file"]::file-selector-button:hover { border-color: var(--g-sand-dim); }

.theme-garage { color-scheme: dark; }

/* Cases à cocher « texte à droite » des onglets outils */
.theme-garage .tab-content .form-group > label:has(> input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.92rem;
    cursor: pointer;
}

.theme-garage .tab-content .form-group > label > input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

.theme-garage .tab-content .alert ul { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.theme-garage .tab-content .alert li { margin: 0.15rem 0; }
.theme-garage .tab-content .alert strong { color: var(--g-reflect); }

/* ==========================================================================
   Composants communs à toutes les pages du panel (préfixe g-)
   ========================================================================== */

/* En-tête de page dans le contenu : titre de section + actions */
.theme-garage .g-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.theme-garage .g-page-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    font-stretch: 115%;
    color: var(--g-reflect);
}

.theme-garage .g-page-head p { margin: 0.2rem 0 0; color: var(--g-text-2); font-size: 0.9rem; }
.theme-garage .g-page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Bande de chiffres clés (remplace les cartes de couleur) */
.theme-garage .g-readout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 0 0 1.5rem;
    background: var(--g-chassis);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-lg);
    overflow: hidden;
}

.theme-garage .g-readout-item {
    position: relative;
    padding: 1.05rem 1.35rem 1.15rem;
    border-right: 1px solid var(--g-line-soft);
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.theme-garage .g-readout-item:last-child { border-right: 0; }
a.g-readout-item:hover { background: rgba(255, 255, 255, 0.025); }

.theme-garage .g-readout-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--g-muted);
}

.theme-garage .g-readout-label i { color: var(--g-sand-dim); font-size: 0.85rem; }

.theme-garage .g-readout-value {
    margin-top: 0.3rem;
    font-size: 1.75rem;
    line-height: 1.1;
    font-weight: 800;
    font-stretch: 112%;
    color: var(--g-reflect);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-garage .g-readout-sub { margin-top: 0.2rem; font-size: 0.8rem; color: var(--g-text-2); }

/* Valeur mise en avant (une seule par bande) */
.theme-garage .g-readout-item.is-key .g-readout-value { color: var(--g-sand); }
.theme-garage .g-readout-item.is-alert .g-readout-value { color: #ff8a7d; }
.theme-garage .g-readout-item.is-ok .g-readout-value { color: #7fd6a9; }

/* Panneau de contenu */
.theme-garage .g-panel {
    background: var(--g-chassis);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-lg);
    margin-bottom: 1.5rem;
    min-width: 0;
}

.theme-garage .g-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--g-line-soft);
}

.theme-garage .g-panel-head h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.05rem;
    font-weight: 750;
    font-stretch: 108%;
    color: var(--g-reflect);
}

.theme-garage .g-panel-head h3 i { color: var(--g-sand); font-size: 0.95em; }
.theme-garage .g-panel-head p { margin: 0.15rem 0 0; color: var(--g-text-2); font-size: 0.85rem; }
.theme-garage .g-panel-meta { color: var(--g-text-2); font-size: 0.87rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.theme-garage .g-panel-meta strong { color: var(--g-text); }
.theme-garage .g-panel-body { padding: 1.3rem 1.4rem; }
.theme-garage .g-panel-body.is-flush { padding: 0; }
.theme-garage .g-panel-body.is-flush .table th:first-child,
.theme-garage .g-panel-body.is-flush .table td:first-child { padding-left: 1.4rem; }
.theme-garage .g-panel-body.is-flush .table th:last-child,
.theme-garage .g-panel-body.is-flush .table td:last-child { padding-right: 1.4rem; }
.theme-garage .g-panel-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.4rem;
    border-top: 1px solid var(--g-line-soft);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 0 0 var(--g-r-lg) var(--g-r-lg);
}

/* Grilles de mise en page */
.theme-garage .g-grid { display: grid; gap: 1.5rem; align-items: start; }
.theme-garage .g-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.theme-garage .g-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.theme-garage .g-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.theme-garage .g-grid-side { grid-template-columns: minmax(260px, 1fr) minmax(0, 2.4fr); }
.theme-garage .g-grid > .g-panel { margin-bottom: 0; }

@media (max-width: 1100px) {
    .theme-garage .g-grid-2,
    .theme-garage .g-grid-3,
    .theme-garage .g-grid-main,
    .theme-garage .g-grid-side { grid-template-columns: minmax(0, 1fr); }
}

/* Liste « libellé : valeur » */
.theme-garage .g-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.25rem; margin: 0; font-size: 0.92rem; }
.theme-garage .g-dl dt { color: var(--g-muted); }
.theme-garage .g-dl dd { margin: 0; color: var(--g-text); min-width: 0; overflow-wrap: anywhere; }
.theme-garage .g-dl.is-stacked { grid-template-columns: 1fr; gap: 0.1rem; }
.theme-garage .g-dl.is-stacked dd { margin-bottom: 0.75rem; }

/* Onglets horizontaux */
.theme-garage .g-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.3rem;
    margin-bottom: 1.25rem;
    background: var(--g-chassis);
    border: 1px solid var(--g-line-soft);
    border-radius: var(--g-r-md);
    overflow-x: auto;
}

.theme-garage .g-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: var(--g-r-sm);
    background: transparent;
    color: var(--g-text-2);
    font-family: var(--g-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.theme-garage .g-tab:hover { color: var(--g-text); background: rgba(255, 255, 255, 0.03); }
.theme-garage .g-tab.active,
.theme-garage .g-tab[aria-selected="true"] { background: var(--g-panel); color: var(--g-reflect); box-shadow: inset 0 -2px 0 var(--g-signal); }
.theme-garage .g-tab .g-count { font-size: 0.75rem; color: var(--g-muted); font-weight: 600; }

/* État vide */
.theme-garage .g-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--g-text-2);
}

.theme-garage .g-empty > i {
    display: block;
    font-size: 1.6rem;
    color: var(--g-sand-dim);
    margin-bottom: 0.75rem;
}

.theme-garage .g-empty strong { display: block; color: var(--g-text); font-size: 1rem; margin-bottom: 0.25rem; }
.theme-garage .g-empty p { margin: 0 auto; max-width: 46ch; font-size: 0.9rem; }
.theme-garage .g-empty .btn { margin-top: 1rem; }

/* Avatar / initiales */
.theme-garage .g-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--g-panel);
    border: 2px solid var(--g-line);
    display: inline-grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--g-sand);
}

.theme-garage .g-avatar.is-lg { width: 88px; height: 88px; font-size: 1.6rem; border-width: 3px; }
.theme-garage .g-person { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.theme-garage .g-person-name { font-weight: 600; color: var(--g-text); }
.theme-garage .g-person-sub { font-size: 0.8rem; color: var(--g-muted); }

/* Pastille de grade (couleur venant de la base, passée en --tag) */
.theme-garage .g-grade {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--g-line);
    background: var(--g-panel);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--g-text);
}

.theme-garage .g-grade::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tag, var(--g-muted));
}

/* Montants et nombres */
.theme-garage .g-money { font-weight: 700; color: var(--g-text); white-space: nowrap; }
.theme-garage .g-money.is-total { font-size: 1.4rem; font-weight: 800; font-stretch: 110%; color: var(--g-sand); }
.theme-garage .g-minus { color: #7fd6a9; }
.theme-garage .g-plus { color: #f0c276; }

/* Barre de filtres */
.theme-garage .g-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

.theme-garage .g-filters .form-group { margin: 0; min-width: 160px; flex: 1; }
.theme-garage .g-filters .g-filters-actions { display: flex; gap: 0.5rem; }

/* Fenêtres modales des pages */
.theme-garage .modal-content,
.theme-garage .g-modal {
    background: var(--g-chassis);
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-lg);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    color: var(--g-text);
}

.theme-garage .modal-header { border-bottom: 1px solid var(--g-line-soft); background: transparent; }
.theme-garage .modal-footer { border-top: 1px solid var(--g-line-soft); }
.theme-garage .modal-title { font-weight: 750; color: var(--g-reflect); }

/* Pagination */
.theme-garage .pagination { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1.25rem; }
.theme-garage .page-link,
.theme-garage .pagination a,
.theme-garage .pagination span {
    min-width: 36px;
    padding: 0.4rem 0.7rem;
    border-radius: var(--g-r-sm);
    border: 1px solid var(--g-line);
    background: var(--g-panel);
    color: var(--g-text-2);
    text-align: center;
    text-decoration: none;
    font-size: 0.87rem;
}

.theme-garage .page-link.active,
.theme-garage .pagination .active { background: var(--g-signal); border-color: var(--g-signal); color: #fff; }

/* Couleurs de graphiques (Chart.js lit ces valeurs via getComputedStyle) */
.theme-garage {
    --g-chart-1: #d2ba93;
    --g-chart-2: #d21a0e;
    --g-chart-3: #4cb782;
    --g-chart-4: #6f8fa8;
    --g-chart-5: #e3a33b;
    --g-chart-6: #9c8c70;
    --g-chart-grid: rgba(255, 255, 255, 0.06);
}

/* Champs sans classe .form-control (anciennes vues) : même rendu que les champs du thème */
.theme-garage input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(.form-control),
.theme-garage select:not(.form-control),
.theme-garage textarea:not(.form-control) {
    width: 100%;
    box-sizing: border-box;
    background: var(--g-field);
    border: 1px solid var(--g-line);
    border-radius: var(--g-r-sm);
    color: var(--g-text);
    font-family: var(--g-font);
    font-size: 0.93rem;
    padding: 0.6rem 0.8rem;
}

.theme-garage input:not([type="checkbox"]):not([type="radio"]):not(.form-control):focus,
.theme-garage select:not(.form-control):focus,
.theme-garage textarea:not(.form-control):focus {
    outline: none;
    border-color: var(--g-sand);
    box-shadow: 0 0 0 3px rgba(210, 186, 147, 0.16);
}

/* Page Paramètres sur mobile : le menu des sections défile sans élargir la page */
.theme-garage .settings-shell > * { min-width: 0; }
.theme-garage .settings-nav { max-width: 100%; }
