@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@500;600;700;800&display=swap");

:root {
  --paper: #eef1f4;
  --card: #ffffff;
  --ink: #16191d;
  --ink-2: #4a5561;
  --ink-3: #7b8794;
  --line: #d5dbe1;
  --line-2: #e6eaee;
  --red: #d7141e;
  --red-dark: #a80f17;
  --red-soft: #fdecec;
  --ok: #12805c;
  --ok-soft: #e4f4ed;
  --warn: #a36100;
  --warn-soft: #fbf0dc;
  --steel: #5b6b7c;
  --r: 10px;
  --r-sm: 8px;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--sans); }
body { min-height: 100vh; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
:focus-visible { outline: 3px solid rgba(215, 20, 30, .45); outline-offset: 2px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-sm); padding: 11px 18px; cursor: pointer; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s, transform .08s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn-ok { color: var(--ok); }
.btn-warn { color: var(--warn); }
.btn-danger { color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-lg { padding: 16px 22px; font-size: 19px; }

/* Champs */
input, select, textarea { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-3); outline: none; }
label.f { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.muted { color: var(--ink-3); }
.err { color: var(--red); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }

/* Statuts */
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-mute { background: var(--line-2); color: var(--ink-2); }

/* Numéro de ticket : talon imprimé */
.stub { font-family: var(--cond); font-weight: 800; letter-spacing: .02em; line-height: 1; }

/* Interrupteur */
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(215, 20, 30, .45); outline-offset: 2px; }

/* Fenêtres */
.overlay { position: fixed; inset: 0; background: rgba(22, 25, 29, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px; }
.dialog { background: var(--card); border-radius: 14px; padding: 26px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.dialog h2 { font-size: 22px; margin-bottom: 4px; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.dialog.center { text-align: center; }
.dialog .logo-s { height: 34px; margin-bottom: 14px; }
.code-in { text-align: center; font: 700 26px var(--cond); letter-spacing: 6px; margin: 16px 0 4px; }

/* Pavé numérique */
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-3); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { font: 600 26px var(--cond); padding: 14px 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.pad button:active { background: var(--line); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-sm); z-index: 60; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
