:root {
  --accent: #1e3ac8;
  --accent-dark: #12206e;
  --accent-soft: #e8ecfb;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --line: #dfe2ea;
  --line-strong: #c4c9d6;
  --text: #1f2330;
  --muted: #6b7285;
  --perso: #188038;
  --confirme: #d93025;
  --attente: #8430ce;
  --sansfact: #1f2330;
  --custody: #ffff00;
  --holiday: #c4d79b;
  --holiday-soft: #eaf2d9;
  --weekend: #f0f1f5;
  --today: #1e3ac8;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Barre supérieure */
.topbar { display: flex; align-items: center; gap: 16px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; }
.logo { height: 26px; }
.brand-title { font-weight: 600; font-size: 15px; color: var(--accent-dark); border-left: 1px solid var(--line); padding-left: 8px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav h1 { font-size: 16px; font-weight: 600; margin: 0 0 0 8px; min-width: 220px; text-transform: capitalize; }
.views { display: flex; background: var(--bg); border-radius: var(--radius); padding: 3px; }
.views button { border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; }
.views button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn { border: 1px solid var(--line-strong); background: var(--surface); padding: 6px 12px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--confirme); border-color: #f0b8b3; }
.btn.danger:hover { background: #fdecea; }
.btn.icon { padding: 4px 10px; font-size: 16px; line-height: 1; }
.btn:disabled { opacity: .5; cursor: default; }
select { border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 8px; background: var(--surface); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #b0b5c3; }
.sync-dot.ok { background: #1e9e4a; }
.sync-dot.err { background: var(--confirme); }
.sync-dot.run { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.search { position: relative; }
.search input { width: 220px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 10px; }
.search-results { position: absolute; right: 0; top: 36px; width: 420px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 50; }
.search-results .r { display: flex; gap: 10px; padding: 7px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.search-results .r:hover { background: var(--accent-soft); }
.search-results .r .d { color: var(--muted); width: 92px; flex: none; }
.search-results .empty { padding: 12px; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 14px; font-size: 12px; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line); align-items: center; }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .hint { margin-left: auto; font-style: italic; }
.legend .presence { background: #e6f4ea; color: #137333; border-radius: 10px; padding: 2px 10px; font-weight: 600; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.s-perso { background: var(--perso); } .sw.s-confirme { background: var(--confirme); }
.sw.s-attente { background: var(--attente); } .sw.s-sansfact { background: var(--sansfact); }
.sw.custody { background: var(--custody); border: 1px solid #d8cc00; } .sw.holiday { background: var(--holiday); }
.badge { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; width: 13px; height: 13px; border-radius: 3px; color: #fff; flex: none; vertical-align: 1px; }
.badge.pro { background: #5059c9; } .badge.perso { background: #0f7b8a; }
.badge.pending { background: #e8a200; }
.badge.error { background: var(--confirme); }

main { flex: 1; overflow: auto; position: relative; }

/* ---------- Couleurs de statut (texte, comme dans Excel) */
.s-perso { --c: var(--perso); } .s-confirme { --c: var(--confirme); }
.s-attente { --c: var(--attente); } .s-sansfact { --c: var(--sansfact); }
.ev { color: var(--c); cursor: pointer; }
.chip.invoiced::after { content: "✓"; color: var(--muted); font-size: 10px; margin-left: auto; }
.ev .tm { font-weight: 600; }
.ev .hd { font-size: 10px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 3px; margin-right: 3px; }
.ev.dragging { opacity: .4; }
.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft) !important; }

/* ---------- Vue Année (façon Excel) */
.year-wrap { padding: 10px; }
table.year { border-collapse: separate; border-spacing: 0; background: var(--surface); table-layout: fixed; width: 100%; font-size: 12px; border: 1px solid var(--line-strong); }
table.year th, table.year td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px 3px; vertical-align: top; }
table.year thead th { position: sticky; top: 0; background: var(--accent-dark); color: #fff; z-index: 2; font-weight: 600; padding: 5px 4px; text-transform: uppercase; letter-spacing: .03em; font-size: 11px; }
table.year thead th .kt { float: right; font-weight: 400; text-transform: none; opacity: .85; }
table.year thead tr.sub th { top: 27px; background: #e9ecf5; color: var(--muted); font-size: 10px; padding: 2px; text-align: center; }
table.year td.mstart, table.year th.mstart { border-left: 2px solid var(--line-strong); }
td.num { text-align: center; font-weight: 600; cursor: pointer; }
td.num.custody { background: var(--custody); }
td.let { text-align: center; color: var(--muted); }
td.we { background: var(--weekend); }
td.det { cursor: default; line-height: 1.35; position: relative; }
td.det.holiday { background: var(--holiday-soft); }
td.det .hol { font-size: 10px; font-style: italic; color: #4d6b12; }
td.det .wk { float: right; margin-left: 4px; font-size: 9px; color: #9aa0b3; }
td.det .ev { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.det.expand .ev { white-space: normal; }
td.p { text-align: center; color: var(--muted); cursor: pointer; font-weight: 600; }
td.p.todo { color: var(--confirme); }
td.k { text-align: right; cursor: pointer; color: #0b5cad; }
td.void { background: repeating-linear-gradient(45deg, #f6f6f9, #f6f6f9 4px, #eceef3 4px, #eceef3 8px); }
tr.today td.num { outline: 2px solid var(--today); outline-offset: -2px; }
td.det.sel, td.num.sel { box-shadow: inset 0 0 0 2px var(--accent); }
table.year tfoot td { background: #e9ecf5; font-weight: 600; position: sticky; bottom: 0; }

/* ---------- Vue Mois */
.month { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(110px, 1fr); height: 100%; min-height: 640px; background: var(--line); gap: 1px; padding-bottom: 1px; }
.month { grid-template-rows: max-content; }
.month .dow { background: var(--surface); text-align: center; padding: 6px 0; font-weight: 600; color: var(--muted); font-size: 12px; min-height: 0; }
.month .wn { background: var(--surface); color: #9aa0b3; font-size: 11px; text-align: center; padding-top: 6px; }
.month .cell { background: var(--surface); padding: 4px 6px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.month .cell.out { background: #fafafc; color: #aab; }
.month .cell.we { background: #fbfbfd; }
.month .cell.holiday { background: var(--holiday-soft); }
.month .cell .top { display: flex; align-items: center; gap: 6px; }
.month .cell .n { font-weight: 600; min-width: 24px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; cursor: pointer; }
.month .cell .n.custody { background: var(--custody); }
.month .cell.today .n { background: var(--today); color: #fff; }
.month .cell.today .n.custody { box-shadow: 0 0 0 3px var(--custody); }
.month .cell .hol { font-size: 10px; font-style: italic; color: #4d6b12; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.month .cell .k { margin-left: auto; font-size: 10px; color: #0b5cad; }
.chip { font-size: 12px; padding: 1px 5px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 7%, white); border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.chip .t { overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 11px; color: var(--accent); cursor: pointer; }

/* ---------- Vue Semaine */
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); min-width: 900px; background: var(--surface); }
.week .wh { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; text-align: center; }
.week .wh .dn { font-size: 20px; font-weight: 600; display: inline-block; min-width: 34px; border-radius: 17px; }
.week .wh .dn.custody { background: var(--custody); }
.week .wh.today .dn { color: var(--today); }
.week .wh .hol { font-size: 10px; font-style: italic; color: #4d6b12; }
.week .allday { border-left: 1px solid var(--line); border-bottom: 2px solid var(--line-strong); padding: 3px; min-height: 30px; display: flex; flex-direction: column; gap: 2px; }
.week .allday.holiday, .week .col.holiday { background: var(--holiday-soft); }
.week .gut { font-size: 10px; color: var(--muted); text-align: right; padding-right: 6px; position: relative; }
.week .gut div { position: absolute; right: 6px; transform: translateY(-6px); }
.week .col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--hh); cursor: cell; }
.week .blk { position: absolute; left: 2px; right: 2px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 4px; padding: 2px 5px; font-size: 11.5px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); color: var(--c); }
.week .blk .tm { display: block; font-size: 10.5px; opacity: .85; }
.week .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--confirme); z-index: 2; pointer-events: none; }

/* ---------- Pointage */
.billing { padding: 16px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .billing { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.card .filters { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.kpis { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.kpi { flex: 1; min-width: 110px; background: var(--bg); border-radius: 6px; padding: 8px 10px; }
.kpi b { display: block; font-size: 20px; }
.kpi span { color: var(--muted); font-size: 11px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line-strong); padding: 5px 6px; }
table.list td { border-bottom: 1px solid var(--line); padding: 5px 6px; }
table.list tr:hover td { background: #fafbff; }
table.list td.num-r { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--accent); border-radius: 4px; }

/* ---------- Panneau journée */
.panel { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); z-index: 40; display: flex; flex-direction: column; }
.panel header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.panel header h2 { margin: 0; font-size: 17px; text-transform: capitalize; }
.panel header .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.panel .x { position: absolute; right: 10px; top: 8px; }
.panel .content { padding: 12px 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.panel .evrow { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.panel .evrow:hover { background: var(--accent-soft); }
.panel .evrow .when { width: 76px; flex: none; color: var(--muted); font-size: 12px; }
.panel .evrow .ttl { flex: 1; color: var(--c); font-weight: 500; }
.panel .evrow .meta { font-size: 11px; color: var(--muted); font-weight: 400; }
.panel .evrow input { margin-top: 2px; }
.panel h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Boîtes de dialogue */
dialog.dlg { border: 0; border-radius: 12px; padding: 0; width: 640px; max-width: 94vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.dlg.wide { width: 820px; }
dialog.dlg.small { width: 440px; }
dialog::backdrop { background: rgba(20, 25, 45, .35); }
.dlg form { display: flex; flex-direction: column; max-height: 90vh; }
.dlg header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg header h2 { margin: 0; font-size: 16px; flex: 1; }
.x { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.dlg .body { padding: 14px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dlg footer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 12px 12px; }
.spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select { border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; background: #fff; width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus, .search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.times { margin-top: 8px; align-items: flex-end; }
.times .field { flex: 0 0 120px; }
.quick { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11.5px; padding-bottom: 4px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line-strong); background: #fff; border-radius: 12px; padding: 2px 8px; cursor: pointer; font-size: 11.5px; }
.quick button:hover { background: var(--accent-soft); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line-strong); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.status-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pick .st { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1.5px solid var(--line-strong); border-radius: 18px; cursor: pointer; color: var(--c); font-weight: 600; }
.status-pick .st input { display: none; }
.status-pick .st b { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.status-pick .st:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); box-shadow: 0 0 0 1px var(--c); }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.field .check input, .check input { width: auto; flex: none; }
.teams-box { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 6px; background: #f5f6fd; border: 1px solid #dfe3f7; }
.note { margin: 0; font-size: 11.5px; color: var(--muted); }
.note.warn { color: #9a5b00; }
.link-info { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.link-info a { color: var(--accent); cursor: pointer; font-weight: 600; }
.link-info .err { color: var(--confirme); }
section h3 { margin: 4px 0 8px; font-size: 13.5px; color: var(--accent-dark); }
section { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.accounts { display: flex; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.acc-block { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.acc-head { display: flex; align-items: center; gap: 8px; }
.acc-head .seg { margin-left: auto; }
.acc-block .acc { border: 0; padding: 0; min-width: 0; }
.acc { flex: 1; min-width: 300px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.acc .btn { margin-left: 4px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; word-break: break-all; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.inline { display: flex; gap: 6px; }
.inline input { flex: 1; }
.colors { display: flex; gap: 6px; align-items: center; }
.colors input[type=color] { width: 44px; height: 32px; padding: 2px; }
.colors .pre { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line-strong); cursor: pointer; display: inline-block; }

/* ---------- Divers */
.progress { position: fixed; inset: 0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; gap: 12px; z-index: 100; font-size: 15px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { background: #22263a; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 640px; animation: tin .2s; }
.toast.error { background: #b3261e; } .toast.warn { background: #8a5a00; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Vue Liste */
.agenda { max-width: 900px; margin: 0 auto; padding: 8px 12px 90px; }
.ag-week { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }
.ag-day { display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.ag-day.we { background: #fafbfd; }
.ag-day.today { border-color: var(--today); box-shadow: 0 0 0 1px var(--today); }
.ag-date { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.ag-n { font-size: 18px; font-weight: 700; min-width: 32px; text-align: center; border-radius: 16px; }
.ag-n.custody { background: var(--custody); }
.ag-dow { font-size: 11px; color: var(--muted); }
.ag-evs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ag-ev { display: flex; gap: 8px; align-items: baseline; padding: 3px 6px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 6%, white); border-radius: 3px; }
.ag-tm { font-size: 11.5px; font-weight: 600; min-width: 64px; flex: none; }
.ag-tm:empty { min-width: 0; }
.ag-t { overflow-wrap: anywhere; }
.ag-empty { color: #b6bac6; }
.ag-k { font-size: 11px; color: #0b5cad; }
.agenda .hol { font-size: 11px; font-style: italic; color: #4d6b12; }

/* ---------- Téléphone */
@media (max-width: 760px) {
  :root { font-size: 14px; }
  .topbar { gap: 6px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand .logo { height: 20px; }
  .brand-title { display: none; }
  .brand { order: 0; }
  .tools { order: 1; margin-left: auto; }
  .nav { order: 2; width: 100%; }
  .nav h1 { font-size: 14px; min-width: 0; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #btnToday { padding: 6px 8px; }
  .views { order: 3; width: 100%; overflow-x: auto; }
  .views button { flex: 1; padding: 7px 6px; }
  .tools { gap: 4px; }
  .tools .search, #yearMonths { display: none; }
  #btnSync span:last-child { display: none; }
  #btnNew { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; border-radius: 28px; padding: 14px 18px; box-shadow: 0 6px 18px rgba(30,58,200,.4); font-size: 15px; }
  .legend { gap: 8px; padding: 4px 8px; font-size: 10.5px; }
  .legend .hint, .legend .lg:nth-child(n+5) { display: none; }
  .month { grid-template-columns: 22px repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(74px, auto); min-height: 0; }
  .month .cell { padding: 2px; }
  .month .cell .hol, .month .cell .k { display: none; }
  .chip { font-size: 10px; padding: 0 3px; }
  .chip .badge { display: none; }
  .panel { width: 100%; }
  dialog.dlg, dialog.dlg.wide { width: 100vw; max-width: 100vw; max-height: 100vh; margin: 0; border-radius: 0; height: 100%; }
  .dlg form { max-height: 100vh; height: 100%; }
  .dlg footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .times .field { flex: 1 1 40%; }
  .billing { padding: 8px; }
  .acc { min-width: 0; }
}
/* ---------- Chiffre d'affaires */
.revenue { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); }
.kpi em { font-style: normal; font-weight: 600; }
.kpi em.up { color: #137333; } .kpi em.down { color: var(--confirme); }
.rbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: transparent; }
.rbar i { display: block; height: 100%; }
.rbar .r1, .lg-sq.r1 { background: var(--accent); }
.rbar .r2, .lg-sq.r2 { background: #8fa0e8; }
.rbar .r3, .lg-sq.r3 { background: #c9a6ec; }
.rbar.old { height: 4px; margin-top: 2px; }
.rbar.old i, .lg-sq.old { background: #b8bcc8; }
.lg-sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }

/* ---------- Plannings (collaborateurs) */
.planning-sel { font-weight: 600; color: var(--accent-dark); border-color: var(--accent); max-width: 220px; }
.planning-pill { background: #fff4e5; color: #8a4b00; border: 1px solid #f0c68a; border-radius: 10px; padding: 2px 10px; font-weight: 600; }
body.other-planning .topbar { box-shadow: inset 0 -3px 0 #f0a33c; }
.plannings h4 { margin: 10px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
.pl-row .btn { margin-left: 4px; }
.badge-on { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 0 6px; font-size: 11px; font-weight: 600; }
@media (max-width: 760px) { .revenue { grid-template-columns: 1fr; } .planning-sel { order: 1; max-width: 140px; } }
.rev-months td:nth-child(2), .rev-months th:nth-child(2) { width: 38%; min-width: 120px; }

/* Rattachement des heures Keyrus aux rdv */
.ky-list { margin-top: 8px; max-height: 52vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: 8px; }
.ky-day { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ky-day:last-child { border-bottom: 0; }
.ky-head { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.ky-badge { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; color: #fff; }
.ky-sûr .ky-badge { background: #2e7d32; } .ky-probable .ky-badge { background: #ef6c00; } .ky-doute .ky-badge { background: #c62828; } .ky-sans .ky-badge { background: #757575; }
.ky-cand { display: flex; gap: 8px; align-items: center; padding: 3px 0 3px 12px; font-size: 13px; }
.ky-cand input { width: 74px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 6px; }
.ky-cand .ky-t { flex: 1; } .ky-cand .ky-m { color: var(--muted, #666); font-size: 12px; }
.ky-sum { margin-left: auto; font-size: 12px; color: var(--muted, #666); } .ky-sum.bad { color: #c62828; font-weight: 600; }