:root {
  --bg: #F1EEFB;
  --surface: #FFFFFF;
  --surface-2: #ECE7FF;
  --ink: #221A3D;
  --ink-2: #4F4768;
  --ink-3: #625A7C;
  --line: #E4DFF5;
  --accent: #5B3FD6;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECE7FF;
  --sage: #B9AAF2;
  --ok: #1F7A4D;
  --ok-soft: #DDF5E7;
  --warn: #9A6200;
  --warn-soft: #FFF1D6;
  --miss: #B4233C;
  --miss-soft: #FFE4E6;
  --radius: 26px;
  --radius-s: 14px;
  --shadow: 0 18px 40px -24px rgba(91,63,214,.45);
  --serif: "Plus Jakarta Sans", system-ui, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 em, .brand-name em { font-style: italic; font-weight: 400; color: var(--accent); }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: rgba(245,241,234,.86);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: var(--accent); color: #fff; font-family: var(--serif); font-size: 14px; letter-spacing: .02em;
}
.brand-name { font-family: var(--serif); font-size: 19px; }
.tabs { display: flex; gap: 4px; margin-left: 12px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.tabs button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  color: var(--ink-2); font-weight: 500; transition: background .2s, color .2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px;
}
.logout { color: var(--ink-3); text-decoration: none; font-size: 13px; }
.logout:hover { color: var(--ink); }

.bottom-nav { display: none; }

/* ---------- Layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 28px 28px 80px; }
.loading { padding: 80px; text-align: center; color: var(--ink-3); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 22px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h2 { font-size: 19px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; text-decoration: none; transition: transform .1s, background .2s, box-shadow .2s;
  background: var(--accent); color: var(--accent-ink);
}
.btn:hover { box-shadow: 0 6px 16px -8px rgba(46,91,90,.6); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: transparent; color: var(--miss); border-color: var(--miss-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* Durée */
.duration { display: flex; flex-direction: column; gap: 10px; }
.duration-input { display: flex; align-items: center; gap: 10px; }
.duration-input input {
  font-family: var(--serif); font-size: 28px; font-weight: 600; text-align: center; padding: 8px; max-width: 150px;
}
.duration-input .hint { font-size: 13px; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all .15s;
}
.chip:hover { border-color: var(--sage); color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Sélecteur de dossier */
.picker { position: relative; }
.picker-selected {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: #fff; cursor: pointer; min-height: 46px;
}
.picker-selected:focus-within, .picker.open .picker-selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.picker-selected .placeholder { color: var(--ink-3); }
.picker-selected input { border: 0; padding: 0; box-shadow: none !important; background: transparent; }
.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: 0 20px 40px -18px rgba(30,42,44,.35); max-height: 320px; overflow: auto; padding: 6px;
}
.picker-item { display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.picker-item:hover, .picker-item.hl { background: var(--accent-soft); }
.picker-item .ref { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12.5px; min-width: 62px; }
.picker-item .nm { font-weight: 500; }
.picker-item .cl { color: var(--ink-3); font-size: 13px; }
.picker-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 8px 10px 4px; font-weight: 600; }
.picker-new { color: var(--accent); font-weight: 600; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.tag.lu { background: #E2E9F3; color: #3A5577; }
.tag.fr { background: #F1E4E8; color: #7A4157; }
.tag.new { background: var(--warn-soft); color: var(--warn); }
.tag.arch { background: #ECECEC; color: #888; }

/* Chrono */
.timer {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, #2E5B5A, #3D7270); color: #fff; margin-bottom: 22px;
}
.timer .t { font-family: var(--serif); font-size: 32px; font-variant-numeric: tabular-nums; min-width: 128px; }
.timer .d { flex: 1; min-width: 0; }
.timer .d b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer .d small { opacity: .75; }
.timer .btn { background: rgba(255,255,255,.16); color: #fff; }
.timer .btn.primary { background: #fff; color: var(--accent); }
.timer .pulse { width: 10px; height: 10px; border-radius: 50%; background: #9BE3C4; box-shadow: 0 0 0 0 rgba(155,227,196,.7); animation: pulse 1.8s infinite; }
.timer.paused .pulse { animation: none; background: #F2C77A; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(155,227,196,0); } 100% { box-shadow: 0 0 0 0 rgba(155,227,196,0); } }

/* Semaine */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day {
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px; text-align: center; cursor: pointer; background: #fff;
  transition: transform .15s, border-color .15s;
}
.day:hover { transform: translateY(-2px); border-color: var(--sage); }
.day .dn { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.day .dd { font-family: var(--serif); font-size: 20px; margin: 2px 0 4px; }
.day .dh { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.day .bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.day .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.day.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.day.missing { background: var(--miss-soft); border-color: #EBC3BC; }
.day.missing .dh { color: var(--miss); }
.day.weekend { opacity: .55; }
.day.future { opacity: .4; cursor: default; }

/* Liste des prestations */
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .dur { font-family: var(--serif); font-size: 18px; font-weight: 600; min-width: 62px; }
.item .body { flex: 1; min-width: 0; }
.item .body .t1 { font-weight: 600; }
.item .body .t2 { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.item .acts { display: flex; gap: 4px; opacity: .55; transition: opacity .15s; }
.item:hover .acts { opacity: 1; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.empty { padding: 28px 10px; text-align: center; color: var(--ink-3); }
.empty .big { font-family: var(--serif); font-size: 18px; color: var(--ink-2); margin-bottom: 4px; }

/* Stats */
.stat { padding: 18px; }
.stat .k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.stat .v { font-family: var(--serif); font-size: 32px; font-weight: 600; margin-top: 4px; }
.stat .v small { font-size: 15px; color: var(--ink-3); font-family: var(--sans); font-weight: 500; }
.progress { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 8px; transition: width .6s ease; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-family: var(--serif); font-size: 22px; display: block; }
.ring small { color: var(--ink-3); font-size: 12px; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bars .b { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 10px; align-items: center; }
.bars .b .n { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .b .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin-top: -4px; }
.bars .b .track i { display: block; height: 100%; background: var(--sage); border-radius: 6px; }
.bars .b .h { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Calendrier mois */
.month { max-width: 440px; margin: 0 auto; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.month .mh { font-size: 11px; text-align: center; color: var(--ink-3); font-weight: 600; text-transform: uppercase; padding-bottom: 4px; }
.month .mc { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; font-size: 12.5px; background: var(--surface-2); color: var(--ink-2); position: relative; }
.month .mc.l1 { background: #D6E5DF; } .month .mc.l2 { background: #A8C8BB; } .month .mc.l3 { background: #5E928A; color: #fff; } .month .mc.l4 { background: var(--accent); color: #fff; }
.month .mc.miss { background: var(--miss-soft); color: var(--miss); }
.month .mc.we { background: transparent; color: var(--ink-3); }
.month .mc.fut { background: transparent; color: var(--ink-3); opacity: .5; }
.month .mc.off { visibility: hidden; }
.legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--ink-3); margin-top: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.miss { background: var(--miss-soft); color: var(--miss); }
.dots { display: flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 3px; background: var(--ok); }
.dots i.m { background: var(--miss); opacity: .8; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 320px; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--ink-2); font-size: 13.5px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav-period { display: inline-flex; align-items: center; gap: 6px; }
.nav-period .lbl { font-weight: 600; min-width: 170px; text-align: center; }

/* Toast & modale */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; z-index: 100;
  transition: all .3s cubic-bezier(.2,.9,.3,1.2); box-shadow: 0 12px 30px -12px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--miss); }
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(30,42,44,.45); color: var(--ink);
}
dialog::backdrop { background: rgba(30,42,44,.35); backdrop-filter: blur(3px); }
.modal-body { padding: 24px; }
.modal-body h2 { font-size: 22px; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.alert { background: var(--miss-soft); color: var(--miss); padding: 12px 14px; border-radius: 12px; margin: 14px 0; font-size: 14px; }
.note { background: var(--warn-soft); color: #7A5A1E; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }

.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.fade-in { animation: fadein .35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, #E3ECE7 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #EFE2D6 0%, transparent 60%), var(--bg); }
.login-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 36px; box-shadow: 0 30px 60px -30px rgba(30,42,44,.3); }
.login-card h1 { font-size: 40px; margin: 26px 0 8px; }
.login-card .btn-ms { width: 100%; margin-top: 22px; padding: 14px; background: var(--ink); }
.local-login { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.local-login label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.fineprint { font-size: 12.5px; color: var(--ink-3); margin: 18px 0 0; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .tabs { display: none; }
  main { padding: 18px 14px 110px; }
  .page-head h1 { font-size: 25px; }
  .card { padding: 18px; }
  .grid-3 { grid-template-columns: 1fr; }
  .week { gap: 4px; }
  .day { padding: 8px 2px; }
  .day .dd { font-size: 17px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(255,253,249,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav button { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 6px 0; font-weight: 500; }
  .bottom-nav button span { font-size: 18px; line-height: 1; }
  .bottom-nav button.active { color: var(--accent); }
  .toast { bottom: 90px; }
  .timer { flex-wrap: wrap; }
  .timer .t { font-size: 28px; min-width: 0; }
  .hide-sm { display: none; }
}

input[type=file] { font-size: 14px; color: var(--ink-2); }
input[type=file]::file-selector-button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 8px 14px; margin-right: 10px; font-weight: 600; color: var(--ink); cursor: pointer; }
.bottom-nav svg { width: 21px; height: 21px; }
@media (max-width: 720px) { .day .dh { font-size: 10.5px; line-height: 1.2; } .day.missing .dh { font-size: 10px; } }


/* ================= Style F · Doux & arrondi ================= */
h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; }
h1 em, .brand-name em { font-style: normal; color: var(--ink); font-weight: 800; }
.topbar { background: rgba(241,238,251,.88); border-bottom: 0; padding: 16px 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 14px; font-family: var(--sans); font-weight: 800; font-size: 17px; }
.brand-name { font-family: var(--sans); font-weight: 800; font-size: 18px; }
.tabs { background: transparent; padding: 0; gap: 4px; }
.tabs button { padding: 10px 18px; font-weight: 600; color: var(--ink-3); }
.tabs button.active { background: var(--ink); color: #fff; box-shadow: none; font-weight: 700; }
.avatar { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.page-head h1 { font-size: 36px; }
.card { border-color: var(--line); padding: 26px; }
.card h2 { font-size: 20px; }
.field > span, .label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea { border-radius: 14px; padding: 12px 14px; }
.btn { border-radius: 999px; font-weight: 700; }
.btn:hover { box-shadow: 0 10px 22px -12px rgba(91,63,214,.8); }
.chip { border-radius: 999px; font-weight: 600; padding: 7px 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); }
.duration-input input { font-family: var(--sans); font-weight: 800; font-size: 30px; height: 64px; }
.picker-selected { border-radius: 14px; min-height: 50px; }
.picker-list { border-radius: 18px; }
.picker-item { border-radius: 12px; }
.tag { border-radius: 999px; }
.tag.lu { background: #E0ECFF; color: #1E3A8A; }
.tag.fr { background: #FCE7F3; color: #831843; }

/* Semaine : tuiles */
.week { gap: 10px; }
.day { border-radius: 18px; padding: 14px 6px; min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.day .dn { letter-spacing: .08em; font-weight: 700; color: inherit; opacity: .8; }
.day .dd { font-family: var(--sans); font-weight: 800; font-size: 24px; }
.day .dh { color: inherit; }
.day .bar { width: 70%; }
.day.sel { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 14px 28px -16px rgba(91,63,214,.9); }
.day.sel .dh, .day.sel.missing .dh { color: #fff; }
.day.sel .bar { background: rgba(255,255,255,.3); }
.day.sel .bar i { background: #fff; }
.day.missing { background: var(--miss-soft); border-color: var(--miss-soft); color: var(--miss); }
.day.missing.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress { height: 6px; }

/* Chrono : aplat violet */
.timer { background: var(--ink); border-radius: 22px; }
.timer .t { font-family: var(--sans); font-weight: 800; }
.timer .btn.primary { color: var(--ink); }

.item .dur, .stat .v, .ring b, .empty .big { font-family: var(--sans); font-weight: 800; }
.month .mc { border-radius: 12px; }
.month .mc.l1 { background: #E4DCFF; } .month .mc.l2 { background: #C5B6FB; } .month .mc.l3 { background: #8C73EA; color: #fff; }
.seg { padding: 4px; }
.seg button.on { background: var(--ink); color: #fff; box-shadow: none; }
.pill { font-weight: 700; }
.table th { letter-spacing: .04em; }
dialog { border-radius: 28px; }
.toast { background: var(--ink); }

/* Connexion */
.login-body { background: var(--bg); }
.login-card { border-radius: 32px; border: 0; box-shadow: 0 30px 70px -30px rgba(91,63,214,.5); }
.login-card h1 { font-size: 40px; font-weight: 800; }
.login-card .btn-ms { background: var(--ink); }

@media (max-width: 720px) {
  .day { min-height: 74px; padding: 8px 2px; border-radius: 14px; }
  .day .dd { font-size: 18px; }
  .bottom-nav { border-radius: 24px 24px 0 0; border-top: 0; box-shadow: 0 -10px 30px -18px rgba(91,63,214,.5); }
  .bottom-nav button.active { color: var(--accent); font-weight: 700; }
}
.picker-selected input[type=search] { padding: 0; border-radius: 0; height: auto; }
.week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { min-width: 0; }
@media (max-width: 720px) {
  .week { gap: 4px; }
  .day .dn { font-size: 9.5px; letter-spacing: .02em; }
  .day.missing .dh { font-size: 9px; }
  .bottom-nav { background: rgba(255,255,255,.96); }
}

.tag.me { background: var(--accent); color: #fff; }
.picker-item .ref { min-width: 74px; }

/* Catégories d'encodage */
#cats .chips { gap: 6px; }
#cats .chip { padding: 6px 12px; font-size: 13px; }
.cat-itl .chip { font-size: 12.5px; }
.seg-sm button { padding: 4px 9px; font-size: 11.5px; }

/* Chrono toujours visible */
#timerSlot { position: sticky; top: 84px; z-index: 15; }
#timerSlot:empty { display: none; }
@media (max-width: 720px) { #timerSlot { top: 66px; } .timer { padding: 12px 14px; gap: 10px; } .timer .t { font-size: 22px; } }

/* Suggestions Outlook */
#sugg:empty { display: none; }
.sugg { margin-bottom: 22px; padding: 18px 20px; background: linear-gradient(135deg, #F4F0FF, #FFFFFF 60%); border: 1px solid #E4DCFF; }
.sugg-head { display: flex; align-items: center; gap: 14px; }
.sugg-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 18px; flex: none; }
.sugg-done .sugg-ico { background: var(--ok); }
.sugg-list { margin-top: 14px; display: grid; gap: 8px; }
.sugg-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line, #ECE8F7); border-radius: 16px; }
.sugg-kind { font-size: 20px; flex: none; }
.sugg-body { flex: 1; min-width: 0; }
.sugg-body .t1 { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-body .t2 { font-size: 12.5px; color: var(--muted, #6B6880); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-meta { font-size: 13px; margin-top: 4px; }
.sugg-dur { font-weight: 800; font-size: 18px; min-width: 56px; text-align: right; }
.sugg-acts { display: flex; gap: 6px; align-items: center; }
@media (max-width: 720px) {
  .sugg { padding: 14px; }
  .sugg-item { flex-wrap: wrap; gap: 8px 10px; }
  .sugg-body { flex-basis: calc(100% - 40px); }
  .sugg-dur { text-align: left; min-width: 0; }
  .sugg-acts { margin-left: auto; }
}
@media (max-width: 720px) {
  .sugg-head { flex-wrap: wrap; }
  .sugg-head > div { flex: 1 1 calc(100% - 100px) !important; }
  #suggAll { order: 5; width: 100%; justify-content: center; }
}

/* Taux horaire */
.rate-field { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted, #6B6880); }
.rate-field select { width: auto; min-width: 110px; padding: 8px 12px; }
.rate-field[hidden] { display: none; }

/* Installation mobile */
.install-btn { border: 1px solid #E4DCFF; background: #F4F0FF; color: var(--accent); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.install-card { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; background: #fff; border-radius: 24px; padding: 18px 18px 14px;
  box-shadow: 0 24px 60px -18px rgba(34,26,61,.45); border: 1px solid #ECE8F7; animation: installUp .35s cubic-bezier(.2,.8,.2,1); max-width: 460px; margin: 0 auto; }
@keyframes installUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.install-top { display: flex; gap: 14px; align-items: center; padding-right: 26px; }
.install-top img { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: 0 8px 20px -8px rgba(91,63,214,.6); }
.install-x { position: absolute; top: 10px; right: 10px; }
.install-steps { margin: 14px 0 4px; padding-left: 22px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.install-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.install-actions .btn:first-child:not(.btn-ghost) { flex: 1; justify-content: center; }
@media (min-width: 721px) { .install-card { bottom: 24px; right: 24px; left: auto; width: 400px; } }
@media (max-width: 420px) { .install-btn span { display: none; } }
.brand-name { white-space: nowrap; }
@media (max-width: 420px) { .topbar .brand-name { font-size: 16px; } .install-btn { padding: 6px 9px; } }
/* Correctifs mobile : la carte de suggestions ne doit jamais élargir la page */
.sugg-list { grid-template-columns: minmax(0, 1fr); }
.sugg-item, .sugg-body { min-width: 0; }
.sugg { overflow: hidden; }

/* ---------- Correctifs d'affichage mobile ---------- */
.day .dh .sm { display: none; }
#editCodes { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (max-width: 720px) {
  .day .dh .lg { display: none; }
  .day .dh .sm { display: inline; font-weight: 800; }
  /* En-têtes de cartes : titre puis boutons sur la ligne suivante */
  .card-head { flex-wrap: wrap; align-items: flex-start; }
  .card-head > .tiny, .card-head > span.tiny { flex-basis: 100%; }
  .card-head .toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
  /* Filtres : une ligne qui défile au lieu de boutons écrasés */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { white-space: nowrap; flex: none; }
  /* Formulaires en une colonne */
  .row { grid-template-columns: 1fr !important; display: grid; gap: 0; }
  input[type=file] { width: 100%; font-size: 13px; }
  select { text-overflow: ellipsis; }
  /* Tableau Équipe : compact */
  .team-table td, .team-table th { padding-left: 6px; padding-right: 6px; }
  .team-table .dots { display: none; }
  .team-table td[style*="min-width"] { min-width: 0 !important; }
  /* Tableau Utilisateurs : une fiche par avocat */
  .users-table thead { display: none; }
  .users-table, .users-table tbody { display: block; }
  .users-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .users-table td { display: block; border: 0 !important; padding: 0 !important; }
  .users-table td:first-child, .users-table td:last-child { grid-column: 1 / -1; }
  .users-table td:last-child { text-align: left; }
  .users-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
  .users-table input[type=text], .users-table input[type=number], .users-table select { max-width: none !important; width: 100%; }
  .users-table [data-save] { width: 100%; justify-content: center; }
  .page-head { flex-wrap: wrap; gap: 12px; }
}
