/* ── Auth form (email + password) ── */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.auth-input:focus {
  outline: none;
  border-color: var(--gold);
}

.auth-error {
  min-height: 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--red);
}

.auth-submit { width: 100%; margin-top: 4px; }
.auth-signout { margin-top: 8px; align-self: center; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 -2px;
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-help {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ── Mode tabs (PIN / Email) ── */
.mode-tabs {
  display: flex;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.mode-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.mode-tab.active {
  background: var(--oak);
  color: var(--gold);
}

.mode-body { width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* ── Staff picker (PIN-mode roster) ── */
.staff-picker {
  display: flex; flex-direction: column;
  gap: 7px;
}
.staff-card {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.staff-card.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.staff-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--oak);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.staff-meta {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.staff-name {
  font-size: 14px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.staff-role {
  font-size: 11px;
  color: var(--muted);
}

.picked-staff {
  display: flex; align-items: center; gap: 12px;
  background: var(--gold-pale);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
}
.back-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(142,155,170,0.4);
}

.login-cta {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px;
  align-items: stretch;
}
.login-cta .back-link { align-self: center; }

/* ── PIN dots + keypad (used by login + setup-account) ── */
.pin-row {
  display: flex; gap: 10px;
  margin-bottom: 14px;
  justify-content: center;
}
.pin-row.shake { animation: shake 0.4s; }
.pin-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.1s, border-color 0.1s;
}
.pin-dot.filled { background: var(--gold); border-color: var(--gold); }
.pin-row.error .pin-dot { border-color: var(--red); }
.pin-row.error .pin-dot.filled { background: var(--red); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}
.key {
  aspect-ratio: 1.6;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.08s, background 0.1s;
  user-select: none;
}
.key:active { transform: scale(0.96); background: var(--surface-warm); }
.key.del { background: var(--surface-warm); font-size: 14px; color: var(--muted); }
.key.go {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-size: 16px;
}
.key[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ── Buttons (general) ── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border: none;
  border-radius: 13px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.btn-primary {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-body);
}

/* ── Bottom navigation ── */
.bottom-nav {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(12px + var(--safe-bottom));
  display: flex;
  justify-content: space-around;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 6px;
  background: none;
  border: none;
  flex: 1;
  position: relative;
}
.nav-icon { font-size: 17px; }
.nav-lbl {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.nav-item.active .nav-lbl { color: var(--gold); }
.nav-badge {
  position: absolute;
  top: 0; right: 18%;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}

/* ── App bar (inner screens) ── */
.app-bar {
  background: var(--oak);
  padding: calc(14px + var(--safe-top)) 18px 16px;
}
.app-bar-row {
  display: flex; align-items: center; justify-content: space-between;
}
.app-bar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--gold);
  display: flex; align-items: center; gap: 7px;
}
.app-bar-title .icon { font-size: 16px; }
.app-bar-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 5px;
}
.app-bar-sub strong { color: rgba(255,255,255,0.9); font-weight: 500; }
.app-bar-action {
  background: none; border: none;
  color: var(--gold);
  font-size: 22px;
}

/* ── Section title ── */
.sec-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  padding: 12px var(--gutter) 4px;
}

/* ── Cards (dashboard widgets, stock items, etc.) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin: 0 var(--gutter) 8px;
  box-shadow: var(--shadow);
  text-align: left;
  width: calc(100% - 2 * var(--gutter));
  display: block;
}
button.card { font: inherit; color: inherit; cursor: pointer; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.card-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 5px;
}
.card-arrow { color: var(--muted); font-size: 18px; line-height: 1; }
.card-sub  { font-size: 12px; color: var(--muted); margin-top: 7px; }

/* ── Pills ── */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  display: flex; align-items: center; gap: 5px;
  background: var(--green-pale);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 500;
  color: var(--green);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ── Mini status cards (low / critical) ── */
.mini-row { display: flex; gap: 8px; }
.mini {
  flex: 1; border-radius: var(--radius); padding: 9px 10px; text-align: center;
}
.mini.amber { background: var(--amber-pale); }
.mini.red   { background: var(--red-pale); }
.mini-num {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  display: block;
}
.mini.amber .mini-num { color: var(--amber); }
.mini.red   .mini-num { color: var(--red); }
.mini-lbl {
  font-size: 10px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Big number (dashboard tasks card) ── */
.big-num {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800; color: var(--text);
}
.big-num-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 400;
  margin-left: 4px;
}

/* ── Till row ── */
.till-row { display: flex; gap: 7px; }
.till-venue {
  flex: 1;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
}
.till-vname {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.till-status { font-size: 13px; font-weight: 600; margin-top: 3px; }
.till-status.ok   { color: var(--green); }
.till-status.pend { color: var(--amber); }

/* ── Avatar ── */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--oak);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 800;
  color: var(--gold);
  flex-shrink: 0;
}
.avatar.small { width: 24px; height: 24px; font-size: 10px; }

/* ── On-shift-now card ── */
.on-now {
  margin: 12px var(--gutter) 0;
  background: var(--gold-pale);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}
.on-now.empty { background: var(--surface); border-color: var(--border); }
.on-now-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--oak-mid);
  margin-bottom: 9px;
}
.on-now.empty .on-now-title { color: var(--muted); }
.on-now-empty { font-size: 13px; color: var(--muted); }

.shift-row {
  display: flex; align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(201,168,76,0.2);
}
.shift-row:last-child { border-bottom: none; padding-bottom: 0; }
.shift-name {
  font-size: 13px; font-weight: 500;
  color: var(--text);
  margin-left: 9px; flex: 1;
}
.shift-since { font-size: 11px; color: var(--muted); }
.shift-dur {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 800;
  color: var(--oak);
}

/* ── Clock button ── */
.clock-btn {
  margin: 12px var(--gutter) 0;
  width: calc(100% - 2 * var(--gutter));
  padding: 13px;
  border-radius: 13px;
  background: var(--gold);
  border: none;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}
.clock-btn.clock-out {
  background: var(--oak);
  box-shadow: 0 4px 16px rgba(44,24,16,0.35);
}

/* ── Owner clock-other ── */
.owner-clock {
  margin: 14px var(--gutter) 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.owner-clock-row { display: flex; gap: 8px; }
.owner-clock-select { flex: 1; padding: 10px 12px; }
.owner-clock-btn { flex-shrink: 0; }

/* ── Weekly hours ── */
.weekly-list {
  margin: 0 var(--gutter) 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.weekly-row {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  box-shadow: var(--shadow);
}
.weekly-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.weekly-hours {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 800;
  color: var(--oak);
}

/* ── Shift history ── */
.hist-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--gutter) 5px;
}
.hist-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.hist-empty {
  margin: 0 var(--gutter) 8px;
  padding: 16px 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.hist-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 13px;
  margin: 0 var(--gutter) 6px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
  gap: 10px;
}
.hist-main { min-width: 0; flex: 1; }
.hist-name { font-size: 13px; font-weight: 500; color: var(--text); }
.hist-date { font-size: 11px; color: var(--muted); margin-top: 1px; }
.hist-right { display: flex; align-items: center; gap: 10px; }
.hist-dur {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 800;
  color: var(--text);
}
.hist-actions { display: flex; gap: 4px; }
.hist-action {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.hist-action.danger { color: var(--red); }

/* ── Dashboard meta strip ── */
.dash-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--gutter) 4px;
  font-size: 11px;
  color: var(--muted);
}
.dash-meta-time { font-weight: 500; }

/* ── Category chips (horizontal scroll) ── */
.cat-scroll {
  display: flex; gap: 6px;
  padding: 10px var(--gutter);
  overflow-x: auto;
}
.cat-chip {
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: var(--shadow);
}
.cat-chip.active {
  background: var(--oak);
  color: var(--gold);
  border-color: var(--oak);
}

/* ── Stock alert bar ── */
.alert-bar {
  margin: 0 var(--gutter) 8px;
  background: var(--amber-pale);
  border: 1px solid rgba(230,126,34,0.2);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-size: 12px; font-weight: 600;
  color: var(--amber);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer;
}
.alert-chevron { font-size: 13px; }
.alert-list {
  margin: -4px var(--gutter) 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 12px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.alert-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-of-type { border-bottom: none; }
.alert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.alert-dot.low      { background: var(--amber); }
.alert-dot.critical { background: var(--red); }
.alert-name { flex: 1; color: var(--text); font-weight: 500; }
.alert-meta { color: var(--muted); font-size: 12px; }
.alert-print { margin-top: 8px; align-self: flex-start; }

/* ── Stock items ── */
.stock-list {
  display: flex; flex-direction: column;
  gap: 7px;
  padding: 0 var(--gutter);
}
.stock-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 12px;
  display: flex; align-items: stretch; gap: 10px;
  box-shadow: var(--shadow);
}
.s-bar {
  width: 4px; border-radius: 2px;
  align-self: stretch; flex-shrink: 0;
}
.s-bar.g { background: var(--green); }
.s-bar.a { background: var(--amber); }
.s-bar.r { background: var(--red); }
.s-info { flex: 1; min-width: 0; cursor: pointer; }
.s-name {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.s-foot { font-size: 10px; color: var(--muted); margin-top: 3px; opacity: 0.8; }
.s-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex-shrink: 0;
}
.s-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.s-badge.g { background: var(--green-pale); color: var(--green); }
.s-badge.a { background: var(--amber-pale); color: var(--amber); }
.s-badge.r { background: var(--red-pale);   color: var(--red); }

.qty-ctrl { display: flex; align-items: center; gap: 5px; }
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-warm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
  color: var(--text);
  user-select: none;
  touch-action: none;
}
.qty-btn:disabled { opacity: 0.35; pointer-events: none; }
.qty-btn:active   { transform: scale(0.92); background: var(--surface); }
.qty-num {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800;
  color: var(--text);
  min-width: 26px;
  text-align: center;
}

/* ── Modal ── */
.modal-wrap {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.15s ease-out;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20,12,8,0.45);
  backdrop-filter: blur(2px);
}
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 18px var(--gutter) calc(18px + var(--safe-bottom));
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease-out;
  max-height: 92dvh;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .modal-wrap { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800;
  color: var(--oak);
}
.modal-close {
  background: none; border: none;
  font-size: 22px; line-height: 1;
  color: var(--muted);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { display: flex; flex-direction: column; gap: 8px; }
.modal-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.modal-error {
  min-height: 18px;
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  margin: 4px 0;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 6px;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(192,57,43,0.3);
}
.btn-ghost.danger { color: var(--red); }

/* ── Form grid (used in stock add/edit modal) ── */
.form-grid { display: flex; flex-direction: column; gap: 10px; }
.form-row  { display: flex; gap: 8px; }
.form-row .auth-field { flex: 1; }

/* ── Print-only block ── */
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  body > #app, body > .toast, body > .offline-banner { display: none !important; }
}

/* ── Loading shim ── */
.loading {
  display: flex;
  align-items: center; justify-content: center;
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
