:root {
  --yellow: #fff541;
  --red: #d92328;
  --black: #233a4d;
  --white: #ffffff;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #6b7785;
  --line: #e7edf4;
  --ok: #1f7a4c;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius: 12px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
a { color: #233a4d; text-decoration: none; }
a:hover { color: #0f2231; text-decoration: underline; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e6ebf2;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: #1e293b;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: #0f172a; }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 0.68rem; font-weight: 600; color: #64748b; }
.nav { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.nav a { color: #475569; font-weight: 600; font-size: 0.8rem; }
.nav a:hover, .nav a.active { color: #0f172a; text-decoration: none; }
.nav-menu { position: relative; }
.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  color: #475569;
  font-weight: 600;
  font-size: 0.8rem;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: "▾"; margin-left: 0.35rem; font-size: 0.75em; opacity: 0.75; }
.nav-menu > summary:hover,
.nav-menu > summary.active,
.nav-menu[open] > summary { color: #0f172a; }
.nav-menu-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 40;
  min-width: 11.5rem;
  padding: 0.4rem;
  border: 1px solid #e3e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 0.15rem;
}
.nav-menu-panel a { display: block; padding: 0.45rem 0.7rem; border-radius: 7px; color: #26323f; white-space: nowrap; }
.nav-menu-panel a:hover,
.nav-menu-panel a.active { background: #eef1f4; color: #233a4d; text-decoration: none; }
.nav .muted { color: #64748b; }
.nav .btn-secondary { background: #fff; color: #334155; border-color: #e2e8f0; }
.nav .btn-secondary:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }

.container { width: min(1440px, calc(100% - 28px)); margin: 1rem auto 2rem; }
h1, h2 { letter-spacing: -0.02em; margin: 0 0 0.45rem; color: #233a4d; }
h1 { font-size: 1.35rem; font-weight: 600; }
h2 { font-size: 14px; font-weight: 600; color: #26323f; }
.page-kicker {
  margin: 0 0 0.2rem;
  color: #6b7785;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.section-head { margin-bottom: 0.85rem; }
.section-head h2 { margin-bottom: 0.25rem; padding-bottom: 8px; border-bottom: 1px solid #e3e7ec; }
.section-head p { margin: 0; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 0.82rem; margin-top: 0.2rem; }
.search-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.search-form input[type="text"] { flex: 1; min-width: 16rem; margin: 0; }
.search-card h2 { margin-bottom: 0.75rem; }
.page-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-header h1 { margin: 0 0 0.35rem; border-bottom: 0; }
.page-header p { margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.75rem;
}
.card h2 { font-size: 14px; font-weight: 600; color: #26323f; border-bottom: 1px solid #e3e7ec; padding-bottom: 8px; }
.filters { display: block; padding: 0.85rem 1rem 0.75rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem 0.55rem; align-items: end; }
.filters label, .date-by-label { margin: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.filters input[type="text"], .filters select { height: 28px; margin: 0.18rem 0 0; padding: 0 0.55rem; border: 1px solid #e6ebf2; border-radius: 7px; background: #fff; font-size: 12px; font-weight: 600; }
.filter-actions { display: flex; align-items: center; gap: 0.4rem; align-self: end; }
.filters .btn { height: 28px; padding: 0 0.7rem; border-radius: 7px; font-size: 12px; }
.filter-note { margin: 0; }
.pair-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
.pair-cards.pair-2 { grid-template-columns: 1.1fr 1fr; }
.pair-cards > .card { margin-bottom: 0; height: 100%; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-bottom: 1.25rem; }
.cards.kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e7edf4;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 12px 12px;
}
.cards > .stat-card .label { display: flex; align-items: center; gap: 8px; }
.cards > .stat-card .label::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e8f8ef;
  flex-shrink: 0;
}
.cards > .stat-card:nth-child(2) .label::before { background: #f3e8ff; }
.cards > .stat-card:nth-child(3) .label::before { background: #fff1dc; }
.cards > .stat-card:nth-child(4) .label::before { background: #e7f0ff; }
.cards > .stat-card:nth-child(5) .label::before { background: #e7f6ee; }
.stat-card .label { color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card .value { font-size: 20px; font-weight: 600; margin-top: 0.15rem; color: #0f172a; font-variant-numeric: tabular-nums; }
.stat-card .sub { margin-top: 2px; color: #6b7785; font-size: 11px; }
.unsub { color: #b42318; font-size: 11px; font-weight: 700; margin-top: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  height: 28px;
  border-radius: 7px;
  padding: 0 0.7rem;
  font-weight: 600;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  background: #233a4d;
  color: var(--white);
  text-decoration: none;
}
.btn:hover { background: #17324a; text-decoration: none; color: var(--white); }
.btn-secondary { background: #f4f6f8; color: #26323f; border-color: #e3e7ec; }
.btn-secondary:hover { background: #e8edf2; color: #26323f; border-color: #b8c2cc; }
.btn-danger { background: #fff; color: #b42318; border-color: #f0c9c6; }
.btn-danger:hover { background: #fff5f5; color: #912018; border-color: #e7b4af; }
.btn:disabled { opacity: 0.45; cursor: default; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.45rem; }
.editor-bar button {
  height: 28px;
  padding: 0 0.55rem;
  border: 1px solid #e3e7ec;
  border-radius: 7px;
  background: #f4f6f8;
  color: #26323f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.editor-bar button:hover { background: #e8edf2; }
.note-editor {
  min-height: 180px;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
  color: #0f172a;
}
.note-editor:focus { outline: 2px solid #dbe4ee; border-color: #cbd5e1; }
.note-editor p { margin: 0 0 0.45rem; }
.btn-sm { height: 26px; padding: 0 0.55rem; font-size: 11px; }

.flash { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash li { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 0.5rem; font-weight: 600; }
.flash .success { background: #e5f5eb; color: var(--ok); }
.flash .error { background: #fce8e8; color: var(--red); }
.flash .info { background: #eef1f4; color: #233a4d; }
.flash-inline { background: #eef1f4; border-radius: 10px; padding: 0.6rem 0.75rem; font-weight: 600; }

label { display: block; font-weight: 600; margin-bottom: 0.2rem; font-size: 11px; color: #64748b; letter-spacing: 0.02em; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
  width: 100%;
  height: 32px;
  padding: 0 0.6rem;
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 0.6rem;
}
input:focus, select:focus { outline: 2px solid #dbe4ee; border-color: #cbd5e1; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #e3e7ec;
  background: #fff; color: #111; font-size: 13px; font-weight: 700; text-decoration: none;
}
.pager a:hover { border-color: #111; }
.pager .is-on { background: #0a0a0a; color: #fff541; border-color: #0a0a0a; }
.pager-count, .pager-gap { border: 0; background: transparent; min-width: 0; color: #64748b; font-weight: 600; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 0.15rem 0 0.85rem; font-size: 13px; font-weight: 600; color: #1e293b; letter-spacing: 0; }
.check-line input { width: auto; margin: 0; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; margin: 0; }
.check input { margin: 0; }
.check-block { margin: 0 0 0.9rem; }

.table-wrap { overflow: auto; border: 1px solid #e3e7ec; border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid #e3e7ec; vertical-align: middle; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7785; background: #fff; }
tr:hover td { background: #f4f6f8; }
.row-actions { display: flex; align-items: center; gap: 0.35rem; flex-wrap: nowrap; }
.row-actions .inline-form { display: inline-flex; width: auto; flex: 0 0 auto; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; }
.inline-form select, .inline-form input[type="text"] { width: auto; height: 28px; margin: 0; min-width: 6.5rem; font-size: 12px; }
.inline-form input[type="text"] { min-width: 8rem; flex: 1; }

.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.badge-bound { background: #e5f5eb; color: var(--ok); }
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.rank li { display: flex; flex-direction: column; gap: 0.15rem; }
.rank span { color: var(--muted); font-size: 0.85rem; }

.qr-card { text-align: center; }
.qr-box { display: inline-block; background: #fff; border-radius: 12px; padding: 0.4rem; }
.qr-box svg { width: 180px; height: 180px; display: block; }
.code-line { font-size: 1.15rem; font-weight: 800; margin: 0.6rem 0 0.2rem; }
.link-line { word-break: break-all; }

body.auth-body { background: #f4f7fb; color: #1e293b; font-size: 14px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid #e7edf4;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  padding: 2rem 1.6rem 1.5rem;
}
.auth-logo { display: block; width: min(210px, 78%); height: auto; margin: 0 auto 0.85rem; }
.auth-card h1 { text-align: center; color: #1e293b; font-size: 1.7rem; margin: 0; }
.auth-card .subtitle { text-align: center; color: #64748b; font-weight: 600; margin: 0.2rem 0 1.15rem; }
.auth-card .auth-note { text-align: center; color: #64748b; font-size: 0.9rem; margin: -0.7rem 0 1rem; }
.auth-card label { font-size: 0.75rem; color: #64748b; }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] {
  height: 36px;
  margin-top: 0.2rem;
  padding: 0 0.85rem;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f8fafc;
}
.auth-card .btn { width: 100%; height: 36px; margin-top: 0.25rem; font-size: 13px; background: #233a4d; }
.auth-card .btn:hover { background: #17324a; color: #fff; }
.auth-card a { color: #1e293b; }

.public-body { background: #f4f7fb; font-size: 15px; }
.public-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem 1rem 2rem; }
.public-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.15rem 0.9rem 1rem;
}
.public-card label,
.public-card .field-label { font-size: 14px; color: #1e293b; font-weight: 600; }
.public-card input[type="text"],
.public-card input[type="tel"],
.public-card input[type="email"] {
  height: 46px;
  font-size: 16px;
  margin-bottom: 0.75rem;
}
.public-logo { display: block; width: min(190px, 70%); height: auto; margin: 0 auto 0.8rem; }
.public-card h1 { text-align: center; font-size: 1.25rem; line-height: 1.35; }
.end-card { padding: 1.35rem 1.15rem 1.4rem; }
.end-mark {
  width: 76px;
  height: 76px;
  margin: 0.15rem auto 0.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff541;
  color: #d92328;
  border: 2px solid #d92328;
}
.end-mark svg { width: 36px; height: 36px; display: block; }
.end-card h1 { font-size: 1.55rem; margin: 0 0 0.45rem; }
.end-copy { text-align: center; font-size: 1.05rem; font-weight: 600; line-height: 1.45; color: #1e293b; margin: 0; }
.end-card .fine { margin-top: 1rem; }
.referrer { text-align: center; font-weight: 700; margin: -0.2rem 0 1rem; }
.fine { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 0.8rem 0 0; }
.form-error { background: #fce8e8; color: var(--red); border-radius: 10px; padding: 0.65rem 0.75rem; font-weight: 700; }
.field-label { font-weight: 700; margin: 0 0 0.45rem; }
.public-card .btn { width: 100%; height: 40px; margin-top: 0.35rem; padding: 0 1rem; font-size: 14px; }
.public-card .btn-office { height: 48px; margin: 0.2rem 0 0; font-size: 16px; background: #d92328; color: #fff; border-color: #d92328; }
.public-card .btn-office:hover { background: #b51d22; color: #fff; border-color: #b51d22; }
.call-or { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0.55rem 0 0.85rem; }
.lang-switch { display: flex; justify-content: center; gap: 0.35rem; margin-bottom: 0.8rem; }
.lang-switch a {
  min-width: 5.5rem;
  text-align: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--black);
  font-weight: 800;
  font-size: 0.92rem;
}
.lang-switch a.is-on { background: #233a4d; color: #fff; border-color: #233a4d; text-decoration: none; }
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 0.9rem; }
.type-grid label { margin: 0; }
.type-grid input { position: absolute; opacity: 0; pointer-events: none; }
.type-grid span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 124px;
  text-align: center;
  padding: 10px 6px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff541;
  color: #e10600;
}
.type-grid img { width: 72px; height: 72px; object-fit: contain; display: block; }
.type-grid em { font-style: normal; color: #111; font-size: 12px; font-weight: 700; line-height: 1.15; }
.type-grid input:checked + span { border-color: #e10600; box-shadow: inset 0 0 0 1px #e10600; }
.type-grid input:focus-visible + span { outline: 2px solid #e10600; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.letter-stage { display: flex; justify-content: center; padding: 8px 0 24px; }
.letter-frame {
  width: min(8.5in, 100%);
  height: 11in;
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
@media (max-width: 900px) {
  .cards, .cards.kpi-row, .pair-cards, .pair-cards.pair-2 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar { align-items: flex-start; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  body { background: #fff; }
  .topbar, .no-print, .flash { display: none !important; }
  .container { width: auto; margin: 0; }
}

/* ===== Payroll-style interface (admin shell + sign-in) ===== */
body.app, body.auth-body {
  --p-bg: #f6f7f9; --p-panel: #fff; --p-line: #e6e8ec; --p-text: #1a1d23; --p-muted: #6b7280;
  --p-accent: #4f46e5; --p-accent-h: #4338ca; --p-accent-soft: #eef0ff;
  --p-err: #dc2626; --p-err-soft: #fdecec; --p-ok: #16a34a; --p-ok-soft: #e8f7ee;
  --p-shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark) {
  body.app, body.auth-body {
    --p-bg: #0f1115; --p-panel: #171a20; --p-line: #262a33; --p-text: #e8eaee; --p-muted: #8b93a1;
    --p-accent: #818cf8; --p-accent-h: #a5b0ff; --p-accent-soft: #1f2340;
    --p-err: #f87171; --p-err-soft: #2d1717; --p-ok: #4ade80; --p-ok-soft: #12261a; --p-shadow: none;
  }
}
body.app, body.auth-body {
  background: var(--p-bg); color: var(--p-text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.app a, body.auth-body a { color: var(--p-accent); }
body.app a:hover { color: var(--p-accent-h); text-decoration: none; }
body.app .muted, body.auth-body .muted, body.app .sub { color: var(--p-muted); }

body.app .shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
body.app .side {
  background: var(--p-panel); border-right: 1px solid var(--p-line); padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
body.app .brand-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 2px 6px 16px; }
body.app .brand-co-logo { display: block; width: 100%; max-width: 148px; height: auto; }
body.app .brand-title {
  font-family: "Outfit", system-ui, sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--p-accent); line-height: 1.1;
}
body.app .side-nav { display: flex; flex-direction: column; gap: 2px; }
body.app .side .sp { flex: 1; }
body.app .side-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--p-muted); margin: 12px 0 2px; padding: 0 9px; }
body.app .side-link {
  display: flex; align-items: center; width: 100%; padding: 6px 9px; border-radius: 6px; border: 0;
  background: none; font: inherit; font-weight: 500; color: var(--p-muted); cursor: pointer; text-align: left;
}
body.app .side-link:hover { background: var(--p-bg); color: var(--p-text); text-decoration: none; }
body.app .side-link.on { background: var(--p-accent-soft); color: var(--p-accent); }
body.app .side form { margin: 0; }
body.app .side-user { padding: 8px 9px; font-size: 12px; word-break: break-word; }
body.app .main { width: 100%; max-width: 1200px; margin: 0; padding: 18px 22px; min-width: 0; }

body.app h1, body.app h2 { color: var(--p-text); letter-spacing: 0; }
body.app h1 { font-size: 16px; font-weight: 600; }
body.app h2 { font-size: 12.5px; font-weight: 600; }
body.app .page-kicker { color: var(--p-muted); }
body.app .page-header { margin-bottom: 14px; }

body.app .card, body.app .stat-card {
  background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 8px; box-shadow: var(--p-shadow);
}
body.app .card h2, body.app .section-head h2 { border-bottom: 1px solid var(--p-line); }
body.app .stat-card .label { color: var(--p-muted); }
body.app .stat-card .value { color: var(--p-text); font-size: 21px; }
body.app .stat-card .sub { color: var(--p-muted); }
body.app .cards > .stat-card:nth-child(n) .label::before { background: var(--p-accent-soft); }

body.app input[type="text"], body.app input[type="email"], body.app input[type="password"],
body.app input[type="tel"], body.app select, body.app textarea,
body.auth-body input[type="text"], body.auth-body input[type="email"], body.auth-body input[type="password"] {
  background: var(--p-panel); color: var(--p-text); border: 1px solid var(--p-line); border-radius: 6px;
}
body.app input:focus, body.app select:focus, body.auth-body input:focus {
  outline: none; border-color: var(--p-accent); box-shadow: 0 0 0 2px var(--p-accent-soft);
}
body.app label, body.auth-body label { color: var(--p-muted); font-weight: 500; font-size: 11.5px; text-transform: none; letter-spacing: 0; }
body.app .filters label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; color: var(--p-muted); }

body.app .btn, body.auth-body .btn {
  background: var(--p-accent); border: 1px solid var(--p-accent); color: #fff; border-radius: 6px; font-weight: 500;
}
body.app .btn:hover, body.auth-body .btn:hover { background: var(--p-accent-h); border-color: var(--p-accent-h); color: #fff; }
body.app .btn-secondary { background: var(--p-panel); color: var(--p-text); border-color: var(--p-line); }
body.app .btn-secondary:hover { background: var(--p-bg); color: var(--p-text); border-color: var(--p-muted); }
body.app .btn-danger { background: var(--p-panel); color: var(--p-err); border-color: var(--p-line); }
body.app .btn-danger:hover { background: var(--p-err-soft); color: var(--p-err); border-color: var(--p-err); }

body.app .table-wrap { background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 8px; }
body.app th { background: var(--p-panel); color: var(--p-muted); border-bottom: 1px solid var(--p-line); font-weight: 600; }
body.app td { border-bottom: 1px solid var(--p-line); }
body.app tr:hover td { background: var(--p-bg); }
body.app .flash .success, body.app .flash .error, body.app .flash .info { border-radius: 6px; padding: 7px 10px; font-size: 12px; font-weight: 500; }
body.app .flash .success { background: var(--p-ok-soft); color: var(--p-ok); }
body.app .flash .error { background: var(--p-err-soft); color: var(--p-err); }
body.app .flash .info { background: var(--p-accent-soft); color: var(--p-accent); }
body.app .badge-bound { background: var(--p-ok-soft); color: var(--p-ok); }
body.app .pager a, body.app .pager span { background: var(--p-panel); color: var(--p-text); border-color: var(--p-line); border-radius: 6px; font-weight: 500; }
body.app .pager a:hover { border-color: var(--p-accent); }
body.app .pager .is-on { background: var(--p-accent-soft); color: var(--p-accent); border-color: var(--p-accent); }
body.app .note-editor, body.app .editor-bar button { background: var(--p-panel); color: var(--p-text); border-color: var(--p-line); }

/* sign-in card */
body.auth-body .auth-card {
  background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 12px; box-shadow: var(--p-shadow);
  width: min(360px, 94vw); padding: 26px;
}
body.auth-body .auth-card h1 {
  font-family: "Outfit", system-ui, sans-serif; font-size: 26px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--p-accent);
}
body.auth-body .auth-card .subtitle, body.auth-body .auth-card .auth-note { color: var(--p-muted); font-weight: 500; }
body.auth-body .auth-card input[type="email"], body.auth-body .auth-card input[type="password"], body.auth-body .auth-card input[type="text"] {
  height: 32px; border-radius: 6px; background: var(--p-panel);
}
body.auth-body .auth-card .btn { height: 32px; background: var(--p-accent); }
body.auth-body .auth-card a { color: var(--p-accent); }
body.auth-body .flash .error { background: var(--p-err-soft); color: var(--p-err); border-radius: 6px; }

@media (max-width: 800px) {
  body.app .shell { grid-template-columns: 1fr; }
  body.app .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--p-line); }
  body.app .brand-stack { flex-direction: row; align-items: center; padding: 0 8px 0 0; }
  body.app .brand-co-logo { max-width: 100px; }
  body.app .side-nav { flex-direction: row; flex-wrap: wrap; }
  body.app .side-sec, body.app .side .sp, body.app .side-user { display: none; }
  body.app .side-link { width: auto; }
  body.app .main { padding: 14px; }
}
@media print { body.app .side { display: none !important; } body.app .shell { display: block; } }
body.auth-body .auth-logo { width: 100%; max-width: 280px; margin: 0 auto 4px; }
body.auth-body .auth-card h1 { text-align: center; margin: 0 0 10px; }
body.auth-body .auth-card .subtitle { margin: 0 0 14px; }
body.auth-body .auth-card label { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }

/* Blue accent + sidebar icons (payroll Time Clock uses red) */
body.app, body.auth-body { --p-accent: #2563eb; --p-accent-h: #1d4ed8; --p-accent-soft: #eff6ff; }
@media (prefers-color-scheme: dark) {
  body.app, body.auth-body { --p-accent: #60a5fa; --p-accent-h: #93c5fd; --p-accent-soft: #152238; }
}
body.app .side-link { gap: 8px; }
body.app .side-link svg { width: 15px; height: 15px; flex: none; }
body.app .side-user { color: var(--p-muted); }

/* The Acero logo has black lettering, so give it a light plate in dark mode */
@media (prefers-color-scheme: dark) {
  body.app .brand-co-logo, body.auth-body .auth-logo { background: #fff; border-radius: 8px; padding: 6px 8px; box-sizing: border-box; }
}
