/* ==========================================================================
   Gantt Intervention Planner — Styles
   ========================================================================== */

/* --- Variables --- */
:root {
    --color-maintenance: #4CAF50;
    --color-deploiement: #2196F3;
    --color-default: #9E9E9E;
    --color-primary: #2c3e50;
    --color-secondary: #7f8c8d;
    --color-success: #27ae60;
    --color-error: #e74c3c;
    --color-warning: #f39c12;
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-border: #dee2e6;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --radius: 6px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

/* Ne pas appliquer hidden aux éléments internes de Frappe Gantt */
.gantt [hidden],
.gantt-container [hidden] {
    display: initial;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* --- Header --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow);
}

.app-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

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

.user-info {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* --- Main --- */
.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1a252f;
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-bg);
}

.btn-dismiss {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    color: var(--color-text-muted);
}

.btn-dismiss:hover {
    color: var(--color-text);
}

/* --- Error Zone --- */
.error-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #fdecea;
    border: 1px solid var(--color-error);
    border-radius: var(--radius);
}

.error-message {
    margin: 0;
    color: var(--color-error);
    font-weight: 500;
}

/* --- Validation Warnings --- */
.validation-warnings {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #fff8e1;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius);
    position: relative;
}

.warning-title {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--color-warning);
}

.warning-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.warning-item {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.warning-item:last-child {
    border-bottom: none;
}

.warning-icon {
    margin-right: 0.3rem;
}

.warning-more {
    font-style: italic;
    opacity: 0.7;
}

.validation-warnings .btn-dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* --- Filters --- */
.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    min-width: 160px;
}

.filter-group select[multiple] {
    min-height: 60px;
}

.filter-actions {
    justify-content: flex-end;
}

/* --- View Controls --- */
.view-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-view {
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view.active {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-view:hover:not(.active) {
    background-color: var(--color-bg);
}

/* --- Loading Indicator --- */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* --- Gantt Container --- */
.gantt-container {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

/* --- Legend --- */
.legend {
    padding: 1rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.legend h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.legend-items {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color-maintenance {
    background-color: var(--color-maintenance);
}

.legend-color-deploiement {
    background-color: var(--color-deploiement);
}

.legend-color-default {
    background-color: var(--color-default);
}

/* --- Modal --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* --- Form elements inside modal --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.15);
}

.field-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--color-error);
}

.recipient-input-group {
    display: flex;
    gap: 0.5rem;
}

.recipient-input-group input {
    flex: 1;
}

.recipients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 1.5rem;
}

.recipient-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.8rem;
}

.recipient-tag .remove-recipient {
    cursor: pointer;
    color: var(--color-text-muted);
    font-weight: bold;
}

.recipient-tag .remove-recipient:hover {
    color: var(--color-error);
}

/* --- Format options --- */
.format-options {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* --- Invitation warning --- */
.invitation-warning {
    padding: 0.6rem 0.8rem;
    background-color: #fff8e1;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--color-warning);
}

/* --- Gantt popup personnalisé --- */
.popup-wrapper {
    display: none !important;
}

.gantt-tooltip {
    position: absolute;
    z-index: 9999;
    background: #2c3e50;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    max-width: 300px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* --- Gantt bar colors (Frappe Gantt overrides) --- */
.bar-maintenance .bar-progress,
.bar-maintenance .bar {
    fill: var(--color-maintenance) !important;
    rx: 12;
    ry: 12;
}

.bar-deploiement .bar-progress,
.bar-deploiement .bar {
    fill: var(--color-deploiement) !important;
    rx: 12;
    ry: 12;
}

.bar-default .bar-progress,
.bar-default .bar {
    fill: var(--color-default) !important;
    rx: 12;
    ry: 12;
}

/* Ligne verticale du jour (today marker) */
.gantt .today-highlight {
    fill: rgba(255, 0, 0, 0.1) !important;
    opacity: 1 !important;
}

.gantt .current-date-highlight {
    stroke: #e74c3c !important;
    stroke-width: 2px !important;
    stroke-dasharray: 4, 4;
}

/* --- Invitation status indicator on Gantt bars --- */
.invitation-status {
    font-size: 10px;
    cursor: default;
}

.invitation-status.sent {
    fill: var(--color-success);
}

.invitation-status.not-sent {
    fill: var(--color-text-muted);
}

/* --- Login Screen --- */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-card {
    text-align: center;
    padding: 3rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 420px;
}

.login-card h2 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    color: var(--color-primary);
    letter-spacing: 0.1em;
}

.login-card p {
    margin: 0 0 2rem 0;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.btn-login {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem 1rem;
    }

    .app-main {
        padding: 1rem;
    }

    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select,
    .filter-group input[type="date"] {
        min-width: auto;
        width: 100%;
    }

    .legend-items {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   Améliorations UX — Toasts, recherche, synthèse, barre d'actions
   ========================================================================== */

/* --- Toasts --- */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 90vw;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 240px;
    max-width: 420px;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    border-left: 4px solid var(--color-secondary);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { border-left-color: var(--color-success); }
.toast-error   { border-left-color: var(--color-error); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info    { border-left-color: var(--color-deploiement); }

.toast-icon { flex-shrink: 0; }
.toast-text { flex: 1; font-size: 0.85rem; line-height: 1.4; }

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0 0.2rem;
}

.toast-close:hover { color: var(--color-text); }

@media (prefers-reduced-motion: reduce) {
    .toast { transition: opacity 0.1s linear; transform: none; }
    .toast-visible { transform: none; }
}

/* --- Barre d'outils (recherche + synthèse + actions) --- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.toolbar-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
}

.toolbar-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.toolbar-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.15);
}

.toolbar-search::before {
    content: "🔍";
    position: absolute;
    left: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.6;
    pointer-events: none;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* --- Bandeau de synthèse (compteurs) --- */
.summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    white-space: nowrap;
}

.summary-chip strong { color: var(--color-text); }
.summary-chip.alert { border-color: var(--color-warning); color: var(--color-warning); }
.summary-chip.alert strong { color: var(--color-warning); }

/* --- Bouton dans le message "aucun résultat" --- */
.no-results .btn {
    margin-top: 1rem;
}

/* --- Responsive toolbar --- */
@media (max-width: 768px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-actions { justify-content: space-between; }
}

/* ==========================================================================
   THÈME GLASSMORPHISM (verre dépoli)
   Appliqué aux panneaux périphériques uniquement. Le Gantt (zone centrale)
   garde son fond blanc pour la lisibilité et la performance.
   Bloc additif : surcharge l'existant sans le réécrire.
   ========================================================================== */

:root {
    --glass-bg: rgba(255, 255, 255, 0.14);
    --glass-bg-strong: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.28);
    --glass-blur: blur(14px);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --glass-text: #ffffff;
    --glass-text-muted: rgba(255, 255, 255, 0.75);
}

/* Fond dégradé : indispensable pour que le flou ait quelque chose à flouter */
body {
    background-color: #2c3e50;
    background-image:
        radial-gradient(circle at 85% 12%, rgba(255, 180, 80, 0.25) 0, transparent 38%),
        radial-gradient(circle at 10% 85%, rgba(80, 200, 255, 0.22) 0, transparent 42%),
        linear-gradient(135deg, #2c3e50 0%, #4a6b8a 50%, #6b8fb0 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* --- Barre d'outils --- */
.toolbar {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
}

.toolbar-search input {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--glass-border);
    color: var(--glass-text);
    border-radius: 10px;
}

.toolbar-search input::placeholder { color: var(--glass-text-muted); }

.toolbar-search input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.toolbar-search::before { opacity: 0.85; }

/* --- Chips de synthèse --- */
.summary-bar { color: var(--glass-text-muted); }

.summary-chip {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--glass-text-muted);
}

.summary-chip strong { color: var(--glass-text); }

.summary-chip.alert {
    background: rgba(243, 156, 18, 0.22);
    border-color: rgba(243, 156, 18, 0.55);
    color: #ffe3b0;
}

.summary-chip.alert strong { color: #fff; }

/* --- Carte de filtres --- */
.filters-section {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
    /* Au-dessus des rangées suivantes (vue + Gantt) pour que les menus
       déroulants débordent par-dessus au lieu d'être masqués ou tronqués. */
    position: relative;
    z-index: 100;
}

/* Les rangées situées sous les filtres restent sous les menus ouverts */
.view-controls,
.gantt-container {
    position: relative;
    z-index: 1;
}

.filter-group label { color: var(--glass-text); }

.filter-group select,
.filter-group input[type="date"] {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--glass-border);
    color: var(--glass-text);
    border-radius: 10px;
}

.filter-group select option {
    /* Les <option> natives restent lisibles sur fond clair (rendu OS) */
    color: var(--color-text);
    background: var(--color-surface);
}

/* --- Légende --- */
.legend {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
    color: var(--glass-text);
}

.legend h3 { color: var(--glass-text); }
.legend-item { color: var(--glass-text-muted); }

/* --- Message "aucun résultat" --- */
.no-results {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
    color: var(--glass-text);
}

/* --- Boutons secondaires sur verre --- */
.btn-secondary {
    background: var(--glass-bg-strong);
    color: var(--glass-text);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
}

/* --- Toasts --- */
.toast {
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    color: var(--glass-text);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.toast-close { color: var(--glass-text-muted); }
.toast-close:hover { color: var(--glass-text); }

/* --- Modal d'invitation en verre --- */
.modal-content {
    background: rgba(40, 55, 75, 0.55);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
    color: var(--glass-text);
}

.modal-header h2 { color: var(--glass-text); }
.modal-overlay { background: rgba(0, 0, 0, 0.45); }

/* --- Panneau d'avertissements de validation --- */
.validation-warnings {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--glass-text);
    border-radius: 14px;
}

.validation-warnings .warning-title,
.validation-warnings .warning-list { color: var(--glass-text); }

/* --- Repli si backdrop-filter non supporté (vieux navigateur) --- */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .toolbar,
    .filters-section,
    .legend,
    .no-results,
    .toast,
    .summary-chip,
    .validation-warnings { background: rgba(44, 62, 80, 0.85); }
    .modal-content { background: rgba(40, 55, 75, 0.95); }
}

/* ==========================================================================
   GLASSMORPHISM — Raffinements (sélecteurs + intégration du Gantt)
   ========================================================================== */

/* --- Sélecteurs multi-lignes : fond verre foncé lisible, coins arrondis --- */
.filter-group select,
.filter-group select[multiple],
.filter-group input[type="date"] {
    background: rgba(20, 30, 45, 0.35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--glass-text);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Les options natives : texte clair sur fond foncé translucide,
   et surbrillance de sélection cohérente avec le thème */
.filter-group select option {
    background: #2c3e50;
    color: #fff;
    padding: 2px 4px;
}

.filter-group select option:checked {
    background: var(--color-deploiement);
    color: #fff;
}

/* L'icône du date-picker reste visible sur fond foncé (navigateurs WebKit) */
.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8;
}

.filter-group input[type="date"]::placeholder { color: var(--glass-text-muted); }

/* --- Boutons de vue (Jour / Semaine / Mois) en verre --- */
.btn-view {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--glass-border);
    color: var(--glass-text-muted);
}

.btn-view:hover:not(.active) { background: rgba(255, 255, 255, 0.2); }

.btn-view.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
    border-color: rgba(255, 255, 255, 0.9);
}

/* --- Intégration du Gantt dans une carte de verre ---
   On encadre le conteneur (coins arrondis, bordure verre, ombre) sans flouter
   la grille interne : le fond du planning reste clair et lisible, mais légèrement
   adouci et détaché du dégradé au lieu d'être un rectangle blanc brut. */
.gantt-container {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 6px;
    overflow: hidden;
    overflow-x: auto;
}

/* Léger arrondi sur le SVG du Gantt pour épouser la carte */
.gantt-container .gantt,
.gantt-container svg { border-radius: 12px; }

/* ==========================================================================
   MultiSelect — menu déroulant à cases à cocher (remplace les <select multiple>)
   Style verre dépoli, cohérent avec le thème.
   ========================================================================== */

.ms-root {
    position: relative;
    min-width: 180px;
}

/* Quand un menu est ouvert, son conteneur passe au-dessus des rangées suivantes
   (view-controls, gantt) pour que le panneau ne soit ni masqué ni tronqué. */
.ms-root.ms-open {
    z-index: 2000;
}

/* Bouton d'ouverture */
.ms-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.7rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--glass-text);
    background: rgba(20, 30, 45, 0.35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    transition: border-color 0.15s, background 0.15s;
}

.ms-toggle:hover { background: rgba(20, 30, 45, 0.45); }

.ms-root.ms-open .ms-toggle {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.ms-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-label-empty { color: var(--glass-text-muted); }

.ms-caret {
    flex-shrink: 0;
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform 0.2s;
}

.ms-root.ms-open .ms-caret { transform: rotate(180deg); }

/* Panneau déroulant */
.ms-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2001;
    min-width: 100%;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.35rem;
    background: rgba(40, 55, 75, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Items cochables */
.ms-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--glass-text);
    cursor: pointer;
    user-select: none;
}

.ms-item:hover { background: rgba(255, 255, 255, 0.12); }

.ms-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--color-deploiement);
    cursor: pointer;
}

.ms-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Repli si backdrop-filter non supporté */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .ms-toggle { background: rgba(44, 62, 80, 0.9); }
    .ms-panel { background: rgba(40, 55, 75, 0.97); }
}

/* ==========================================================================
   Feature 3 — Statuts sur les barres du Gantt
   ========================================================================== */

/* Bordure d'alerte quand invitation ou matériel manquant */
.gantt .bar-wrapper .bar.bar-has-alert {
    stroke: #e74c3c;
    stroke-width: 2px;
}

.status-badge { pointer-events: none; }

/* ==========================================================================
   Feature 2 — Fiche détail (panneau latéral)
   ========================================================================== */

.detail-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.35);
    z-index: 11500;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.detail-overlay-open { opacity: 1; pointer-events: auto; }

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    z-index: 11600;
    display: flex;
    flex-direction: column;
    background: rgba(40, 55, 75, 0.9);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    color: var(--glass-text, #fff);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.detail-open { transform: translateX(0); }

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.detail-title { margin: 0; font-size: 1rem; font-weight: 600; }

.detail-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.3rem;
}
.detail-close:hover { color: #fff; }

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.detail-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.875rem;
}

.detail-label {
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    padding-top: 2px;
}

.detail-value {
    text-align: right;
    word-break: break-word;
}

.detail-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}
.detail-status.ok { color: #6ee7a0; }
.detail-status.ko { color: #ff9a9a; }

.detail-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
    .detail-panel, .detail-overlay { transition: none; }
}

/* --- Bouton d'action dans un toast (Feature 4 : Annuler) --- */
.toast-action {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--glass-text, #fff);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.3); }

/* ==========================================================================
   Feature 5 — Envoi groupé d'invitations (panneau de sélection)
   ========================================================================== */

.bulk-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 11700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.bulk-overlay-open { opacity: 1; pointer-events: auto; }

.bulk-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: 520px;
    max-width: 92vw;
    max-height: 80vh;
    z-index: 11800;
    display: flex;
    flex-direction: column;
    background: rgba(40, 55, 75, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    color: var(--glass-text, #fff);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.bulk-open { opacity: 1; transform: translate(-50%, -50%); }

.bulk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.bulk-header h2 { margin: 0; font-size: 1rem; }

.bulk-close {
    background: none; border: none; color: rgba(255,255,255,0.7);
    font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.3rem;
}
.bulk-close:hover { color: #fff; }

.bulk-intro {
    margin: 0;
    padding: 0.75rem 1.2rem 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.bulk-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.2rem;
}

.bulk-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}
.bulk-item:hover { background: rgba(255, 255, 255, 0.1); }
.bulk-item input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--color-deploiement); flex-shrink: 0;
}

.bulk-empty {
    padding: 1.5rem 1.2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
}

.bulk-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .bulk-panel, .bulk-overlay { transition: none; }
}

/* ==========================================================================
   Multi-projets — barre d'onglets de sélection de projet
   ========================================================================== */

/* Marque + onglets regroupés à gauche du header */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    min-width: 0;
}

.project-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Onglets dans le header foncé : pills translucides */
.project-tab {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}

.project-tab:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

.project-tab.active {
    background: #fff;
    color: var(--color-primary);
    border-color: #fff;
}

@media (max-width: 640px) {
    .header-brand { gap: 0.5rem; }
    .project-tab { padding: 0.3rem 0.7rem; font-size: 0.72rem; }
}

/* --- Fiche détail : liste des tâches agrégées (sous-projet) --- */
.detail-tasks { margin-top: 1rem; }
.detail-tasks-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}
.detail-task {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.detail-task-main { font-size: 0.875rem; font-weight: 600; }
.detail-task-sub {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.15rem;
}

/* ==========================================================================
   Pastilles d'alerte compactes (barre d'outils) + liste des sites au clic
   ========================================================================== */

.alert-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: #ffd0d0;
    background: rgba(231, 76, 60, 0.22);
    border: 1px solid rgba(231, 76, 60, 0.55);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background 0.15s, border-color 0.15s;
}

.alert-badge:hover { background: rgba(231, 76, 60, 0.35); }

.alert-badge.active {
    background: rgba(231, 76, 60, 0.5);
    border-color: #e74c3c;
    color: #fff;
}

.alert-badge strong { color: #fff; }
.alert-badge-icon { line-height: 1; }
.alert-badge-label { opacity: 0.9; }

/* Pastille "tout est à jour" */
.alert-badge.ok {
    color: #6ee7a0;
    background: rgba(39, 174, 96, 0.2);
    border-color: rgba(39, 174, 96, 0.5);
    cursor: default;
}

/* Panneau de détail : liste des sites concernés par le type sélectionné */
.alert-detail {
    margin-bottom: 1rem;
    padding: 0.9rem 1.1rem;
    background: rgba(40, 55, 75, 0.85);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--glass-text, #fff);
}

.alert-detail-head {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.alert-detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.alert-site-chip {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-family: inherit;
}

.alert-site-chip.clickable { cursor: pointer; }
.alert-site-chip.clickable:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}
.alert-site-chip:disabled { opacity: 0.6; cursor: default; }

/* Compteur total cliquable (réinitialise les filtres) */
.summary-chip-total {
    cursor: pointer;
    font: inherit;
}
.summary-chip-total:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Liste des interventions (clic sur le compteur total) */
.summary-chip-total.active {
    background: #fff;
    color: var(--color-primary);
}

.intervention-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.3rem;
    max-height: 320px;
    overflow-y: auto;
}

.intervention-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    text-align: left;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--glass-text, #fff);
    cursor: pointer;
    transition: background 0.12s;
}
.intervention-list-item:hover { background: rgba(255, 255, 255, 0.2); }
.il-main { font-size: 0.85rem; font-weight: 600; }
.il-sub { font-size: 0.76rem; color: rgba(255, 255, 255, 0.7); }

/* ==========================================================================
   RESPONSIVE MOBILE — adaptation complète pour téléphones (≤ 640px)
   S'ajoute aux règles 768px existantes ; cible les éléments ajoutés
   (header+onglets, barre d'outils, pastilles, fiche, Gantt).
   ========================================================================== */
@media (max-width: 640px) {

    /* --- Header : marque + onglets + actions empilés --- */
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0.7rem 0.9rem;
    }
    .app-header h1 { font-size: 1.15rem; }
    .header-brand { gap: 0.6rem; }
    .header-actions { justify-content: flex-end; }

    /* --- Barre d'outils : tout en colonne, pleine largeur --- */
    .toolbar { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .toolbar-search { flex: 1 1 auto; min-width: 0; }
    .toolbar-actions { flex-wrap: wrap; gap: 0.4rem; }
    .toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }

    /* --- Compteurs + pastilles : défilement propre, pas de débordement --- */
    .summary-bar, .alert-badges { width: 100%; }
    .alert-badges { gap: 0.35rem; }
    /* Les pastilles passent à la ligne plutôt que de déborder ; libellés gardés */
    .alert-badge { font-size: 0.75rem; padding: 0.3rem 0.6rem; }

    /* --- Filtres déjà en colonne via 768px ; menus pleine largeur --- */
    .ms-root, .ms-toggle { width: 100%; }

    /* --- Sélecteurs de vue : pleine largeur répartie --- */
    .view-controls { flex-wrap: wrap; }
    .view-controls .btn-view { flex: 1 1 30%; text-align: center; }

    /* --- Gantt : hauteur mini utilisable + défilement tactile --- */
    .gantt-container {
        -webkit-overflow-scrolling: touch;
        max-height: 70vh;
    }

    /* --- Fiche détail : plein écran (plus de panneau étroit) --- */
    .detail-panel { width: 100%; max-width: 100%; }

    /* --- Panneau envoi groupé : quasi plein écran --- */
    .bulk-panel { width: 96vw; max-height: 85vh; }

    /* --- Détail d'alerte / liste : chips plus aérés au doigt --- */
    .alert-site-chip, .intervention-list-item { padding: 0.5rem 0.7rem; }

    /* --- Inputs ≥ 16px : empêche le zoom auto d'iOS au focus --- */
    .toolbar-search input,
    .filter-group select,
    .filter-group input[type="date"],
    .ms-toggle {
        font-size: 16px;
    }
}

/* ==========================================================================
   Sous-sélecteur d'affichage (Gantt / Kanban) + vue Kanban
   ========================================================================== */

.display-mode {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.btn-mode {
    background: var(--glass-bg, rgba(255,255,255,0.14));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.28));
    color: var(--glass-text-muted, rgba(255,255,255,0.75));
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-mode:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.btn-mode.active { background: #fff; color: var(--color-primary); border-color: #fff; }

/* --- Tableau Kanban --- */
.kanban-container {
    margin-bottom: 1.5rem;
}

.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.kanban-column {
    flex: 1 1 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 0.5rem;
}

.kanban-col-count {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.05rem 0.45rem;
}

.kanban-col-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    overflow-y: auto;
    max-height: 62vh;
}

.kanban-card {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.95);
    color: #1f2a36;
    border: none;
    border-left: 3px solid var(--color-default);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 0.1s, box-shadow 0.1s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2); }

.kanban-card-centre { font-size: 0.82rem; font-weight: 700; }
.kanban-card-task { font-size: 0.76rem; color: #4a5a68; margin-top: 0.1rem; }
.kanban-card-sub { font-size: 0.72rem; color: #6c7a88; margin-top: 0.15rem; }

.kanban-col-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.8rem 0;
    font-size: 0.85rem;
}

/* Mobile : colonnes qui défilent horizontalement, largeur fixe lisible */
@media (max-width: 640px) {
    .kanban-column { min-width: 78vw; }
}

/* ==========================================================================
   Vues Matériel par centre + Stats (projet agrégé)
   ========================================================================== */

.materiel-container, .stats-container { margin-bottom: 1.5rem; }

.ms-empty { color: rgba(255,255,255,0.7); text-align: center; padding: 1.5rem; }

/* --- Matériel par centre : grille de cartes + tuiles carrées --- */
.materiel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
}
.materiel-centre {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.materiel-centre-head {
    display: block;
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
}
.materiel-centre-head:hover { background: rgba(255, 255, 255, 0.18); }

/* Tuiles carrées d'équipement */
.materiel-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 0.5rem;
    padding: 0.7rem;
}
.materiel-tile {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    padding: 0.4rem;
    background: rgba(40, 55, 75, 0.7);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.materiel-tile input {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border: 1px solid var(--glass-border, rgba(255,255,255,0.25));
    border-radius: 6px;
}
.materiel-tile-qt {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
}
.materiel-tile-name {
    font-size: 0.72rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.72);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Navigateurs sans aspect-ratio : repli hauteur mini */
@supports not (aspect-ratio: 1 / 1) {
    .materiel-tile { min-height: 84px; }
}

/* --- Stats : grille de cartes --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
}
.stats-card {
    background: rgba(40, 55, 75, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 12px;
    padding: 1rem;
    color: var(--glass-text, #fff);
}
.stats-card-wide { grid-column: 1 / -1; }
.stats-card-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.7rem;
}
.stats-big { font-size: 2rem; font-weight: 700; line-height: 1; }
.stats-sub { font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); margin-top: 0.4rem; }
.stats-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.6rem;
}
.stats-progress-fill { height: 100%; background: #27ae60; border-radius: 999px; }

.stats-status-row, .stats-eq-row, .stats-centre-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}
.stats-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.stats-status-name { flex: 1; }
.stats-status-num { color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums; }
.stats-eq-row { justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.08); }
.stats-centre-row { justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.08); }
.stats-centre-prog { font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.85); }

/* ==========================================================================
   Fiche détail — édition des champs de tâche (statut / quantité / technicien)
   ========================================================================== */

.detail-task-edit {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.detail-edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-edit-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.55);
}

.detail-edit-input {
    width: 100%;
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: #fff;
    background: rgba(20, 30, 45, 0.45);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.28));
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.detail-edit-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.detail-edit-input option { background: #2c3e50; color: #fff; }

/* États de sauvegarde */
.detail-edit-input.edit-saving { opacity: 0.6; }
.detail-edit-input.edit-ok { border-color: #27ae60; box-shadow: 0 0 0 2px rgba(39,174,96,0.3); }
.detail-edit-input.edit-ko { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231,76,60,0.3); }

/* --- Kanban : drag & drop --- */
.kanban-card-draggable { cursor: grab; }
.kanban-card-draggable:active { cursor: grabbing; }
.kanban-card-dragging { opacity: 0.5; }
.kanban-column-over {
    outline: 2px dashed rgba(255, 255, 255, 0.5);
    outline-offset: -4px;
    background: rgba(255, 255, 255, 0.16);
}

/* --- Kanban : barre de filtres (tâche + technicien) --- */
.kanban-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}
.kanban-filter {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.kanban-filter-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.6);
}
.kanban-filter-select {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: #fff;
    background: rgba(20, 30, 45, 0.45);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.28));
    border-radius: 8px;
    min-width: 160px;
}
.kanban-filter-select option { background: #2c3e50; color: #fff; }
.kanban-filter-reset {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: #ffd0d0;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: 8px;
    cursor: pointer;
}
.kanban-filter-reset:hover { background: rgba(231, 76, 60, 0.35); }

/* Quantité éditable directement sur une tuile Matériel */
.materiel-tile-input {
    width: 100%;
    max-width: 64px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary, #2c3e50);
    background: #fff;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 8px;
    padding: 0.2rem;
}
.materiel-tile-input:focus {
    outline: none;
    border-color: var(--color-deploiement, #2196F3);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}
.materiel-tile-input.edit-saving { opacity: 0.6; }
.materiel-tile-input.edit-ok { border-color: #27ae60; box-shadow: 0 0 0 2px rgba(39,174,96,0.3); }
.materiel-tile-input.edit-ko { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231,76,60,0.3); }

/* ==========================================================================
   Rapport d'intervention (modèle UCPA) — formulaire + impression
   ========================================================================== */

.report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 12000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.report-overlay-open { opacity: 1; pointer-events: auto; }

.report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: 820px;
    max-width: 94vw;
    max-height: 92vh;
    z-index: 12001;
    display: flex;
    flex-direction: column;
    background: #eef1f4;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}
.report-open { opacity: 1; transform: translate(-50%, -50%); }

.report-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-primary, #2c3e50);
    flex-shrink: 0;
}

/* Feuille blanche imprimable */
.report-sheet {
    background: #fff;
    color: #1f2a36;
    margin: 1rem;
    padding: 2.5rem;
    overflow-y: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.report-logo {
    color: #e8530e;
    font-weight: 800;
    font-size: 34px;
    letter-spacing: -1px;
    margin-bottom: 18px;
}
.report-title { font-size: 16px; margin: 0 0 16px; }

.report-info-table { border-collapse: collapse; width: 100%; max-width: 640px; margin-bottom: 22px; }
.report-info-table td { border: 1px solid #333; padding: 7px 10px; font-size: 13px; }
.report-info-label { width: 45%; background: #fafafa; }
.report-cell-input {
    width: 100%; border: none; font: inherit; font-size: 13px; color: #1f2a36; background: transparent;
}
.report-cell-input:focus { outline: 1px dashed #2196F3; }

.report-field-label { font-weight: 700; font-size: 13px; margin: 16px 0 6px; }
.report-check { display: flex; align-items: center; gap: 0.5rem; font-size: 13px; margin: 3px 0; }
.report-textarea {
    width: 100%;
    min-height: 48px;
    font: inherit;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #cdd4da;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}
.report-textarea-big { min-height: 72px; }

.report-comments-table { border-collapse: collapse; width: 100%; max-width: 640px; margin-top: 8px; }
.report-comments-table th { border: 1px solid #333; padding: 7px 10px; font-size: 12px; text-align: left; font-weight: 600; }
.report-comments-table td { border: 1px solid #333; padding: 4px; vertical-align: top; }
.report-comment-cell { border: none; min-height: 44px; }

/* Photos */
.report-photo-input { display: block; margin: 6px 0; font-size: 13px; }
.report-photo-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.report-photo { position: relative; margin: 0; width: 160px; }
.report-photo img { width: 100%; border: 1px solid #ccc; border-radius: 4px; display: block; }
.report-photo-remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border-radius: 50%;
    border: none; background: rgba(0, 0, 0, 0.6); color: #fff;
    font-size: 15px; line-height: 1; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .report-modal, .report-overlay { transition: none; }
}

/* Impression : n'imprimer QUE la feuille de rapport */
@media print {
    body * { visibility: hidden !important; }
    .report-sheet, .report-sheet * { visibility: visible !important; }
    .report-overlay, .report-actions { display: none !important; }
    .report-modal {
        position: static; transform: none; box-shadow: none;
        max-width: none; max-height: none; width: auto; background: #fff;
    }
    .report-sheet { margin: 0; box-shadow: none; padding: 0; }
    .report-photo-remove, .report-photo-input { display: none !important; }
    .report-textarea { border: none; }
}

/* --- Sélecteur de centre pour le rapport --- */
.report-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: 420px;
    max-width: 92vw;
    max-height: 80vh;
    z-index: 12001;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem;
    background: rgba(40, 55, 75, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.25));
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.report-picker.report-open { opacity: 1; transform: translate(-50%, -50%); }
.report-picker-title { margin: 0; font-size: 1rem; }
.report-picker-search {
    padding: 0.5rem 0.7rem; font-size: 0.9rem; font-family: inherit;
    color: #fff; background: rgba(20,30,45,0.5);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.25)); border-radius: 8px;
}
.report-picker-list { overflow-y: auto; display: flex; flex-direction: column; gap: 0.3rem; }
.report-picker-item {
    text-align: left; padding: 0.55rem 0.7rem; font-size: 0.88rem;
    color: #fff; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; cursor: pointer;
}
.report-picker-item:hover { background: rgba(255,255,255,0.2); }
.report-picker-empty { color: rgba(255,255,255,0.6); text-align: center; padding: 1rem; }
.report-picker-cancel { align-self: flex-end; }

/* ==========================================================================
   Onglet Rapports (fichiers Drive archivés)
   ========================================================================== */
.rapports-container { margin-bottom: 1.5rem; }
.rapports-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.8rem;
}
.rapports-head h3 { margin: 0; color: #fff; font-size: 1rem; }
.rapports-info { color: rgba(255,255,255,0.7); padding: 0.5rem 0; }
.rapports-list { display: flex; flex-direction: column; gap: 0.4rem; }
.rapport-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 8px;
    color: #fff;
}
.rapport-item-info { display: flex; flex-direction: column; min-width: 0; }
.rapport-item-name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rapport-item-date { font-size: 0.76rem; color: rgba(255,255,255,0.65); white-space: nowrap; }
.rapport-item-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.rapport-item-actions .btn { padding: 0.35rem 0.6rem; font-size: 0.8rem; }

/* ==========================================================================
   Vue Dashboard — Inventaire Parc Opérateur
   ========================================================================== */
.dashboard-container { margin-bottom: 1.5rem; }

/* Compteurs */
.dash-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* centre les lignes incomplètes (< 5 cartes) */
    gap: 1rem;
    margin-bottom: 1.6rem;
}
.dash-metric {
    /* largeur FIXE : une carte seule sur sa ligne garde la même taille que les
       autres (pas d'étirement), la ligne reste centrée. */
    flex: 0 1 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.15rem;
    min-height: 118px;
    background: rgba(40, 55, 75, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 14px;
    padding: 1.3rem 1.2rem;
    color: #fff;
    transition: transform 0.12s ease, background 0.12s ease;
}
.dash-metric-clickable { cursor: pointer; }
.dash-metric-clickable:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }
.dash-metric-title {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    font-size: 0.85rem; font-weight: 500; color: rgba(255,255,255,0.78);
}
.dash-metric-value { font-size: 2.1rem; font-weight: 700; line-height: 1.05; margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
/* Carte « héros » : Sites et Tâches, chiffre plus présent */
.dash-metric-hero .dash-metric-value { font-size: 2.6rem; }

/* Point d'état à côté du titre (couleur = ton) */
.dash-stat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: transparent; }

/* Ligne « barre + pourcentage » */
.dash-stat-row { display: flex; align-items: center; gap: 0.55rem; width: 100%; margin-top: 0.7rem; }
.dash-stat-pct { flex: 0 0 auto; min-width: 2.8rem; text-align: right; font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.9); font-variant-numeric: tabular-nums; }

/* Barre « glassy » : piste translucide avec reflet, remplissage lumineux */
.dash-stat-bar {
    position: relative; flex: 1 1 auto; height: 10px; overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.dash-stat-bar::after {
    content: ''; position: absolute; inset: 0 0 50% 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
    border-radius: 999px; pointer-events: none;
}
.dash-stat-fill { position: relative; height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.dash-stat-sub { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin-top: 0.35rem; }
.dash-metric-sub { font-size: 0.78rem; color: rgba(255,255,255,0.7); margin-top: 0.25rem; }
/* Barre de progression : pleine largeur de la carte, même centrée */
.dash-metric .dash-metric-bar { width: 100%; margin-top: 0.6rem; }

/* Répartitions */
.dash-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}
.dash-breakdown {
    background: rgba(40, 55, 75, 0.7);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    color: #fff;
}
.dash-breakdown-row {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; gap: 0.5rem;
    background: none; border: none; color: #fff;
    padding: 0.3rem 0; font-size: 0.85rem; cursor: pointer;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.dash-breakdown-row:first-of-type { border-top: none; }
.dash-breakdown-row:hover:not(:disabled) { color: #fff; opacity: 0.85; }
.dash-breakdown-row:disabled { cursor: default; opacity: 0.6; }

/* Barre d'outils dashboard */
.dash-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.4rem 0 1rem; }
.dash-search {
    flex: 1 1 240px; min-width: 180px;
    padding: 0.7rem 1rem; font-size: 0.9rem; font-family: inherit;
    color: #fff; background: rgba(255,255,255,0.12);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.25)); border-radius: 10px;
}
.dash-search::placeholder { color: rgba(255,255,255,0.6); }
.dash-filter-chip {
    padding: 0.4rem 0.8rem; font-size: 0.8rem; cursor: pointer;
    color: #cfe8ff; background: rgba(33,150,243,0.25);
    border: 1px solid rgba(33,150,243,0.55); border-radius: 20px;
}
.dash-filter-chip:hover { background: rgba(33,150,243,0.4); }

/* Tableau */
.dash-table-wrap {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
    border-radius: 12px;
    padding: 0.5rem;
    overflow-x: auto;
}
.dash-table-count { font-size: 0.78rem; color: rgba(255,255,255,0.6); padding: 0.3rem 0.5rem; }
.dash-empty { color: rgba(255,255,255,0.7); text-align: center; padding: 1.2rem; }
.dash-table { width: 100%; border-collapse: collapse; color: #fff; font-size: 0.84rem; }
.dash-table th {
    text-align: left; padding: 0.5rem 0.6rem; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.03em; color: rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.2); white-space: nowrap;
}
.dash-row { cursor: pointer; }
.dash-row td { padding: 0.7rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.dash-row:hover td { background: rgba(255,255,255,0.08); }
.dash-yes { color: #6ee7a0; font-weight: 600; }
.dash-no { color: #ff9a9a; font-weight: 600; }
.dash-part { color: #ffd27a; font-weight: 600; }

/* ==========================================================================
   Dashboard — sous-vue "Tâches à effectuer" (cases vides)
   ========================================================================== */
.tasks-count {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    margin: 0.4rem 0 0.8rem;
}
.tasks-list { display: flex; flex-direction: column; gap: 0.6rem; }
.tasks-site {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
    border-radius: 10px;
    overflow: hidden;
}
.tasks-site-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    width: 100%; text-align: left;
    padding: 0.6rem 0.9rem;
    background: rgba(255,255,255,0.06); border: none;
    color: #fff; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.tasks-site-head:hover { background: rgba(255,255,255,0.16); }
.tasks-site-count {
    flex-shrink: 0;
    background: var(--color-warning, #f39c12); color: #1f2a36;
    border-radius: 12px; padding: 0.05rem 0.5rem;
    font-size: 0.78rem; font-weight: 700;
}
.tasks-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.7rem 0.9rem; }
.tasks-chip {
    font-size: 0.76rem;
    color: #ffe3b0;
    background: rgba(243,156,18,0.18);
    border: 1px solid rgba(243,156,18,0.45);
    border-radius: 14px;
    padding: 0.25rem 0.6rem;
}

/* Carte compteur "Tâches à effectuer" (accent) + bouton retour */
.dash-metric-tasks { border-color: rgba(243,156,18,0.5); }
.dash-metric-tasks .dash-metric-value { color: var(--color-warning, #f39c12); }
.dash-back { margin-bottom: 0.8rem; }

/* ==========================================================================
   Dashboard — couleur de complétion des compteurs + tâches éditables
   ========================================================================== */

/* Accent de complétion (bordure gauche + couleur du chiffre) */
.dash-complete-high { border-left: 4px solid #27ae60; }
.dash-complete-mid  { border-left: 4px solid #f39c12; }
.dash-complete-low  { border-left: 4px solid #e74c3c; }
.dash-complete-high .dash-metric-value { color: #6ee7a0; }
.dash-complete-mid  .dash-metric-value { color: #ffd27a; }
.dash-complete-low  .dash-metric-value { color: #ff9a9a; }

/* Barre de progression dans la carte */
.dash-metric-bar {
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.dash-metric-bar-fill { height: 100%; border-radius: 999px; }
.dash-complete-high .dash-metric-bar-fill { background: #27ae60; }
.dash-complete-mid  .dash-metric-bar-fill { background: #f39c12; }
.dash-complete-low  .dash-metric-bar-fill { background: #e74c3c; }

/* Chip de tâche cliquable + mini-formulaire inline */
.tasks-chip-clickable { cursor: pointer; }
.tasks-chip-clickable:hover { background: rgba(243,156,18,0.3); }
.tasks-chip-form {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: rgba(20,30,45,0.5);
    border: 1px solid rgba(243,156,18,0.5);
    border-radius: 14px; padding: 0.15rem 0.3rem 0.15rem 0.6rem;
}
.tasks-chip-form-error { border-color: #e74c3c; }
.tasks-chip-form-label { font-size: 0.74rem; color: rgba(255,255,255,0.8); white-space: nowrap; }
.tasks-chip-input {
    width: 130px; font-size: 0.8rem; font-family: inherit;
    color: #fff; background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 0.15rem 0.4rem;
}
.tasks-chip-input option { background: #2c3e50; color: #fff; }
.tasks-chip-ok {
    border: none; cursor: pointer;
    background: #27ae60; color: #fff; border-radius: 8px;
    width: 24px; height: 24px; font-size: 0.85rem; line-height: 1;
}
.tasks-chip-ok:disabled { opacity: 0.5; cursor: default; }

/* Bande de compteurs par type de tâche (page Tâches) */
.tasks-type-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.tasks-type-cell {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    text-align: left;
    padding: 0.7rem 0.9rem;
    background: rgba(40, 55, 75, 0.7);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-left: 4px solid var(--color-warning, #f39c12);
    border-radius: 12px;
    color: #fff; cursor: pointer;
}
.tasks-type-cell:hover { background: rgba(255,255,255,0.16); }
.tasks-type-cell.active {
    background: rgba(243,156,18,0.22);
    border-color: var(--color-warning, #f39c12);
}
.tasks-type-label { font-size: 0.8rem; }
.tasks-type-num { font-size: 1.3rem; font-weight: 700; color: var(--color-warning, #f39c12); }

/* ==========================================================================
   Dashboard — 2e ligne d'indicateurs (synthèse / alerte) + donuts
   ========================================================================== */

/* Indicateurs de synthèse (réutilise .dash-metric via .dash-indicators) */
.dash-indicators { margin-top: -0.2rem; }
.dash-indicator { position: relative; }
/* Tons : la couleur n'apparaît que sur la barre et un point d'état.
   Le fond et le chiffre restent neutres (plus calme, plus lisible). */
/* Teinte douce en dégradé depuis l'angle : la couleur est présente sans peindre
   toute la carte (ni froid, ni « sapin de Noël »). */
.dash-tone-good {
    background: radial-gradient(120% 140% at 0% 0%, rgba(39,174,96,0.30), rgba(40,55,75,0.7) 65%);
    border-color: rgba(110,231,160,0.38);
}
.dash-tone-warn {
    background: radial-gradient(120% 140% at 0% 0%, rgba(243,156,18,0.30), rgba(40,55,75,0.7) 65%);
    border-color: rgba(255,210,122,0.38);
}
.dash-tone-bad {
    background: radial-gradient(120% 140% at 0% 0%, rgba(231,76,60,0.28), rgba(40,55,75,0.7) 65%);
    border-color: rgba(255,154,154,0.38);
}
.dash-tone-good .dash-stat-dot { background: #27ae60; }
.dash-tone-warn .dash-stat-dot { background: #f39c12; }
.dash-tone-bad  .dash-stat-dot { background: #e74c3c; }
.dash-tone-good .dash-stat-fill { background: linear-gradient(90deg, #1e8449, #6ee7a0); box-shadow: 0 0 10px rgba(110, 231, 160, 0.45); }
.dash-tone-warn .dash-stat-fill { background: linear-gradient(90deg, #d68910, #ffd27a); box-shadow: 0 0 10px rgba(255, 210, 122, 0.45); }
.dash-tone-bad  .dash-stat-fill { background: linear-gradient(90deg, #c0392b, #ff9a9a); box-shadow: 0 0 10px rgba(255, 154, 154, 0.45); }


/* Carte répartition : donut + légende côte à côte */
.dash-breakdown-body {
    display: flex; align-items: center; gap: 0.9rem;
    margin-top: 0.6rem;
}
.dash-donut { flex: 0 0 auto; width: 120px; height: 120px; }
.dash-donut-svg { width: 100%; height: 100%; display: block; }
.dash-donut-total {
    fill: #fff; font-size: 1.5rem; font-weight: 700;
    font-family: inherit;
}
.dash-legend { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dash-legend-row {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    background: none; border: none; color: #fff; cursor: pointer;
    padding: 0.25rem 0.3rem; border-radius: 8px;
    font-size: 0.84rem; text-align: left;
}
.dash-legend-row:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.dash-legend-row:disabled { cursor: default; opacity: 0.6; }
.dash-legend-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.dash-legend-label {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: rgba(255,255,255,0.85);
}
.dash-legend-row strong { flex: 0 0 auto; }

@media (max-width: 560px) {
    .dash-breakdown-body { flex-direction: column; align-items: stretch; }
    .dash-donut { align-self: center; }
}

/* ==========================================================================
   Dashboard — liste détaillée repliable (effet dashboard : table secondaire)
   ========================================================================== */
.dash-table-panel {
    margin-top: 0.5rem;
    border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    overflow: hidden;
}
.dash-table-summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem; font-weight: 600; color: #fff;
    display: flex; align-items: center; gap: 0.5rem;
    user-select: none;
}
.dash-table-summary::-webkit-details-marker { display: none; }
.dash-table-summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    color: rgba(255,255,255,0.6);
}
.dash-table-panel[open] > .dash-table-summary::before { transform: rotate(90deg); }
.dash-table-summary:hover { background: rgba(255,255,255,0.06); }
.dash-table-panel > .dash-toolbar { padding: 0 1.1rem; }
.dash-table-panel > .dash-table-wrap { border: none; border-radius: 0; background: transparent; }

/* ==========================================================================
   Dashboard — section « Autres projets » (stats transverses)
   ========================================================================== */
.dash-cross-warn {
    margin-top: 0.6rem; font-size: 0.78rem;
    color: #ffd27a;
}

/* Section « autres projets » : un peu d'air au-dessus (sans séparateur) */
#dash-cross { margin-top: 0.4rem; }

/* ==========================================================================
   Vue Tâches — même style que le dashboard (cartes, barre, teinte douce)
   ========================================================================== */
.dash-metric.active { outline: 2px solid rgba(79,155,255,0.85); outline-offset: 2px; }
.tasks-site-head { align-items: center; }
.tasks-site-stat { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin: 0 0.6rem; min-width: 0; }
.tasks-site-head .dash-stat-bar { flex: 0 0 110px; margin: 0; }
.tasks-site-head .dash-stat-bar,
.tasks-site-head .dash-stat-fill { display: block; }
.tasks-site-head .dash-stat-pct { min-width: 0; font-size: 0.78rem; white-space: nowrap; }
.tasks-site-count { background: rgba(255,255,255,0.14); color: #fff; white-space: nowrap; }

/* Variante compacte (vue Tâches : nombreux types de tâche) */
.dash-metrics.dash-metrics-compact { gap: 0.6rem; margin-bottom: 0.9rem; }
.dash-metric.dash-metric-compact { flex: 0 1 170px; min-height: 0; padding: 0.6rem 0.7rem; gap: 0.1rem; border-radius: 10px; }
.dash-metric-compact .dash-metric-title { font-size: 0.74rem; }
.dash-metric-compact .dash-metric-value { font-size: 1.25rem; margin-top: 0.15rem; }
.dash-metric-compact .dash-stat-row { margin-top: 0.4rem; gap: 0.4rem; }
.dash-metric-compact .dash-stat-bar { height: 7px; }
.dash-metric-compact .dash-stat-pct { font-size: 0.75rem; min-width: 2.2rem; }

/* En-tête : boutons de même hauteur (l'emoji du bouton Rapport agrandissait la ligne) */
.header-actions .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    height: 2.25rem; min-height: 2.25rem; padding: 0 0.9rem;
    line-height: 1; white-space: nowrap;
}
.header-actions .btn span,
.header-actions #btn-report { font-size: 0.875rem; }

/* Sélecteur de rapport : centres avec intervention le jour même */
.report-picker-item-today { border-left: 3px solid #f39c12; font-weight: 600; }
.report-picker-badge {
    margin-left: 0.5rem; padding: 0.1rem 0.5rem; border-radius: 999px;
    font-size: 0.7rem; font-weight: 700;
    background: #f39c12; color: #1f2a36;
}

/* ==========================================================================
   Nouvelle intervention (formulaire depuis l'inventaire)
   ========================================================================== */
.ni-modal {
    position: fixed; top: 50%; left: 50%; z-index: 1101;
    transform: translate(-50%, -50%); opacity: 1;
    width: min(460px, 92vw); max-height: 88vh; overflow-y: auto;
    padding: 1.2rem 1.3rem;
    background: rgba(30, 42, 58, 0.97);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 14px; color: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.ni-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(5, 10, 18, 0.55);
}
.ni-title { font-size: 1.1rem; margin: 0 0 0.9rem; }
.ni-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.7rem; }
.ni-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
.ni-input {
    width: 100%; padding: 0.5rem 0.7rem; font: inherit; font-size: 0.9rem;
    color: #fff; background: rgba(255,255,255,0.10);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.25)); border-radius: 8px;
    box-sizing: border-box;
}
select.ni-input option { color: #1f2a36; }
.ni-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.9rem; }
.ni-empty { font-size: 0.8rem; color: #ffd27a; margin: 0 0 0.6rem; }
/* Un bouton d'en-tête masqué (attribut hidden) doit rester masqué malgré display: inline-flex */
.header-actions .btn[hidden] { display: none; }


/* ==========================================================================
   Fiche d'intervention (tournée hiver) — aperçu et PDF en fond blanc
   ========================================================================== */
.fiche-modal {
    position: fixed; top: 50%; left: 50%; z-index: 1101;
    transform: translate(-50%, -50%);
    width: min(640px, 94vw); max-height: 90vh; overflow-y: auto;
    padding: 1rem 1.1rem;
    background: rgba(30, 42, 58, 0.97);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 14px; color: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.fiche-picker-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 50vh; overflow-y: auto; margin: 0.6rem 0; }
.fiche-picker-item {
    text-align: left; padding: 0.5rem 0.7rem; font: inherit; font-size: 0.88rem;
    color: #fff; background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.2)); border-radius: 8px; cursor: pointer;
}
.fiche-picker-item:hover { background: rgba(255,255,255,0.16); }
.fiche-sheet {
    background: #fff; color: #1f2a36; padding: 18px 20px; margin-top: 0.8rem;
    border-radius: 6px; font-family: Arial, Helvetica, sans-serif; font-size: 12px;
}
.fiche-logo {
    color: #e8530e;
    font-weight: 800;
    font-size: 34px;
    letter-spacing: -1px;
    margin-bottom: 18px;
}
.fiche-title { font-size: 16px; margin: 0 0 12px; color: #1f2a36; }
.fiche-section { font-size: 13px; margin: 14px 0 6px; color: #1f2a36; }
.fiche-table { width: 100%; border-collapse: collapse; }
.fiche-table th, .fiche-table td { border: 1px solid #c9d1d9; padding: 6px 8px; text-align: left; vertical-align: top; }
.fiche-table th { width: 38%; background: #f3f5f8; font-weight: 600; }
.fiche-comments p { margin: 0 0 6px; white-space: pre-wrap; }

/* ==========================================================================
   Onglet Compta — répartitions en barres (même langage que le dashboard)
   ========================================================================== */
.compta-metrics { margin-bottom: 1.4rem; }
.compta-section {
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
    color: rgba(255,255,255,0.8); margin: 1.2rem 0 0.5rem;
}
.compta-box {
    background: rgba(40, 55, 75, 0.7);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 14px; padding: 0.9rem 1.1rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.compta-bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 0.7rem; font-size: 0.84rem; color: #fff; }
.compta-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compta-bar-track {
    position: relative; height: 10px; border-radius: 999px; overflow: hidden;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
}
.compta-bar-fill { display: block; height: 100%; border-radius: 999px; }
.compta-bar-fill.tone-blue { background: linear-gradient(90deg, #1f5fa8, #4f9bff); box-shadow: 0 0 10px rgba(79,155,255,0.4); }
.compta-bar-fill.tone-orange { background: linear-gradient(90deg, #d35400, #e8530e); box-shadow: 0 0 10px rgba(232,83,14,0.4); }
.compta-bar-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Tableau par année (onglet Compta) */
.compta-table-wrap { padding: 0.6rem 0.8rem; overflow-x: auto; }
.compta-table { width: 100%; border-collapse: collapse; color: #fff; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.compta-table th {
    text-align: right; padding: 0.5rem 0.6rem; font-size: 0.74rem; font-weight: 500;
    color: rgba(255,255,255,0.7); border-bottom: 1px solid rgba(255,255,255,0.2);
}
.compta-table th:first-child, .compta-table td:first-child { text-align: left; }
.compta-table td { padding: 0.5rem 0.6rem; text-align: right; border-bottom: 1px solid rgba(255,255,255,0.08); }
.compta-table-total td { font-weight: 700; border-bottom: none; color: #ffd27a; }

/* Sélecteur d'année (onglet Compta) */
.compta-year-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 0.8rem; }
.compta-year-chip {
    padding: 0.4rem 0.9rem; font: inherit; font-size: 0.82rem; cursor: pointer;
    color: #fff; background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22)); border-radius: 999px;
}
.compta-year-chip:hover { background: rgba(255,255,255,0.16); }
.compta-year-chip.active { background: #1f5fa8; border-color: #4f9bff; font-weight: 600; }

/* Sous-catégories Compta (CB, puis autres fichiers) */
.compta-source-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.2rem 0 0.4rem; }
.compta-crumb { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.85); margin-right: 0.4rem; }

/* Lignes sans client (onglet Compta › Facturation) */
.compta-unassigned-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; align-items: center; margin: 0.45rem 0; }
.compta-unassigned-info { font-size: 0.82rem; color: rgba(255,255,255,0.9); }

/* Bulle budget CB (onglet Compta) */
.compta-budget { flex: 0 1 230px; }

/* Bloc d'information (colonnes hors site, ex. CIDR disponibles) : neutre et sobre */
.dash-info-box {
    background: rgba(40, 55, 75, 0.7);
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
    border-radius: 14px; padding: 0.8rem 1rem; margin-bottom: 1rem;
}
.dash-info-title {
    font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.85);
    text-align: left; margin-bottom: 0.55rem;
}
.dash-info-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dash-info-chip {
    font-size: 0.74rem; padding: 0.2rem 0.55rem; border-radius: 6px;
    color: #fff; background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Pop-up de la liste complète (colonne d'info) */
.info-pop-list { max-height: 60vh; overflow-y: auto; margin: 0.5rem 0 0.8rem; }

/* Carte des centres (dashboard) */
.dash-map { margin: 0 0 1rem; }
.dash-map-caption { font-size: 0.78rem; color: rgba(255,255,255,0.75); margin: 0 0 0.4rem 0.2rem; }
.dash-map-canvas {
    height: 420px; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--glass-border, rgba(255,255,255,0.22));
}

/* --- Créer une tournée (Déploiement hiver) --- */
.tn-modal { max-width: 620px; }
.tn-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}
.tn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  cursor: pointer;
}
.tn-row-name { font-weight: 600; flex: 1 1 auto; }
.tn-dur { width: auto; min-width: 130px; }
.tn-nb { width: 64px; }
.tn-nb-label { font-size: 0.85em; opacity: 0.8; }
.tn-row-addr { flex: 0 0 100%; padding-left: 24px; font-size: 0.85em; opacity: 0.75; }
.tn-result { margin-top: 12px; }
.tn-status { font-size: 0.95em; margin: 6px 0; }
.tn-steps { margin: 6px 0 0 18px; padding: 0; }
.tn-steps li { margin: 3px 0; }
.tn-return { opacity: 0.8; font-style: italic; }
.tn-warn { color: #e0a800; font-size: 0.9em; margin: 4px 0; }
.tn-error { color: #e5484d; font-size: 0.95em; margin: 6px 0; }
.tn-hint { opacity: 0.8; font-size: 0.85em; }
.tn-step {
  cursor: grab;
  padding: 6px 8px;
  margin: 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  list-style: decimal;
}
.tn-step:active { cursor: grabbing; }
.tn-step.tn-dragging { opacity: 0.5; }
.tn-step-head { font-weight: 600; }
.tn-step-leg, .tn-step-work { font-size: 0.9em; opacity: 0.85; }

/* ==========================================================================
   Vue liste téléphone (js/mobileList.js) : remplace le Gantt sous 640 px
   ========================================================================== */
.mobile-list .gantt-container {
    overflow: visible;
    max-height: none;
    padding: 0.3rem 0 0.8rem;
}
.mobile-list .view-controls,
.mobile-list #display-mode,
.mobile-list #legend {
    display: none !important;
}
.ml-day {
    margin: 0.9rem 0.7rem 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    text-transform: capitalize;
}
.ml-card {
    display: block;
    width: calc(100% - 1.4rem);
    margin: 0 0.7rem 0.55rem;
    padding: 0.75rem 0.9rem;
    text-align: left;
    font: inherit;
    color: #1f2937;
    background: #fff;
    border: 1px solid #d1d5db;
    border-left: 4px solid #4f9bff;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}
.ml-card:active {
    background: #f3f4f6;
}
.ml-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.ml-card-meta {
    font-size: 0.85rem;
    line-height: 1.45;
    color: #374151;
}
.ml-card-line {
    overflow-wrap: anywhere;
}
.ml-empty {
    padding: 1.2rem;
    text-align: center;
    color: #374151;
}
