/* Velar Horaires — styles communs (Velar Shift et Velar Manager) */
:root {
  --ink: #1A1A1A; --gun: #353A3E; --silver: #BFBFBF; --alab: #E0E0E0; --gold: #AA9975; --gold-text: #7A6450; --gold-soft: #F4EFEA;
  --bg: #F2F2F2; --card: #FFFFFF; --line: #E2E2E2; --muted: #6B6E73; --text: #1A1A1A; --danger: #A3352B; --danger-soft: #FBEDEB; --ok: #2E6B4F;
  --radius: 14px; --font-h: 'Jost', 'Futura', 'Century Gothic', sans-serif; --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 6px; } .stack.lg { gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.nowrap { flex-wrap: nowrap; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1 1 0; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s; }
.btn:hover { background: #F4F4F4; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.gold:hover { background: #9C8268; }
.btn.outline { border-color: #BDBDBD; font-weight: 600; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.fill { background: var(--danger); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; min-height: 48px; font-size: 15px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Pastilles et statuts */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--gun); background: #EDEDED; padding: 3px 9px; border-radius: 6px; }
.tag.gold { background: var(--gold-soft); color: var(--gold-text); font-weight: 700; }
.chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st-a_combler { background: #fff; color: var(--gold-text); border: 1.5px dashed var(--gold); }
.st-propose { background: var(--alab); color: var(--ink); }
.st-en_attente { background: #fff; color: var(--gold-text); border: 1.5px solid var(--gold); }
.st-accepte { background: #5A5E66; color: #fff; }
.st-confirme { background: var(--ink); color: var(--gold); }
.st-termine { background: #F0F0F0; color: #4A4D52; border: 1px solid #D4D4D4; }
.st-annule, .st-refuse { background: #F0F0F0; color: #6B6E73; text-decoration: line-through; }
.chip.urgent { background: var(--gold); color: var(--ink); }
.chip.alert { background: var(--danger-soft); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--gold); display: inline-block; }

/* Cartes et formulaires */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.card h2 { font-size: 17px; font-weight: 700; }
.card.flat { padding: 0; overflow: hidden; }
.card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--alab); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--gun); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #C9C9C9; border-radius: 10px; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--gold); font-size: 14px; }
.alert.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* Tableaux */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid #EFEFEF; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FAFAFA; }

/* Onglets / segments */
.seg { display: inline-flex; background: #E4E4E4; border-radius: 10px; padding: 3px; }
.seg button, .seg a { min-height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 500; color: #4A4D52; cursor: pointer; text-decoration: none; }
.seg [aria-pressed="true"], .seg [aria-current="true"] { background: var(--ink); color: #fff; font-weight: 700; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.pills button { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; border: 1px solid #CFCFCF; font-weight: 600; font-size: 14px; cursor: pointer; }
.pills button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }

/* Fenêtres et notifications */
.backdrop { position: fixed; inset: 0; background: rgba(20, 20, 20, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 100; padding: 0; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 22px 22px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal.wide { max-width: 860px; }
.modal h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@media (min-width: 700px) { .backdrop { align-items: center; padding: 24px; } .modal { border-radius: 20px; } }
#toasts { position: fixed; left: 0; right: 0; bottom: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 480px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.3); border-left: 4px solid var(--gold); }
.toast.error { border-left-color: #E5736A; }

/* Écran de connexion */
.login { min-height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: #fff; }
.login .brand { padding: 48px 28px 28px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; max-width: 460px; width: 100%; margin: 0 auto; }
.login .brand .word { font-weight: 800; letter-spacing: .24em; font-size: 20px; }
.login .brand .word span { color: var(--gold); }
.login .brand p { color: var(--silver); font-size: 15px; max-width: 34ch; }
.login .panel { background: var(--bg); color: var(--text); border-radius: 24px 24px 0 0; padding: 28px; flex: 1; }
.login .panel form { max-width: 404px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-size: 24px; font-weight: 800; }

/* ===== Velar Shift (agent, mobile) ===== */
.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; position: relative; }
@media (min-width: 520px) { body.is-shift { background: #D9D9D9; } .phone { box-shadow: 0 0 40px rgba(0,0,0,.18); } }
.phone-head { background: var(--ink); color: #fff; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; padding-top: calc(16px + env(safe-area-inset-top)); }
.phone-head .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phone-head .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2em; font-size: 14px; }
.phone-head .logo span { color: var(--gold); }
.phone-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.phone-head .sub { color: var(--silver); font-size: 14px; }
.phone-head .back { display: inline-flex; align-items: center; gap: 6px; color: var(--silver); min-height: 44px; margin-left: -6px; padding: 0 6px; border: 0; background: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.phone-main { flex: 1; padding: 14px 16px 110px; display: flex; flex-direction: column; gap: 12px; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--ink); display: flex; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 50; }
.tabbar a { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--silver); font-size: 11px; font-weight: 500; text-decoration: none; position: relative; }
.tabbar a[aria-current="page"] { color: #fff; font-weight: 700; }
.tabbar a[aria-current="page"] .icon { stroke: var(--gold); stroke-width: 2; }
.tabbar .badge, .bell .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.bell { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #2C2C2C; color: #fff; text-decoration: none; }
.bell .badge { top: 4px; left: auto; right: 4px; }
.shift-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.shift-card .datebox { width: 52px; height: 56px; flex: none; border-radius: 10px; background: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.datebox .dow { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--gold); text-transform: uppercase; }
.datebox .day { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.1; }
.shift-card .time { font-size: 18px; font-weight: 800; }
.weekstrip { background: #fff; border-bottom: 1px solid var(--line); padding: 12px; display: flex; gap: 4px; align-items: center; }
.weekstrip .nav { width: 36px; height: 52px; border: 0; background: none; cursor: pointer; flex: none; border-radius: 10px; }
.weekstrip .d { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; }
.weekstrip .d.today { background: var(--ink); color: #fff; }
.weekstrip .d .w { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.weekstrip .d .n { font-size: 18px; font-weight: 800; }
.weekstrip .d i { width: 6px; height: 6px; border-radius: 999px; background: transparent; }
.weekstrip .d.has i { background: var(--gold); }
.day-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 2px 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }
.clock { background: var(--ink); color: #fff; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.clock .big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.notif { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; text-decoration: none; }
.notif.unread { border-color: var(--gold); background: #FFFDFB; }
.notif .dot { margin-top: 7px; flex: none; }
.notif.read .dot { background: transparent; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.msg.mine { background: var(--gold-soft); border-color: var(--gold); }

/* ===== Velar Manager (gestionnaire) ===== */
.mgr { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 240px; max-width: 260px; min-width: 220px; background: var(--ink); color: var(--alab); display: flex; flex-direction: column; padding: 26px 14px 18px; gap: 26px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.side .brand b { display: block; font-weight: 800; letter-spacing: .22em; font-size: 15px; color: #fff; }
.side .brand small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 44px; border-radius: 8px; font-weight: 500; font-size: 14px; text-decoration: none; color: inherit; }
.side nav a:hover { background: #262626; }
.side nav a[aria-current="page"] { background: #2C2C2C; color: #fff; font-weight: 600; }
.side nav a[aria-current="page"] .icon { stroke: var(--gold); }
.side nav .pill { margin-left: auto; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--gun); font-size: 13px; }
.side .me .av { width: 36px; height: 36px; border-radius: 999px; background: var(--gun); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.side .me button { margin-left: auto; background: none; border: 0; color: var(--silver); cursor: pointer; font-size: 12px; text-decoration: underline; min-height: 44px; }
.main { flex: 999 1 560px; min-width: 0; padding: 30px 38px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head .eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.hero { background: var(--ink); color: #fff; border-radius: 16px; padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; }
.hero .big { font-size: 60px; font-weight: 800; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.kpis { display: flex; flex-wrap: wrap; gap: 14px; }
.kpi { flex: 1 1 190px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.kpi .v { font-size: 32px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.cols > * { min-width: 0; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 0; border-top: 1px solid #ECECEC; }
.list-row:first-of-type { border-top: 0; }
.bar { height: 8px; background: #E9E9E9; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gun); border-radius: 999px; }
.av-sm { width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
/* Calendrier */
.weekgrid { display: flex; gap: 10px; min-width: 980px; align-items: stretch; }
.weekgrid .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.weekgrid .dh { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.weekgrid .dh.today { background: var(--gold); border-color: var(--gold); }
.weekgrid .dh .w { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.weekgrid .dh .n { font-size: 22px; font-weight: 800; }
.sh { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 10px; text-align: left; cursor: pointer; width: 100%; border: 1px solid; }
.sh .t { font-size: 12px; font-weight: 700; } .sh .s { font-size: 13px; font-weight: 700; line-height: 1.3; } .sh .a { font-size: 12px; opacity: .9; }
.sh.k-a_combler { background: #fff; border: 2px dashed var(--gold); color: var(--ink); }
.sh.k-propose { background: var(--alab); border-color: #BFBFBF; color: var(--ink); }
.sh.k-accepte { background: #5A5E66; border-color: #5A5E66; color: #fff; }
.sh.k-confirme { background: var(--ink); border-color: var(--ink); color: #fff; }
.sh.k-termine { background: #F7F7F7; border-color: #D4D4D4; color: #4A4D52; }
.sh.k-annule { background: #F7F7F7; border-color: #D4D4D4; color: #8A8D92; text-decoration: line-through; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; min-width: 760px; }
.month .mh { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.month .cell { min-height: 108px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; }
.month .cell.out { background: #F8F8F8; color: #9A9DA2; }
.month .cell.today { border-color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.month .cell .mn { font-weight: 800; font-size: 14px; }
.mini { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #EDEDED; }
.mini.open { background: var(--gold-soft); color: var(--gold-text); border: 1px dashed var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: #4A4D52; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.cand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid #ECECEC; }
.cand:first-child { border-top: 0; }
.cand .issues { flex-basis: 100%; font-size: 12px; color: var(--danger); }
.cand .issues.soft { color: var(--gold-text); }
.timeline { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.timeline div { display: flex; gap: 10px; } .timeline time { color: var(--muted); flex: none; width: 120px; }
@media (max-width: 900px) {
  .side { position: static; height: auto; max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
  .side nav a { white-space: nowrap; } .side .me { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 26px; }
}
@media print { .side, #toasts, .no-print { display: none !important; } .main { padding: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== Identité Velar Protection (brandbook) ===== */
h1, h2, h3, .btn, .tabbar, .side nav a, .phone-head .logo, .side .brand b, .login .brand .word, .datebox .dow, .hero .big { font-family: var(--font-h); }
h1, h2, h3 { text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.btn { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
body { font-weight: 400; letter-spacing: .01em; }
.login .brand .word { font-weight: 500; letter-spacing: .28em; text-transform: uppercase; font-size: 13px; color: var(--gold); }
.login .brand .logo-full { margin: 0 0 4px -4px; max-width: 100%; height: auto; }
.phone-head .logo, .side .brand b { font-weight: 600; }
.logo-v { flex: none; display: block; }
.phone-head h1, .page-head h1, .login h1 { letter-spacing: .04em; }
