/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds — near-black, cool/neutral */
  --bg:        #09090e;
  --surface:   #101018;
  --surface-2: #16161f;
  --surface-3: #1c1c28;
  --surface-4: #232332;

  /* Borders */
  --border:       #22222e;
  --border-hover: #32324a;

  /* Text */
  --text:       #e6e6f0;
  --text-muted: #7272a0;
  --text-faint: #404060;

  /* Accent — spring green (used sparingly) */
  --accent:     #52c97a;
  --accent-h:   #66d48c;
  --accent-dim: rgba(82, 201, 122, 0.10);
  --accent-glow:rgba(82, 201, 122, 0.18);

  /* Earth — warm ochre for secondary accents */
  --earth:      #c4884a;
  --earth-dim:  rgba(196, 136, 74, 0.13);

  /* Status */
  --success:     #4ecb6e;
  --success-dim: rgba(78, 203, 110, 0.12);
  --error:       #e05858;
  --error-dim:   rgba(224, 88, 88, 0.13);
  --warn:        #d4a030;
  --warn-dim:    rgba(212, 160, 48, 0.13);

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow:    0 8px 32px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.45);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes leaf-drift {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  25%     { transform: translate(6px,-14px) rotate(10deg) scale(1.05); }
  60%     { transform: translate(-4px,-8px) rotate(-7deg) scale(0.97); }
}
@keyframes sprout {
  from { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
  to   { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
}
@keyframes glow-pulse {
  0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%     { box-shadow: 0 0 16px 4px var(--accent-glow); }
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.nav-brand svg { opacity: 0.85; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  width: 38px; height: 38px;
  flex-shrink: 0;
}
.nav-hamburger:hover { color: var(--text); background: var(--surface-3); }
.nav-hamburger .icon-close { display: none; }
.nav-hamburger.is-open .icon-menu { display: none; }
.nav-hamburger.is-open .icon-close { display: block; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-3); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

.nav-logout { color: var(--text-faint); margin-left: 0.5rem; }
.nav-logout:hover { color: var(--error); background: var(--error-dim); }

.nav-reset { color: var(--text-faint); }
.nav-reset:hover { color: var(--warn); background: var(--warn-dim); }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  animation: fade-in-up 0.25s ease-out;
}

/* ── Flash Messages ───────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 68px;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: opacity 0.3s, transform 0.3s;
  animation: slide-in-right 0.22s ease-out;
}
.flash-success { background: var(--success-dim); border: 1px solid var(--success); color: var(--success); }
.flash-error   { background: var(--error-dim);   border: 1px solid var(--error);   color: var(--error); }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.page-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.page-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #050510;
}
.btn-primary:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-full { width: 100%; justify-content: center; padding: 0.7rem 1rem; font-size: 0.95rem; }
.btn-sm   { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
}
.btn-delete { color: var(--text-faint); }
.btn-delete:hover { color: var(--error); background: var(--error-dim); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(212,160,48,0.4); background: var(--warn-dim); color: var(--warn);
  font-family: inherit; transition: all 0.15s;
}
.btn-danger:hover { background: rgba(212,160,48,0.2); border-color: var(--warn); }

.btn-danger-full {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(224,88,88,0.4); background: var(--error-dim); color: var(--error);
  font-family: inherit; transition: all 0.15s;
}
.btn-danger-full:hover { background: rgba(224,88,88,0.2); border-color: var(--error); }

/* ── Form Elements ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-faint); font-size: 0.8rem; margin-left: 0.25rem; }

.form-input, .form-textarea, .form-select {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.5) sepia(1) hue-rotate(90deg); cursor: pointer; }
.form-select  { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.char-count { font-size: 0.75rem; color: var(--text-faint); text-align: right; margin-top: 0.25rem; }

/* ── Login Page ───────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Decorative leaf background shapes */
.login-wrapper::before,
.login-wrapper::after {
  content: "";
  position: absolute;
  border-radius: 50% 10% 50% 10%;
  opacity: 0.04;
  background: var(--accent);
  pointer-events: none;
}
.login-wrapper::before {
  width: 340px; height: 340px;
  top: -80px; left: -80px;
  transform: rotate(-30deg);
  animation: leaf-drift 9s ease-in-out infinite;
}
.login-wrapper::after {
  width: 260px; height: 260px;
  bottom: -60px; right: -60px;
  transform: rotate(40deg);
  animation: leaf-drift 11s ease-in-out infinite reverse;
}

.leaf-deco {
  position: absolute;
  pointer-events: none;
  color: var(--accent);
  opacity: 0.05;
}
.leaf-deco-1 { top: 15%; right: 12%; animation: leaf-drift 13s ease-in-out infinite 1s; }
.leaf-deco-2 { bottom: 20%; left: 10%; animation: leaf-drift 10s ease-in-out infinite 3s reverse; }
.leaf-deco-3 { top: 55%; right: 8%; animation: leaf-drift 14s ease-in-out infinite 5s; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 390px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  position: relative;
  z-index: 1;
}

.login-icon {
  width: 60px; height: 60px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.login-title    { text-align: center; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 0.25rem; }
.login-tagline  { text-align: center; font-size: 0.8rem; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.5rem; }
.login-subtitle { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.login-form     { display: flex; flex-direction: column; gap: 1.25rem; }

.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 2.75rem; }

#toggle-pw {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  display: flex; align-items: center; padding: 0.25rem; transition: color 0.15s;
}
#toggle-pw:hover { color: var(--text-muted); }

/* ── Employees Grid ───────────────────────────────────────── */
.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}

.employee-card {
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  transition: all 0.22s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.employee-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, var(--accent-dim) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
}
.employee-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4), 0 0 0 1px var(--accent-dim);
}
.employee-card:hover::before { opacity: 1; }

.employee-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-4), var(--surface-3));
  border: 2px solid var(--border-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: var(--text-muted);
  position: relative; z-index: 1;
  transition: border-color 0.22s, color 0.22s, box-shadow 0.22s;
}
.employee-card:hover .employee-avatar {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-glow);
}
.employee-avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; flex-shrink: 0; }

.employee-name {
  font-weight: 600; font-size: 0.95rem; color: var(--text);
  position: relative; z-index: 1;
}

.employee-action {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; color: var(--accent); font-weight: 600;
  position: relative; z-index: 1;
}

/* ── Log Hours Form ───────────────────────────────────────── */
.page-back { margin-bottom: 1.5rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; color: var(--text-muted); font-weight: 500;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

.form-card-wrapper { display: flex; justify-content: center; }
.form-card {
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
}
.form-card-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.75rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.form-card-title   { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.form-card-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.1rem; }
.log-form  { display: flex; flex-direction: column; gap: 1.25rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }

/* ── Mode Toggle ──────────────────────────────────────────── */
.mode-toggle { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.mode-option { cursor: pointer; }
.mode-option input[type="radio"] { display: none; }
.mode-option span {
  display: block; padding: 0.35rem 0.9rem;
  border-radius: 4px; font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
  transition: all 0.15s; white-space: nowrap;
}
.mode-option input:checked + span {
  background: var(--surface); color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* ── Admin Summary Cards ──────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color 0.2s;
}
.summary-card:hover { border-color: var(--border-hover); }
.summary-card-inactive { opacity: 0.45; }
.summary-card-total { border-color: var(--accent); background: linear-gradient(135deg, rgba(82,201,122,0.07), var(--surface)); }

.summary-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.summary-avatar-total { background: var(--accent); color: #050510; border-color: var(--accent); }

.summary-name    { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.15rem; }
.summary-hours   { font-size: 1.4rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.summary-hours span { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }
.summary-hours-total { color: var(--accent); }
.summary-earnings { font-size: 0.85rem; color: var(--earth); font-weight: 600; margin-top: 0.15rem; }
.summary-earnings-total { font-size: 1rem; font-weight: 700; }

.badge-inactive {
  display: inline-block; font-size: 0.65rem; padding: 0.1rem 0.4rem;
  background: var(--surface-3); border-radius: 4px; color: var(--text-faint);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle;
}

/* ── Filter Card ──────────────────────────────────────────── */
.filter-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.filter-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.filter-group { flex: 1; min-width: 140px; }
.filter-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Table ────────────────────────────────────────────────── */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.table-title  { font-size: 1rem; font-weight: 600; }
.table-count  { font-size: 0.8rem; color: var(--text-muted); background: var(--surface-3); padding: 0.2rem 0.6rem; border-radius: 20px; }
.table-wrapper { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table thead th {
  padding: 0.75rem 1rem; text-align: left;
  font-size: 0.72rem; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr.row-inactive { opacity: 0.45; }
.data-table td { padding: 0.75rem 1rem; color: var(--text); vertical-align: middle; }

.table-emp { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.table-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.avatar-inactive { border-color: var(--border-hover); color: var(--text-faint); background: var(--surface-3); }

.hours-badge    { display: inline-block; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-hover); border-radius: 6px; padding: 0.15rem 0.5rem; font-weight: 700; font-size: 0.85rem; }
.earnings-badge { display: inline-block; background: var(--earth-dim); color: var(--earth); border-radius: 6px; padding: 0.15rem 0.5rem; font-weight: 600; font-size: 0.82rem; }
.time-range     { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.text-faint     { color: var(--text-faint); }

.td-date    { color: var(--text-muted); white-space: nowrap; }
.td-meta    { color: var(--text-faint); white-space: nowrap; font-size: 0.8rem; }
.td-comment { color: var(--text-muted); max-width: 260px; }
.td-action  { text-align: right; white-space: nowrap; }

/* ── Status Badges ────────────────────────────────────────── */
.status-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.status-active   { background: var(--success-dim); color: var(--success); }
.status-inactive { background: var(--surface-3);   color: var(--text-faint); }

/* ── Input + Button inline ────────────────────────────────── */
.input-with-btn { display: flex; gap: 0.5rem; align-items: center; }
.input-with-btn .form-input { flex: 1; }

/* ── Rate input ───────────────────────────────────────────── */
.rate-form { display: inline-block; }
.rate-input-row { display: flex; align-items: center; gap: 0.25rem; }
.rate-prefix, .rate-suffix { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.rate-field { width: 80px; padding: 0.35rem 0.5rem; text-align: right; font-size: 0.875rem; }

/* ── Setup Wizard Steps ───────────────────────────────────── */
.setup-steps {
  display: flex;
  align-items: flex-start;
  margin: 1.5rem 0 1.75rem;
}
.setup-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.setup-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: 13px;
  min-width: 16px;
}
.line-done { background: var(--border-hover); }
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.setup-step-label {
  font-size: 0.68rem; color: var(--text-faint); font-weight: 500;
  text-align: center; white-space: nowrap;
}
.step-active .step-dot {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.step-active .setup-step-label { color: var(--text-muted); font-weight: 600; }
.step-done .step-dot {
  background: var(--surface-3);
  color: var(--text-muted);
}

.setup-role-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.step-role-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-role-name { font-weight: 600; font-size: 0.9rem; }
.step-role-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── Setup & Change-code pages ────────────────────────────── */
.setup-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.setup-legend { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 0.4rem; }
.setup-legend-note { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.setup-info { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.8rem; color: var(--text-faint); background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; line-height: 1.4; }
.setup-info svg { flex-shrink: 0; margin-top: 1px; }

.forced-banner { display: flex; align-items: center; gap: 0.6rem; background: var(--warn-dim); border: 1px solid rgba(212,160,48,0.3); color: var(--warn); border-radius: var(--radius); padding: 0.75rem 1rem; font-size: 0.875rem; font-weight: 500; margin-bottom: 1.5rem; }
.change-code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; align-items: start; }
.form-card-required { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.must-change-label { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; color: var(--warn); background: var(--warn-dim); border: 1px solid rgba(212,160,48,0.25); border-radius: 4px; padding: 0.1rem 0.4rem; }

/* ── Reset page ───────────────────────────────────────────── */
.reset-stats { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.5rem; margin-bottom: 1.5rem; width: fit-content; }
.reset-stat { text-align: center; }
.reset-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); display: block; }
.reset-stat-label { font-size: 0.78rem; color: var(--text-faint); }
.reset-stat-sep   { color: var(--border-hover); font-size: 1.5rem; }
.reset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; align-items: start; }

.danger-card { background: var(--surface); border: 1px solid rgba(212,160,48,0.3); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.danger-card-full { border-color: rgba(224,88,88,0.35); }
.danger-card-header { display: flex; align-items: flex-start; gap: 1rem; }
.danger-icon { width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.danger-icon-warn { background: var(--warn-dim); color: var(--warn); }
.danger-icon-red  { background: var(--error-dim); color: var(--error); }
.danger-title    { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.danger-subtitle { font-size: 0.85rem; color: var(--text-muted); }

.danger-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; padding: 0.75rem 1rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.danger-list li { display: flex; align-items: center; gap: 0.5rem; }
.danger-list-del::before { content: "✕"; font-size: 0.7rem; color: var(--error); font-weight: 700; flex-shrink: 0; }
.danger-list-ok::before  { content: "✓"; font-size: 0.7rem; color: var(--success); font-weight: 700; flex-shrink: 0; }
.danger-list-del { color: var(--text-muted); }
.danger-list-ok  { color: var(--success); }
.danger-form { display: flex; flex-direction: column; gap: 0.75rem; }
.confirm-input { font-family: monospace; letter-spacing: 0.05em; }

/* ── Misc ─────────────────────────────────────────────────── */
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--text); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 3rem 1rem; color: var(--text-faint); text-align: center; }
.empty-state p { font-size: 0.9rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Navbar — hamburger mode */
  .navbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
    padding: 0.625rem 1rem;
    align-items: center;
  }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 0 0.375rem;
    margin-top: 0.375rem;
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-link {
    padding: 0.75rem 0.625rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    min-height: 44px;
  }
  .nav-logout, .nav-reset { margin-left: 0; }

  /* Layout */
  .main-content {
    padding: 1.25rem 1rem 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
  .page-header    { flex-direction: column; gap: 0.75rem; }
  .page-title     { font-size: 1.35rem; }
  .form-row       { grid-template-columns: 1fr; }

  /* Inputs — font-size 1rem = 16px prevents iOS auto-zoom */
  .form-input, .form-textarea, .form-select {
    font-size: 1rem;
    padding: 0.7rem 0.875rem;
    min-height: 44px;
  }

  /* Touch targets */
  .btn            { min-height: 44px; padding: 0.65rem 1rem; }
  .btn-sm         { min-height: 38px; }
  .btn-full       { padding: 0.8rem 1rem; }
  .btn-icon       { width: 40px; height: 40px; }
  .btn-danger,
  .btn-danger-full { min-height: 44px; }

  /* Grids */
  .employees-grid   { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .summary-grid     { grid-template-columns: repeat(2, 1fr); }
  .change-code-grid { grid-template-columns: 1fr; }
  .reset-grid       { grid-template-columns: 1fr; }

  /* Filters */
  .filter-card    { padding: 1rem; }
  .filter-form    { flex-direction: column; }
  .filter-actions { width: 100%; display: flex; gap: 0.5rem; }
  .filter-actions .btn { flex: 1; justify-content: center; }

  /* Flash */
  .flash-container { right: 1rem; left: 1rem; max-width: 100%; top: 64px; }

  /* Login */
  .login-wrapper  { align-items: flex-start; padding-top: 2rem; }
  .login-card     { padding: 2rem 1.25rem; }

  /* Summary cards — smaller on mobile */
  .summary-card   { padding: 1rem; gap: 0.75rem; }
  .summary-avatar { width: 36px; height: 36px; font-size: 0.875rem; }
  .summary-hours  { font-size: 1.2rem; }

  /* Form cards */
  .form-card      { padding: 1.5rem 1.25rem; }

  /* Tables — horizontal scroll, no wrapping */
  .data-table     { font-size: 0.82rem; }
  .data-table td, .data-table th { padding: 0.6rem 0.75rem; }

  /* Reset stats */
  .reset-stats    { flex-wrap: wrap; gap: 0.75rem; }
}

@media (max-width: 380px) {
  .employees-grid { grid-template-columns: 1fr; }
}
