/* Pointage Dupont Métal
   Colours come from the Dupont Métal logo: the blue of "DUPONT" and white, on
   the dark ground the logo is drawn for. Type is Archivo, one variable family:
   wide for the clock and headings (echoing the logo's wide capitals), narrow
   where a long name must fit a tile. */

@font-face {
  font-family: 'Archivo Variable'; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo Variable'; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --blue: #0A4B8D;            /* Dupont blue */
  --blue-deep: #083B70;
  --blue-soft: #E6EEF7;
  --blue-on-dark: #5B9BE0;    /* the same hue, lifted so it reads on the dark ground */
  --night: #0B121B;           /* the ground behind the logo */
  --night-2: #16212F;
  --night-line: #26344668;
  --ink: #0F1822;
  --ink-2: #46525F;
  --ink-3: #6F7B88;
  --line: #D8DEE6;
  --line-soft: #EAEEF2;
  --floor: #EEF1F5;
  --plate: #FFFFFF;
  --wash: #F5F7FA;
  --in: #0F7A44;
  --in-soft: #E2F3E9;
  --break: #9A5B00;
  --break-fill: #F0A21A;
  --break-soft: #FCF0D8;
  --danger: #B3261E;
  --danger-soft: #FBEAE8;
  --font: 'Archivo Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-lg: 22px; --r: 14px; --r-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--ink);
  background: var(--floor); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior: none; -webkit-text-size-adjust: 100%;
}
#app { min-height: 100%; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #7FB0E6; outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.hide { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; }

.boot, .noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--night); color: #fff; }
.boot img { height: auto; opacity: .9; }
.boot { align-content: center; justify-items: center; gap: 22px; padding: 24px; }
.boot-problem { max-width: 560px; font-size: 15px; line-height: 1.45; color: #C3CDD9; }
.boot-problem p { margin: 0 0 8px; }
.boot-problem p:nth-child(odd) { color: #fff; }

/* ── Buttons and form controls ──────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
  border-radius: var(--r-sm); border: 1.5px solid transparent; background: var(--blue); color: #fff;
  font-weight: 640; font-size: 16px; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--blue-deep); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8F1D17; }
.btn.danger-ghost { background: #fff; color: var(--danger); border-color: #E7B9B5; }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.quiet { background: transparent; color: var(--blue); padding: 0 10px; }
.btn.quiet:hover { background: var(--blue-soft); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }

.field { display: block; }
.field + .field { margin-top: 16px; }
.field > span, .label { display: block; font-size: 14px; font-weight: 620; color: var(--ink-2); margin-bottom: 6px; }
.field > small, .help { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
.input, .select {
  width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 16px; appearance: none; -webkit-appearance: none;
}
.select {
  padding-right: 38px; background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2346525F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.input:focus, .select:focus { border-color: var(--blue); outline: 3px solid var(--blue-soft); outline-offset: 0; }
.input.sm, .select.sm { height: 40px; font-size: 15px; }
.input.code { font-size: 26px; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; line-height: 1.35; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--blue); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.switch-row:first-child { border-top: 0; padding-top: 0; }
.switch-row > div:first-child { min-width: 0; }
.switch-row b { font-weight: 620; display: block; }
.switch-row small { color: var(--ink-3); font-size: 13.5px; display: block; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: #C3CBD5; transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(11,18,27,.3); }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid #7FB0E6; outline-offset: 2px; }

.error-text { color: var(--danger); font-weight: 600; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-soft); color: #0B3663; font-size: 15px; }
.notice.warn { background: var(--break-soft); color: #6A3F00; }
.notice.bad { background: var(--danger-soft); color: #7E1B15; }
.notice.good { background: var(--in-soft); color: #0A5530; }

/* Language switch: two fixed positions so it can be hit without reading. */
.lang { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.09); }
.lang button { height: 40px; min-width: 52px; border: 0; border-radius: 9px; background: transparent; color: #B9C4D1; font-weight: 650; font-size: 15px; }
.lang button[aria-pressed="true"] { background: #fff; color: var(--night); }
.lang.light { background: var(--line-soft); }
.lang.light button { color: var(--ink-2); }
.lang.light button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(11,18,27,.15); }

/* ── Kiosk ──────────────────────────────────────────────────────────────── */

.kiosk {
  position: fixed; inset: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr);
  background: var(--floor); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.rail {
  background: var(--night); color: #fff; display: flex; flex-direction: column; min-height: 0;
  padding: calc(env(safe-area-inset-top) + 26px) 24px calc(env(safe-area-inset-bottom) + 20px) calc(env(safe-area-inset-left) + 24px);
}
.rail-logo { width: 100%; max-width: 188px; height: auto; display: block; }
.rail-clock { margin: auto 0; }
.clock { font-size: 68px; font-weight: 620; font-stretch: 125%; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock-date { margin-top: 10px; font-size: 17px; color: #C2CCD8; }
.clock-date::first-letter { text-transform: uppercase; }
.rail-foot { display: flex; flex-direction: column; gap: 16px; }
.legend { display: grid; gap: 7px; font-size: 14.5px; color: #C2CCD8; }
.legend span { display: flex; align-items: center; gap: 9px; }
.legend b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; font-weight: 640; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: #5A6777; }
.dot.in { background: #2FBF71; } .dot.break { background: var(--break-fill); }
.rail-admin { display: inline-flex; align-items: center; gap: 8px; color: #8E9BAA; font-size: 14px; text-decoration: none; background: none; border: 0; padding: 6px 0; align-self: flex-start; }
.rail-admin:hover { color: #fff; }

.floor { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: calc(env(safe-area-inset-top) + 22px) calc(env(safe-area-inset-right) + 24px) calc(env(safe-area-inset-bottom) + 20px) 24px; }
.floor-title { font-size: 31px; font-weight: 720; font-stretch: 114%; letter-spacing: -.012em; line-height: 1.1; margin-bottom: 16px; }
.tiles-box { flex: 1; min-height: 0; position: relative; }
.tiles { position: absolute; inset: 0; display: grid; gap: 10px; align-content: start; }
.tiles.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; text-align: left;
  padding: 6px 12px 6px 18px; background: var(--plate); border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  transition: transform .08s ease-out, box-shadow .08s ease-out;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--line); }
.tile.s-in { background: var(--in-soft); border-color: #BFE3CD; }
.tile.s-in::before { background: var(--in); }
.tile.s-break { background: var(--break-soft); border-color: #F3D9A2; }
.tile.s-break::before { background: var(--break-fill); }
.tile:active, .tile.pressed { transform: scale(.965); box-shadow: 0 0 0 3px var(--blue); }
.tile-first { font-size: var(--tile-fs, 19px); font-weight: 690; font-stretch: 98%; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-last { font-size: calc(var(--tile-fs, 19px) * .8); color: var(--ink-2); line-height: 1.25; font-stretch: 94%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.f-x1 .tile-first { font-stretch: 84%; } .tile.f-x2 .tile-first { font-stretch: 74%; } .tile.f-x3 .tile-first { font-stretch: 66%; }
.tile.l-x1 .tile-last { font-stretch: 84%; } .tile.l-x2 .tile-last { font-stretch: 74%; } .tile.l-x3 .tile-last { font-stretch: 66%; }
.tile-no { position: absolute; right: 9px; top: 6px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 560; }

.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--danger); color: #fff; font-weight: 600; margin-bottom: 14px; }

/* Kiosk in portrait or on a narrow screen: the rail becomes a top band. */
@media (max-width: 899px), (orientation: portrait) {
  .kiosk { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; align-items: center; gap: 20px; padding: calc(env(safe-area-inset-top) + 14px) 20px 14px; }
  .rail-logo { width: auto; height: 76px; }
  .rail-clock { margin: 0 0 0 auto; text-align: right; }
  .clock { font-size: 46px; }
  .clock-date { margin-top: 4px; font-size: 15px; }
  .rail-foot { flex-direction: row; align-items: center; gap: 12px; }
  .legend { display: none; }
  .rail-admin span { display: none; }
  .floor { padding-top: 18px; }
}
@media (max-width: 560px) {
  .rail-logo { height: 52px; }
  .clock { font-size: 32px; }
  .clock-date { display: none; }
  .floor { padding: 14px 14px 12px; }
  .floor-title { font-size: 24px; margin-bottom: 12px; }
}

/* ── Kiosk flow: PIN, choice ────────────────────────────────────────────── */

.veil {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(11, 18, 27, .74); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  animation: fade .14s ease-out;
}
.sheet { position: relative; background: var(--plate); border-radius: 26px; width: min(840px, 100%); max-height: 100%; overflow: auto; padding: 34px 36px; box-shadow: 0 30px 80px rgba(4, 10, 18, .5); animation: rise .18s ease-out; }
.sheet-top { position: absolute; top: 18px; right: 18px; display: flex; gap: 10px; align-items: center; }
.close-x { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--line-soft); display: grid; place-items: center; color: var(--ink-2); }
.close-x:active { background: var(--line); }
.who-first { font-size: 42px; font-weight: 730; font-stretch: 110%; line-height: 1.02; letter-spacing: -.015em; }
.who-last { font-size: 25px; color: var(--ink-2); margin-top: 2px; }
.who-state { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 17px; color: var(--ink-2); }

.pin-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; }
.pin-prompt { margin-top: 28px; font-size: 21px; font-weight: 600; }
.pin-sub { margin-top: 4px; color: var(--ink-2); font-size: 16px; }
.pin-dots { display: flex; gap: 14px; margin-top: 20px; }
.pin-dot { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid #9AA6B3; transition: background .08s, border-color .08s, transform .08s; }
.pin-dot.on { background: var(--blue); border-color: var(--blue); transform: scale(1.08); }
.pin-dots.shake { animation: shake .36s ease-in-out; }
.pin-dots.shake .pin-dot { border-color: var(--danger); }
.pin-msg { min-height: 50px; margin-top: 16px; color: var(--danger); font-weight: 620; font-size: 17px; line-height: 1.35; }
.keypad { display: grid; grid-template-columns: repeat(3, 96px); gap: 12px; }
.key { height: 84px; border-radius: 20px; border: 1px solid var(--line); background: var(--wash); font-size: 36px; font-weight: 600; font-stretch: 112%; font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.key:active, .key.pressed { background: var(--blue); border-color: var(--blue); color: #fff; }
.key.aux { background: transparent; border-color: transparent; color: var(--ink-2); font-size: 15px; font-weight: 620; font-stretch: 100%; }
.key.aux:active { background: var(--line-soft); color: var(--ink); }
.key .icon { width: 30px; height: 30px; }
.busy .keypad, .busy .choice { opacity: .45; pointer-events: none; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.choice.one { grid-template-columns: 1fr; }
.act {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 176px;
  padding: 22px 24px 24px; border-radius: 22px; border: 2px solid var(--line); background: #fff; text-align: left;
}
.act .icon { width: 34px; height: 34px; margin-bottom: auto; }
.act-label { margin-top: 14px; font-size: 36px; font-weight: 740; font-stretch: 114%; line-height: 1; letter-spacing: -.015em; }
.act-hint { font-size: 16.5px; opacity: .82; }
.act.a-in.primary, .act.a-break_end.primary { background: var(--in); border-color: var(--in); color: #fff; }
.act.a-break_start.primary { background: var(--break-fill); border-color: var(--break-fill); color: var(--ink); }
.act.a-out.primary { background: var(--night); border-color: var(--night); color: #fff; }
.act.a-in .icon, .act.a-break_end .icon { color: var(--in); }
.act.a-break_start .icon { color: var(--break); }
.act.primary .icon { color: inherit; }
.act:active { transform: scale(.98); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }

@media (max-width: 760px) {
  .sheet { padding: 26px 22px; border-radius: 22px; }
  .pin-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: center; text-align: center; }
  .pin-layout .sheet-who { padding-right: 0; }
  .pin-dots { justify-content: center; }
  .pin-prompt { margin-top: 16px; }
  .pin-msg { min-height: 26px; margin-top: 10px; }
  .who-first { font-size: 32px; } .who-last { font-size: 20px; }
  .keypad { grid-template-columns: repeat(3, minmax(72px, 92px)); }
  .key { height: 68px; font-size: 30px; }
  .choice { grid-template-columns: 1fr; margin-top: 22px; }
  .act { min-height: 118px; }
  .act-label { font-size: 30px; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .key { height: 66px; }
  .sheet { padding: 24px 30px; }
}

/* ── The confirmation: one colour, one word, one time — readable from across the shop. ── */

.result {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; color: #fff;
  padding: calc(env(safe-area-inset-top) + 44px) calc(env(safe-area-inset-right) + 52px) calc(env(safe-area-inset-bottom) + 0px) calc(env(safe-area-inset-left) + 52px);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  animation: wipe .26s cubic-bezier(.2, .8, .2, 1);
}
.result.k-in, .result.k-break_end { background: var(--in); }
.result.k-break_start { background: var(--break-fill); color: var(--ink); }
.result.k-out { background: var(--night); }
.result-kind { font-size: clamp(38px, 6.4vw, 72px); font-weight: 760; font-stretch: 118%; line-height: 1; letter-spacing: -.02em; display: flex; align-items: center; gap: .32em; }
.result-kind .icon { width: .92em; height: .92em; }
.result-time { margin-top: .04em; font-size: clamp(104px, 25vw, 290px); font-weight: 700; font-stretch: 125%; line-height: .92; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.result-who { margin-top: auto; font-size: clamp(22px, 3.2vw, 32px); font-weight: 600; }
.result-sum { margin-top: 6px; font-size: clamp(17px, 2.2vw, 22px); opacity: .86; }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; padding-bottom: 30px; flex-wrap: wrap; }
.result-btn { height: 60px; padding: 0 28px; border-radius: 16px; font-size: 19px; font-weight: 660; border: 2px solid currentColor; background: transparent; color: inherit; display: inline-flex; align-items: center; gap: 10px; }
.result-btn.solid { background: #fff; border-color: #fff; color: var(--ink); }
.result.k-break_start .result-btn.solid { background: var(--ink); border-color: var(--ink); color: #fff; }
.result-btn:active { transform: scale(.97); }
.result-drain { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: rgba(255,255,255,.22); }
.result.k-break_start .result-drain { background: rgba(15,24,34,.16); }
.result-drain i { display: block; height: 100%; width: 100%; background: currentColor; transform-origin: left; animation: drain linear forwards; }
@media (max-width: 560px) { .result { padding-left: 24px; padding-right: 24px; } .result-btn { height: 54px; padding: 0 20px; font-size: 17px; } }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes wipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  .veil, .sheet, .result, .pin-dots.shake { animation: none; }
  .tile, .act, .result-btn { transition: none; }
}

/* ── Sign-in ────────────────────────────────────────────────────────────── */

.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); background: #fff; }
.auth-brand { background: var(--night); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: calc(env(safe-area-inset-top) + 48px) 48px 40px; }
.auth-brand img { width: min(280px, 72%); height: auto; }
.auth-brand p { color: #AEBAC8; font-size: 15px; max-width: 30ch; }
.auth-brand .word { font-size: 44px; font-weight: 720; font-stretch: 120%; letter-spacing: -.02em; color: #fff; line-height: 1; margin-bottom: 12px; }
.auth-main { display: flex; flex-direction: column; padding: 28px 28px 40px; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-card { width: min(430px, 100%); margin: auto; padding: 24px 0; }
.auth-card h1 { font-size: 31px; font-weight: 720; font-stretch: 112%; letter-spacing: -.012em; line-height: 1.12; margin-bottom: 8px; }
.auth-card .lede { color: var(--ink-2); margin-bottom: 24px; }
.auth-card form > .btn { margin-top: 22px; }
.auth-alt { margin-top: 18px; text-align: center; }
.qr { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); margin: 18px 0; }
.qr img { width: 168px; height: 168px; display: block; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; background: var(--wash); border-radius: 8px; padding: 8px 10px; margin-top: 6px; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); margin: 18px 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--blue); }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .auth-brand { flex-direction: row; align-items: center; padding: calc(env(safe-area-inset-top) + 18px) 22px 18px; }
  .auth-brand img { width: 104px; }
  .auth-brand .word { font-size: 26px; margin: 0; }
  .auth-brand p { display: none; }
  .auth-main { padding: 14px 22px 32px; }
  .auth-card { margin-top: 12px; }
  .qr { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
}

/* ── Signed-in shell (control panel, remote punching) ───────────────────── */

.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.side { background: var(--night); color: #fff; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 24px) 14px 16px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; }
.side-logo { width: 128px; height: auto; margin: 0 10px 26px; display: block; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: var(--r-sm); color: #C3CDD9; text-decoration: none; font-weight: 580; font-size: 15.5px; }
.nav a:hover { background: var(--night-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--blue); color: #fff; }
.nav hr { border: 0; border-top: 1px solid #243244; margin: 10px 6px; }
.side-foot { margin-top: auto; padding: 16px 8px 0; display: grid; gap: 12px; }
.side-user { font-size: 14px; color: #AEBAC8; line-height: 1.35; overflow-wrap: anywhere; }
.side-user b { display: block; color: #fff; font-size: 15px; font-weight: 620; }
.side-foot .btn { justify-content: flex-start; background: transparent; color: #C3CDD9; border-color: #2A394C; height: 42px; font-size: 14.5px; }
.side-foot .btn:hover { background: var(--night-2); color: #fff; }
.topbar { display: none; }
.main { min-width: 0; padding: 30px 34px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { font-size: 31px; font-weight: 720; font-stretch: 114%; letter-spacing: -.012em; line-height: 1.1; }
.page-sub { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: #E2E7EE; }
.seg button { height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(11,18,27,.16); }

@media (max-width: 940px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: var(--night); color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; }
  .topbar img { height: 38px; width: auto; }
  .topbar b { font-weight: 640; font-stretch: 108%; }
  .menu-btn { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--night-2); color: #fff; display: grid; place-items: center; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 50; transform: translateX(-102%); transition: transform .2s ease-out; }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(4,10,18,.5); }
  .side-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(11,18,27,.5); border: 0; }
  .main { padding: 20px 16px 64px; }
  .page-title { font-size: 26px; }
}

/* Panels and tables */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel > h2 { font-size: 19px; font-weight: 680; font-stretch: 108%; margin-bottom: 4px; }
.panel > h2 + p { color: var(--ink-2); margin-bottom: 16px; font-size: 15px; max-width: 72ch; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th { text-align: left; font-size: 13px; font-weight: 640; color: var(--ink-2); padding: 12px 14px; background: var(--wash); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; }
.t .c { text-align: center; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #F8FAFC; }
.t tfoot td { font-weight: 680; background: var(--wash); border-top: 1.5px solid var(--blue); border-bottom: 0; }
.t .name { font-weight: 620; }
.t td.tight, .t th.tight { width: 1%; white-space: nowrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 620; background: var(--line-soft); color: var(--ink-2); white-space: nowrap; }
.badge.in { background: var(--in-soft); color: #0A5530; }
.badge.break { background: var(--break-soft); color: #6A3F00; }
.badge.blue { background: var(--blue-soft); color: #0B3663; }
.badge.bad { background: var(--danger-soft); color: #7E1B15; }

/* Modal */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(11,18,27,.56); animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 20px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 26px; box-shadow: 0 24px 70px rgba(4,10,18,.4); }
.modal.wide { width: min(720px, 100%); }
.modal > h2 { font-size: 23px; font-weight: 700; font-stretch: 110%; line-height: 1.15; margin-bottom: 16px; padding-right: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.modal section + section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.modal section > h3 { font-size: 16px; font-weight: 680; margin-bottom: 10px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols-2 > .field + .field { margin-top: 0; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 14px; }
.cols-3 > .field + .field { margin-top: 0; }
@media (max-width: 560px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } .modal { padding: 20px; } }
.secret-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--night); color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .04em; margin: 14px 0 8px; overflow-wrap: anywhere; }
.secret-box.long { font-size: 14px; }
.secret-box .btn { background: rgba(255,255,255,.14); height: 38px; font-family: var(--font); letter-spacing: 0; font-size: 14px; }

.toasts { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 13px 20px; border-radius: 12px; background: var(--night); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(4,10,18,.35); animation: rise .16s ease-out; }
.toast.bad { background: var(--danger); }

/* ── Today ──────────────────────────────────────────────────────────────── */

.today { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.presence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.presence .panel { padding: 0; margin: 0; overflow: hidden; }
.presence h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 680; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); margin: 0; }
.presence h2 b { margin-left: auto; font-size: 22px; font-stretch: 118%; font-variant-numeric: tabular-nums; }
.presence ul { list-style: none; margin: 0; padding: 6px 0; }
.presence li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 16px; font-size: 15px; }
.presence li span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence li span:last-child { color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 15px; }
.feed li:first-child { border-top: 0; }
.feed time { font-variant-numeric: tabular-nums; font-weight: 640; }
.feed small { color: var(--ink-3); display: block; font-size: 13.5px; }
@media (max-width: 1180px) { .today { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .presence { grid-template-columns: minmax(0, 1fr); } }

/* ── Timesheets ─────────────────────────────────────────────────────────── */

.day { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 8px 18px; align-items: start; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.day:first-child { border-top: 0; }
.day.flag { background: #FFF8F7; }
.day-date b { display: block; font-weight: 660; }
.day-date b::first-letter { text-transform: uppercase; }
.day-date span { color: var(--ink-3); font-size: 14px; }
.day-total { text-align: right; font-variant-numeric: tabular-nums; }
.day-total b { font-size: 19px; font-weight: 680; display: block; }
.day-total span { color: var(--ink-3); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 19px; border: 1px solid var(--line); background: #fff; font-size: 14.5px; font-weight: 580; }
.chip:hover { border-color: var(--blue); }
.chip time { font-variant-numeric: tabular-nums; font-weight: 680; }
.chip.k-in { border-color: #BFE3CD; background: var(--in-soft); }
.chip.k-out { border-color: #C9D2DD; background: var(--line-soft); }
.chip.k-break_start, .chip.k-break_end { border-color: #F3D9A2; background: var(--break-soft); }
.chip.add { border-style: dashed; color: var(--blue); background: transparent; }
.chip i { font-style: normal; font-size: 12px; color: var(--ink-3); }
.day-note { margin-top: 8px; font-size: 14px; }
@media (max-width: 720px) { .day { grid-template-columns: minmax(0, 1fr) auto; } .day .chips-cell { grid-column: 1 / -1; grid-row: 2; } }
.weeknav { display: inline-flex; align-items: center; gap: 4px; }
.weeknav .btn { width: 44px; padding: 0; }
.weeknav b { min-width: 210px; text-align: center; font-weight: 640; font-variant-numeric: tabular-nums; }

/* ── Reports ────────────────────────────────────────────────────────────── */

.report-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; align-items: end; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.presets button { height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); background: #fff; font-size: 14.5px; font-weight: 580; }
.presets button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.totals { display: flex; flex-wrap: wrap; gap: 10px 34px; padding: 18px 22px; background: var(--night); color: #fff; border-radius: var(--r); margin: 18px 0; }
.totals div { min-width: 120px; }
.totals small { display: block; color: #AEBAC8; font-size: 13.5px; }
.totals b { font-size: 30px; font-weight: 680; font-stretch: 118%; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.totals .warn b { color: #FFB4AC; }
.detail-row > td { background: var(--wash); padding: 0; }
.detail { padding: 6px 14px 14px 46px; }
.detail .t { font-size: 14.5px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.detail .t th { background: #fff; }
.detail .t .week td { background: var(--wash); font-weight: 640; }
.expander { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); }
.expander[aria-expanded="true"] .icon { transform: rotate(90deg); }
.pick { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px; }
.pick label { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.pick label:hover { background: var(--wash); }
.pick input { width: 20px; height: 20px; accent-color: var(--blue); margin: 0; }

/* Print view */
.print-page { background: #fff; min-height: 100vh; padding: 28px 34px; max-width: 1000px; margin: 0 auto; color: #000; }
.print-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 34px; background: var(--night); color: #fff; position: sticky; top: 0; z-index: 5; }
.print-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 2.5px solid var(--blue); padding-bottom: 12px; margin-bottom: 16px; }
.print-head h1 { font-size: 24px; font-weight: 720; font-stretch: 112%; }
.print-head p { font-size: 14px; color: #333; }
.print-page h2 { font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.print-page .pt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-page .pt th { text-align: left; border-bottom: 1.5px solid #000; padding: 5px 6px; font-weight: 680; }
.print-page .pt td { border-bottom: 1px solid #D0D5DB; padding: 5px 6px; vertical-align: top; }
.print-page .pt .r { text-align: right; }
.print-page .pt tfoot td, .print-page .pt .sub td { font-weight: 700; border-bottom: 1.5px solid #000; background: #F2F4F7; }
.print-emp { break-inside: avoid-page; page-break-inside: avoid; }
.print-emp.break { break-before: page; page-break-before: always; }
.print-rules { font-size: 12px; color: #444; margin-top: 4px; }
.flagged { color: var(--danger); font-weight: 680; }

@media print {
  @page { size: letter; margin: 14mm 12mm; }
  body { background: #fff; }
  .print-bar, .no-print, .toasts { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .print-page .pt tfoot td, .print-page .pt .sub td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Settings ───────────────────────────────────────────────────────────── */

.settings { display: grid; gap: 18px; max-width: 860px; }
.settings .panel { margin: 0; }
.ip-list { display: grid; gap: 8px; margin: 14px 0; }
.ip-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }
.ip-item small { font-family: var(--font); color: var(--ink-3); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 200px; }
.save-bar { position: sticky; bottom: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 14px 12px 20px; border-radius: var(--r); background: var(--night); color: #fff; box-shadow: 0 12px 34px rgba(4,10,18,.3); }

/* ── Remote punching ("Mon pointage") ───────────────────────────────────── */

.me { max-width: 760px; }
.me-card { border-radius: var(--r-lg); padding: 28px; background: #fff; border: 1px solid var(--line); }
.me-card.s-in { background: var(--in-soft); border-color: #BFE3CD; }
.me-card.s-break { background: var(--break-soft); border-color: #F3D9A2; }
.me-state { font-size: 34px; font-weight: 740; font-stretch: 114%; letter-spacing: -.015em; line-height: 1.05; }
.me-since { margin-top: 6px; color: var(--ink-2); font-size: 17px; }
.me-card .choice { margin-top: 24px; }
.me-card .act { min-height: 132px; }
.me-done { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px 12px 16px; border-radius: var(--r-sm); background: var(--night); color: #fff; font-weight: 600; }
.me-done .btn { background: rgba(255,255,255,.14); height: 38px; font-size: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.timeline li:first-child { border-top: 0; }
.timeline time { font-variant-numeric: tabular-nums; font-weight: 680; width: 52px; }
.kv { display: flex; gap: 10px 36px; flex-wrap: wrap; }
.kv div small { display: block; color: var(--ink-3); font-size: 13.5px; }
.kv div b { font-size: 24px; font-weight: 680; font-stretch: 114%; font-variant-numeric: tabular-nums; }

.center-msg { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px; background: var(--night); color: #fff; text-align: center; }
.center-msg > div { max-width: 520px; }
.center-msg img { width: 170px; height: auto; margin-bottom: 26px; }
.center-msg h1 { font-size: 28px; font-weight: 720; font-stretch: 112%; margin-bottom: 10px; }
.center-msg p { color: #C3CDD9; margin-bottom: 8px; }
.center-msg code { background: var(--night-2); padding: 3px 8px; border-radius: 6px; font-size: 15px; }
.center-msg .btn { margin-top: 18px; }
