/* Raza Foods Time — shared styles */
:root {
  --pine: #0e3b2e;
  --pine-2: #15513f;
  --pine-soft: #e3ece7;
  --brass: #c9a13b;
  --brass-soft: #f6edd2;
  --ink: #17201c;
  --slate: #5d6b64;
  --line: #d9e0db;
  --field: #f3f5f2;
  --surface: #ffffff;
  --signal: #b3261e;
  --signal-soft: #fbe7e5;
  --ok: #1d7a4f;
  --focus: #c9a13b;
  --on-pine: #f4f8f5;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pine: #1f6a52; --pine-2: #2a7d62; --pine-soft: #1a2b25; --brass: #d8b24e; --brass-soft: #2e2915;
    --ink: #e8eeea; --slate: #9aa9a1; --line: #2a3632; --field: #0f1714; --surface: #172220;
    --signal: #f08a80; --signal-soft: #3a1e1c; --ok: #5fc896; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --pine: #1f6a52; --pine-2: #2a7d62; --pine-soft: #1a2b25; --brass: #d8b24e; --brass-soft: #2e2915;
  --ink: #e8eeea; --slate: #9aa9a1; --line: #2a3632; --field: #0f1714; --surface: #172220;
  --signal: #f08a80; --signal-soft: #3a1e1c; --ok: #5fc896; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; background: var(--field); color: var(--ink); font-variant-numeric: tabular-nums; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; }
h1 { font-size: 1.6rem; font-stretch: 112%; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-stretch: 108%; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--slate); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Brand bar ---------- */
.brandbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.mark { width: 48px; height: 40px; border-radius: 10px; background: #000; display: flex; align-items: center; justify-content: center; padding: 6px; flex: none; overflow: hidden; }
.mark img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.brandbar .title { font-weight: 700; font-stretch: 110%; }
.brandbar .sub { font-size: .8rem; color: var(--slate); }
.brandbar .spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--slate); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.btn.primary:hover { background: var(--pine-2); }
.btn.danger { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--pine-soft); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; }
.btn.block { width: 100%; }

/* ---------- Forms ---------- */
label.field { display: grid; gap: 6px; align-content: start; font-weight: 600; font-size: .9rem; }
label.field .hint { font-weight: 400; color: var(--slate); font-size: .82rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=month], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 30%, transparent); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--pine); }

/* ---------- Notices ---------- */
.notice { padding: 12px 14px; border-radius: var(--radius-s); background: var(--pine-soft); border-left: 4px solid var(--pine); }
.notice.warn { background: var(--brass-soft); border-color: var(--brass); }
.notice.err { background: var(--signal-soft); border-color: var(--signal); color: var(--ink); }
.toast-host { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { padding: 14px 16px; border-radius: var(--radius-m); background: var(--ink); color: var(--field); font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toast-in .2s ease-out; }
.toast.err { background: var(--signal); color: #fff; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- PIN pad ---------- */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; min-height: 18px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--slate); }
.pin-dots span.on { background: var(--pine); border-color: var(--pine); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 340px; margin: 0 auto; }
.pinpad button { min-height: 64px; font-size: 1.6rem; font-weight: 600; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); cursor: pointer; touch-action: manipulation; }
.pinpad button:active { background: var(--pine-soft); }
.pinpad button.key-fn { font-size: 1rem; color: var(--slate); }
.pinpad button.key-go { background: var(--pine); color: var(--on-pine); border-color: var(--pine); font-size: 1.05rem; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- State slab (the one bold element) ---------- */
.slab { border-radius: var(--radius-l); padding: 22px 20px; background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.slab .state { font-size: .95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.slab .state::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--slate); }
.slab .big { font-size: clamp(3rem, 15vw, 4.6rem); font-weight: 700; font-stretch: 125%; letter-spacing: -0.02em; line-height: 1; margin: 10px 0 4px; }
.slab .caption { font-size: .95rem; opacity: .85; }
.slab[data-state="in"] { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.slab[data-state="in"] .state::before { background: #7fe0ae; box-shadow: 0 0 0 5px rgba(127,224,174,.2); }
.slab[data-state="break"] { background: var(--brass); border-color: var(--brass); color: #231b05; }
.slab[data-state="break"] .state::before { background: #231b05; }

/* Day ribbon: 24h line with in/break segments */
.ribbon { margin-top: 18px; }
.ribbon .track { position: relative; height: 12px; border-radius: 6px; background: color-mix(in srgb, currentColor 14%, transparent); overflow: hidden; }
.ribbon .seg { position: absolute; top: 0; bottom: 0; background: currentColor; opacity: .85; }
.ribbon .seg.brk { background: repeating-linear-gradient(135deg, currentColor 0 3px, transparent 3px 6px); opacity: .6; }
.ribbon .now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: currentColor; }
.ribbon .scale { display: flex; justify-content: space-between; font-size: .72rem; opacity: .7; margin-top: 4px; }

/* ---------- Worker app ---------- */
.worker-shell { max-width: 520px; margin: 0 auto; padding: 0 16px 40px; }
.who { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.who h1 { font-size: 1.45rem; }
.checks { display: grid; gap: 8px; margin: 16px 0; }
.checkrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.checkrow .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--field); flex: none; font-size: 15px; }
.checkrow.ok .ico { background: var(--pine-soft); color: var(--ok); }
.checkrow.bad .ico { background: var(--signal-soft); color: var(--signal); }
.checkrow .txt { flex: 1; min-width: 0; }
.checkrow .txt b { display: block; font-size: .95rem; }
.checkrow .txt span { font-size: .82rem; color: var(--slate); }
.actions { display: grid; gap: 10px; margin: 16px 0 24px; }
.actions .act { min-height: 64px; font-size: 1.15rem; font-weight: 700; font-stretch: 108%; border-radius: var(--radius-m); }
.actions .act.in { background: var(--pine); color: var(--on-pine); border-color: var(--pine); }
.actions .act.brk { background: var(--brass-soft); border-color: var(--brass); }
.actions .act.out { background: var(--surface); border: 2px solid var(--signal); color: var(--signal); }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.totals div { padding: 12px 14px; }
.totals div + div { border-left: 1px solid var(--line); }
.totals span { display: block; font-size: .78rem; color: var(--slate); }
.totals b { font-size: 1.25rem; font-stretch: 112%; }
.daylist { margin-top: 22px; }
.daylist h2 { font-size: 1rem; margin-bottom: 8px; }
.dayrow { display: flex; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--line); gap: 12px; }
.dayrow:last-child { border-bottom: 0; }
.dayrow .d { font-weight: 600; }
.dayrow .t { color: var(--slate); font-size: .875rem; }
.namegrid { display: grid; gap: 8px; }
.namebtn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; min-height: 60px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font-size: 1.1rem; font-weight: 600; cursor: pointer; }
.namebtn:hover { border-color: var(--pine); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--pine-soft); color: var(--pine); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; }
.scanner { position: fixed; inset: 0; background: #000; z-index: 50; display: grid; grid-template-rows: 1fr auto; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .bar { padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: #000; color: #fff; display: flex; gap: 12px; align-items: center; }
.scanner .bar p { flex: 1; margin: 0; }
.done-sheet { text-align: center; padding: 40px 10px; }
.done-sheet .tick { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: var(--pine); color: var(--on-pine); font-size: 40px; animation: pop .35s ease-out; }
.done-sheet .tick.brk { background: var(--brass); color: #231b05; }
.done-sheet .tick.out { background: var(--signal); color: #fff; }
.done-sheet .time { font-size: 3rem; font-weight: 700; font-stretch: 125%; line-height: 1; margin: 8px 0; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
