/* Coffre RH — Cabinet Dentaire Anatole France. Fond blanc, bleu ciel, lisible sur téléphone. */
:root {
  --bg: #f6fafd; --surface: #fff; --surface-2: #f0f7fc; --border: #dbe8f2; --text: #1d2b38; --muted: #6b7c8c;
  --sky: #0ea5e9; --sky-d: #0284c7; --sky-dd: #075985; --sky-l: #e0f2fe; --teal: #0cb8b6;
  --ok: #15803d; --ok-l: #dcfce7; --warn: #b45309; --warn-l: #fef3c7; --err: #b91c1c; --err-l: #fee2e2;
  --r: 14px; --sh: 0 1px 2px rgba(15, 50, 80, .05), 0 4px 14px rgba(15, 50, 80, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--sky-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: .2rem 0 .8rem; color: var(--sky-dd); letter-spacing: -.01em; }
h2 { font-size: 1.12rem; margin: 1.5rem 0 .7rem; color: var(--sky-dd); }
.card h2:first-child, .card > .head-row:first-child h2 { margin-top: 0; }
code { font: .9em ui-monospace, Menlo, Consolas, monospace; background: var(--sky-l); padding: .1em .4em; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.ico { width: 22px; height: 22px; flex: none; }
.ico.big { width: 34px; height: 34px; }
.ico.huge { width: 54px; height: 54px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 1.2rem; padding-bottom: 6rem; min-height: 70vh; }
.narrow { max-width: 460px; margin: 2rem auto; }
.foot { color: var(--muted); font-size: .8rem; text-align: center; padding-bottom: 1.5rem; }

/* En-tête */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1120px; margin: 0 auto; padding: .5rem 16px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--sky-dd); font-weight: 650; white-space: nowrap; }
.brand img { height: 34px; width: auto; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: .2rem; flex: 1; }
.nav a { white-space: nowrap; display: flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border-radius: 10px; color: var(--muted); font-weight: 550; position: relative; }
.nav a:hover { background: var(--sky-l); color: var(--sky-dd); text-decoration: none; }
.nav a.on { background: var(--sky-l); color: var(--sky-d); }
.nav .ico { width: 19px; height: 19px; }
.badge-n { background: var(--err); color: #fff; font-size: .7rem; border-radius: 99px; padding: 0 .4rem; min-width: 1.2rem; text-align: center; }
.me { display: flex; align-items: center; gap: .5rem; }
.me form { margin: 0; }
@media (max-width: 1180px) and (min-width: 861px) {
  .brand span { display: none; }
  .nav a { padding: .45rem .5rem; font-size: .92rem; }
  .nav .ico { display: none; }
  .top-in { gap: .6rem; }
}
@media (max-width: 860px) {
  .brand span { display: none; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border);
    justify-content: space-around; padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom)); z-index: 20; gap: 0; }
  .nav a { flex-direction: column; gap: .1rem; font-size: .68rem; padding: .35rem .3rem; flex: 1; text-align: center; }
  .nav .ico { width: 23px; height: 23px; }
  .badge-n { position: absolute; top: 0; right: 18%; }
  .top-in { justify-content: space-between; }
}

/* Boutons et formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: .6rem 1rem; border-radius: 11px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: var(--sky); text-decoration: none; }
.btn.primary { background: var(--sky-d); border-color: var(--sky-d); color: #fff; }
.btn.primary:hover { background: var(--sky-dd); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); border-color: #f3b4b4; background: #fff; }
.btn.small { padding: .35rem .7rem; font-size: .88rem; border-radius: 9px; }
.btn.wide { width: 100%; padding: .85rem; }
.btn.big-btn { padding: 1rem 1.2rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: wait; }
.linkbtn { border: 0; background: none; color: var(--sky-d); cursor: pointer; font: inherit; padding: 0; }
.form { display: grid; gap: .9rem; }
.form > .btn { justify-self: start; }
.form > .btn.wide { justify-self: stretch; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; color: #3b4d5e; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: .65rem .75rem; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--sky-l); border-color: var(--sky); }
.big-input { font-size: 1.4rem; font-weight: 650; padding: .7rem; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; color: var(--text); }
label.check input { width: 20px; height: 20px; flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.form.inline { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.inline-label { display: inline-flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.inline-label input { width: auto; }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.stack { display: grid; gap: .6rem; justify-items: start; }
.stack form { margin: 0; }
.danger-zone { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); }

/* Cartes et blocs */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 1.1rem 1.2rem; box-shadow: var(--sh); margin-bottom: 1rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + *, * + .cols { margin-top: 1rem; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.head-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.head-row h1, .head-row h2 { margin: 0; }
.head-row h2 { display: flex; align-items: center; gap: .4rem; }
.crumbs { color: var(--muted); margin: 0 0 .4rem; font-size: .9rem; }
.empty { color: var(--muted); padding: 1.2rem; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r); }
.flash { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.flash.ok { background: var(--ok-l); color: var(--ok); }
.flash.err { background: var(--err-l); color: var(--err); }
.flash.warn { background: var(--warn-l); color: var(--warn); }
.flash.info { background: var(--sky-l); color: var(--sky-dd); }
.warn-card { border-color: #f5d08a; background: #fffbeb; }
.small-card { padding: .8rem 1rem; }
.secours-code code { font-size: 1.35rem; letter-spacing: .06em; padding: .4rem .7rem; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); font-weight: 600; }
.new-text { color: var(--sky-d); font-weight: 650; }
.pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.pill { padding: .3rem .75rem; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); background: #fff; font-size: .9rem; }
.pill.on { background: var(--sky-d); border-color: var(--sky-d); color: #fff; }
.pill:hover { text-decoration: none; border-color: var(--sky); }
.chip { display: inline-block; padding: .2rem .6rem; border-radius: 99px; background: var(--surface-2); font-size: .85rem; }
.chip.ok { background: var(--ok-l); color: var(--ok); }
.chip.warn { background: var(--warn-l); color: var(--warn); }
.search input { width: 13rem; padding: .45rem .7rem; }

/* Avatars ronds */
.av { display: inline-block; border-radius: 50%; overflow: hidden; flex: none; object-fit: cover; background: var(--sky-l); vertical-align: middle; }
.av svg { width: 100%; height: 100%; display: block; }
.av-xs { width: 22px; height: 22px; }
.av-sm { width: 32px; height: 32px; }
.av-md { width: 42px; height: 42px; }
.av-lg { width: 60px; height: 60px; }
.av-xl { width: 110px; height: 110px; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--sky-l); }
.av-none { display: inline-flex; align-items: center; justify-content: center; color: var(--warn); background: var(--warn-l); font-weight: 700; }
.av-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.av-row > a, .av-row > span { display: grid; justify-items: center; gap: .2rem; font-size: .8rem; color: var(--text); max-width: 76px; text-align: center; }
.hello { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.hello h1 { margin: 0; }
.hello p { margin: 0; }

/* Accueil salarié */
.humour-card { display: flex; gap: 1rem; align-items: center; background: linear-gradient(120deg, #e0f2fe, #ecfeff); border-color: #bae6fd; color: var(--text); }
.humour-card:hover { text-decoration: none; border-color: var(--sky); }
.humour-card .ico { color: var(--sky-d); }
.humour-card .link { color: var(--sky-d); font-weight: 650; white-space: nowrap; }
.humour { background: var(--sky-l); padding: .7rem .9rem; border-radius: 12px; margin-top: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; gap: 1rem; align-items: center; color: var(--text); margin: 0; }
.tile:hover { text-decoration: none; }
.tile > div { display: grid; }
.tile .ico { color: var(--sky-d); }
.big-num { font-size: 1.9rem; line-height: 1.1; color: var(--sky-dd); }

.req-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; }
@media (max-width: 900px) { .req-grid { grid-template-columns: repeat(2, 1fr); } }
.req-tile { display: grid; justify-items: center; text-align: center; gap: .3rem; padding: 1.1rem .7rem; border-radius: var(--r); background: #fff;
  border: 1px solid var(--border); box-shadow: var(--sh); color: var(--text); }
.req-tile:hover { text-decoration: none; border-color: var(--tc); transform: translateY(-1px); }
.req-tile .ico { color: var(--tc); }
.req-tile span { font-size: .8rem; color: var(--muted); }
.req-grid.compact .req-tile { padding: .8rem .5rem; }
.t-conge { --tc: #0ea5e9; } .t-absence { --tc: #8b5cf6; } .t-frais { --tc: #0cb8b6; } .t-km { --tc: #f59e0b; } .t-acompte { --tc: #10b981; }
.req-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: color-mix(in srgb, var(--tc, var(--sky)) 14%, #fff); color: var(--tc, var(--sky-d)); }
.req-ico.inline { width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; }
.req-ico.inline .ico { width: 18px; height: 18px; }
h1.with-ico { display: flex; align-items: center; gap: .6rem; }

.req-list, .doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.req-list li, .doc-list li { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .65rem .8rem; }
.req-list li > a, .doc-list li > a { display: flex; align-items: center; gap: .75rem; flex: 1; color: var(--text); min-width: 0; }
.req-list li > a:hover, .doc-list li > a:hover { text-decoration: none; }
.req-list li form, .doc-list li form { margin: 0; }
.req-list.detailed li { align-items: flex-start; }
.req-list li.focus { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-l); }
.row-flex { display: flex; align-items: center; gap: .7rem; flex: 1; flex-wrap: wrap; }
.reply { background: var(--surface-2); border-radius: 8px; padding: .35rem .6rem; margin-top: .35rem; font-size: .9rem; }
.st { font-size: .76rem; font-weight: 650; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; }
.st-attente { background: var(--warn-l); color: var(--warn); }
.st-acceptee { background: var(--ok-l); color: var(--ok); }
.st-refusee { background: var(--err-l); color: var(--err); }
.st-annulee { background: #eef2f6; color: var(--muted); }
.st-new { background: var(--sky-d); color: #fff; }
.dl { font-size: 1.1rem; }

/* Photo de profil */
.photo-row { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.photo-form { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.photo-form .btn { cursor: pointer; }
.infos { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .35rem; }
.infos li { display: flex; gap: .8rem; }
.infos span { color: var(--muted); min-width: 6.5rem; }

/* Demandes : formulaires */
.req-form { max-width: 640px; }
.file-btns, .photo-zone { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.file-btns .btn, .photo-zone .btn { cursor: pointer; }
.preview { max-width: 100%; max-height: 260px; border-radius: 12px; border: 1px solid var(--border); flex-basis: 100%; object-fit: contain; }

/* Calendrier de sélection */
.cal { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.cal-nav { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.cal-month { border: 1px solid var(--border); border-radius: 12px; padding: .6rem; background: #fff; }
.cal-title { text-align: center; font-weight: 700; color: var(--sky-dd); margin-bottom: .4rem; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-h { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; padding: .2rem 0; }
.cal-d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-size: .95rem; cursor: pointer; position: relative;
  touch-action: none; }
.cal-d:hover { background: var(--sky-l); }
.cal-d.we, .cal-d.fer { color: #a0aebb; }
.cal-d.fer::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: #f59e0b; }
.cal-d.past { color: #c3ccd5; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--sky); }
.cal-d.busy-ok { background: var(--ok-l); color: var(--ok); }
.cal-d.busy-wait { background: var(--warn-l); color: var(--warn); }
.cal-d.in { background: var(--sky-l); color: var(--sky-dd); border-radius: 0; }
.cal-d.sel-a, .cal-d.sel-b { background: var(--sky-d); color: #fff; font-weight: 700; }
.cal-d.sel-a { border-radius: 9px 0 0 9px; } .cal-d.sel-b { border-radius: 0 9px 9px 0; } .cal-d.sel-a.sel-b { border-radius: 9px; }
.cal-grid > * { min-width: 0; }
.cal-summary { font-weight: 650; color: var(--sky-dd); background: var(--sky-l); padding: .6rem .8rem; border-radius: 10px; }
.cal-help { margin-bottom: -.4rem; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1rem; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { display: grid; justify-items: start; gap: .2rem; margin: 0; color: var(--text); }
.kpi:hover { text-decoration: none; border-color: var(--sky); }
.kpi .ico { color: var(--sky-d); }
.kpi strong { font-size: 1.6rem; color: var(--sky-dd); line-height: 1.1; }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi.alert { border-color: #fcd34d; background: #fffbeb; }
.kpi.alert strong { color: var(--warn); }
.legend { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.lg.ok { background: var(--ok); } .lg.wait { background: #f59e0b; }
.team-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tc-head { text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.tc-day { min-height: 74px; border: 1px solid var(--border); border-radius: 10px; padding: .25rem; position: relative; background: #fff; }
.tc-x { min-height: 0; }
.tc-day.we, .tc-day.ferie { background: var(--surface-2); }
.tc-day.today { border-color: var(--sky); box-shadow: inset 0 0 0 1px var(--sky); }
.tc-num { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tc-count { position: absolute; top: .2rem; right: .3rem; font-size: .7rem; background: var(--sky-d); color: #fff; border-radius: 99px; padding: 0 .35rem; }
.tc-avs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: .15rem; }
.tc-av { border-radius: 50%; display: inline-flex; }
.tc-av.ok .av { box-shadow: 0 0 0 2px var(--ok); }
.tc-av.wait .av { box-shadow: 0 0 0 2px #f59e0b; opacity: .85; }
@media (max-width: 640px) { .tc-day { min-height: 54px; padding: .15rem; } .av-xs { width: 16px; height: 16px; } }

/* Équipe */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; }
.person { display: grid; justify-items: center; text-align: center; gap: .25rem; margin: 0; color: var(--text); }
.person:hover { text-decoration: none; border-color: var(--sky); }

/* Demandes (gestion) */
.dem-list { display: grid; gap: .9rem; }
.dem { margin: 0; }
.dem-head { display: flex; gap: .9rem; align-items: flex-start; }
.dem-main { font-size: 1.05rem; font-weight: 600; margin: .25rem 0; }
.justif { display: inline-block; margin-top: .3rem; font-weight: 600; }
.overlap { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-top: .7rem; padding: .5rem .7rem; background: var(--surface-2); border-radius: 10px; }
.ov .av { box-shadow: 0 0 0 2px #f59e0b; }
.ov.ok .av { box-shadow: 0 0 0 2px var(--ok); }
.dem-actions { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.dem-actions input { flex: 1 1 220px; }

/* Fiches de paie */
.steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; color: var(--muted); font-size: .9rem; padding: .3rem .8rem; border-radius: 99px; background: var(--surface-2); }
.steps li::before { content: counter(s) ". "; font-weight: 700; }
.steps li.on { background: var(--sky-d); color: #fff; }
.steps li.done { background: var(--ok-l); color: var(--ok); }
.drop { position: relative; border: 2px dashed #b9d9ee; border-radius: var(--r); background: var(--surface-2); text-align: center; transition: .15s; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop label { display: grid; justify-items: center; gap: .4rem; padding: 1.1rem; color: var(--text); font-weight: 500; cursor: pointer; }
.drop.big label { padding: 2.4rem 1rem; }
.drop.big .ico { color: var(--sky-d); }
.drop.over { border-color: var(--sky); background: var(--sky-l); }
.queue { list-style: none; padding: 0; margin: .8rem 0; display: grid; gap: .35rem; }
.queue li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .7rem; border: 1px solid var(--border); border-radius: 9px; background: #fff; font-size: .9rem; }
.queue li.done { border-color: #a7e3b8; }
.queue li.fail { border-color: #f3b4b4; color: var(--err); }
.paie-sum { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); font-weight: 650; }
.table th, .table td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.paie-table tr.ok td:first-child { box-shadow: inset 4px 0 var(--ok); }
.paie-table tr.warn td:first-child { box-shadow: inset 4px 0 #f59e0b; }
.paie-table tr.warn .state { color: var(--warn); font-weight: 600; }
.paie-table tr.ok .state { color: var(--ok); }
.paie-table tr.done { opacity: .6; }
.paie-table tr.sent .state { color: var(--ok); font-weight: 700; }
.paie-table tr.fail .state { color: var(--err); }
.paie-table .who { display: flex; align-items: center; gap: .5rem; min-width: 15rem; }
.paie-table select { padding: .4rem; }
.paie-table input[type=month] { padding: .35rem; width: 10rem; }
.paie-table input[type=checkbox] { width: 20px; height: 20px; }
.fname { word-break: break-all; }
.small-drop label { padding: .8rem; }

/* Connexion */
.login .card { padding: 1.8rem; text-align: center; }
.login .form { text-align: left; }
.login-logo { height: 52px; margin-bottom: .6rem; }
body.is-guest .foot { margin-top: 2rem; }
[hidden] { display: none !important; }

/* Double authentification : QR code */
.totp-setup { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.totp-setup ol { flex: 1 1 260px; margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; }
.qr { width: 190px; height: 190px; flex: none; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }

/* Actions sensibles (rouge) */
.btn.danger:hover { border-color: var(--err); background: var(--err-l); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger.solid:hover { background: #991b1b; }
.card.sensitive { border-color: #f3b4b4; box-shadow: inset 4px 0 0 var(--err), var(--sh); }
.card.sensitive h2 { color: var(--err); }
.sensitive-note { color: var(--err); background: var(--err-l); padding: .45rem .7rem; border-radius: 9px; margin-top: 0; }
.admin-card { border-style: dashed; background: #fafcff; }

/* Messages (registre permanent) */
.t-message { --tc: #6366f1; }
.archive-note { display: flex; gap: .6rem; align-items: flex-start; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; padding: .7rem .9rem; border-radius: 12px; font-size: .92rem; }
.msg-text { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; margin: .4rem 0; }
.st-lu { background: var(--sky-l); color: var(--sky-dd); }

/* Tableau de bord : bascule calendrier / planning */
.pills.switch .pill { font-weight: 600; }
.tc-count.lvl2 { background: #f59e0b; } .tc-count.lvl3 { background: #ea580c; } .tc-count.lvl4 { background: var(--err); }
.tc-more { font-size: .7rem; font-weight: 700; color: var(--sky-dd); background: var(--sky-l); border-radius: 99px; padding: 0 .35rem; align-self: center; }
.tc-more:hover { text-decoration: none; background: var(--sky); color: #fff; }

.planning-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.planning { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .8rem; }
.planning th, .planning td { padding: 0; border-bottom: 1px solid #eef3f8; }
.planning .pl-name { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; min-width: 9.5rem; max-width: 9.5rem; padding: .25rem .5rem;
  border-right: 1px solid var(--border); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning .pl-name a { display: flex; align-items: center; gap: .4rem; color: var(--text); }
.planning .pl-name a:hover { text-decoration: none; color: var(--sky-d); }
.planning thead .pl-name { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.pl-day { min-width: 26px; text-align: center; color: var(--muted); font-weight: 600; padding: .2rem 0 !important; line-height: 1.15; }
.pl-day span { display: block; font-size: .62rem; font-weight: 500; }
.pl-day.today { color: var(--sky-d); box-shadow: inset 0 -3px var(--sky); }
.pl-count { text-align: center; font-weight: 700; height: 24px; color: #fff; }
.pl-count.lvl0 { color: transparent; }
.pl-count.lvl1 { background: #bae6fd; color: var(--sky-dd); }
.pl-count.lvl2 { background: #fcd34d; color: #78350f; }
.pl-count.lvl3 { background: #fb923c; }
.pl-count.lvl4 { background: var(--err); }
.pl-cell { height: 30px; min-width: 26px; position: relative; }
.pl-cell.off, .pl-day.off { background: var(--surface-2); }
.pl-cell .bar { position: absolute; left: 0; right: 0; top: 6px; bottom: 6px; display: block; }
.pl-cell .bar.ok { background: #22c55e; }
.pl-cell .bar.wait { background: repeating-linear-gradient(135deg, #fbbf24 0 5px, #fde68a 5px 10px); }
.pl-cell .bar.deb { left: 3px; border-radius: 6px 0 0 6px; }
.pl-cell .bar.fin { right: 3px; border-radius: 0 6px 6px 0; }
.pl-cell .bar.deb.fin { border-radius: 6px; }
.pl-cell .bar:hover { filter: brightness(.9); }
.planning tbody tr:hover .pl-name, .planning tbody tr:hover td { background-color: #f3f9fe; }
.planning tbody tr:hover td.off { background-color: #e8f1f8; }
@media (max-width: 640px) { .planning .pl-name { min-width: 6.5rem; max-width: 6.5rem; } }
@media (max-width: 860px) {
  .nav a { min-width: 0; font-size: .62rem; padding: .35rem .1rem; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Application installable */
.install-card { border-color: #99e6e4; background: linear-gradient(135deg, #f0fdfc, #fff 60%); }
.install-head { display: flex; gap: .9rem; align-items: center; }
.install-head img { border-radius: 14px; flex: none; box-shadow: 0 2px 8px rgba(12, 184, 182, .25); }
.install-head h2 { margin: 0 0 .2rem; }
.install-head p { margin: 0; }
.steps-list { margin: .4rem 0 .6rem; padding-left: 1.3rem; display: grid; gap: .35rem; }
.share-ico { display: inline-block; width: 15px; height: 18px; vertical-align: -3px; border: 2px solid var(--sky-d); border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 .15rem; }
.share-ico::before { content: ''; position: absolute; left: 50%; top: -7px; width: 2px; height: 13px; background: var(--sky-d); transform: translateX(-50%); }
.share-ico::after { content: ''; position: absolute; left: 50%; top: -8px; width: 7px; height: 7px; border-left: 2px solid var(--sky-d); border-top: 2px solid var(--sky-d); transform: translateX(-50%) rotate(45deg); }
.install-note { margin-bottom: 0; }
.offline { text-align: center; margin-top: 3rem; }
.offline img { border-radius: 20px; }
/* Dans l'application installée : pas de pied de page, marges de l'encoche respectées */
.is-app .foot { display: none; }
.is-app .top { padding-top: env(safe-area-inset-top); }
