:root {
  --bg: #f8f7f5;
  --surface: #fdfdfc;
  --surface-2: #f1f0ee;
  --border: #e3e1dd;
  --text: #23262b;
  --text-2: #5b6a72;
  --text-3: #8b969b;
  --brand: #17916f;
  --brand-dark: #0f6b53;
  --brand-soft: #e6f4ef;
  --success: #1f9e5c;
  --success-soft: #e8f7ee;
  --danger: #c23b28;
  --danger-soft: #fbeae7;
  --amber: #b9821f;
  --amber-soft: #fbf2e1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 96px 20px;
  gap: 16px;
}

.app-shell.wide { max-width: 900px; }

h1.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.eyebrow { font-size: 12px; color: var(--text-3); margin: 0 0 2px 0; }

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

.card.tight { padding: 12px 14px; }

.row { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex-grow: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
}
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.brand { background: var(--brand-soft); color: var(--brand-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.92; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px; font-size: 17px; border-radius: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }

.balance-card {
  background: var(--brand-soft);
  border-radius: 18px;
  padding: 18px 20px;
}
.balance-amount { font-size: 28px; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.01em; }

.nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)) 0;
}
.nav-bar-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.nav-item.active { color: var(--brand); }

table.plain { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.plain th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px; border-bottom: 1px solid var(--border); }
table.plain td { padding: 10px 8px; border-bottom: 1px solid var(--border); }

.toast {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; }
.dot.gray { background: var(--text-3); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,20,20,0.4);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  background: var(--surface);
  width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)) 20px;
  display: flex; flex-direction: column; gap: 14px;
}

.pin-boxes { display: flex; gap: 10px; justify-content: center; }
.pin-box { width: 48px; height: 58px; background: white; border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }

.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 260px; margin: 0 auto; }
.keypad-key {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
}
.keypad-key:active { background: var(--border); }

.pin-dots { display: flex; gap: 16px; justify-content: center; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--border); }
.pin-dot.filled { background: var(--brand); border-color: var(--brand); }

.error-text { color: var(--danger); font-size: 13px; text-align: center; min-height: 18px; }

.install-banner {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  display: none;
}

@media (min-width: 640px) {
  .employer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
