:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --ink: #1b1f24;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #176b5d;
  --accent-dark: #0f4d43;
  --panel: #fffefb;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 24px; background: rgba(255, 254, 251, .96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; font-size: 20px; color: var(--accent-dark); }
.app-icon { width: 34px; height: 34px; border-radius: 8px; display: block; }
.app-icon.large { width: 44px; height: 44px; }
nav { display: flex; gap: 12px; flex: 1; flex-wrap: wrap; }
nav a, .session a { color: var(--muted); text-decoration: none; font-weight: 700; }
.session { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.section-head { margin-bottom: 18px; }
h1 { margin: 0 0 6px; font-size: 30px; }
h2 { margin-top: 0; font-size: 20px; }
p { color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats article, .panel, .login-card, .report-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.stats strong { display: block; font-size: 34px; color: var(--accent); }
.stats span { color: var(--muted); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; margin-bottom: 18px; }
label { display: grid; gap: 6px; font-weight: 700; color: #344054; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; font: inherit; background: #fff; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
button, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; border: 0; border-radius: 6px; padding: 0 14px; background: var(--accent); color: #fff; font-weight: 800; text-decoration: none; cursor: pointer; }
.secondary { background: #e8f1ef; color: var(--accent-dark); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: 18px 0; }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f1f4f7; color: #344054; font-size: 13px; text-transform: uppercase; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.toolbar input { max-width: 180px; }
.flash { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; background: #e8f1ef; color: var(--accent-dark); font-weight: 700; }
.flash.error { background: #fee4e2; color: var(--danger); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: min(420px, 100%); display: grid; gap: 14px; }
.login-card h1 { color: var(--accent-dark); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand h1 { margin: 0; }
.narrow-form { max-width: 460px; display: grid; gap: 14px; }
.report-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 24px; }
.report-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.report-card h2 { margin: 0 0 4px; }
.report-card span { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #e8f1ef; color: var(--accent-dark); font-weight: 800; white-space: nowrap; }
.compact { margin-top: 22px; }
.payroll-summary { margin-bottom: 18px; }
.badge { width: 320px; margin: 40px auto; text-align: center; background: #fff; border: 1px solid #111; padding: 20px; }
.badge img { width: 220px; height: 220px; }
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 16px; }
  nav, .session { width: 100%; }
  nav a { padding: 6px 0; }
  .page { padding: 20px 14px 46px; }
  h1 { font-size: 26px; }
  .stats { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; min-width: 220px; }
  button, .button { width: 100%; }
  .toolbar input { max-width: none; }
  .report-card { align-items: flex-start; flex-direction: column; }
}
@media print {
  .topbar, .page > .flash, .badge button { display: none; }
  body { background: #fff; }
  .badge { border: 1px solid #000; }
}
