:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c1f26;
  --muted: #6b7280;
  --border: #e3e5e9;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --ok: #1e7a3e;
  --warn: #a15c00;
  --radius: 12px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .title { font-weight: 700; font-size: 1.05rem; }
.topbar .sub { font-size: 0.8rem; opacity: 0.85; }
.topbar button {
  background: rgba(255,255,255,0.15);
  color: var(--accent-ink);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  position: sticky;
  top: 56px;
  z-index: 9;
}
.tabs button {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.logo-banner {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
.logo-banner img { height: 34px; width: auto; max-width: 100%; display: block; }
.logo-banner .divider { width: 1px; height: 28px; background: rgba(255,255,255,0.35); flex-shrink: 0; }
@media (max-width: 360px) {
  .logo-banner { gap: 10px; padding: 14px 8px; }
  .logo-banner img { height: 28px; }
}

.card h2, .card h3 { margin-top: 0; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 6px; }
label:first-child { margin-top: 0; }

input[type=text], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-secondary { background: #eceef1; color: var(--ink); }
.btn-danger { background: #fdeceb; color: var(--danger); }
.btn-small { padding: 8px 12px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.5; }

.choice-grid { display: flex; flex-direction: column; gap: 12px; }
.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
}
.choice-card:active { background: #f4f5f7; }
.choice-icon {
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.choice-icon img { height: 26px; width: auto; display: block; }
.choice-text { flex: 1; }
.choice-label { font-weight: 700; }
.choice-sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.name-btn {
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  font-size: 0.95rem;
  cursor: pointer;
}
.name-btn.selected { border-color: var(--accent); background: #eaf2ef; font-weight: 600; }

.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots .dot.filled { background: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.keypad button { padding: 18px 0; font-size: 1.3rem; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.keypad button:active { background: #eceef1; }

.employee-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; }
.employee-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.employee-row input[type=checkbox] { width: 20px; height: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
tfoot td { font-weight: 700; }

.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-submitted { background: #fff4e0; color: var(--warn); }
.badge-approved { background: #e6f4ea; color: var(--ok); }
.badge-expired { background: #fdeceb; color: var(--danger); }

.muted { color: var(--muted); font-size: 0.85rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.error-text { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }
.notice { background: #fff4e0; color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; margin-bottom: 12px; }

.photo-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.week-nav .label { font-weight: 600; }

.empty-state { text-align: center; color: var(--muted); padding: 32px 12px; }

@media (min-width: 560px) {
  .name-grid { grid-template-columns: 1fr 1fr 1fr; }
}
