:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --warning: #f97316;
  --danger: #b42318;
  --success: #15803d;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
code, .num { font-variant-numeric: tabular-nums; }
a { color: inherit; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 22px; }
.brand-logo { width: 118px; height: 44px; object-fit: contain; flex: none; display: block; }
.brand small, td small { display: block; color: var(--muted); font-size: 12px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: var(--radius); color: var(--muted); text-decoration: none; margin-bottom: 4px; transition: background 180ms ease, color 180ms ease; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover, .nav-link.is-active { background: #eff6ff; color: var(--primary-strong); }
.main { min-width: 0; padding: 18px 22px 40px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.search-pill { min-height: 44px; width: min(420px, 45vw); display: flex; align-items: center; padding: 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.env-badge, .user-chip, .chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); }
.page-head { margin-bottom: 16px; }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 4px; letter-spacing: 0; }
h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: 0; }
p { margin: 0; color: var(--muted); }
.surface, .metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric span { color: var(--muted); }
.metric strong { display: block; font-size: 30px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.filter-row { display: flex; gap: 12px; align-items: end; margin-bottom: 14px; flex-wrap: wrap; }
label { display: grid; gap: 6px; font-weight: 650; color: var(--text); }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.25); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; }
.span-2 { grid-column: span 2; }
.field-group { display: grid; gap: 6px; }
.field-label { font-weight: 650; color: var(--text); }
.form-actions { display: flex; align-items: end; gap: 10px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.checkbox-field input { width: auto; min-height: auto; }
button { min-height: 44px; border: 0; border-radius: var(--radius); padding: 0 14px; cursor: pointer; transition: background 180ms ease, color 180ms ease, opacity 180ms ease; }
button:disabled { opacity: 0.55; cursor: progress; }
.primary-button { background: var(--primary); color: #fff; font-weight: 750; }
.primary-button:hover { background: var(--primary-strong); }
.secondary-button { border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); font-weight: 700; }
.ghost-button { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); background: #f8fafc; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
.employee-list-surface { padding: 14px; }
.dense-table { min-width: 2280px; font-size: 13px; line-height: 1.35; }
.dense-table th, .dense-table td { padding: 8px 10px; }
.dense-table th { font-size: 11px; white-space: nowrap; }
.dense-table td { white-space: nowrap; }
.dense-table strong { font-size: 13px; }
.dense-table code { font-size: 12px; }
.dense-table .status { min-height: 24px; padding: 2px 7px; font-size: 11px; }
.dense-table .wrap-cell { display: block; min-width: 220px; max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
.dense-table .address-cell { min-width: 260px; max-width: 380px; }
.dense-table .media-cell { min-width: 180px; max-width: 280px; }
.empty-cell { color: var(--muted); text-align: center; padding: 30px; }
.status { display: inline-flex; min-height: 28px; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 750; background: #e2e8f0; color: #334155; }
.status.active, .status.approved { background: #dcfce7; color: var(--success); }
.status.inactive, .status.rejected { background: #fee2e2; color: var(--danger); }
.status.draft, .status.pending_review { background: #ffedd5; color: #9a3412; }
.notice { border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); }
.notice.success { background: #ecfdf3; color: var(--success); border-color: #bbf7d0; }
.notice.error { background: #fef3f2; color: var(--danger); border-color: #fecaca; }
.notice.neutral { background: #eff6ff; color: var(--primary-strong); border-color: #bfdbfe; }
.helper, .muted { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.section-subhead { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.section-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.section-tab { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); text-decoration: none; font-weight: 750; }
.section-tab:hover, .section-tab.is-active { background: #eff6ff; border-color: #bfdbfe; color: var(--primary-strong); }
.combo-picker { max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.combo-option { min-height: 48px; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius); background: #f8fafc; font-weight: 500; cursor: pointer; }
.combo-option input { width: auto; min-height: auto; margin-top: 3px; }
.combo-option strong { display: block; font-size: 13px; }
.combo-option small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.truncate { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-list { display: grid; grid-template-columns: 180px 1fr; gap: 10px; align-items: center; }
.actions { display: flex; align-items: center; gap: 10px; }
.actions form { display: inline; }
.status-select-form { display: inline; }
.status-select { width: 150px; min-height: 34px; padding: 5px 28px 5px 10px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 13px; font-weight: 750; cursor: pointer; }
.status-select.active { background: #dcfce7; color: var(--success); border-color: #bbf7d0; }
.status-select.inactive { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.text-link, .secondary-link, .link-button { color: var(--primary-strong); font-weight: 700; text-decoration: none; }
.button-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-soft); color: var(--text); }
.link-button { min-height: auto; padding: 0; background: transparent; border: 0; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, 0.38); }
.modal-panel { width: min(860px, 100%); max-height: min(820px, calc(100dvh - 48px)); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22); padding: 18px; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 14px; }
.modal-head h2 { margin-bottom: 3px; }
.icon-close { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: 26px; line-height: 1; }
.modal-form { gap: 12px; }
.public-page { min-height: 100dvh; }
.login-shell, .checkin-shell { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 16px; padding: 24px; }
.public-logo { width: min(360px, 82vw); height: auto; display: block; }
.login-panel, .checkin-panel { width: min(460px, 100%); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; }
.form-kicker { font-weight: 750; color: var(--muted); }
.split-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; gap: 6px; overflow-x: auto; }
  .nav-link { white-space: nowrap; }
  .main { padding: 14px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .search-pill { width: 100%; }
  .metric-grid, .two-col, .form-grid, .form-grid.compact, .combo-picker { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .topbar-right { justify-content: space-between; flex-wrap: wrap; }
  .modal-backdrop { align-items: end; padding: 12px; }
  .modal-panel { max-height: calc(100dvh - 24px); }
  h1 { font-size: 24px; }
}
