/* ============================================================
   EURY — Design System "Précision Verte"
   Charte graphique basée sur le logo vert #005F54
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    /* Brand — Vert EURY */
    --primary:       #005F54;
    --primary-dark:  #004840;
    --primary-light: #e8f5f2;

    /* États */
    --success: #059669;
    --warning: #d97706;
    --danger:  #dc2626;

    /* Gris à légère tonalité verte */
    --gray-50:  #f7f9f8;
    --gray-100: #f0f4f3;
    --gray-200: #e1e9e7;
    --gray-300: #c8d5d3;
    --gray-500: #6b7978;
    --gray-700: #2e3c3a;
    --gray-900: #111d1b;
    --white:    #ffffff;

    /* Statuts interventions */
    --statut-planifiee: #3b82f6;
    --statut-en-cours:  #f59e0b;
    --statut-terminee:  #10b981;
    --statut-annulee:   #9ca3af;

    /* Typographie */
    --font:         'DM Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Syne', var(--font);

    /* Formes */
    --radius:    8px;
    --radius-sm: 5px;
    --radius-lg: 12px;

    /* Ombres */
    --shadow:    0 1px 3px rgba(17,29,27,.06), 0 4px 12px rgba(17,29,27,.04);
    --shadow-lg: 0 4px 16px rgba(17,29,27,.10), 0 12px 32px rgba(17,29,27,.08);

    /* Sidebar */
    --sidebar-bg: #071E1A;
    --sidebar-w:  248px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    color: var(--gray-700);
    background: var(--gray-100);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Typographie ────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; }
h1 { font-size: 1.5rem;  font-weight: 700; color: var(--gray-900); }
h2 { font-size: 1.2rem;  font-weight: 700; color: var(--gray-900); }
h3 { font-size: 1rem;    font-weight: 600; color: var(--gray-700); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 1.25rem 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    height: 54px;
    width: auto;
    object-fit: contain;
    opacity: .9;
}

.sidebar-nav { flex: 1; padding: .75rem 0; }

.nav-section {
    padding: 1rem 1.25rem .35rem;
    font-size: .63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: rgba(255,255,255,.22);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 1.25rem;
    padding-left: 1.4rem;
    color: rgba(255,255,255,.55);
    font-size: .875rem;
    font-weight: 450;
    transition: background .15s, color .15s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.88);
    text-decoration: none;
}

.nav-item.active {
    background: rgba(0,95,84,.25);
    color: var(--white);
    border-left-color: #00C4AD;
    padding-left: 1.25rem;
    text-decoration: none;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: .5;
    transition: opacity .15s;
}

.nav-item:hover svg,
.nav-item.active svg { opacity: 1; }

.sidebar-user {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: .82rem;
}

.sidebar-user strong {
    display: block;
    color: var(--white);
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: .4rem;
}

.sidebar-user > span {
    display: inline-block;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #00C4AD;
    background: rgba(0,196,173,.16);
    padding: .2rem .55rem;
    border-radius: 4px;
    margin-bottom: .6rem;
}

.sidebar-logout {
    display: block;
    margin-top: .35rem;
    padding: .4rem .75rem;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.45);
    font-size: .78rem;
    text-align: center;
    transition: background .15s, color .15s;
}

.sidebar-logout:hover {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.82);
    text-decoration: none;
}

/* ── Main content ────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: .9rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
    position: relative;
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.topbar h1 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.01em;
    margin: 0;
}

/* ── Page content ────────────────────────────────────────────── */
.page-content {
    padding: 1.75rem;
    flex: 1;
    animation: pageIn .28s ease both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-family: var(--font);
    font-size: .845rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
    white-space: nowrap;
    min-height: 38px;
    letter-spacing: -.01em;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,95,84,.28);
    text-decoration: none;
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
    text-decoration: none;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(220,38,38,.22);
}
.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
    text-decoration: none;
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}
.btn-success:hover {
    background: #047857;
    border-color: #047857;
    text-decoration: none;
    color: var(--white);
}

.btn-sm  { padding: .3rem .65rem; font-size: .78rem; min-height: 30px; }
.btn-lg  { padding: .75rem 1.5rem; font-size: 1rem; min-height: 46px; }

/* ── Cartes ──────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body { padding: 1.25rem; }

/* ── Tableau ─────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: .855rem; }

thead { background: var(--gray-50); }

th {
    padding: .65rem 1rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

td {
    padding: .72rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    transition: background .1s;
}

tr:last-child td { border-bottom: none; }

tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--gray-50); }
tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--primary); }

/* ── Formulaire ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .4rem;
    letter-spacing: -.01em;
}

.form-control {
    display: block;
    width: 100%;
    padding: .55rem .85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .9rem;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    min-height: 40px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,95,84,.15);
}

.form-control::placeholder { color: var(--gray-300); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { appearance: auto; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Alertes ─────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .855rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
    border-left: 3px solid var(--danger);
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
    border-left: 3px solid var(--success);
}

.alert-info {
    background: var(--primary-light);
    color: #1a4a44;
    border-color: rgba(0,95,84,.2);
    border-left: 3px solid var(--primary);
}

/* ── Badges statut ───────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-planifiee {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.badge-planifiee::before { background: #3b82f6; }


.badge-terminee {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.badge-terminee::before { background: #10b981; }

.badge-annulee {
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
}
.badge-annulee::before { background: var(--gray-300); }

/* ── Badges types client ─────────────────────────────────────── */
.badge-particulier {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.badge-particulier::before { background: #3b82f6; }

.badge-professionnel {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.badge-professionnel::before { background: #10b981; }

.badge-industriel {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}
.badge-industriel::before { background: #f97316; }

.badge-collectivite {
    background: #faf5ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}
.badge-collectivite::before { background: #8b5cf6; }

/* ── KPI Cards ───────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}

.kpi-card:hover { box-shadow: var(--shadow-lg); }

.kpi-value {
    font-family: 'Space Grotesk', var(--font);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.kpi-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gray-500);
    margin-top: .5rem;
}

/* ── Filtres ─────────────────────────────────────────────────── */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.filters-bar .form-group { margin: 0; }
.filters-bar .form-control { min-width: 140px; }

/* ── Table actions ───────────────────────────────────────────── */
.table-actions { display: flex; gap: .3rem; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: .25rem;
    margin-top: 1.25rem;
    justify-content: center;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: .3rem .65rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    font-size: .835rem;
    font-weight: 500;
    background: var(--white);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
}

.page-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
    text-decoration: none;
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,95,84,.28);
}

/* ── Mobile ──────────────────────────────────────────────────── */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    color: var(--gray-500);
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.menu-toggle:hover { background: var(--gray-100); color: var(--gray-900); }

/* Overlay sidebar mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* Grilles responsives — classes utilitaires */
.resp-grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.resp-grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.resp-grid-dash { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: start; margin-bottom: 1rem; }

/* ── Tables responsives ───────────────────────────────────────── */
/* Sur desktop : comportement normal */
.resp-table { width: 100%; border-collapse: collapse; font-size: .855rem; }

@media (max-width: 768px) {
    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }

    /* Topbar */
    .topbar { padding: .75rem 1rem; gap: .5rem; }
    .topbar-search { display: none; }

    /* Page */
    .page-content { padding: .875rem; }

    /* KPI grid : 2 colonnes maintenues */
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }

    /* Grilles : empilées */
    .resp-grid-2,
    .resp-grid-main,
    .resp-grid-dash { grid-template-columns: 1fr !important; }
    .iv-today-grid { grid-template-columns: 1fr !important; }

    /* Cal-bar */
    .cal-bar { flex-direction: column; align-items: stretch; gap: .6rem; }
    .cal-controls { flex-wrap: wrap; gap: .5rem; }
    .cal-controls select { flex: 1; min-width: 0; width: auto !important; }
    .cal-title { font-size: .9rem; }

    /* Filtres */
    .filters-bar { flex-direction: column; gap: .6rem; padding: .875rem 1rem; }
    .filters-bar .form-group { width: 100%; margin: 0; }
    .filters-bar .form-control { min-width: 0; width: 100%; }
    .filters-bar .form-group:last-child { margin-left: 0 !important; }

    /* Tableaux → cards */
    .resp-table thead { display: none; }
    .resp-table,
    .resp-table tbody,
    .resp-table tr,
    .resp-table td { display: block; width: 100%; }
    .resp-table tr {
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        margin-bottom: .75rem;
        background: var(--white);
        box-shadow: var(--shadow);
        overflow: hidden;
    }
    .resp-table tr:hover { box-shadow: var(--shadow-lg); }
    .resp-table td {
        display: flex;
        align-items: flex-start;
        gap: .75rem;
        padding: .55rem 1rem;
        border-bottom: 1px solid var(--gray-100);
        font-size: .875rem;
        border-left: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .resp-table td:last-child { border-bottom: none; }
    .resp-table td::before {
        content: attr(data-label);
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--gray-500);
        min-width: 85px;
        flex-shrink: 0;
        padding-top: 2px;
    }
    .resp-table td[data-label=""] { display: none; }
    .resp-table .table-actions { flex-wrap: wrap; }

    /* Pagination */
    .pagination { flex-wrap: wrap; }

    /* Cards header : flex-wrap */
    .card-header { flex-wrap: wrap; gap: .5rem; }

    /* Boutons barre d'actions page */
    .page-actions { flex-wrap: wrap; gap: .5rem; }
}

@media (max-width: 480px) {
    .page-content { padding: .625rem; }
    .resp-grid-2 .kpi-card { aspect-ratio: auto !important; padding: 1rem .75rem; }
    .kpi-value { font-size: 1.75rem; }
    .topbar h1 { font-size: .95rem; }
    .btn { font-size: .82rem; }
}

/* ── Agenda list (technicien) ────────────────────────────────── */
.agenda-day {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
}

.agenda-day:last-child { border-bottom: none; }

.agenda-day-label {
    width: 110px;
    flex-shrink: 0;
    padding: 1rem 1rem 1rem 1.25rem;
    font-size: .78rem;
    color: var(--gray-500);
    border-right: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.agenda-day-label strong {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.agenda-day-items { flex: 1; padding: .5rem .75rem; }

.agenda-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background .12s;
    color: inherit;
}

.agenda-item:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.agenda-item-time {
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 700;
    color: var(--gray-900);
    min-width: 42px;
    flex-shrink: 0;
}

.agenda-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.agenda-item-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-item-sub {
    font-size: .775rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .agenda-day { flex-direction: column; }
    .agenda-day-label {
        width: auto;
        flex-direction: row;
        align-items: center;
        gap: .4rem;
        border-right: none;
        border-bottom: 1px solid var(--gray-100);
        padding: .6rem 1rem;
    }
    .agenda-day-label strong { font-size: 1.1rem; }
}

/* ── Intervention card (vue mobile technicien) ────────────────── */
.intervention-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, border-color .2s;
}

.intervention-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.intervention-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .5rem;
}

.intervention-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
    letter-spacing: -.01em;
}

.intervention-card-meta {
    font-size: .82rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--gray-500);
}

.empty-state svg {
    width: 44px;
    height: 44px;
    opacity: .3;
    margin-bottom: .75rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.empty-state p { font-size: .9rem; }

/* ── Barre calendrier ────────────────────────────────────────── */
.cal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow);
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 .55rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all .15s;
    line-height: 1;
}

.cal-nav-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.cal-nav-today { padding: 0 .7rem; }

.cal-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
    padding-left: .6rem;
}

.cal-controls {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

/* ── Toggle vue mois/semaine ──────────────────────────────────── */
.view-toggle {
    display: flex;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.view-btn {
    padding: .35rem .9rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
    white-space: nowrap;
}

.view-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 1px 4px rgba(0,95,84,.25);
}

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

/* ── Légende techniciens ─────────────────────────────────────── */
.tech-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-bottom: .75rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 500;
    color: var(--gray-700);
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── FullCalendar overrides ───────────────────────────────────── */
#calendar { background: var(--white); border-radius: var(--radius); padding: .5rem; }

/* Événements compacts */
.fc-ev {
    display: flex;
    flex-direction: column;
    padding: 1px 4px;
    gap: 1px;
    overflow: hidden;
    height: 100%;
}

.fc-ev-time {
    font-size: .65rem;
    font-weight: 700;
    opacity: .8;
    white-space: nowrap;
    flex-shrink: 0;
}

.fc-ev-title {
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-ev-client {
    font-size: .65rem;
    font-weight: 400;
    opacity: .85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vue mois — rendu natif FC, juste arrondi et espacement */
.fc-daygrid-event {
    border-radius: 3px !important;
    margin-bottom: 1px !important;
    border: none !important;
    font-size: .75rem !important;
    font-weight: 600 !important;
}

/* Vue semaine (time grid) */
.fc-timegrid-event {
    border-radius: 3px !important;
    border: none !important;
    box-shadow: none !important;
}

.fc-timegrid-event .fc-event-main {
    padding: 0 !important;
}

/* Lien "+X autres" */
.fc-daygrid-more-link {
    font-size: .72rem !important;
    font-weight: 700 !important;
    color: var(--gray-500) !important;
    padding: 1px 4px !important;
}

/* Popover "+X autres" */
.fc-popover {
    background: var(--white) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
    border: 1px solid var(--gray-200) !important;
    z-index: 200 !important;
}

.fc-popover-header {
    background: var(--gray-50) !important;
    border-bottom: 1px solid var(--gray-200) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

.fc-popover-title {
    font-family: var(--font-display) !important;
    font-size: .8rem !important;
    font-weight: 700 !important;
}

.fc-popover-body {
    background: var(--white) !important;
    border-radius: 0 0 var(--radius) var(--radius) !important;
    padding: .35rem !important;
}

/* Jours passés — fond gris + hachures diagonales */
.fc-day-past,
.fc-timegrid-col.fc-day-past {
    background-color: rgba(0,0,0,.055) !important;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 6px,
        rgba(0,0,0,.055) 6px,
        rgba(0,0,0,.055) 7px
    ) !important;
}

.fc-day-past .fc-daygrid-day-number {
    opacity: .4 !important;
}

/* Jour courant */
.fc-day-today { background: rgba(0,95,84,.06) !important; }
.fc-day-today .fc-daygrid-day-number { color: var(--primary) !important; font-weight: 700 !important; }

.fc-button, .fc-button-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    font-family: var(--font) !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.fc-button:hover, .fc-button-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.fc-button:focus {
    box-shadow: 0 0 0 3px rgba(0,95,84,.25) !important;
}

.fc-button-active, .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.fc-toolbar-title {
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    color: var(--gray-900) !important;
}

.fc-col-header-cell {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.fc-daygrid-day-number,
.fc-timegrid-slot-label-cushion {
    font-size: .8rem;
    color: var(--gray-500);
}
