:root {
  --ink: #16212b;
  --ink-2: #4b5966;
  --muted: #8693a0;
  --line: #e2e7ec;
  --bg: #f4f6f8;
  --card: #ffffff;
  --brand: #1d3a52;      /* Alpro navy — change to match your brand */
  --brand-2: #2f6f9f;
  --go: #1f8a4c;
  --stop: #c2412d;
  --warn: #b7791f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-2); }
.hidden { display: none !important; }

.topbar {
  background: var(--brand); color: #fff; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: #fff; color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand small { display: block; font-weight: 500; opacity: .75; font-size: 12px; letter-spacing: 0; }
.topbar .link-btn { background: rgba(255,255,255,.12); color: #fff; border: 0; padding: 8px 14px; border-radius: 999px; font-size: 14px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 20px 20px 60px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.sub { color: var(--ink-2); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Buttons */
.btn {
  border: 1px solid var(--line); background: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #c9d1d9; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #16304a; }
.btn-danger { color: var(--stop); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Staff login */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.staff-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 12px;
  font-weight: 600; font-size: 16px; text-align: center;
}
.staff-btn:hover { border-color: var(--brand-2); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #e6eef5; color: var(--brand);
  display: grid; place-items: center; margin: 0 auto 8px; font-weight: 700;
}
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); }
.pin-dots span.on { background: var(--brand); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pinpad button {
  height: 64px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
  font-size: 24px; font-weight: 600;
}
.pinpad button:active { background: #eef3f7; }
.pinpad .ghost { border-color: transparent; background: transparent; font-size: 15px; color: var(--ink-2); }
.error { color: var(--stop); text-align: center; min-height: 22px; margin-top: 12px; font-weight: 500; }

/* Clock screen */
.now-time { font-size: 52px; font-weight: 700; letter-spacing: -.02em; text-align: center; font-variant-numeric: tabular-nums; }
.now-date { text-align: center; color: var(--ink-2); margin-bottom: 18px; }
.status {
  text-align: center; padding: 12px; border-radius: 12px; margin-bottom: 16px; font-weight: 600;
  background: #eef2f5; color: var(--ink-2);
}
.status.on { background: #e7f5ec; color: var(--go); }
.big-btn {
  width: 100%; border: 0; border-radius: 18px; padding: 26px 16px; font-size: 24px; font-weight: 800;
  color: #fff; letter-spacing: .02em; box-shadow: var(--shadow);
}
.big-btn.in { background: var(--go); }
.big-btn.out { background: var(--stop); }
.big-btn:disabled { opacity: .6; }
.note-input { width: 100%; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

.week-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.week-row:last-child { border-bottom: 0; }
.week-row .d { font-weight: 600; min-width: 90px; }
.week-row .t { color: var(--ink-2); font-size: 14px; flex: 1; }
.week-row .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.total { display: flex; justify-content: space-between; font-weight: 800; padding-top: 12px; font-size: 17px; }

/* Sheet / dialog */
dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px));
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(10, 20, 30, .45); }
.dlg-body { padding: 22px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbfc; flex-wrap: wrap; }
.choice { display: grid; gap: 10px; margin: 14px 0; }
.choice button {
  text-align: left; padding: 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-size: 16px; font-weight: 600;
}
.choice button small { display: block; font-weight: 400; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.choice button.suggested { border-color: var(--brand-2); background: #f2f7fb; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.field .hint { font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }

/* Admin */
.tabs { display: flex; gap: 4px; background: #fff; border-radius: 12px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 16px; width: fit-content; }
.tabs button { border: 0; background: transparent; padding: 9px 16px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.tabs button.active { background: var(--brand); color: #fff; }
.period-nav { display: flex; align-items: center; gap: 8px; }
.period-nav .label { font-weight: 700; min-width: 210px; text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total-row td { font-weight: 800; background: #fafbfc; }
.table-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f5; color: var(--ink-2); }
.pill.go { background: #e7f5ec; color: var(--go); }
.pill.warn { background: #fdf3e2; color: var(--warn); }
.pill.stop { background: #fbeae7; color: var(--stop); }
.banner { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: #fdf3e2; color: #7a5212; }
.banner.ok { background: #e7f5ec; color: #145c33; }
.results li { margin-bottom: 6px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px; font-weight: 500; z-index: 50; box-shadow: var(--shadow); max-width: 90vw;
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .now-time { font-size: 44px; }
  .period-nav .label { min-width: 0; }
}
a.btn { text-decoration: none; color: inherit; }
.pill { white-space: nowrap; }
