/* One design-token set for register + office. High contrast, big touch targets. */
:root {
  --green-900: #14361f;
  --green-700: #1f6b3a;
  --green-600: #23803f;
  --green-100: #e3f2e7;
  --soil: #5b4636;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #1a1d1a;
  --muted: #5d655e;
  --line: #d6dad3;
  --warn-bg: #fff4d6;
  --warn: #8a5a00;
  --danger: #b42318;
  --danger-bg: #fde8e6;

  --radius: 10px;
  --gap: 12px;
  --touch: 48px;          /* minimum touch target */
  --touch-primary: 56px;  /* Charge / primary actions */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.4 var(--font); background: var(--bg); color: var(--text); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
[hidden] { display: none !important; }

.btn {
  min-height: var(--touch); padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--green-600); }
.btn-big { min-height: var(--touch-primary); font-size: 1.15rem; }
.btn-link { background: none; border: none; color: var(--green-700); text-decoration: underline; min-height: var(--touch); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .95rem; }
.input {
  min-height: var(--touch); padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); font: inherit; color: var(--text);
}
.input:focus { outline: 3px solid var(--green-100); border-color: var(--green-700); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--muted); }
.error { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }

.offline-banner {
  position: sticky; top: 0; z-index: 50; background: var(--danger); color: #fff;
  padding: 10px 16px; font-weight: 700; text-align: center;
}

/* app chrome */
.topbar {
  display: flex; align-items: center; gap: var(--gap); padding: 8px 16px;
  background: var(--green-900); color: #fff; min-height: 60px;
}
.topbar .brand { font-weight: 800; font-size: 1.1rem; margin-right: auto; }
.topbar .who { opacity: .85; font-size: .95rem; }
.topbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.topbar a.btn { text-decoration: none; }

/* sign in */
.signin-wrap { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.signin { width: 100%; max-width: 380px; }
.signin .logo { font-size: 1.6rem; font-weight: 800; color: var(--green-900); margin-bottom: 4px; }

/* register layout: catalog left, cart right; stacks on narrow screens */
.register { display: grid; grid-template-columns: 1fr 380px; gap: var(--gap); padding: var(--gap); height: calc(100% - 60px); }
.register .pane { display: flex; flex-direction: column; min-height: 0; }
.register .search { font-size: 1.2rem; min-height: var(--touch-primary); }
.cart-total { font-size: 1.6rem; font-weight: 800; display: flex; justify-content: space-between; margin: 12px 0; }
@media (max-width: 860px) {
  .register { grid-template-columns: 1fr; height: auto; }
}

/* office */
.office { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100% - 60px); }
.office nav { background: var(--surface); border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.office nav a { min-height: var(--touch); display: flex; align-items: center; padding: 0 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 600; }
.office nav a[aria-current="page"] { background: var(--green-100); color: var(--green-900); }
.office main { padding: 20px; }
@media (max-width: 760px) {
  .office { grid-template-columns: 1fr; }
  .office nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .office nav a { white-space: nowrap; }
}

/* ---------- shared office components ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h1, .page-head h2 { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }
.right { text-align: right; }
.center { text-align: center; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .95rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.notice { background: var(--green-100); color: var(--green-900); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.card + .card, .card + form, #panel > .card, #editor > .card, #panel > form { margin-top: 16px; }
.form h2 { margin-bottom: 14px; }
.form h3 { margin: 22px 0 6px; }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid3 { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
select.input { padding-right: 8px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table td.right, .table th.right { text-align: right; }
.table tr.dim td { color: var(--muted); }
.card { overflow-x: auto; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--line); color: var(--text); vertical-align: middle; }
.chip-custom { background: #e8e1ff; color: #4a2fa6; }
.chip-live { background: var(--green-100); color: var(--green-900); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }

.perm-area { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 10px; margin: 0 0 12px; }
.perm-area legend { font-weight: 700; padding: 0 6px; }
.perm { display: flex; align-items: center; gap: 10px; min-height: var(--touch); flex-wrap: wrap; }
.perm input { width: 22px; height: 22px; accent-color: var(--green-700); }
.perm.disabled { color: var(--muted); }

.pin-card { text-align: center; }
.pin-big { font-size: 3rem; font-weight: 800; letter-spacing: .3em; margin: 12px 0; color: var(--green-900); font-variant-numeric: tabular-nums; }

.week-nav { margin-bottom: 14px; }
.tc-person { margin-bottom: 16px; }
.tc-totals { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 700; }

/* ---------- time clock kiosk ---------- */
.clock-wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
.clock-now { text-align: center; margin-bottom: 16px; }
.clock-time { font-size: 3.2rem; font-weight: 800; color: var(--green-900); font-variant-numeric: tabular-nums; }
.pin-dots { text-align: center; font-size: 2.4rem; letter-spacing: .4em; min-height: 56px; line-height: 56px; }
.pin-dots.empty { font-size: 1.2rem; letter-spacing: 0; color: var(--muted); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 16px; }
.key { min-height: 68px; font-size: 1.6rem; font-weight: 700; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.key:active { background: var(--green-100); }
.clock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clock-result { min-height: 0; border-radius: var(--radius); text-align: center; font-size: 1.1rem; }
.clock-result.good, .clock-result.bad { padding: 12px; margin: 6px 0 10px; }
.clock-result.good { background: var(--green-100); color: var(--green-900); }
.clock-result.bad { background: var(--danger-bg); color: var(--danger); }
