:root {
  color-scheme: light;
  --canvas: #f3f6f2;
  --paper: #fff;
  --ink: #172f2a;
  --muted: #50635c;
  --line: #d8e3db;
  --brand: #145a49;
  --brand-dark: #103b32;
  --mint: #e4f3e9;
  --radius: 16px;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); font-weight: 650; text-underline-offset: .2em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #288778; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 3.35rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 1.23rem; line-height: 1.3; letter-spacing: -.02em; }
p { color: var(--muted); }
h1 + p, h2 + p { margin-top: .5rem; }
.shell { width: min(1280px, 100% - 3rem); margin: 0 auto; }
main.shell { padding-block: 2.7rem 3.5rem; }
.top { background: var(--brand-dark); color: #edf6ee; }
.top-inner, .top-end, .brand {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.top-inner { justify-content: space-between; min-height: 68px; }
.top-end { font-size: .875rem; }
.main-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.main-nav a { color: #fff; text-decoration: none; }
.brand { color: #fff; text-decoration: none; font-size: 1.12rem; letter-spacing: -.02em; }
.brand-mark {
  background: #bde6c9;
  color: #154638;
  border-radius: 9px;
  padding: .26rem .47rem;
  font-size: .82rem;
  font-weight: 800;
}
.eyebrow {
  color: var(--brand);
  letter-spacing: .11em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 750;
  margin-bottom: .7rem;
}
.auth-layout {
  max-width: 900px;
  margin: clamp(1rem, 6vw, 6rem) auto 0;
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  align-items: stretch;
  gap: 1.1rem;
}
.intro {
  background: linear-gradient(135deg, #0d3b32, #176550);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  color: #fff;
}
.intro .eyebrow, .intro p { color: #d4ebdf; }
.intro h1 { max-width: 13ch; margin-bottom: 1rem; }
.intro p + p { margin-top: .9rem; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.6rem);
  box-shadow: 0 3px 12px #143e2d08;
}
.stack { display: grid; gap: 1rem; margin-top: 1rem; }
.stack > .button { justify-self: start; }
label { display: block; font-size: .88rem; font-weight: 650; }
input:not([type=checkbox]):not([type=radio]), select {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: .3rem;
  padding: .45rem .65rem;
  border: 1px solid #b9ccc0;
  border-radius: 8px;
  background: #fcfdfc;
  color: var(--ink);
}
input[type=file] { font-size: .84rem; }
input[type=checkbox] { accent-color: var(--brand); }
input[type=radio] { accent-color: var(--brand); }
.workbook-list { margin: .75rem 0; }
.workbook-list label { font-weight: 400; }
.workbook-list label { display: flex; align-items: center; gap: .5rem; }
.workbook-list input[type=radio] { flex: none; width: 1rem; height: 1rem; margin: 0; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: .45rem .85rem;
  border: 1px solid var(--brand);
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { background: var(--paper); border-color: #a2bcad; color: var(--brand); }
.button.secondary:hover { background: var(--mint); }
.button.outline { background: transparent; border-color: #a5c7b5; }
.button.outline:hover { background: #226150; }
.button.small { min-height: 35px; font-size: .8rem; }
.heading, .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.section-heading { margin-bottom: 1rem; }
.filters, .actions, .options { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem 1rem; }
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.4rem;
}
.stat { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 1rem; }
.stat span { display: block; color: var(--muted); font-size: .82rem; font-weight: 650; }
.stat strong { display: block; font-size: clamp(1.12rem, 2.4vw, 1.65rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.accent { border-color: #a7cdb6; background: var(--mint); }
.section { margin-top: 1.25rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .88rem; }
th, td { border-bottom: 1px solid var(--line); padding: .73rem .65rem; }
thead th { background: #f0f5f0; color: var(--muted); font-size: .74rem; white-space: nowrap; }
tbody th { min-width: 125px; }
th small { display: block; color: var(--muted); font-weight: 400; }
tbody tr:last-child > * { border-bottom: 0; }
.num, dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { background: #eef3ef; color: #3e584c; border-radius: 999px; padding: .25rem .48rem; font-size: .73rem; white-space: nowrap; }
.pill.ready { background: var(--mint); color: #21583e; }
.breakdown { margin: .75rem 0 0; }
.breakdown > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.breakdown > div:last-child { border-bottom: 0; font-weight: 700; }
.breakdown > .tax-total { font-weight: 600; }
.breakdown > .deductions-total { font-weight: 700; }
.breakdown > .employer-start { margin-top: 1rem; }
dd { margin: 0; }
.back { display: inline-block; margin-bottom: 1rem; }
.narrow { max-width: 550px; margin-inline: auto; }
.pay-form { max-width: 1040px; margin-inline: auto; }
.form-error { color: #7c2d24; background: #fdf0ea; padding: .65rem .8rem; border-radius: 8px; }
.detail-fields, details > p { margin-top: .75rem; }
.narrow h1 { margin-bottom: 1rem; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; margin-top: 1.3rem; }
.adjustment-columns { margin-top: 0; }
.adjustment-columns section, .input-section { border: 1px solid var(--line); border-radius: 9px; padding: .8rem; }
details .button { margin-top: .65rem; }
.view-tabs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: .8rem; min-width: 0; }
.payroll-fields { padding: 0; border: 0; margin-inline: 0; }
.payroll-fields:disabled input { opacity: 1; }
fieldset p { margin-bottom: .7rem; font-size: .88rem; }
legend { font-weight: 700; }
summary { cursor: pointer; font-weight: 650; }
.empty { border: 1px dashed #b9ccc0; border-radius: 8px; padding: 1.25rem; }
.card p + .button { margin-top: 1rem; }
.finalize { border-top: 1px solid var(--line); padding-top: 1rem; }

@media (max-width: 930px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 1.5rem); }
  main.shell { padding-block: 1.5rem; }
  .auth-layout, .two-columns { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heading, .section-heading { align-items: start; flex-direction: column; }
  .top-end { font-size: .72rem; }
  .fields { grid-template-columns: 1fr; }
  .stat { padding: .75rem; }
}

.hours-calendar { margin: .75rem 0; overflow-x: auto; border: 1px solid #d1d5df; }
.hours-calendar table { table-layout: fixed; min-width: 630px; border-collapse: collapse; font-size: .8rem; }
.hours-calendar caption { text-align: left; font-weight: 650; padding: .45rem .65rem; background: #fff; }
.hours-calendar th { text-align: center; padding: .35rem .2rem; color: var(--ink); background: #fff; border: 1px solid #d1d5df; }
.hours-calendar td { height: 7rem; padding: .25rem; vertical-align: top; border: 1px solid #d1d5df; background: #fff; }
.hours-calendar td.weekend { background: #f0f2f9; }
.hours-calendar td.outside-month { background: #f1f1f5; color: #6c7280; }
.hours-calendar td.outside-period { background: #e8ecf2; }
.calendar-date { display: flex; justify-content: space-between; align-items: center; min-height: 1.2rem; }
.calendar-date time { margin-left: auto; font-size: .74rem; }
.week-number { padding: .05rem .35rem; border-radius: 1rem; background: #e2e5f0; color: #596073; font-size: .65rem; }
.hours-calendar .hours-entry { display: flex; align-items: center; min-width: 0; margin: .2rem 0 0; padding: .12rem .25rem; border: 1px dashed transparent; border-radius: 2px; font-size: .75rem; font-weight: 400; }
.hours-calendar .hours-entry:focus-within, .hours-calendar .hours-entry:hover { border-color: #858dd3; }
.hours-calendar .hours-entry.has-hours, .hours-calendar .saved-hours { background: #aaaef4; border: 1px solid #8389df; color: #202349; }
.hours-calendar .hours-entry input { width: 100%; min-width: 0; padding: .08rem; border: 0; background: transparent; color: #202349; font-size: .75rem; box-shadow: none; }
.hours-calendar .hours-entry input::placeholder { color: #879093; }
.hours-calendar .hours-suffix { display: none; white-space: nowrap; }
.hours-calendar .has-hours .hours-suffix { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.workbook-list details { margin-left: 1.75rem; }

.button:disabled, fieldset:disabled .button { opacity: .5; cursor: not-allowed; }
