/* ==========================================================================
   Agenda Lyova — feuille de style (sans étape de compilation)
   ========================================================================== */

:root {
    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --line: #E5E9F0;
    --line-soft: #EEF1F5;
    --ink: #0F172A;
    --ink-2: #334155;
    --muted: #64748B;
    --muted-2: #475569;
    --accent: #0F172A;
    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --warn: #B45309;
    --warn-soft: #FFFBEB;
    --ok: #15803D;
    --ok-soft: #F0FDF4;
    --tech: #7C3AED;
    --tech-soft: #F3EEFF;
    --tech-line: #C4B5FD;
    --tech-ink: #3B0F80;
    --pic: #2563EB;
    --pic-soft: #EAF2FF;
    --pic-line: #93C5FD;
    --pic-ink: #1E3A8A;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .08);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: #4338CA; }
a:hover { color: #312E81; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid #6366F1; outline-offset: 2px; }

/* --- Barre du haut ------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    min-height: 64px; display: flex; align-items: center; gap: 24px;
    padding: 0 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.brand-logo { height: 36px; max-width: 200px; object-fit: contain; display: block; }
.auth-card .brand-logo { height: 56px; max-width: 260px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-name span { font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
    text-decoration: none; padding: 8px 12px; border-radius: 8px;
    color: var(--muted-2); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: #F1F5F9; color: var(--ink); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar .nav-toggle { display: none; }

@media (max-width: 860px) {
    .topbar-inner { padding: 8px 16px; gap: 12px; }
    .nav { order: 3; width: 100%; display: none; flex-direction: column; padding-bottom: 8px; }
    .nav.open { display: flex; }
    .topbar .nav-toggle { display: inline-flex; }
    .user-meta { display: none; }
}

/* --- Boutons ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); color: var(--ink); border-color: #D6DCE5; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1E293B; border-color: #1E293B; color: #fff; }
.btn-danger { color: var(--danger); border-color: #FBD5D5; }
.btn-danger:hover { background: var(--danger-soft); color: #B91C1C; border-color: #FCA5A5; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #B91C1C; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #EEF2F7; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn svg { flex: none; }

.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: #CBD5E1; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.swatch-tech { background: var(--tech); }
.swatch-pic { background: var(--pic); }
.swatch-itech { background: var(--tech-soft); border: 1px solid #A78BFA; }
.swatch-ipic { background: var(--pic-soft); border: 1px solid var(--pic-line); }

.segmented { display: inline-flex; background: #E9EDF3; border-radius: 10px; padding: 3px; }
.segmented a {
    height: 34px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center;
    color: var(--muted-2); font-size: 13px; font-weight: 500; text-decoration: none;
}
.segmented a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08); }

.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: #EEF2F7; color: var(--ink-2); white-space: nowrap;
}
.badge-tech { background: var(--tech-soft); color: var(--tech-ink); }
.badge-pic { background: var(--pic-soft); color: var(--pic-ink); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: #F1F5F9; color: var(--muted); }
.badge-absent { background: var(--danger-soft); color: #B91C1C; }

/* --- Pages --------------------------------------------------------------- */
.page { padding: 24px; max-width: 1180px; margin: 0 auto; }
.page-wide { max-width: none; }
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card h2 { font-size: 17px; font-weight: 700; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } .page { padding: 16px; } }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

/* --- Formulaires --------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
    border: 1px solid #D6DCE5; background: #fff; color: var(--ink);
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
.error { color: var(--danger); font-size: 12.5px; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fields-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .fields-2, .fields-3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* Choix de catégorie */
.cat-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-picker label {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid #D6DCE5; cursor: pointer; font-weight: 500; font-size: 13.5px;
}
.cat-picker input { position: absolute; opacity: 0; pointer-events: none; }
.cat-picker label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
.cat-picker label:has(input:focus-visible) { outline: 2px solid #6366F1; outline-offset: 2px; }

/* Choix des participants avec pastille de présence */
.people-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.people-picker label {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
    border: 1px solid #D6DCE5; cursor: pointer; font-size: 13.5px; font-weight: 500; position: relative;
}
.people-picker input { position: absolute; opacity: 0; pointer-events: none; }
.people-picker label:has(input:checked) { border-color: var(--ink); background: #F1F5F9; font-weight: 600; }
.people-picker label:has(input:focus-visible) { outline: 2px solid #6366F1; outline-offset: 2px; }
.presence-dot { width: 9px; height: 9px; border-radius: 50%; background: #CBD5E1; flex: none; }
.presence-dot.in { background: #16A34A; }
.presence-dot.half { background: #F59E0B; }
.presence-dot.out { background: #CBD5E1; }

/* --- Avatars ------------------------------------------------------------- */
.avatar {
    position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: var(--s, 28px); height: var(--s, 28px); border-radius: 50%; overflow: hidden;
    background: var(--c, #334155); color: #fff; font-weight: 600;
    font-size: calc(var(--s, 28px) * .39); letter-spacing: .01em; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.away { background: #E2E8F0; color: var(--muted); }
.avatar.away img { filter: grayscale(1); opacity: .55; }
.avatar .half-veil { position: absolute; top: 0; right: 0; width: 50%; height: 100%; background: rgba(203, 213, 225, .9); }
.avatar .half-veil.am { left: 0; right: auto; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -4px; box-shadow: 0 0 0 2px var(--ring, #fff); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* --- Alertes et toasts --------------------------------------------------- */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.alert-ok { background: var(--ok-soft); border-color: #BBF7D0; color: #14532D; }
.alert-error { background: var(--danger-soft); border-color: #FECACA; color: #7F1D1D; }
.alert-warn { background: var(--warn-soft); border-color: #FDE68A; color: #78350F; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
    font-weight: 500; display: flex; align-items: center; gap: 10px; animation: toast-in .2s ease-out;
}
.toast.error { background: #991B1B; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- Menus déroulants ---------------------------------------------------- */
.dropdown { position: relative; }
.dropdown-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
    padding: 6px;
}
.dropdown-panel a, .dropdown-panel button.menu-item {
    display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px;
    text-decoration: none; color: var(--ink); background: none; border: 0; cursor: pointer; font-size: 14px; text-align: left;
}
.dropdown-panel a:hover, .dropdown-panel button.menu-item:hover { background: var(--surface-2); }
.bell { position: relative; }
.bell-count {
    position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px;
    background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.notif-panel { width: 360px; max-width: calc(100vw - 24px); padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.notif-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.notif-item { display: block; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.notif-item:hover { background: var(--surface-2); color: var(--ink); }
.notif-item.unread { background: #F5F3FF; }
.notif-item.unread:hover { background: #EDE9FE; }
.notif-title { font-weight: 600; font-size: 13.5px; }
.notif-sub { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.notif-time { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* --- Modale -------------------------------------------------------------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .42);
    display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto;
}
.modal {
    width: 100%; max-width: 620px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
    animation: modal-in .16s ease-out;
}
.modal-sm { max-width: 460px; }
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.modal-head h2 { font-size: 19px; font-weight: 700; flex: 1; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 0 22px 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.modal-foot .spacer { flex: 1; }
.conflict-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
body.modal-open { overflow: hidden; }

/* --- Tableaux ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: .55; }

/* ==========================================================================
   Agenda
   ========================================================================== */
.agenda-toolbar { padding: 18px 24px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.agenda-toolbar h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.agenda-toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.agenda-toolbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agenda-body { padding: 14px 24px 28px; }
@media (max-width: 860px) {
    .agenda-toolbar { padding: 14px 16px 0; }
    .agenda-body { padding: 12px 16px 20px; }
    .agenda-toolbar .right { margin-left: 0; }
}

.cal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.cal-inner { min-width: var(--min-w, 1060px); }
.cal-row { display: grid; grid-template-columns: 64px repeat(var(--days, 7), minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line-soft); }
.cal-day-head { padding: 12px 10px; border-left: 1px solid var(--line-soft); min-width: 0; }
.cal-day-head.today { background: #F5F3FF; }
.cal-day-head.weekend { background: #FAFBFC; }
.cal-day-head a.day-link { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.cal-dow { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.today .cal-dow { color: #5B21B6; }
.cal-num { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.today .cal-num {
    font-size: 15px; color: #fff; background: var(--ink); min-width: 28px; height: 28px; border-radius: 14px;
    display: inline-grid; place-items: center; padding: 0 6px;
}
.presence { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin-top: 10px; min-height: 28px; }
.presence .in, .presence .out { display: flex; gap: 4px; flex-wrap: wrap; }
.presence .out { justify-content: flex-end; }
.presence a { text-decoration: none; display: inline-flex; border-radius: 50%; }

.cal-band { border-bottom: 1px solid var(--line-soft); padding: 6px 0; background: #FBFCFD; }
.cal-band-grid { grid-auto-rows: 30px; row-gap: 4px; }
.cal-band-label { grid-column: 1; font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 0 0 10px; }
.bar {
    margin: 0 4px; border-radius: 8px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
    font-size: 12.5px; white-space: nowrap; overflow: hidden; min-width: 0; border: 1px solid transparent;
    text-decoration: none; cursor: pointer; text-align: left;
}
.bar .bar-text { overflow: hidden; text-overflow: ellipsis; }
.bar.cut-before { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.bar.cut-after { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.bar-intern { cursor: default; }
.bar .avatar-stack { margin-left: auto; padding-left: 6px; }

.cal-grid { position: relative; }
.cal-hours { position: relative; }
.cal-hour { position: absolute; right: 10px; font-size: 11.5px; font-weight: 500; color: var(--muted); transform: translateY(-50%); }
.cal-col { position: relative; border-left: 1px solid var(--line-soft); background: #F7F8FA; cursor: copy; }
.cal-col.weekend { background: #F2F4F7; }
.cal-col .office { position: absolute; left: 0; right: 0; background: #fff; pointer-events: none; }
.cal-col.weekend .office { background: #F7F8FA; }
.cal-col .lines {
    position: absolute; inset: 0; pointer-events: none;
    background-image: repeating-linear-gradient(to bottom, #E8ECF2 0, #E8ECF2 1px, transparent 1px, transparent var(--hour, 48px));
}
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

.ev {
    position: absolute; z-index: 2; padding: 5px 7px; border-radius: 8px; overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2px; text-align: left;
    border: 1px solid transparent; font: inherit; box-shadow: 0 0 0 1.5px var(--surface);
}
.ev:hover { filter: brightness(1.04); z-index: 3; box-shadow: 0 0 0 1.5px var(--surface), 0 4px 12px rgba(15,23,42,.15); }
.ev-title { font-size: 12.5px; font-weight: 600; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.tall .ev-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.ev-time { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .avatar { --s: 20px; font-size: 8.5px; font-weight: 700; }
.ev.compact { flex-direction: row; align-items: center; padding: 2px 7px; }
.ev.compact .ev-meta .avatar-stack { display: none; }
.ev.narrow .avatar-stack { display: none; }
.ev-repeat { opacity: .85; flex: none; }

/* Vue mois */
.month { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.month-inner { min-width: 760px; }
.month-head, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head div { padding: 10px 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.month-day { min-height: 128px; padding: 8px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; cursor: copy; min-width: 0; }
.month-week .month-day:last-child { border-right: 0; }
.month-day.other { background: #FAFBFC; }
.month-day.other .month-num { color: #94A3B8; }
.month-num { font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink); align-self: flex-start; padding: 2px 6px; border-radius: 8px; }
.month-day.today .month-num { background: var(--ink); color: #fff; }
.month-ev {
    display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 6px; font-size: 12px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border: 1px solid transparent; text-align: left; width: 100%;
}
.month-ev span { overflow: hidden; text-overflow: ellipsis; }
.month-more { font-size: 12px; color: var(--muted-2); text-decoration: none; font-weight: 600; padding-left: 4px; }

/* ==========================================================================
   Disponibilités
   ========================================================================== */
.week-editor { display: grid; grid-template-columns: 120px repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; }
.week-editor .wk-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.week-editor .wk-day { font-weight: 600; }
.toggle-half { position: relative; display: block; cursor: pointer; }
.toggle-half input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-half span {
    display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 10px;
    border: 1px solid #D6DCE5; color: var(--muted); font-weight: 600; font-size: 13px; background: #fff;
}
.toggle-half input:checked + span { background: #ECFDF3; border-color: #86EFAC; color: #166534; }
.toggle-half .on { display: none; }
.toggle-half input:checked + span .on { display: inline; }
.toggle-half input:checked + span .off { display: none; }
.toggle-half input:focus-visible + span { outline: 2px solid #6366F1; outline-offset: 2px; }
.preview-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.preview-day { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-size: 12px; }
.preview-day .pd-num { font-weight: 700; font-size: 15px; }
.preview-day .halves { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 6px; }
.preview-day .halves span { height: 8px; border-radius: 4px; background: #E2E8F0; }
.preview-day .halves span.present { background: #22C55E; }
.preview-day .halves span.absent { background: #F87171; }
.preview-day.today { border-color: var(--ink); }
.preview-day.past { opacity: .5; }

/* ==========================================================================
   Connexion
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 24px; }
.auth-card .card { padding: 28px; }
.auth-card h1 { font-size: 21px; margin-bottom: 4px; }

/* ==========================================================================
   Écran TV (1920 × 1080, thème clair)
   ========================================================================== */
.tv-body { background: var(--bg); overflow: hidden; }
.tv {
    width: 100vw; height: 100vh; padding: 2.1vw; display: flex; flex-direction: column; gap: 1.25vw;
    font-size: clamp(14px, 0.94vw, 26px);
}
.tv-head { display: flex; align-items: center; gap: 1.7vw; }
.tv-clock { font-size: 5vw; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-date { font-size: 1.8vw; font-weight: 600; letter-spacing: -0.01em; }
.tv-week { font-size: 1.05vw; color: var(--muted-2); margin-top: .3vw; }
.tv-brands { margin-left: auto; display: flex; gap: 1.5vw; font-size: 1.15vw; font-weight: 600; }
.tv-brands span { display: inline-flex; align-items: center; gap: .55vw; }
.tv-brands i { width: .85vw; height: .85vw; border-radius: .26vw; display: inline-block; }
.tv-grid {
    flex: 1; min-height: 0; display: grid; gap: 1.25vw;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
.tv-panel {
    background: #fff; border: 1px solid var(--line); border-radius: 1.05vw; padding: 1.25vw;
    display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow);
}
.tv-panel h2 { font-size: 1.38vw; font-weight: 700; }
.tv-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1vw; margin-bottom: .85vw; }
.tv-panel-head .muted { font-size: .95vw; color: var(--muted-2); }
.tv-day { grid-column: 1; grid-row: 1 / span 2; }
.tv-next { grid-column: 2; grid-row: 1 / span 2; overflow: hidden; }
.tv-team { grid-column: 3; grid-row: 1; }
.tv-stock { grid-column: 3; grid-row: 2; background: transparent; border: 2px dashed #CBD5E1; box-shadow: none; }

.tv-allday { display: flex; flex-direction: column; gap: .4vw; margin-bottom: .6vw; }
.tv-allday .bar { margin: 0; height: 2.1vw; font-size: .95vw; font-weight: 600; border-radius: .6vw; }
.tv-timeline { position: relative; flex: 1; min-height: 0; display: flex; gap: .4vw; }
.tv-hours { position: relative; width: 2.6vw; flex: none; }
.tv-hours div { position: absolute; right: .3vw; transform: translateY(-50%); font-size: .8vw; font-weight: 600; color: var(--muted-2); }
.tv-track { position: relative; flex: 1; background: #F1F4F8; border-radius: .55vw; overflow: hidden; }
.tv-track .office { position: absolute; left: 0; right: 0; background: #FAFBFD; }
.tv-track .lines { position: absolute; inset: 0; }
.tv-track .lines i { position: absolute; left: 0; right: 0; height: 1px; background: #E2E7EF; }
.tv-ev {
    position: absolute; z-index: 2; border-radius: .65vw; padding: .55vw .75vw; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; border: 1px solid transparent;
    box-shadow: 0 0 0 2px #F1F4F8;
}
.tv-ev .t { font-size: 1.1vw; font-weight: 700; line-height: 1.2; overflow: hidden; }
.tv-ev .m { display: flex; align-items: center; justify-content: space-between; gap: .4vw; }
.tv-ev .h { font-size: .9vw; font-weight: 600; white-space: nowrap; }
.tv-ev .avatar { --s: 1.9vw; box-shadow: 0 0 0 .16vw var(--ring); }
.tv-ev.compact { flex-direction: row; align-items: center; gap: .6vw; padding: .2vw .6vw; }
.tv-ev.compact .t { font-size: .95vw; white-space: nowrap; text-overflow: ellipsis; }
.tv-now { position: absolute; left: 0; right: 0; height: 3px; background: var(--danger); z-index: 4; }
.tv-now::before { content: ''; position: absolute; left: -2px; top: -5px; width: 13px; height: 13px; border-radius: 50%; background: var(--danger); }
.tv-empty { color: var(--muted-2); font-size: 1vw; padding: 1vw 0; }

.tv-next-list { display: flex; flex-direction: column; gap: .75vw; min-height: 0; overflow: hidden; }
.tv-next-item { display: flex; gap: .85vw; padding: .75vw; border-radius: .75vw; background: var(--surface-2); border: 1px solid var(--line-soft); }
.tv-next-date { width: 3vw; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: .55vw; background: #fff; border: 1px solid var(--line); padding: .4vw 0; }
.tv-next-date .d { font-size: .75vw; font-weight: 600; color: var(--muted-2); letter-spacing: .06em; text-transform: uppercase; }
.tv-next-date .n { font-size: 1.38vw; font-weight: 800; line-height: 1.1; }
.tv-next-title { font-size: 1.02vw; font-weight: 700; line-height: 1.25; }
.tv-next-meta { display: flex; align-items: center; justify-content: space-between; gap: .4vw; margin-top: .4vw; }
.tv-next-when { display: flex; align-items: center; gap: .45vw; font-size: .82vw; font-weight: 500; color: var(--ink-2); }
.tv-next-when i { width: .65vw; height: .65vw; border-radius: .2vw; flex: none; }
.tv-next-item .avatar { --s: 1.7vw; box-shadow: 0 0 0 .16vw var(--surface-2); }

.tv-team-row { flex: 1; display: flex; align-items: center; gap: 2vw; min-height: 0; }
.tv-people { display: flex; flex-wrap: wrap; gap: 1.4vw; }
.tv-person { display: flex; flex-direction: column; align-items: center; gap: .6vw; }
.tv-person .avatar { --s: 6.2vw; font-size: 2.1vw; font-weight: 700; }
.tv-person.in .avatar { box-shadow: 0 0 0 .21vw #fff, 0 0 0 .33vw var(--c); }
.tv-person.away .avatar { --s: 5vw; font-size: 1.7vw; }
.tv-person .n { font-size: 1.05vw; font-weight: 600; }
.tv-person.away .n { color: var(--muted); font-weight: 500; font-size: .95vw; }
.tv-person .note { font-size: .78vw; color: var(--muted-2); margin-top: -.3vw; }
.tv-sep { width: 1px; align-self: stretch; margin: 1.4vw 0; background: var(--line); }
.tv-intern {
    display: flex; align-items: center; gap: .75vw; padding: .7vw .95vw; border-radius: .75vw; margin-top: .5vw;
    border: 1px solid; flex-wrap: wrap;
}
.tv-intern .k { font-size: .78vw; font-weight: 700; letter-spacing: .08em; }
.tv-intern .nm { font-size: 1.05vw; font-weight: 700; }
.tv-intern .dt { font-size: .9vw; }

.tv-stock-head { display: flex; align-items: center; gap: .75vw; }
.tv-stock-tag { font-size: .75vw; font-weight: 600; color: var(--ink-2); background: #E9EDF3; border-radius: 999px; padding: .3vw .65vw; }
.tv-stock p { margin: .9vw 0 0; font-size: .95vw; color: var(--muted-2); line-height: 1.5; max-width: 34vw; }
.tv-stock-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6vw; margin-top: .9vw; }
.tv-stock-item { display: flex; justify-content: space-between; gap: .6vw; padding: .65vw .85vw; background: #fff; border: 1px solid var(--line); border-radius: .6vw; font-size: .95vw; font-weight: 600; }
.tv-stock-item span:last-child { color: var(--muted-2); font-weight: 500; }
.tv-skel { display: flex; flex-direction: column; gap: .6vw; margin-top: .9vw; }
.tv-skel div { height: 2.3vw; border-radius: .55vw; background: #fff; border: 1px solid var(--line-soft); display: flex; align-items: center; gap: .75vw; padding: 0 .85vw; }
.tv-skel i { height: .62vw; border-radius: .31vw; background: var(--line-soft); }

/* Fiche d'une personne */
.person-ev { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.person-ev:hover { background: var(--surface-2); color: var(--ink); }
.person-ev-date { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; }
.person-ev-date .d { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.person-ev-date .n { font-size: 17px; font-weight: 700; line-height: 1.1; }
.person-ev-title { display: block; font-weight: 600; }
.person-ev-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
