:root {
  --bg: #f4f6f9; --card: #ffffff; --ink: #18212f; --muted: #667085; --line: #dfe3ea; --accent: #1d5fd1; --accent-ink: #ffffff;
  --green: #17824a; --green-bg: #e3f5ea; --amber: #a86a00; --amber-bg: #fff1d6; --red: #b8322a; --red-bg: #fde8e6; --gray-bg: #eceff3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c; --card: #1a202a; --ink: #e8ecf3; --muted: #9aa5b8; --line: #2b3442; --accent: #5b94f5; --accent-ink: #0b1220;
    --green: #4cc686; --green-bg: #12301f; --amber: #f0b44c; --amber-bg: #3a2c0d; --red: #f0766d; --red-bg: #3b1814; --gray-bg: #232b38;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.wrap { max-width: 540px; margin: 0 auto; padding: 12px 16px 48px; }
.wide { max-width: 1280px; margin: 0 auto; padding: 12px 16px 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: 12px; }

label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
input[type=checkbox] { width: auto; min-height: 0; transform: scale(1.2); margin-right: 8px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 1px; }
.field { margin: 0 0 12px; }
.check { display: flex; align-items: center; margin: 0 0 12px; color: var(--ink); font-size: 1rem; }
.check label { margin: 0; color: var(--ink); font-size: 1rem; }
.help { font-size: .8rem; color: var(--muted); margin-top: 3px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 10px 16px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.warn { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .85rem; border-radius: 8px; }
.btn.big { min-height: 68px; font-size: 1.25rem; border-radius: 14px; width: 100%; letter-spacing: .02em; }
.btn.link { border: none; background: none; color: var(--accent); padding: 4px 6px; min-height: 0; font-weight: 500; }
.btns { display: grid; gap: 12px; }

.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; background: var(--gray-bg); color: var(--muted); white-space: nowrap; }
.pill.working, .pill.approved, .pill.sent, .pill.reconciled { background: var(--green-bg); color: var(--green); }
.pill.lunch, .pill.break, .pill.submitted, .pill.mismatch, .pill.returned, .pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.exported { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.pill.bad, .pill.rejected, .pill.voided { background: var(--red-bg); color: var(--red); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #98a2b3; margin-right: 8px; }
.dot.working { background: var(--green); } .dot.lunch, .dot.break { background: #e0a100; }

.banner { padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; font-size: .95rem; }
.banner.warn { background: var(--amber-bg); color: var(--amber); }
.banner.bad { background: var(--red-bg); color: var(--red); }
.banner.good { background: var(--green-bg); color: var(--green); }
.err { color: var(--red); font-size: .92rem; min-height: 1.3em; margin: 6px 0; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .in { max-width: 1280px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .01em; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; }
.tab { font: inherit; background: none; border: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab:hover { background: var(--gray-bg); }
.tab.on { background: var(--accent); color: var(--accent-ink); }

.menu { position: relative; }
.menu .pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; min-width: 200px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 30; overflow: hidden; }
.menu .pop button, .menu .pop a { display: block; width: 100%; text-align: left; padding: 12px 14px; background: none; border: none; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; }
.menu .pop button:hover, .menu .pop a:hover { background: var(--gray-bg); }

table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--card); position: sticky; top: 0; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--gray-bg); }
tr.flag td { background: var(--amber-bg); }
.scroll { overflow-x: auto; max-height: 70vh; }

.stat { display: inline-block; min-width: 130px; padding: 12px 16px; margin: 0 10px 10px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.formgrid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--card); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog.wide { width: min(860px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(8, 12, 20, .55); }
dialog .dh { padding: 16px 18px 4px; } dialog .db { padding: 8px 18px 8px; overflow: auto; max-height: calc(100vh - 190px); } dialog .df { padding: 10px 18px 16px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 100; max-width: 90vw; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.toast.bad { background: var(--red); }
.big-time { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.who { font-size: 1.25rem; font-weight: 700; }
.team-row { display: flex; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: none; }
.team-row .t { flex: 1 1 auto; } .team-row .s { font-size: .78rem; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.daycard h3 { display: flex; justify-content: space-between; }
.seg { padding: 8px 0; border-top: 1px solid var(--line); }
.seg.dim { color: var(--muted); }
.spin { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .wide { padding: 8px 10px 64px; } th, td { padding: 7px 6px; } }
