/* SPARTANS Payroll — SPARTANS Advisors design system, Marble theme */
:root {
  --ground: #f4f1ea; --panel: #fbf9f4; --ivory: #faf1ec;
  --ink: #0a1221; --muted: #565c68; --bronze: #6b4a22;
  --line: rgba(107, 74, 34, 0.24); --tint: rgba(107, 74, 34, 0.10);
  --midnight: #0a1221; --midnight-2: #121d31; --champagne: #e8cc92; --on-mid-muted: #a8b0c0;
  --aegean: #1f4e8c; --terracotta: #a8482a; --signal: #9de8fd;
  --display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --text: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 26px; }
a { color: var(--bronze); }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--aegean); outline-offset: 2px; }
.on-midnight a:focus-visible, .on-midnight button:focus-visible { outline-color: var(--signal); }
h1, h2, h3, h4 { margin: 0; font-family: var(--text); font-weight: 600; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 46px; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-weight: 500; font-size: 12px; line-height: 16px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.eyebrow.gold { color: var(--bronze); }
.fig { font-weight: 500; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 21px; }
.cap { font-size: 12px; line-height: 16px; font-weight: 500; }
.sub { display: block; color: var(--muted); font-weight: 400; font-size: 14px; line-height: 20px; }
.n { text-align: right; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--bronze); background: var(--panel); color: var(--ink); font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .04em; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--tint); color: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--midnight); border-color: var(--midnight); color: var(--ground); }
.btn-primary:hover { background: var(--midnight-2); border-color: var(--midnight-2); color: var(--ground); }
.btn-sm { min-height: 36px; padding: 0 12px; }
.btn-link { border: 0; background: none; padding: 8px 4px; min-height: 0; color: var(--bronze); text-decoration: underline; letter-spacing: 0; }
.btn-link:hover { background: none; color: var(--ink); }
.btn-gold { background: var(--champagne); border-color: var(--champagne); color: var(--midnight); }
.btn-gold:hover { background: #f0dbad; border-color: #f0dbad; color: var(--midnight); }
.btn-danger { color: var(--terracotta); border-color: var(--terracotta); }

/* tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 2px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--tint); color: var(--bronze); }
.tag-ok { background: var(--ground); color: var(--aegean); }
.tag-bad { background: var(--ground); color: var(--terracotta); }
.tag-ink { background: var(--ground); color: var(--ink); }
.tag-deep { background: var(--midnight); color: var(--ground); }
.tag-line { background: var(--panel); color: var(--ink); border: 1px solid var(--bronze); padding: 1px 7px; }
.tag svg { flex: none; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; min-width: 0; }
.panel.strong { border-color: var(--bronze); }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.ph h2 { font-size: 18px; line-height: 26px; }
.pb { padding: 4px 24px 20px; display: flex; flex-direction: column; }
.pad { padding: 20px 24px; }
.line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.line:last-child, .line.last { border-bottom: 0; }
.total { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 0; border-top: 2px solid var(--ink); font-size: 14px; line-height: 20px; font-weight: 600; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; line-height: 21px; }
.note.warn { border-color: var(--terracotta); }
.note svg { flex: none; margin-top: 1px; }
.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cols > * { min-width: 0; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--line); }
.grid4 > div { background: var(--panel); padding: 20px 24px; display: flex; flex-direction: column; }
.strip { display: flex; flex-wrap: wrap; gap: 8px 40px; align-items: baseline; padding: 20px 24px; background: var(--ground); border-top: 1px solid var(--line); }
.stats { display: flex; flex-wrap: wrap; }
.stat { flex: 1 1 200px; min-width: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.empty { padding: 32px 24px; text-align: center; color: var(--muted); }

/* steps (worked-out sums) */
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.step .num { white-space: nowrap; }
.step.noline { border-bottom: 0; }
.step-total { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 600; }
.op { width: 24px; height: 24px; border-radius: 2px; background: var(--tint); color: var(--bronze); display: grid; place-items: center; font-weight: 500; font-size: 14px; line-height: 1; }
.op-eq { background: var(--midnight); color: var(--ground); }
.op-none { background: transparent; }

/* tables */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { font-size: 14px; line-height: 20px; padding: 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
td.nw, th.nw { white-space: nowrap; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 600; }
tr.sel td { background: var(--tint); }
tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--bronze); }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(107, 74, 34, 0.05); }

/* forms */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lbl { font-size: 14px; line-height: 20px; font-weight: 600; }
.hint { font-size: 12px; line-height: 16px; color: var(--muted); }
.input { min-height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--bronze); border-radius: 2px; background: #fff; color: var(--ink); font-family: inherit; font-size: 16px; }
textarea.input { padding: 10px 12px; min-height: 80px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--terracotta); }
.check { display: flex; gap: 10px; align-items: center; min-height: 40px; font-size: 14px; line-height: 20px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--midnight); flex: none; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.err { color: var(--terracotta); font-size: 14px; line-height: 20px; font-weight: 500; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0 0 6px; }

/* admin shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.rail { flex: 1 1 264px; max-width: 300px; background: var(--panel); border-right: 1px solid var(--line); }
.rail-in { position: sticky; top: 0; min-height: 100vh; padding: 28px 16px 24px; display: flex; flex-direction: column; gap: 28px; }
td.who { min-width: 150px; }
.rail .brand { display: flex; flex-direction: column; gap: 10px; }
.rail .brand img { height: 36px; width: auto; align-self: flex-start; }
.navlist { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 500; }
.nav:hover { background: var(--tint); color: var(--ink); }
.nav[aria-current="page"] { background: var(--tint); font-weight: 600; }
.nav svg { color: var(--muted); flex: none; }
.nav[aria-current="page"] svg { color: var(--bronze); }
.count { margin-left: auto; padding: 0 6px; border-radius: 2px; background: var(--midnight); color: var(--ground); font-size: 12px; line-height: 18px; font-weight: 600; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 4px; background: var(--midnight); color: var(--ground); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.main { flex: 999 1 560px; min-width: 0; padding: 40px 48px 64px; }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.head > .stack { gap: 8px; min-width: 0; }
.foot { display: flex; flex-direction: column; gap: 6px; }
.monthnav { display: inline-flex; align-items: center; gap: 4px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); cursor: pointer; }
.iconbtn:hover { background: var(--tint); }
.iconbtn:disabled { opacity: .4; cursor: not-allowed; }

/* top header shell (staff, pay masters) */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1216px; margin: 0 auto; padding: 12px 48px; min-height: 72px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 32px; }
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand img { height: 36px; width: auto; }
.topbar .divider { width: 1px; height: 20px; background: var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 4px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 500; }
.tab:hover { background: var(--tint); color: var(--ink); }
.tab[aria-current="page"] { background: var(--tint); font-weight: 600; }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.page { max-width: 1216px; margin: 0 auto; padding: 40px 48px 64px; display: flex; flex-direction: column; gap: 32px; }

/* cards */
.cards { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.card { flex: 1 1 300px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.bar { height: 8px; border-radius: 2px; background: var(--tint); overflow: hidden; }
.bar > div { height: 100%; background: var(--midnight); }

/* midnight hero (pay master) */
.hero { background: var(--midnight); color: var(--ground); border-radius: 4px; overflow: hidden; display: flex; flex-wrap: wrap; }
.hero .copy { flex: 1 1 520px; min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.hero .eyebrow { color: var(--champagne); }
.hero p { color: var(--on-mid-muted); }
.hero svg.peak { display: block; flex: 0 1 360px; min-width: 0; min-height: 220px; }
.eq { padding: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.term { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.term .fig { font-size: 24px; line-height: 32px; }
.eqop { flex: none; width: 32px; height: 32px; border-radius: 4px; background: var(--tint); color: var(--bronze); display: grid; place-items: center; font-weight: 500; font-size: 16px; }
.eqop-eq { background: var(--midnight); color: var(--ground); }
.term.final { padding: 8px 16px; border-radius: 4px; background: var(--midnight); color: var(--ground); }

/* definition lists */
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); font-size: 14px; line-height: 20px; margin: 0; }
.dl dt, .dl dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--muted); }
.dl dd { font-weight: 500; }
.dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* AERO documents shown inside the app (payslips, invoice) */
.doc { background: #fff; color: #0E1F44; border: 1px solid var(--line); border-radius: 4px; padding: 40px; font-family: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif; font-size: 14px; line-height: 20px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.doc h2 { font-family: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif; font-weight: 600; font-size: 24px; line-height: 32px; color: #0E1F44; }
.doc .k { font-family: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif; font-weight: 600; font-size: 12px; line-height: 16px; letter-spacing: .18em; text-transform: uppercase; color: #5B6B85; }
.doc .mut { color: #5B6B85; }
.doc img.logo { height: 28px; width: auto; }
.doc th { color: #5B6B85; border-bottom-color: #D9DEE8; padding: 8px; }
.doc td { border-bottom-color: #D9DEE8; padding: 10px 8px; }
.doc th:first-child, .doc td:first-child { padding-left: 0; }
.doc th:last-child, .doc td:last-child { padding-right: 0; }
.doc tfoot td { border-top: 2px solid #0E1F44; }
.doc .due { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-radius: 8px; background: #F4F7FC; }
.doc .amt { font-family: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif; font-weight: 600; font-size: 28px; line-height: 36px; font-variant-numeric: tabular-nums; }
.doc .pay { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 16px; }
.doc .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }

/* sign in */
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.signin .left { flex: 1 1 560px; min-width: 0; padding: 48px 64px; display: flex; flex-direction: column; gap: 48px; }
.signin .left > img { height: 40px; width: auto; align-self: flex-start; }
.signin .mid { margin: auto 0; display: flex; flex-direction: column; gap: 24px; max-width: 560px; }
.signin h1 { font-size: 52px; line-height: 58px; letter-spacing: -0.005em; }
.signin aside { flex: 1 1 460px; min-width: 0; background: var(--midnight); color: var(--ground); padding: 48px 56px; display: flex; flex-direction: column; gap: 40px; }
.role { display: flex; gap: 16px; align-items: flex-start; }
.role-t { font-size: 18px; line-height: 26px; font-weight: 500; }
.role-d { color: var(--on-mid-muted); }
.tagline { margin-top: auto; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 32px; line-height: 40px; color: var(--champagne); }
#gbtn { min-height: 44px; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 4px; padding: 0; background: var(--panel); color: var(--ink); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(10, 18, 33, .45); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
dialog .dh h2 { font-size: 18px; line-height: 26px; }
dialog .db { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
dialog .df { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--panel); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 4px; background: var(--midnight); color: var(--ground); font-size: 14px; line-height: 20px; box-shadow: none; }
.toast.bad { background: var(--terracotta); color: #fff; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

/* narrow screens */
@media (max-width: 900px) {
  .rail { flex: 1 1 100%; max-width: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-in { position: static; min-height: 0; padding: 16px; gap: 12px; }
  .rail .brand { flex-direction: row; align-items: center; justify-content: space-between; }
  .navlist { flex-direction: row; flex-wrap: wrap; }
  .nav { min-height: 40px; padding: 0 10px; }
  .userchip { padding-top: 12px; }
  .main { padding: 24px 16px 48px; }
  .topbar .in { padding: 10px 16px; gap: 8px 16px; }
  .topbar .who { margin-left: 0; width: 100%; justify-content: space-between; }
  .page { padding: 24px 16px 48px; gap: 24px; }
  .signin .left { padding: 32px 16px; gap: 32px; }
  .signin h1 { font-size: 40px; line-height: 46px; }
  .signin aside { padding: 32px 16px; }
  .hero .copy { padding: 24px; }
  .hero svg.peak { display: none; }
  h1 { font-size: 32px; line-height: 38px; }
  .doc { padding: 20px; }
  .ph, .pb, .pad { padding-left: 16px; padding-right: 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid4 > div { padding: 16px; }
}
@media print {
  .rail, .topbar, .noprint { display: none !important; }
  body { background: #fff; }
}

/* Hours entry rows: label beside the boxes, or above them on a phone */
.hrow .hlab { min-width: 160px; }
@media (max-width: 560px) { .hrow .hlab { flex-basis: 100%; min-width: 0; } }
