/* VETTER Pointeuse — charte VETTER (identique à VETTER Écrans / VETTER Gestion) */
:root {
  --bg: #F2F3F6; --card: #fff; --ink: #131A2A; --muted: #6B7385; --line: #DCDFE6;
  --brand: #7E1A52; --brand-2: #AB1263; --plum: #2E1526; --soft: #F2E6EC; --ok: #23804F; --warn: #f59e0b; --bad: #C22F2F;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, .cb-name b, .cc-name { font-family: var(--display); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.boot { padding: 80px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- En-tête ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: var(--plum); color: #fff;
  display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; white-space: nowrap; }
.logo b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #fff; flex: none; }
.logo b svg { width: 27px; height: 27px; }
.logo span { font: 700 17px/1.05 var(--display); letter-spacing: .02em; }
.logo small { display: block; font: 400 12px "Inter", sans-serif; opacity: .7; letter-spacing: 0; }
nav.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav.tabs button { border: 0; background: none; padding: 9px 14px; border-radius: 10px; color: rgba(255,255,255,.75); font-weight: 600; white-space: nowrap; }
nav.tabs button.on { background: rgba(255,255,255,.14); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.75); font-size: 13px; white-space: nowrap; }
.who span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; font-size: 13px; }
header.top .linkbtn { color: rgba(255,255,255,.75); }
.dellink { border: 0; background: none; color: var(--bad); text-decoration: underline; padding: 0; font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

.btn { border: 1px solid var(--line); background: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 600; }
.btn:hover { border-color: #c5ccdb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #691545; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.brand { background: var(--soft); color: var(--brand); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #94a3b8; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.dot.off { background: var(--bad); }
.dot.pause { background: var(--warn); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.grid > *, .shell > * { min-width: 0; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel + .panel { margin-top: 18px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card .body { padding: 14px 16px 10px; flex: 1; }
.card .name { font-weight: 700; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card .foot { display: flex; gap: 8px; padding: 0 12px 12px; }
.card .foot .btn { flex: 1; }
.add-card { border: 2px dashed #D9C3CF; border-radius: var(--radius); background: transparent; min-height: 170px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--brand); font-weight: 700; }
.add-card:hover { background: var(--soft); border-color: var(--brand-2); }
.add-card .plus { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 38px; line-height: 62px; text-align: center; }

/* ---------- Tableaux ---------- */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #faf6f8; }
table.t tfoot td { font-weight: 800; border-bottom: 0; }
table.t .arch td { color: var(--muted); }

/* ---------- Fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 92vh; overflow: auto; }
.modal.wide { max-width: 760px; }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.modal input[type=text], .modal input[type=email], .modal input[type=password], .modal input[type=number], .modal input[type=time],
.modal input[type=date], .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.modal textarea { min-height: 64px; resize: vertical; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; align-items: center; flex-wrap: wrap; }
.modal .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pin { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.pin input { width: 50px; height: 64px; text-align: center; font-size: 30px; font-weight: 800; border: 2px solid var(--line); border-radius: 12px; }
.pin input:focus { border-color: var(--brand); outline: none; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; font-size: 14px; }
.switch input { width: 20px; height: 20px; flex: none; }
.err { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1em; }
.info { background: #f6f7fa; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.info div + div { margin-top: 3px; }
.code10 { font: 800 26px/1 ui-monospace, monospace; letter-spacing: .18em; text-align: center; padding: 14px; background: var(--soft); color: var(--brand); border-radius: 12px; margin: 6px 0 10px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .modal { max-width: 400px; box-shadow: 0 20px 60px rgba(46,21,38,.18); }
.login .logo { justify-content: center; font-size: 20px; margin-bottom: 16px; color: var(--plum); }
.login .logo b { background: var(--soft); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 99; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--bad); }

/* ---------- Bandeau « client en cours » ---------- */
.clientbar { position: sticky; top: 62px; z-index: 19; background: linear-gradient(90deg, #5E1640, #7E1A52 55%, #9A2366); color: #fff; box-shadow: 0 2px 8px rgba(126,26,82,.28); }
.cb-in { max-width: 1280px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cb-name { display: flex; flex-direction: column; line-height: 1.15; }
.cb-name small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.cb-name b { font-size: 24px; display: inline-flex; align-items: center; }
.clientbar select { border-radius: 8px; padding: 6px 8px; border: 0; color: var(--ink); }
.cb-stats { display: flex; gap: 18px; font-size: 14px; opacity: .95; flex-wrap: wrap; }
.cb-stats b { font-size: 17px; }
.cb-ren { border: 0; background: rgba(255,255,255,.15); color: #fff; border-radius: 8px; width: 30px; height: 30px; font-size: 14px; margin-left: 6px; }
.cb-ren:hover { background: rgba(255,255,255,.28); }
.cb-acc { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.cb-acc:hover { background: rgba(255,255,255,.22); }

/* ---------- Admin : menu de gauche (client en cours uniquement) ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 62px); }
.shell.solo { grid-template-columns: 1fr; }
.side { background: var(--plum); color: #fff; padding: 16px 12px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; }
.side button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; border-radius: 10px; color: rgba(255,255,255,.72); }
.curcli { padding: 10px 12px 12px; }
.curcli b { display: block; font: 700 18px/1.2 var(--display); color: #fff; }
.curcli small { display: block; margin-top: 3px; color: rgba(255,255,255,.6); font-size: 12px; }
.nav2 { padding: 10px 12px; font-weight: 600; font-size: 15px; }
.nav2:hover { background: rgba(255,255,255,.08); }
.nav2.on { background: rgba(255,255,255,.16); color: #fff; }
.nav-switch { margin-top: 6px; justify-content: center; background: rgba(255,255,255,.1) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.22) !important; font-weight: 700; padding: 10px; }
.content { min-width: 0; }
.mswitch { display: none; }

/* ---------- Accueil admin : cartes clients ---------- */
.ccard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .15s; }
.ccard:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.cc-top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.cc-name { font-size: 19px; font-weight: 800; }
.cc-devs { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-dev { display: inline-flex; align-items: center; gap: 6px; background: #f1f4f9; border-radius: 8px; padding: 4px 9px; font-size: 13px; font-weight: 600; }
.cc-meta { color: var(--muted); font-size: 13px; }
.adminbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Présence ---------- */
.kpis { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 18px; min-width: 130px; }
.kpi b { display: block; font: 700 26px/1.1 var(--display); }
.kpi small { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi.ok b { color: var(--ok); } .kpi.warn b { color: #b45309; } .kpi.bad b { color: var(--bad); }
.pres { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 5px solid #cbd5e1; cursor: pointer; }
.pcard.present { border-left-color: var(--ok); } .pcard.pause { border-left-color: var(--warn); } .pcard.parti { border-left-color: var(--brand); }
.pcard .pn { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pcard .ps { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pcard .pt { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- Pointages ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; font-weight: 600; max-width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; }
.period { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.period button { border: 0; background: none; padding: 8px 12px; font-weight: 800; color: var(--brand); }
.period b { min-width: 170px; text-align: center; font-size: 14px; }
.day { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 10px; }
.day .dh { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.day .dh .dd { font-weight: 800; min-width: 110px; text-transform: capitalize; }
.day .dh .tot { margin-left: auto; font: 700 18px var(--display); }
.day .ents { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ent { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 5px 9px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ent:hover { border-color: var(--brand-2); }
.ent.k-in { background: #ecfdf3; border-color: #bbe5cb; } .ent.k-out { background: #f6eef2; border-color: #e3c8d6; }
.ent.k-break_start, .ent.k-break_end { background: #fff8e6; border-color: #f3dfa6; }
.ent.void { text-decoration: line-through; opacity: .55; background: #f3f4f6; border-color: var(--line); }
.ent i { font-style: normal; font-weight: 600; color: var(--muted); }
.anom { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.legend { color: var(--muted); font-size: 13px; margin-top: 12px; }
td.cell { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.cell.has-a { background: #fff7e6; }
.hist td { font-size: 14px; }
.hist .why { color: var(--muted); font-style: italic; }

/* ---------- Réglages ---------- */
.set { display: grid; gap: 4px; max-width: 720px; }
.set .opt { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set .opt:last-child { border-bottom: 0; }
.set .opt input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.set .opt b { display: block; }
.set .opt small { color: var(--muted); font-size: 13px; }
.set select, .set input[type=number] { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }

.bnav { display: none; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px !important; } /* évite le zoom automatique de l'iPhone */
  header.top { height: 54px; padding: 0 14px; gap: 10px; }
  header.top nav.tabs, .who span { display: none; }
  .clientbar { top: 54px; }
  main { padding: 16px 14px 96px; }
  h1 { font-size: 20px; }
  .side { display: none; }
  .mswitch { display: inline-block; }
  .modal .two { grid-template-columns: 1fr; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
  .bnav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px;
    font-weight: 700; font-size: 11px; color: var(--muted); }
  .bnav button span { font-size: 19px; line-height: 1.1; }
  .bnav button.on { color: var(--brand); background: var(--soft); }
}
