:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #17202a;
  --muted: #5d6875;
  --border: #e2e6eb;
  --accent: #0f766e;
  --accent-strong: #0b5e57;
  --accent-soft: #e3f3f0;
  --on-accent: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --focus: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  color-scheme: light;
}

/* Light is the default; dark only when chosen with the button in the header. */
:root[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #171d24;
  --surface-2: #1d252e;
  --text: #e7ebef;
  --muted: #9aa5b1;
  --border: #2a333d;
  --accent: #2bb3a3;
  --accent-strong: #5fd0c2;
  --accent-soft: #123a36;
  --on-accent: #06201d;
  --danger: #f97066;
  --danger-soft: #3a1714;
  --warn: #f5b454;
  --warn-soft: #3a2a10;
  --focus: #7aa7ff;
  --shadow: none;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.15rem;
  margin: 0;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.35rem 0 0;
}

.center {
  text-align: center;
}

.strong {
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.print-only {
  display: none;
}

/* ---- header ---- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.95rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.topnav > a,
.linklike {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
}

.topnav > a:hover,
.linklike:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topnav > a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.linklike {
  background: none;
  border: 0;
  cursor: pointer;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.lang {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0.25rem;
}

.lang a {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.lang a[aria-current="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

form.inline {
  display: inline;
}

/* ---- layout ---- */

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.head-actions {
  display: flex;
  gap: 0.5rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
}

p.meta + .stats,
p.meta + .alert {
  margin-top: 1rem;
}

.back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.back:hover {
  color: var(--text);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 0 0 1rem;
}

.panel.flush {
  padding: 0;
  overflow: hidden;
}

.panel.narrow {
  max-width: 560px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 0.75rem;
  padding: 0;
}

.flash {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  margin: 0 0 1rem;
}

.badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-soft {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  margin: 0;
}

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger);
  filter: brightness(0.92);
}

.btn-danger-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: var(--danger-soft);
  border-color: transparent;
}

.btn-small {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  font-size: 0.875rem;
}

.btn-icon {
  width: 44px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-icon:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn-block {
  width: 100%;
}

/* ---- month switcher ---- */

.month-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.month-name {
  min-width: 11ch;
  text-align: center;
  font-size: 1.2rem;
}

.month-today {
  font-size: 0.9rem;
  margin-left: 0.25rem;
}

/* ---- stat cards ---- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  min-width: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.stat-value small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.stat-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.stat-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.stat-accent .stat-label,
.stat-accent .stat-sub {
  color: inherit;
  opacity: 0.85;
}

/* ---- tables ---- */

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.data th,
table.data td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.data tbody tr:hover {
  background: var(--surface-2);
}

table.data tfoot th,
table.data tfoot td {
  font-weight: 700;
  border-bottom: 0;
  background: var(--surface-2);
}

table.data .num {
  text-align: right;
}

.cell-main {
  font-weight: 600;
}

.note {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: normal;
}

.cell-actions {
  text-align: right;
  width: 1%;
}

/* one-line summary of a working day, only used on small screens */
.cell-compact {
  display: none;
}

.cell-actions .btn + form {
  margin-left: 0.25rem;
}

tr.clickable {
  position: relative;
}

.row-link {
  color: var(--text);
  text-decoration: none;
}

.row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

tr.clickable:hover .row-link {
  color: var(--accent);
}

tr.inactive td {
  color: var(--muted);
}

/* ---- pay calculation ---- */

.calc {
  max-width: 560px;
  margin-left: auto;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.calc-table th,
.calc-table td {
  padding: 0.45rem 0;
  text-align: left;
  font-weight: 400;
}

.calc-table .num {
  text-align: right;
  white-space: nowrap;
  padding-left: 1rem;
}

.calc-table .subtotal th,
.calc-table .subtotal td {
  border-top: 1px solid var(--border);
}

.calc-table .total th,
.calc-table .total td {
  border-top: 2px solid var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.6rem;
}

.calc-table .employer th,
.calc-table .employer td {
  color: var(--muted);
  font-size: 0.9rem;
}

.calc-table .employer-head {
  padding-top: 1.25rem;
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.legal {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---- forms ---- */

.stack {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.field > span {
  font-size: 0.9rem;
  font-weight: 600;
}

.field-short input {
  max-width: 220px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input:not([type]),
select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px dashed var(--muted);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
  border-color: transparent;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-sections {
  max-width: 640px;
}

.form-sections fieldset {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.form-sections legend {
  float: left;
  width: 100%;
  margin: 0;
}

.form-sections legend + * {
  clear: both;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.choices-3 {
  grid-template-columns: repeat(3, 1fr);
}

.choice,
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice span,
.check span {
  display: flex;
  flex-direction: column;
}

.choice small,
.check small {
  color: var(--muted);
  font-size: 0.85rem;
}

.check {
  border: 0;
  padding: 0;
}

input[type="radio"],
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0.1rem 0 0;
  accent-color: var(--accent);
  flex: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.panel .form-actions {
  margin: 0;
}

.danger-zone {
  max-width: 640px;
}

.danger-zone .panel-title {
  color: var(--danger);
}

.danger-zone .hint {
  margin-bottom: 0.75rem;
}

.auth-card {
  max-width: 400px;
  margin: 2rem auto;
}

.auth-logo {
  display: block;
  height: 52px;
  width: auto;
  margin: 0.25rem auto 1.25rem;
}

/* the logo's tagline band is white: keep it on white in the dark theme */
:root[data-theme="dark"] .auth-logo {
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  height: 68px;
}

/* quick "add working day" form: 5 fields, then note + button */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.entry-grid .field-wide {
  grid-column: span 3;
}

.entry-submit {
  padding-top: 1.65rem;
}

.entry-submit .btn {
  width: 100%;
}

.entry-grid-edit {
  grid-template-columns: 1fr 1fr;
}

.entry-grid-edit .field-wide {
  grid-column: 1 / -1;
}

/* extras next to the pay calculation */
.month-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.month-bottom .calc {
  max-width: none;
  margin: 0;
}

.extra-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.extra-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.extra-text {
  flex: 1;
  min-width: 0;
}

.extra-text .badge {
  margin-left: 0.25rem;
}

.extra-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.extras-empty {
  margin: 0 0 1rem;
}

.extra-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.75rem;
}

.extra-grid .field-wide {
  grid-column: 1 / -1;
}

/* import */
.checklist {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.checklist li {
  margin: 0.2rem 0;
}

.alert-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.alert-warn div + div {
  margin-top: 0.35rem;
}

.badge-new {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.warn-text {
  color: var(--warn) !important;
}

.diff {
  display: block;
  color: var(--warn);
  font-size: 0.8rem;
  font-weight: 600;
}

.confirm-panel {
  margin-top: 1rem;
}

.confirm-panel p {
  margin-top: 0;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.credentials code {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.delete-line {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---- small screens ---- */

@media (max-width: 900px) {
  .entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-grid .field-wide {
    grid-column: span 2;
  }

  .entry-submit {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .entry-grid-edit {
    grid-template-columns: 1fr 1fr;
  }

  .entry-grid-edit .field-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* tables turn into one card per row */
  .stack-table thead,
  .stack-table tfoot {
    display: none;
  }

  .stack-table,
  .stack-table tbody {
    display: block;
  }

  .stack-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  .stack-table.list tr {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  table.data.stack-table td {
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .stack-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted);
  }

  .stack-table .cell-main,
  .stack-table .cell-actions {
    grid-column: 1 / -1;
  }

  .stack-table .cell-actions {
    width: auto;
    text-align: left;
    padding-top: 0.25rem !important;
  }

  /* working days: date + amount, then a compact summary line */
  .stack-table.hours tr {
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.75rem;
  }

  .stack-table.hours td[data-label] {
    display: none;
  }

  .stack-table.hours .cell-main {
    grid-column: 1;
  }

  table.data.stack-table.hours .cell-amount {
    display: block;
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .stack-table.hours .cell-amount::before {
    content: none;
  }

  .stack-table.hours .cell-compact {
    display: block;
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.9rem;
  }

  .calc {
    max-width: none;
  }

  .month-bottom {
    grid-template-columns: 1fr;
  }

  .stack-table.import-table tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack-table.import-table .cell-status,
  .stack-table.import-table .skip-cell {
    grid-column: 1 / -1;
  }

  .stack-table.import-table .skip-cell {
    display: none;
  }
}

@media (max-width: 560px) {
  .topnav {
    gap: 0.1rem;
  }

  .topnav > a,
  .linklike {
    padding: 0.35rem 0.4rem;
    font-size: 0.9rem;
  }

  .lang {
    margin: 0 0.1rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stack-table.list tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-2,
  .choices,
  .extra-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid {
    grid-template-columns: 1fr 1fr;
  }

  .entry-grid label.field:first-of-type,
  .entry-grid .field-wide,
  .entry-submit {
    grid-column: 1 / -1;
  }

  .entry-submit {
    padding-top: 0;
  }

  .entry-submit .btn {
    width: 100%;
  }

  .month-switch {
    justify-content: space-between;
  }

  .month-name {
    flex: 1;
  }

  .month-today {
    display: none;
  }
}

/* ---- printed documents (payslip, payroll list): one A4 portrait page ---- */

@page doc {
  size: A4 portrait;
  margin: 14mm 12mm;
}

.print-doc {
  color: #1a1a1a;
  background: #fff;
  font: 9.5pt/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8mm;
  padding-bottom: 3mm;
  margin-bottom: 5mm;
  border-bottom: 0.6mm solid #1a1a1a;
}

.doc-logo {
  display: block;
  height: 13mm;
  width: auto;
}

.doc-title {
  text-align: right;
}

.doc-title strong {
  display: block;
  margin-top: 1.5mm;
  font-size: 12pt;
}

.doc-title span {
  color: #555;
}

.doc-kicker {
  margin: 0;
  font-size: 7.5pt;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}

.doc-head h1 {
  margin: 1mm 0 0;
  font-size: 20pt;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.doc-facts {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 3mm 6mm;
  margin: 0 0 6mm;
  padding: 3mm 4mm;
  background: #f4f5f6;
  border-radius: 1.5mm;
}

.doc-facts dt {
  font-size: 7pt;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #666;
}

.doc-facts dd {
  margin: 0.5mm 0 0;
  font-weight: 600;
}

.doc-section {
  margin: 0 0 1.5mm;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #444;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.doc-table th,
.doc-table td {
  padding: 0.8mm 2mm;
  font-size: 9pt;
  text-align: left;
  font-weight: 400;
  border-bottom: 0.25mm solid #e1e3e6;
  white-space: nowrap;
}

.doc-table thead th {
  padding-top: 0;
  font-size: 7pt;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #666;
  border-bottom: 0.4mm solid #1a1a1a;
  vertical-align: bottom;
}

.doc-table .num {
  text-align: right;
}

.doc-table tfoot th,
.doc-table tfoot td {
  font-weight: 700;
  border-top: 0.4mm solid #1a1a1a;
  border-bottom: 0;
}

.doc-note {
  margin-left: 2mm;
  font-size: 8pt;
  color: #777;
}

.doc-empty {
  color: #777;
  text-align: center !important;
}

.doc-muted {
  color: #888;
}

.doc-strong {
  font-weight: 700 !important;
}

/* payroll list: many columns, so the headers may wrap */
.doc-summary thead th {
  white-space: normal;
}

.doc-summary tbody th {
  font-weight: 600;
}

/* the pay calculation sits right-aligned under the days, like the totals of an invoice */
.doc-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 7mm;
}

.doc-bottom > div {
  width: 92mm;
}

.doc-calc {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.doc-calc th,
.doc-calc td {
  padding: 1mm 0;
  font-weight: 400;
}

.doc-calc th {
  text-align: left;
  padding-right: 4mm;
}

.doc-calc td {
  text-align: right;
  white-space: nowrap;
}

.doc-calc .subtotal th,
.doc-calc .subtotal td {
  border-top: 0.25mm solid #c9ccd0;
}

.doc-calc .total th,
.doc-calc .total td {
  padding: 2mm 0 0;
  font-size: 12pt;
  font-weight: 700;
  border-top: 0.6mm solid #1a1a1a;
}

.doc-legal {
  margin: 0;
  font-size: 7.5pt;
  color: #666;
}

.doc-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8mm;
  margin-top: 8mm;
  padding-top: 2mm;
  border-top: 0.25mm solid #e1e3e6;
}

.doc-powered {
  margin: 0;
  font-size: 7.5pt;
  color: #666;
  white-space: nowrap;
}

.doc-powered strong {
  color: #007e9b;
}

/* ---- "Powered by IDS" footer ---- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 1rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* the logo has a white band behind its tagline, so it always sits on white */
.site-footer .ids-logo {
  height: 40px;
  width: auto;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---- print ---- */

@media print {
  :root,
  :root[data-theme="dark"] {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #f3f4f6;
    --text: #000;
    --muted: #444;
    --border: #bbb;
    --accent: #000;
    --on-accent: #000;
    color-scheme: light;
  }

  body {
    font-size: 12px;
  }

  .topbar,
  .site-footer,
  .no-print,
  .month-switch .btn,
  .month-today,
  .flash,
  .cell-actions,
  .back {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .screen-only {
    display: none !important;
  }

  .print-doc {
    page: doc;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .stat-accent {
    background: #fff;
    border: 2px solid #000;
  }

  .panel,
  .stat {
    box-shadow: none;
    break-inside: avoid;
  }

  .calc {
    max-width: 360px;
  }
}
