:root {
  --bg: #0b1020;
  --panel: #121a33;
  --panel-2: #0f172e;
  --text: #e7ecff;
  --muted: rgba(231, 236, 255, 0.75);
  --border: rgba(231, 236, 255, 0.12);
  --accent: #7c3aed;
  --accent-2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(124, 58, 237, 0.25), transparent 60%),
              radial-gradient(900px 600px at 70% 0%, rgba(34, 197, 94, 0.18), transparent 55%),
              var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(10px);
}

.topbar__title { display: flex; gap: 10px; align-items: center; }
.topbar__logo { width: 28px; height: 28px; object-fit: contain; flex: 0 0 auto; }
.topbar__status { display: flex; gap: 10px; align-items: center; }

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

.nav {
  padding: 14px;
  border-right: 1px solid var(--border);
  background: rgba(18, 26, 51, 0.35);
}

.nav__item {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(18, 26, 51, 0.55);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: 140ms ease;
}
.nav__item:hover { transform: translateY(-1px); border-color: rgba(231, 236, 255, 0.22); }
.nav__item.is-active { border-color: rgba(124, 58, 237, 0.55); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }
.nav__sub {
  display: grid;
  gap: 6px;
  margin: 6px 0 12px 14px;
}
.nav__sub[hidden] { display: none; }
.nav__subitem {
  background: rgba(18, 26, 51, 0.45);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(231, 236, 255, 0.12);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: 140ms ease;
}
.nav__subitem:hover { transform: translateY(-1px); border-color: rgba(231, 236, 255, 0.22); }
.nav__subitem.is-active { border-color: rgba(124, 58, 237, 0.55); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

.content { padding: 18px; min-width: 0; }
h1 { margin: 0 0 14px; font-size: 24px; }
h2 { margin: 0 0 12px; font-size: 16px; }

.cards { display: grid; gap: 14px; }
.cards--compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 14px;
}
.card {
  background: rgba(18, 26, 51, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card--muted {
  background: rgba(15, 23, 46, 0.45);
  box-shadow: none;
}
.card--subtle {
  background: rgba(15, 23, 46, 0.38);
  box-shadow: none;
  padding: 12px;
}
.card--collapsible { padding: 0; }
.card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  list-style: none;
}
.card__header::-webkit-details-marker { display: none; }
.card__header h2 { margin: 0; }
.card--collapsible:not([open]) .card__header { border-bottom: none; }
.card__body { padding: 14px; }
.collapse__chevron {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  transition: transform 140ms ease;
}
.card--collapsible[open] .collapse__chevron { transform: rotate(180deg); }

.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.tab {
  border: 1px solid var(--border);
  background: rgba(15, 23, 46, 0.6);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: 140ms ease;
}
.tab:hover { transform: translateY(-1px); border-color: rgba(231, 236, 255, 0.22); }
.tab.is-active {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(124, 58, 237, 0.25);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}
.settings-actions {
  position: sticky;
  top: 70px;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 -4px 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 26, 51, 0.94);
  backdrop-filter: blur(10px);
}
.tab-panel { display: grid; gap: 14px; }
.settings-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 23, 46, 0.4);
  display: grid;
  gap: 12px;
}
.settings-section h3 { margin: 0; font-size: 13px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.grow { flex: 1; }

.report-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.report-workspace--single {
  grid-template-columns: 1fr;
}
.report-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.report-nav-panel {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 26, 51, 0.65);
  box-shadow: var(--shadow);
}
.nav .report-nav-panel {
  position: static;
  margin-top: 8px;
  padding: 12px;
  background: rgba(18, 26, 51, 0.58);
  box-shadow: none;
}
.report-nav-panel__header h2 {
  margin: 0;
  font-size: 16px;
}
.report-nav-group {
  border-top: 1px solid rgba(231, 236, 255, 0.08);
  padding-top: 8px;
}
.report-nav-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.report-nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.report-nav-group summary::-webkit-details-marker {
  display: none;
}
.report-nav-group summary::after {
  content: '>';
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.15s ease;
}
.report-nav-group[open] summary {
  border-color: rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.12);
  color: var(--text);
}
.report-nav-group[open] summary::after {
  transform: rotate(90deg);
}
.report-nav-group__items {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding-left: 8px;
}
.report-nav-item {
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.report-nav-item:hover {
  border-color: rgba(231, 236, 255, 0.14);
  background: rgba(231, 236, 255, 0.06);
}
.report-nav-item.active {
  border-color: rgba(124, 58, 237, 0.75);
  background: rgba(124, 58, 237, 0.2);
}
.report-controls {
  display: grid;
  gap: 12px;
}
.report-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 26, 51, 0.65);
  box-shadow: var(--shadow);
}
.report-panel__header,
.report-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.report-panel__header h2,
.report-preview__header h2 {
  margin: 0;
}
.report-scope {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(231, 236, 255, 0.18);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}
.report-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.report-form--builder {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}
.report-form--range {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-form .field {
  min-width: 0;
}
.report-form .field input,
.report-form .field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.report-form__wide {
  grid-column: 1 / -1;
}
.report-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
}
.report-options[hidden] {
  display: none;
}
.report-options .report-form__wide {
  grid-column: 1 / -1;
}
.report-specific-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid rgba(231, 236, 255, 0.1);
  border-radius: 10px;
  background: rgba(15, 23, 46, 0.32);
}
.report-specific-options[hidden] {
  display: none;
}
.report-specific-options .report-form__wide {
  grid-column: 1 / -1;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
  font-size: 13px;
}
.report-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.report-preview {
  min-width: 0;
  overflow: hidden;
}
.report-preview .tablewrap {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.table-scrollbar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: rgb(15, 23, 46);
}
.table-scrollbar[hidden] {
  display: none;
}
.table-scrollbar__spacer {
  height: 1px;
}
.report-document {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.report-document[hidden] {
  display: none;
}
.report-document__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 236, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 46, 0.55);
}
.report-document__bar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.report-document__frame {
  width: 100%;
  min-height: 760px;
  border: 0;
  border-radius: 8px;
  background: #eee;
}
.crystal-report {
  width: 1120px;
  min-height: 790px;
  margin: 0 auto;
  padding: 18px 36px 24px;
  border-radius: 2px;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.25;
}
.crystal-report__header {
  margin-bottom: 14px;
  text-align: center;
}
.crystal-report__header h1 {
  margin: 0 0 3px;
  color: #111;
  font-size: 18px;
}
.crystal-report__header p {
  margin: 4px 0 0;
}
.crystal-report__columns,
.crystal-report__line {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 72px 88px 92px 180px;
  gap: 10px;
  align-items: baseline;
}
.crystal-report__columns {
  padding: 0 0 5px 0;
  border-bottom: 1px solid #8a8a8a;
  font-weight: 700;
  text-align: right;
}
.crystal-report__columns span:first-child {
  text-align: left;
}
.crystal-report__line {
  min-height: 20px;
  padding: 2px 0;
}
.crystal-report__branch {
  margin-top: 10px;
}
.crystal-report__summary {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid #8a8a8a;
}
.crystal-report__branch h3,
.crystal-report__branch h4,
.crystal-report__branch h5 {
  margin: 5px 0 3px;
  color: #111;
  font-size: 10px;
  font-weight: 700;
}
.crystal-report__branch h4 {
  margin-left: 12px;
}
.crystal-report__branch h5 {
  margin-left: 24px;
}
.crystal-report__period {
  margin: 7px 0 2px 44px;
  font-weight: 700;
}
.crystal-report__desc {
  padding-left: 44px;
}
.crystal-report__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.crystal-report__sign {
  display: inline-block;
  min-width: 10px;
  text-align: center;
}
.payslip-run-report {
  padding: 18px;
  border: 1px solid rgba(231, 236, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 46, 0.72);
}
.payslip-run-report__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.payslip-run-report__header h1 {
  margin: 0;
  font-size: 18px;
}
.payslip-run-report__header p {
  margin: 4px 0 0;
  color: var(--muted);
}
.payslip-run-report__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.payslip-run-report__stats div {
  padding: 10px 12px;
  border: 1px solid rgba(231, 236, 255, 0.12);
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.08);
}
.payslip-run-report__stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.payslip-run-report__stats strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.payslip-run-report__tablewrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.payslip-run-report__table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.payslip-run-report__table th,
.payslip-run-report__table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(231, 236, 255, 0.1);
  text-align: left;
  white-space: nowrap;
}
.payslip-run-report__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgb(17, 24, 49);
  color: var(--muted);
  font-size: 11px;
}
.payslip-run-report__table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.payslip-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
}
.report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.report-meta__item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(231, 236, 255, 0.12);
  border-radius: 8px;
  background: rgba(15, 23, 46, 0.38);
}
.report-meta__item strong {
  display: block;
  overflow-wrap: anywhere;
}
.report-meta__item span,
.report-stat span,
.report-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.report-stat {
  padding: 10px 12px;
  border: 1px solid rgba(231, 236, 255, 0.14);
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.08);
}
.report-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.report-detail {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(231, 236, 255, 0.12);
  border-radius: 10px;
  background: rgba(15, 23, 46, 0.44);
}
.report-detail[hidden] {
  display: none;
}
.report-detail__section {
  display: grid;
  gap: 8px;
}
.report-detail__section h3 {
  margin: 0;
  font-size: 13px;
}
.report-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}
.report-field {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(4, 12, 28, 0.35);
}
.report-field strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 46, 0.75);
  color: var(--text);
  outline: none;
}
.field textarea {
  height: auto;
  min-height: 120px;
  resize: vertical;
}
.field input[type="date"] {
  color-scheme: dark;
}
.field .value {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 46, 0.55);
  color: var(--text);
  display: flex;
  align-items: center;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(124, 58, 237, 0.6); }

.btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.65);
  background: rgba(124, 58, 237, 0.25);
  color: var(--text);
  cursor: pointer;
  transition: 140ms ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(124, 58, 237, 0.35); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn--secondary {
  border-color: rgba(231, 236, 255, 0.22);
  background: rgba(231, 236, 255, 0.06);
}
.btn--tiny {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}
.btn--danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.22);
}
.btn--locked {
  border-color: rgba(124, 58, 237, 0.9);
  background: rgba(124, 58, 237, 0.55);
  color: #fff;
}
.btn--locked:disabled {
  opacity: 1;
  cursor: default;
}

.muted { color: var(--muted); }
.link { color: var(--text); text-decoration: none; border-bottom: 1px dashed rgba(231, 236, 255, 0.3); }
.link:hover { border-bottom-color: rgba(231, 236, 255, 0.6); }

.pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(231, 236, 255, 0.06);
}
.pill--ok { border-color: rgba(34, 197, 94, 0.55); background: rgba(34, 197, 94, 0.12); }
.pill--warn { border-color: rgba(245, 158, 11, 0.55); background: rgba(245, 158, 11, 0.12); }
.pill--bad { border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.14); }

.tablewrap { overflow: auto; border-radius: 12px; border: 1px solid var(--border); max-height: 540px; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(231, 236, 255, 0.08);
  text-align: left;
  white-space: nowrap;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-weight: 600;
  background: rgb(15, 23, 46);
}
.table th.num,
.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table tr:hover td { background: rgba(124, 58, 237, 0.06); }
.table tr.report-row--employee-start td {
  border-top: 8px solid rgba(15, 23, 46, 0.95);
  font-weight: 600;
}

.status-message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(231, 236, 255, 0.04);
  line-height: 1.45;
  white-space: pre-line;
}

.status-message:empty { display: none; }
.table tr.report-row--summary td {
  font-weight: 700;
  background: rgba(20, 184, 166, 0.08);
}
.table tfoot td {
  background: rgba(15, 23, 46, 0.5);
  font-weight: 600;
  border-top: 1px solid rgba(231, 236, 255, 0.12);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 26, 51, 0.9);
  box-shadow: var(--shadow);
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}
.modal__card {
  width: min(720px, 100%);
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .nav { position: sticky; top: 56px; display: flex; gap: 10px; overflow: auto; }
  .nav__item { margin: 0; width: auto; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .report-workspace { grid-template-columns: 1fr; }
  .report-nav-panel { position: static; }
  .nav .report-nav-panel { flex: 0 0 280px; max-height: 70vh; overflow: auto; }
  .report-form--builder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .report-form--range { grid-template-columns: 1fr; }
  .report-form--builder { grid-template-columns: 1fr; }
  .report-options { grid-template-columns: 1fr; }
  .report-specific-options { grid-template-columns: 1fr; }
  .report-actions { justify-content: stretch; }
  .report-actions .btn { flex: 1 1 auto; }
}

.statutory-day-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.statutory-day-toolbar--filters {
  flex-wrap: wrap;
}

.statutory-day-toolbar--filters .field:not(.grow) {
  min-width: 190px;
}

.statutory-day-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.statutory-day-summary__item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.statutory-day-summary__item span {
  color: var(--muted);
  font-size: .82rem;
}

.statutory-day-summary__item strong {
  font-size: 1.45rem;
}

.statutory-day-guidance {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  font-size: .86rem;
}

.statutory-day-list {
  display: grid;
  gap: 14px;
}

.statutory-day-card {
  display: grid;
  gap: 14px;
}

.statutory-day-card__head,
.statutory-day-card__body,
.statutory-day-decision,
.statutory-day-date-choice {
  display: flex;
  gap: 12px;
}

.statutory-day-card__head {
  justify-content: space-between;
  align-items: start;
}

.statutory-day-card__head h2,
.statutory-day-card__head p,
.statutory-day-card__body h3,
.statutory-day-card__body p {
  margin: 0;
}

.statutory-day-card__state {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.statutory-day-date-choice,
.statutory-day-decision {
  align-items: end;
  flex-wrap: wrap;
}

.statutory-day-date-choice > span {
  color: var(--muted);
  font-size: .82rem;
  align-self: center;
}

.statutory-day-link {
  width: 100%;
  border: 1px solid #e7b84b;
  border-radius: 7px;
  background: #fff7d6;
  color: #5a4300;
  padding: 4px 6px;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}

.statutory-day-card__body > div {
  flex: 1 1 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.statutory-day-evidence ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

@media (max-width: 1000px) {
  .statutory-day-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statutory-day-guidance { grid-template-columns: 1fr; }
  .statutory-day-card__body { flex-direction: column; }
}

/* NZ Payroll V2 shell and workforce workspaces. Payroll documents and
   calculation screens keep their proven structure. */
:root {
  --bg: #f3f7f4;
  --panel: #ffffff;
  --panel-2: #f6faf7;
  --text: #102b24;
  --muted: #60756f;
  --border: #d7e2dc;
  --accent: #145844;
  --accent-2: #d7f458;
  --shadow: 0 12px 32px rgba(24, 67, 54, 0.09);
}

body {
  background: linear-gradient(180deg, #edf4f0 0, #f7faf8 280px, #f3f7f4 100%);
}

.topbar {
  min-height: 66px;
  padding: 12px 20px;
  border-color: rgba(255,255,255,.09);
  background: #0c3027;
  color: #fff;
  box-shadow: 0 5px 18px rgba(8, 36, 29, .16);
}
.topbar .pill { color: #edf7f1; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.07); }
.topbar .btn--secondary { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.08); }
.topbar__logo { width: 38px; height: 38px; }

.layout { grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.nav { padding: 18px 14px; border-color: var(--border); background: rgba(255,255,255,.68); }
.nav__item, .nav__subitem {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  font-weight: 650;
}
.nav__item:hover, .nav__subitem:hover { border-color: #cbdcd3; background: #edf5f0; }
.nav__item.is-active, .nav__subitem.is-active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(20,88,68,.2);
}
.nav .report-nav-panel, .report-nav-panel, .report-panel, .settings-section,
.card, .card--muted, .card--subtle {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.nav .report-nav-panel { background: #f7faf8; box-shadow: none; }
.report-nav-group { border-color: var(--border); }
.report-nav-group summary, .report-nav-item { color: var(--muted); }
.report-nav-group[open] summary, .report-nav-item.active {
  color: var(--accent); border-color: #b9d5c8; background: #eaf5ef; box-shadow: none;
}
.report-nav-item:hover { border-color: var(--border); background: #f0f6f2; }

.content { padding: 26px clamp(18px, 3vw, 44px); }
h1 { font-size: 28px; color: #102b24; }
h2 { color: #102b24; }
.card { border-radius: 16px; }
.card__header { border-color: var(--border); }

.field input, .field select, .field textarea, .field .value {
  color: var(--text);
  border-color: #cddbd4;
  background: #fbfdfc;
}
.field input[type="date"], .field input[type="time"], .field input[type="datetime-local"] {
  color-scheme: light;
}
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator,
.field input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #4b9478;
  box-shadow: 0 0 0 3px rgba(75,148,120,.12);
}
.field input:disabled, .field select:disabled, .field textarea:disabled { color: #7c8c87; background: #edf1ef; }
.btn {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 700;
}
.btn:hover { background: #0d4635; }
.btn--secondary { color: #163a30; border-color: #cbdad3; background: #eef4f0; }
.btn--secondary:hover { background: #e2ece7; }
.btn--danger { color: #8f2730; border-color: #e5b7bc; background: #fae9eb; }
.btn--danger:hover { background: #f4d9dd; }
.pill { color: #315b4e; border-color: #c9ddd3; background: #eef7f2; font-weight: 650; }
.pill--ok, .status-approved, .status-paid { color: #0d6948; border-color: #a9dbc4; background: #e2f5eb; }
.pill--warn, .status-submitted { color: #825a0c; border-color: #ead49e; background: #fff7df; }
.pill--bad, .status-rejected { color: #9b3038; border-color: #e6b5ba; background: #fbe8ea; }
.status-draft, .status-not_started { color: #536963; background: #eff3f1; }
.table th { color: #46645a; background: #edf4f0; }
.table th, .table td { border-color: #e2e9e5; }
.table tr:hover td { background: #f3f8f5; }
.table tfoot td { background: #edf4f0; border-color: #dbe6e0; }
.table tr.report-row--employee-start td { border-color: #edf4f0; }
.status-message { border-color: #ceddd5; background: #f2f7f4; }
.status-message--error { color: #902f38; border-color: #e3b1b7; background: #fbeaec; }
.toast { color: #fff; border-color: rgba(255,255,255,.15); background: #153e33; }
.modal { background: rgba(8, 39, 31, .56); }
.settings-actions { border-color: var(--border); background: rgba(243,247,244,.96); }
.tab { color: var(--text); border-color: var(--border); background: #f3f7f4; }
.tab.is-active { color: #fff; border-color: var(--accent); background: var(--accent); box-shadow: none; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.page-heading h1 { margin-bottom: 4px; }
.page-heading p { margin: 0; }
.eyebrow { color: #36745e; font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.workforce-list { display: grid; gap: 16px; margin-top: 16px; }
#empEditPayHistoryNotice { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rate-history { margin-top: 16px; }
.workforce-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.workforce-card__header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.workforce-card__header h2, .workforce-card__header p { margin: 0; }
.workforce-card__footer { justify-content: flex-end; margin-top: 14px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(145px, 1fr)); gap: 9px; overflow-x: auto; padding-bottom: 4px; }
.work-day { min-width: 145px; padding: 10px; border: 1px solid #cbd9d2; border-radius: 12px; background: #f5faf7; }
.work-day__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 25px; margin-bottom: 8px; color: #285a49; font-size: 11px; }
.work-day .field { margin-top: 7px; }
.work-day .field input, .work-day .field select { width: 100%; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.roster-actions { margin-bottom: 12px; }
.roster-template-bar { margin-bottom: 16px; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .page-heading { align-items: stretch; flex-direction: column; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .nav { top: 66px; background: rgba(255,255,255,.96); }
  .workforce-card__header { flex-direction: column; }
}

/* Fiji-style workforce shell. The proven NZ payroll document and calculator
   components below this shell retain their existing markup and behaviour. */
html { scrollbar-gutter: stable; }
.topbar {
  height: 78px;
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 10px 22px;
  overflow: visible;
  z-index: 40;
}
.topbar__title { white-space: nowrap; }
.topbar__status { justify-self: end; min-width: 0; }
.topbar .nav {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.topbar .nav__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: 48px;
  min-width: 0;
  margin: 0;
  padding: 0 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #b9d0c8;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}
.topbar .nav__item::before {
  content: attr(data-icon);
  font-family: "Segoe UI Symbol", "Segoe UI Emoji", sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}
.topbar .nav__item::after { display: none; }
.topbar .nav__item:hover,
.topbar .nav__item.is-active { color: #fff; background: #164d3f; transform: none; }
.topbar .nav__sub {
  position: absolute;
  top: 70px;
  left: 50%;
  z-index: 65;
  width: 310px;
  padding: 8px;
  border: 1px solid #2b6657;
  border-radius: 12px;
  background: #0c3027;
  box-shadow: 0 16px 38px rgba(4,40,30,.28);
  transform: translateX(-50%);
}
.topbar .nav__subitem { color: #c8d9d3; background: transparent; }
.topbar .nav__subitem:hover,
.topbar .nav__subitem.is-active { color: #fff; background: #164d3f; box-shadow: none; }
.topbar .report-nav-panel { display: none; }
.layout { display: block; min-height: calc(100vh - 78px); }
.content { width: 100%; max-width: 1800px; margin: 0 auto; padding: 24px 38px 72px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon-button { width: 40px; min-width: 40px; padding-inline: 0; font-size: 22px; }
.view-toggle { display: flex; gap: 7px; }
.view-toggle button { width: 38px; height: 38px; border: 1px solid #cbdad3; border-radius: 10px; background: #fff; color: #547068; font-size: 18px; cursor: pointer; }
.view-toggle button.is-active { border-color: #287c62; background: #287c62; color: #fff; }

/* Reports retain the complete BOSS Pay catalogue after moving to top navigation. */
#view-reports .report-workspace {
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  gap: 18px;
}
#view-reports .report-nav-panel {
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
#view-reports .report-nav-panel__header h2 { font-size: 18px; }

@media (max-width: 900px) {
  #view-reports .report-workspace { grid-template-columns: minmax(0, 1fr); }
  #view-reports .report-nav-panel { position: static; max-height: none; }
}

/* Employee directory and employee file */
.employee-directory-heading { align-items: center; }
.employee-directory-tool { margin-bottom: 2px; }
.employee-directory-card { padding: 0; overflow: hidden; }
.employee-directory-card > .row { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.employee-directory-card .tablewrap { border: 0; border-radius: 0; }
.employee-directory-card .table th,
.employee-directory-card .table td { padding: 13px 14px; vertical-align: middle; }
.employee-directory-card .table td small,
.employee-directory-identity small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.employee-name-button { border: 0; padding: 0; background: transparent; color: #285b91; font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.employee-name-button:hover { text-decoration: underline; }
.employee-edit-workspace { display: grid; gap: 14px; }
.employee-edit-workspace__head { position: sticky; top: 88px; z-index: 8; align-items: center; padding: 10px 0; background: rgba(243,247,244,.96); }
#view-employees.is-editing .employee-directory-heading,
#view-employees.is-editing .employee-directory-card,
#view-employees.is-editing .employee-directory-tool { display: none !important; }
.employee-profile-page { max-width: 1650px; margin: 0 auto; }
.employee-profile-toolbar { position: sticky; top: 78px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: -8px -6px 18px; padding: 10px 6px; border-bottom: 1px solid #dce5e1; background: rgba(243,247,244,.96); backdrop-filter: blur(8px); }
.employee-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.employee-profile-more { position: relative; }
.employee-profile-more > summary { list-style: none; cursor: pointer; }
.employee-profile-more > summary::-webkit-details-marker { display: none; }
.employee-profile-more__menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 35; display: grid; gap: 7px; width: 230px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 18px 45px rgba(10,55,43,.2); }
.employee-profile-more__menu .btn { width: 100%; justify-content: flex-start; }
.employee-profile-hero { position: relative; display: flex; align-items: center; gap: 24px; min-height: 174px; padding: 30px 38px; border-radius: 20px; background: linear-gradient(112deg,#0c4738 0%,#17664f 72%,#25785d 100%); color: #fff; box-shadow: 0 16px 35px rgba(20,75,59,.14); }
.employee-profile-avatar { display: grid; place-items: center; flex: 0 0 90px; width: 90px; height: 90px; border: 3px solid #fff; border-radius: 50%; background: #d9f45e; color: #14392f; font-size: 25px; font-weight: 900; }
.employee-profile-identity { display: flex; align-items: baseline; gap: 18px; min-width: 0; flex-wrap: wrap; }
.employee-profile-identity h1 { margin: 0; color: #fff; font-size: 32px; }
.employee-profile-id { font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.employee-profile-subtitle { color: #d7e8e2; font-size: 16px; }
.employee-profile-badges { margin-left: auto; align-self: flex-start; display: flex; gap: 8px; }
.employee-profile-badges span { padding: 7px 11px; border-radius: 9px; background: #eef8f2; color: #174b3a; font-size: 12px; font-weight: 800; }
.employee-section-nav { position: sticky; top: 145px; z-index: 16; display: flex; gap: 6px; margin-top: 12px; padding: 8px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 7px 20px rgba(26,76,61,.08); }
.employee-section-nav button { padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #49665c; font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.employee-section-nav button:hover, .employee-section-nav button.is-active { background: #e8f4ee; color: #0c5a43; }
#employeeProfileHero, #employeeWorkAssignments, #employeeProfileAttendance, #employeePayrollHistory { scroll-margin-top: 215px; }
.employee-collapsible-section { padding: 0; overflow: clip; }
.employee-collapsible-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; cursor: pointer; list-style: none; }
.employee-collapsible-summary::-webkit-details-marker { display: none; }
.employee-collapsible-summary::after { content: '\203A'; color: #315d4f; font-size: 26px; font-weight: 800; transform: rotate(90deg); transition: transform .15s ease; }
.employee-collapsible-section[open] > .employee-collapsible-summary::after { transform: rotate(-90deg); }
.employee-collapsible-summary > span:first-child { display: grid; gap: 4px; }
.employee-collapsible-summary strong { color: #102d24; font-size: 18px; }
.employee-collapsible-body { display: grid; gap: 14px; padding: 0 20px 20px; border-top: 1px solid var(--border); }
.employee-collapsible-body > .profile-section-head { margin-top: 16px; }
.employee-readiness { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 12px; padding: 15px 18px; border-left: 5px solid #2b916c; }
.employee-readiness.has-issues { border-left-color: #c3434d; background: #fffafa; }
.employee-readiness h2, .employee-readiness p { margin: 0; }
.employee-readiness h2 { margin-top: 3px; font-size: 18px; }
.employee-readiness__items { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.employee-readiness__items span { padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.readiness-ok { background: #ddf4e7; color: #176143; }
.readiness-issue { background: #fde7e9; color: #a32734; }
.readiness-info { background: #edf2ef; color: #587068; }
.profile-workforce-sections { display: grid; gap: 18px; margin-top: 18px; }
.profile-workforce-sections:empty { display: none; }
.profile-workforce-sections > section { scroll-margin-top: 210px; }
.profile-loading { padding: 70px; text-align: center; }
.profile-primary-grid { display: grid; grid-template-columns: minmax(520px,.95fr) minmax(620px,1.15fr); gap: 18px; margin-top: 18px; }
.profile-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.profile-summary-card, .employee-fact-card, .employee-leave-card, .employee-attendance-card, .employee-attendance-summary { padding: 22px; }
.profile-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.profile-stat { min-height: 92px; padding: 15px; border-radius: 14px; background: #f4f7f5; }
.profile-stat span { display: block; color: #39705f; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.profile-stat strong { display: block; margin: 8px 0 4px; color: #073f32; font-size: 19px; }
.profile-stat small { display: block; color: #788a84; font-size: 11px; line-height: 1.35; }
.employee-facts-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-top: 18px; }
.employee-fact-list { display: grid; gap: 11px; margin: 0; }
.employee-fact-list div { display: grid; grid-template-columns: minmax(110px,.85fr) minmax(0,1.15fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #edf1ef; }
.employee-fact-list dt { color: #758780; font-size: 11px; }
.employee-fact-list dd { margin: 0; overflow-wrap: anywhere; color: #203a32; font-size: 12px; font-weight: 700; }
.employee-leave-card { margin-top: 18px; }
.employee-leave-workspace { margin-top: 18px; padding: 22px; }
.profile-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.profile-section-head h2, .profile-section-head p { margin: 0; }
.attendance-month-control { display: flex; align-items: center; gap: 10px; }
.attendance-month-control strong { min-width: 150px; text-align: center; }
.attendance-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.attendance-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border: 1px solid #ccd8d3; border-radius: 3px; vertical-align: -1px; }
.attendance-legend .worked::before { border-color: #64ba92; background: #d9f4e6; }
.attendance-legend .planned::before { border-color: #96cbb4; background: #eef8f3; }
.attendance-legend .approved::before { border-color: #e1b84d; background: #fff4c9; }
.attendance-legend .pending::before { border-color: #d4a46b; background: #fff0df; }
.attendance-legend .public-holiday::before { border-color: #d6c45c; background: #fff8ce; }
.attendance-legend .off::before { background: #eef1ef; }
.attendance-calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.attendance-calendar__weekday { padding: 4px; color: #557168; font-size: 10px; font-weight: 850; text-align: center; text-transform: uppercase; }
.attendance-day { min-height: 64px; padding: 7px 6px; overflow: hidden; border: 1px solid #d5dfda; border-radius: 8px; background: #f1f3f2; }
.attendance-day.is-outside { visibility: hidden; }
.attendance-day strong { display: block; margin-bottom: 4px; font-size: 10px; }
.attendance-day span, .attendance-day small { display: block; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.attendance-day small { margin-top: 4px; color: #60756d; }
.attendance-day.worked { border-color: #76c49e; background: #dff5e9; }
.attendance-day.planned { border-color: #b6d6c7; background: #eff8f3; }
.attendance-day.approved_leave, .attendance-day.recorded_leave { border-color: #e3bd54; background: #fff5cf; }
.attendance-day.pending_leave { border-color: #dfa96b; background: #fff1e0; }
.attendance-day.public_holiday { border-color: #d6c45c; background: #fff8ce; }
.attendance-day.no_record { border-color: #e3e9e6; background: #f8faf9; color: #8b9893; }
.attendance-summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.attendance-summary-grid .profile-stat { background: #f6f8f7; }
.profile-data-note { margin: 14px 0 0; color: #74867f; font-size: 11px; line-height: 1.45; }
.leave-workspace-grid { display: grid; grid-template-columns: minmax(280px,.75fr) minmax(0,1.6fr); gap: 20px; align-items: start; }
.leave-request-form[hidden] + .leave-history { grid-column: 1 / -1; }
.leave-request-form { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #f8faf9; }
.leave-request-form h3, .leave-history h3 { margin-top: 0; }
.leave-request-form .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.leave-request-form .grow { grid-column: 1 / -1; }
.leave-history .table { min-width: 760px; }
.leave-history-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.leave-history-actions .btn { padding: 6px 8px; font-size: 10px; }
.recorded-leave-history { margin-top: 14px; }
.recorded-leave-history summary, .roster-template-manager > summary, .roster-history-panel > summary { cursor: pointer; color: #315d4f; font-weight: 800; }
.recorded-leave-history .tablewrap { margin-top: 10px; }
.employee-financial-fields { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: #f8faf9; }
.employee-financial-fields h3, .employee-financial-fields p { margin: 0; }
.employee-financial-fields > .grid { margin-top: 14px; }
.deduction-plan-list { display: grid; gap: 10px; margin-top: 14px; }
.deduction-plan-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.deduction-plan-row small { display: block; margin-top: 4px; color: var(--muted); }
.deduction-plan-row__heading { justify-content: flex-start; gap: 8px; }
.deduction-plan-editor { margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.deduction-plan-editor > .grid { margin-bottom: 14px; }
.employee-engagement-blocks { display: grid; gap: 16px; }
.employee-engagement-blocks form.card--muted { display: grid; gap: 14px; padding: 16px; box-shadow: none; }
#workAssignmentForm { scroll-margin-top: 215px; }
.employee-engagement-blocks details.is-disabled { opacity: .62; }
.engagement-block-form { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #f8faf9; }
.engagement-block-form .grow { grid-column: 1 / -1; }
.engagement-block-list { display: grid; gap: 10px; }
.engagement-block-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfb; }
.engagement-block-row small { display: block; margin-top: 4px; color: var(--muted); }
.engagement-block-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.engagement-label { color: #27634e !important; font-weight: 750; }
.engagement-warning { color: #a12b35 !important; font-weight: 750; }
.engagement-context { margin: -3px 0 10px; padding: 8px 10px; border-radius: 9px; background: #edf7f2; color: #315d4f; font-size: 11px; }

/* Compact weekly roster */
.roster-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 14px 16px; }
.roster-toolbar .roster-search { flex: 1; max-width: 440px; }
.workforce-filterbar { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 12px; margin-bottom: 14px; padding: 12px 16px; box-shadow: none; }
.workforce-filterbar .field { margin: 0; }
.workforce-pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding: 10px 14px; box-shadow: none; }
.workforce-pager .row { justify-content: flex-end; }
.workforce-page-size { display: flex; align-items: center; gap: 6px; margin: 0; }
.workforce-page-size select { width: 76px; }
.week-control { display: flex; align-items: end; gap: 7px; }
.roster-total { align-self: center; font-size: 12px; white-space: nowrap; }
.roster-grid-wrap { padding: 0; overflow: auto; }
.roster-template-manager { margin-bottom: 14px; padding: 14px 16px; box-shadow: none; }
.roster-template-list { display: grid; gap: 8px; margin-top: 12px; }
.roster-template-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: #f8faf9; }
.roster-template-row small { color: var(--muted); }
.roster-history-panel { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.roster-history-list { display: grid; gap: 8px; margin-top: 12px; }
.roster-history-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; padding: 9px; border-radius: 9px; background: #f4f7f5; font-size: 11px; }
.roster-history-row small { color: var(--muted); }
.roster-table { width: 100%; min-width: 1250px; border-collapse: collapse; }
.roster-table th { padding: 13px 10px; background: #f8faf9; color: #62756e; font-size: 11px; text-align: left; white-space: nowrap; }
.roster-table td { padding: 9px 8px; border-top: 1px solid #e5ebe8; font-size: 12px; }
.roster-employee { min-width: 210px; }
.roster-employee small { display: block; margin-top: 3px; color: #788a84; }
.roster-role { min-width: 190px; color: #516b62; }
.shift { display: flex; min-width: 94px; min-height: 50px; border: 1px solid #bfd2ca; border-radius: 12px; background: #eaf6ef; flex-direction: column; align-items: center; justify-content: center; color: #1e6949; font-size: 10px; font-weight: 800; }
.shift small { margin-top: 3px; color: #274f43; }
.shift.off { border-color: #d5dcda; background: #eef0ef; color: #7c8984; }
.roster-action { border: 0; border-radius: 8px; padding: 8px 10px; background: #edf3f0; color: #265546; font-weight: 750; white-space: nowrap; cursor: pointer; }
.workforce-dialog { width: min(1120px, calc(100vw - 40px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 18px; color: var(--text); box-shadow: 0 24px 80px rgba(4,44,35,.3); }
.workforce-dialog::backdrop { background: rgba(3,31,25,.58); }
.workforce-dialog__shell { display: grid; gap: 18px; padding: 24px; }
.workforce-dialog__head, .workforce-dialog__footer, .roster-editor-settings { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.workforce-dialog__head { align-items: start; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.workforce-dialog__head h2, .workforce-dialog__head p { margin: 0; }
.roster-editor-days { display: grid; grid-template-columns: repeat(7,minmax(125px,1fr)); gap: 8px; overflow-x: auto; }
.roster-editor-days .work-day { min-width: 125px; box-shadow: none; }

/* Compact Fiji-style weekly timesheets */
.timesheet-toolbar { display: grid; grid-template-columns: auto minmax(260px,1fr) auto auto; align-items: end; gap: 20px; margin-bottom: 16px; padding: 16px; }
.timesheet-search { width: 100%; max-width: 520px; justify-self: center; }
.timesheet-clock { min-width: 130px; }
.timesheet-summary { align-self: center; padding: 12px 15px; border: 1px solid #ddb74f; border-radius: 11px; background: #fff5d7; color: #273d35; white-space: nowrap; }
.timesheet-queue { display: flex; align-items: center; gap: 8px; margin: -2px 0 16px; padding: 0 4px; overflow-x: auto; }
.timesheet-queue > strong { margin-right: 4px; color: #315d4f; font-size: 11px; white-space: nowrap; }
.timesheet-queue button { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #cbdad3; border-radius: 999px; background: #fff; color: #49665c; font-size: 10px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.timesheet-queue button:hover { border-color: #6aa88e; background: #edf7f2; }
.timesheet-queue button.has-warning { border-color: #e4a2a7; background: #fff1f2; color: #a32734; }
.timesheet-queue b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #e8f1ed; color: #174b3a; }
.timesheet-queue button.has-warning b { background: #f8d6d9; color: #92232d; }
.timesheet-list { display: grid; gap: 18px; }
.intake-workflow, .intake-help { margin-bottom: 16px; padding: 20px; }
.intake-workflow__steps { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.intake-workflow__steps span { padding: 8px 12px; border: 1px solid #bfd8ca; border-radius: 999px; background: #eef8f1; color: #15543d; font-size: 12px; font-weight: 700; }
.intake-workflow .grid { grid-template-columns: minmax(210px,1fr) minmax(210px,1fr) minmax(280px,2fr); align-items: end; }
.intake-workflow .row { margin-top: 16px; }
.intake-approval { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; padding: 12px; border: 1px solid #dfc98e; border-radius: 10px; background: #fff9e9; color: #5b4212; font-size: 12px; line-height: 1.4; }
.intake-approval[hidden] { display: none; }
.intake-approval input { flex: none; margin-top: 2px; }
.intake-workflow .status-message { margin-top: 16px; }
.intake-preview { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 12px; }
.intake-preview th, .intake-preview td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.intake-preview th { background: #eef5f1; color: #315b4e; }
.intake-preview-wrap { max-height: 360px; overflow: auto; }
.intake-help p { margin: 8px 0; line-height: 1.55; }
.payrun-intake-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding: 12px 16px; }
.timesheet-day__missing-time { display: block; margin-top: 7px; color: #825a0c; font-size: 10px; font-weight: 700; }
.timesheet-list.is-grid { grid-template-columns: 1fr; }
.timesheet-view-toggle button { width: auto; min-width: 92px; padding: 0 10px; font-size: 12px; font-weight: 700; }
.timesheet-card { padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.timesheet-card__summary { display: grid; grid-template-columns: minmax(180px,1.4fr) minmax(420px,4fr) 132px; gap: 16px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.timesheet-card__summary::-webkit-details-marker { display: none; }
.timesheet-card__summary::marker { content: ''; }
.timesheet-card__summary:hover { background: #f5faf7; }
.timesheet-card__identity { display: grid; gap: 3px; min-width: 0; }
.timesheet-card__identity strong { color: #184e3c; font-size: 15px; }
.timesheet-card__identity small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.timesheet-card__identity::after { content: 'Open week'; color: #28694f; font-size: 11px; font-weight: 700; }
.timesheet-card__editor[open] .timesheet-card__identity::after { content: 'Close week'; }
.timesheet-week-strip { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; min-width: 0; }
.timesheet-week-day { display: grid; gap: 2px; min-width: 0; padding: 6px 4px; border: 1px solid #d9e4dd; border-radius: 7px; background: #f4f7f5; text-align: center; }
.timesheet-week-day.has-hours { border-color: #abdbc0; background: #e5f7ed; }
.timesheet-week-day b { font-size: 10px; }
.timesheet-week-day small { color: #426459; font-size: 10px; white-space: nowrap; }
.timesheet-card__detail { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.timesheet-card__detail > .engagement-context { margin-top: 12px; }
.timesheet-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.timesheet-card__head .employee-name-button { font-size: 16px; }
.timesheet-card__head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.timesheet-card__totals { display: grid; justify-items: end; gap: 3px; }
.timesheet-card__totals strong { font-size: 18px; }
.timesheet-card__totals span { color: var(--muted); font-size: 11px; }
.timesheet-card__totals small { padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.timesheet-card__body { display: grid; grid-template-columns: minmax(0,1fr) 145px; gap: 10px; }
.timesheet-days { display: grid; grid-template-columns: repeat(7,minmax(140px,1fr)); gap: 8px; overflow-x: auto; padding-bottom: 3px; }
.timesheet-day { min-width: 140px; padding: 10px; border: 1px solid #bad5c8; border-radius: 13px; background: #edf8f2; }
.timesheet-day.off { border-color: #d2d8d5; background: #f0f1f1; }
.timesheet-day__heading { display: flex; justify-content: space-between; gap: 8px; color: #315d4f; font-size: 10px; }
.timesheet-day__hours { margin: 10px 0 8px; color: #1c744f; font-size: 23px; font-weight: 850; }
.timesheet-day.off .timesheet-day__hours { color: #98a49f; }
.timesheet-day .field { margin-top: 7px; }
.timesheet-day .field span { font-size: 9px; }
.timesheet-day .field input, .timesheet-day .field select { width: 100%; min-width: 0; padding: 7px; font-size: 11px; }
.timesheet-day__type { margin-top: 0 !important; }
.timesheet-day-more { margin-top: 7px; }
.timesheet-day-more summary { color: #61766e; font-size: 9px; cursor: pointer; }
.timesheet-actions { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px; border: 1px solid #c7d5ce; border-radius: 13px; background: #fbfcfb; }
.timesheet-actions .btn { width: 100%; }
.timesheet-import-tools { margin-top: 18px; box-shadow: none; }
.timesheet-import-tools > summary { cursor: pointer; color: #45655a; font-weight: 750; }
.timesheet-import-tools__body { margin-top: 16px; }

@media (max-width: 1280px) {
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; padding-inline: 12px; }
  .topbar .nav { justify-content: flex-start; gap: 5px; overflow-x: auto; }
  .topbar .nav__item { width: 42px; min-width: 42px; padding: 0; font-size: 0; }
  .topbar__status .pill:not(#authStatus) { display: none; }
  .timesheet-toolbar { grid-template-columns: 1fr 1fr; }
  .timesheet-list.is-grid { grid-template-columns: 1fr; }
  .profile-primary-grid { grid-template-columns: 1fr; }
  .profile-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workforce-filterbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 66px; grid-template-columns: auto 1fr; }
  .topbar__title strong { display: none; }
  .topbar .nav { order: 3; grid-column: 1 / -1; width: 100%; justify-content: flex-start; }
  .topbar__status { grid-column: 2; grid-row: 1; }
  .content { padding: 20px 12px 60px; }
  .page-heading, .employee-profile-toolbar, .employee-profile-hero { align-items: stretch; flex-direction: column; }
  .employee-profile-toolbar { top: 112px; }
  .employee-profile-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .employee-profile-more__menu { position: fixed; top: auto; right: 16px; bottom: 16px; left: 16px; width: auto; }
  .employee-section-nav { top: 188px; }
  .employee-readiness { align-items: stretch; flex-direction: column; }
  .employee-readiness__items { justify-content: flex-start; }
  .employee-profile-badges { margin-left: 0; }
  .profile-summary-grid, .profile-primary-grid, .employee-facts-grid { grid-template-columns: 1fr; }
  .attendance-summary-grid { grid-template-columns: 1fr; }
  .leave-workspace-grid { grid-template-columns: 1fr; }
  .engagement-block-row { grid-template-columns: 1fr; align-items: start; }
  .engagement-block-actions { justify-content: flex-start; }
  .attendance-calendar { grid-template-columns: repeat(7,minmax(64px,1fr)); overflow-x: auto; }
  .timesheet-toolbar { grid-template-columns: 1fr; }
  .timesheet-card__summary { grid-template-columns: 1fr; gap: 8px; }
  .timesheet-week-strip { overflow-x: auto; grid-template-columns: repeat(7,minmax(62px,1fr)); }
  .timesheet-card__summary .timesheet-card__totals { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
  .intake-workflow .grid { grid-template-columns: 1fr; }
  .payrun-intake-link { align-items: stretch; flex-direction: column; }
  .timesheet-search { max-width: none; }
  .workforce-filterbar { grid-template-columns: 1fr; }
  .workforce-pager { align-items: stretch; flex-direction: column; }
  .timesheet-card__body { grid-template-columns: 1fr; }
  .timesheet-actions { flex-direction: row; }
  .workforce-dialog__head, .workforce-dialog__footer, .roster-editor-settings { align-items: stretch; flex-direction: column; }
}
.termination-weekdays {
  gap: .75rem;
  flex-wrap: wrap;
}

.termination-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.session-locked .topbar .nav,
.session-locked .content > .view {
  visibility: hidden;
}

/* User administration: explicit editors and compact, responsive access rows. */
.users-card { min-width: 0; }
.grid.user-invite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.user-invite-grid .field { min-width: 0; }
.user-invite-grid input, .user-invite-grid select { width: 100%; min-width: 0; box-sizing: border-box; }
.user-invite-panel, .user-access-editor { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 16px 0; scroll-margin-top: 110px; }
.user-invite-panel summary { cursor: pointer; font-weight: 700; color: var(--text); }
.user-invite-panel summary:focus-visible, .user-permission input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.user-permission-fieldset { min-width: 0; padding: 0; margin: 18px 0; border: 0; }
.user-permission-fieldset legend { padding: 0 0 10px; font-size: 13px; font-weight: 700; }
.user-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.user-permission { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; }
.user-permission:has(input:checked) { background: #eaf5ef; border-color: #89b9a4; }
.user-permission input { accent-color: var(--accent); width: 17px; height: 17px; flex: 0 0 17px; margin: 0; }
.user-permission span { overflow-wrap: anywhere; }
.user-access-editor > .field { max-width: 320px; }
.users-list-heading { margin-top: 24px; }
.users-card .users-tablewrap { max-height: none; overflow: visible; }
#usersTable { table-layout: fixed; }
#usersTable th, #usersTable td { white-space: normal; overflow-wrap: anywhere; vertical-align: middle; }
#usersTable th { position: static; }
#usersTable th:first-child { width: 23%; }
#usersTable th:last-child { width: 23%; }
.user-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.user-row-actions .btn { height: auto; min-height: 36px; padding: 8px 10px; }
.user-status { text-transform: capitalize; }
#usersTable .user-row--highlight { background: #fff4cf; }

@media (max-width: 1100px) {
  #usersTable, #usersTable tbody, #usersTable tr, #usersTable td { display: block; width: auto; }
  #usersTable thead { display: none; }
  #usersTable tr { padding: 12px; border-bottom: 1px solid var(--border); }
  #usersTable td { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 10px; padding: 6px 0; border: 0; }
  #usersTable td::before { content: attr(data-label); color: var(--muted); }
  #usersTable td[colspan] { display: block; }
  #usersTable td:first-child { font-weight: 700; }
}

@media (max-width: 680px) {
  .grid.user-invite-grid, .user-permission-grid { grid-template-columns: minmax(0, 1fr); }
}
