:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #cfd6e0;
  --primary: #1570ef;
  --primary-dark: #175cd3;
  --accent: #0e9384;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 30px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(21, 112, 239, .28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px 14px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e6f4f1;
  color: #0e9384;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-note {
  display: grid;
  gap: 3px;
  margin: 22px 10px 0;
  padding: 12px;
  border: 1px solid #d9e8ff;
  border-radius: 8px;
  background: #f4f8ff;
  color: #344054;
}

.sidebar-note b {
  color: var(--primary-dark);
  font-size: 12px;
}

.sidebar-note span {
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 18px;
  padding: 8px 0;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-title {
  padding: 0 10px 4px;
  color: #8a94a6;
  font-size: 12px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  color: #344054;
  font-weight: 500;
  gap: 10px;
}
.side-nav a i { width: 20px; color: #98a2b3; font-style: normal; font-size: 16px; text-align: center; }
.side-nav a[aria-current="page"] i { color: var(--primary); }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eaf2ff; color: var(--primary-dark); font-weight: 700; }
.section-kicker { color: var(--muted); font-size: 12px; font-weight: 600; }
.danger-stat { background: #fff4f2; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #98a2b3; }
.status-dot.online { background: #12b76a; box-shadow: 0 0 0 4px #e7f6ee; }
.status-dot.offline { background: #f79009; box-shadow: 0 0 0 4px #fff4e5; }
.status-list { display: grid; gap: 14px; margin: 6px 0 20px; }
.status-list > div { display: flex; gap: 10px; align-items: flex-start; }
.status-list b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eff6ff; color: var(--primary); font-size: 11px; }
.status-list span { display: grid; gap: 1px; }
.status-list small { color: var(--muted); }
.progress-panel { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.progress-meta strong { color: var(--text); }
.progress-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #eef2f6; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1570ef, #12b76a); }
.table-scroll {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #cfd6e0 transparent;
}

.table-scroll:has(#employee-table),
.table-scroll:has(#pending-link-table),
.table-scroll:has(#review-employee-table) {
  max-height: min(68vh, 720px);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.table-scroll:has(#employee-table) table,
.table-scroll:has(#pending-link-table) table,
.table-scroll:has(#review-employee-table) table {
  margin-top: 0;
}

.audit-log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.audit-log-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

.audit-log-filters input,
.audit-log-filters select {
  width: 100%;
}

.audit-log-filters .actions {
  align-items: end;
  margin: 0;
}

.audit-log-table {
  min-width: 980px;
}

.audit-log-table td {
  vertical-align: top;
}

.audit-log-detail summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 600;
}

.audit-log-detail pre {
  max-width: 460px;
  max-height: 220px;
  margin: 8px 0 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-log-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.audit-log-pagination > span {
  display: flex;
  gap: 5px;
}

.audit-log-pagination a[aria-disabled="true"] {
  pointer-events: none;
  opacity: .45;
}

.side-nav a:hover,
.side-nav a[aria-current="page"] {
  background: #eff6ff;
  color: var(--primary-dark);
}

.payslip-preview {
  display: grid;
  gap: 12px;
}

.payroll-hero,
.month-hero {
  background: linear-gradient(110deg, #ffffff 0%, #f4f8ff 100%);
}

.payroll-hero h1,
.month-hero h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.2;
}

.month-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.month-hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.accent-stat {
  background: #f0fbf8;
}

.warning-stat {
  background: #fffaeb;
}

.section-heading,
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading p {
  margin-top: 3px;
}

.workflow small,
.slip-card-head p {
  color: var(--muted);
}

.feature-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #f4fbfa;
}

.feature-band div {
  display: grid;
  gap: 3px;
}

.feature-band span {
  color: var(--muted);
}

.upload-panel {
  min-height: 300px;
}

.upload-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.upload-panel-head h2 {
  margin-bottom: 0;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
}

.file-drop {
  display: block;
  padding: 20px;
  border: 1px dashed #84adff;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--text);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.file-drop:hover {
  border-color: var(--primary);
  background: #f4f8ff;
}

.file-drop:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 112, 239, .1);
}

.file-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-drop-visual {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-drop-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 700;
}

.file-drop-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.file-drop-copy strong {
  font-size: 15px;
}

.file-drop-copy small {
  color: var(--muted);
}

.file-browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
}

.file-meta {
  display: block;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  word-break: break-all;
}

.file-drop:has(.file-native:valid) {
  border-color: #75c69f;
  background: #f6fef9;
}

.file-drop:has(.file-native:valid) .file-drop-icon {
  background: #dcfae6;
  color: #087443;
}

.file-drop:has(.file-native:valid) .file-meta {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #087443;
}

.period-list {
  display: grid;
  gap: 8px;
}

.period-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.period-list a:hover {
  border-color: #98bffb;
  background: #f8fbff;
}

.period-list span {
  color: var(--primary-dark);
  font-weight: 700;
}

.period-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.slip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.slip-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.slip-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #f8fbff;
  border-bottom: 1px solid var(--line);
}

.slip-card-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.slip-card-head p {
  margin: 3px 0 0;
  font-size: 12px;
}

.slip-view-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.slip-view-status > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.slip-view-status small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slip-view-status.is-viewed > span {
  background: #ecfdf3;
  color: #087443;
}

.slip-view-status.is-unread > span {
  background: #fff4e5;
  color: #b54708;
}

.mini-label,
.portal-lock {
  color: var(--muted);
  font-size: 11px;
}

.send-state,
.tag {
  white-space: nowrap;
}

.send-state {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
}

.send-state.done {
  background: #e7f6ee;
  color: #087443;
}

.send-state.pending {
  background: #fff4e5;
  color: #b54708;
}


.send-state.failed {
  background: #fef3f2;
  color: #b42318;
}

.send-state.skipped {
  background: #f2f4f7;
  color: #475467;
}

.slip-card-body {
  padding: 10px 14px;
}

.slip-breakdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 14px;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.slip-breakdown summary::-webkit-details-marker {
  display: none;
}

.slip-breakdown summary::after {
  content: "+";
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
}

.slip-breakdown[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.slip-breakdown[open] summary::after {
  content: "−";
}

.slip-breakdown summary small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
}

.slip-section {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.slip-section:last-child {
  border-bottom: 0;
}

.slip-section-title,
.slip-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.slip-section-title {
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-size: 12px;
}

.slip-line {
  padding: 3px 0;
  color: #475467;
  font-size: 12px;
}

.slip-line b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.employee-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.employee-summary div {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-summary span {
  color: var(--muted);
  font-size: 12px;
}

.payslip-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.detail-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-group header,
.detail-group > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.detail-group header {
  background: #f3f7ff;
  color: var(--primary-dark);
}

.detail-group > div {
  border-top: 1px solid var(--line);
}

.detail-group > div span {
  color: var(--muted);
}

.config-count {
  color: var(--primary-dark);
  font-weight: 700;
}

.table-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.order-input {
  width: 74px;
}

.switch {
  display: inline-flex;
  align-items: center;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d0d5dd;
  cursor: pointer;
  transition: background .15s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.back-link {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 12px;
}

.bare-page:has(.employee-portal) {
  min-height: 100vh;
  background: #f5f7fa;
}

.employee-portal {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px 16px 52px;
}

.employee-portal input,
.employee-portal textarea,
.employee-portal select {
  font-size: 16px;
}

.portal-top {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 2px;
  color: #1d2939;
  font-size: 15px;
  font-weight: 700;
}

.portal-top > span:first-child {
  position: relative;
  padding-bottom: 4px;
  letter-spacing: .01em;
}

.portal-top > span:first-child::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 28px;
  height: 2px;
  border-radius: 99px;
  background: #2f80ed;
  content: "";
}

.portal-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid #d1fadf;
  border-radius: 999px;
  background: #f0fdf4;
  color: #087443;
  font-size: 11px;
  font-weight: 600;
}

.portal-lock::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  content: "";
}

.portal-header {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
  padding: 28px;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  background: #fff;
  color: #101828;
  box-shadow: inset 0 3px 0 #2f80ed, 0 8px 24px rgba(16, 24, 40, .06);
}

.portal-header::after {
  content: none;
}

.portal-header .eyebrow {
  color: #2463eb;
  font-weight: 700;
}

.portal-header p {
  color: #667085;
}

.portal-header h1 {
  margin: 6px 0 0;
  color: #101828;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.portal-header p {
  margin: 6px 0 0;
}

.portal-ledger,
.portal-document {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #dfe3e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .055);
}

.portal-ledger-header,
.portal-document-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.portal-document-status {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 4px;
  color: #087443;
}

.portal-document-status b {
  padding: 5px 11px;
  border: 1px solid #d1fadf;
  border-radius: 999px;
  background: #ecfdf3;
  font-size: 11px;
}

.portal-document-status small {
  color: #98a2b3;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.portal-ledger-header {
  align-items: center;
  padding: 30px 30px 26px;
  border-top: 3px solid #2f80ed;
  border-bottom: 1px solid #e4e7ec;
}

.portal-ledger-header .eyebrow,
.portal-document-header .eyebrow {
  color: #2463eb;
  font-weight: 700;
}

.portal-ledger-header h1,
.portal-document-header h1 {
  margin: 7px 0 0;
  color: #101828;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -.025em;
}

.portal-ledger-header p {
  margin: 7px 0 0;
  color: #667085;
}

.portal-ledger-count {
  display: grid;
  min-width: 74px;
  padding-left: 22px;
  border-left: 1px solid #e4e7ec;
  text-align: right;
}

.portal-ledger-count strong {
  color: #175cd3;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.portal-ledger-count small {
  margin-top: 6px;
  color: #667085;
  font-size: 11px;
}

.portal-ledger-body {
  padding: 8px 26px 18px;
}

.portal-document-header {
  position: relative;
  overflow: hidden;
  padding: 34px 32px 82px;
  border-top: 0;
  background: linear-gradient(135deg, #215ccc 0%, #3279e6 58%, #72a8f1 100%);
}

.portal-document-header::before,
.portal-document-header::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  content: "";
}

.portal-document-header::before {
  right: -54px;
  bottom: -88px;
  width: 220px;
  height: 220px;
}

.portal-document-header::after {
  right: 116px;
  bottom: -116px;
  width: 170px;
  height: 170px;
}

.portal-detail-page .portal-document {
  margin-top: 0;
  border: 0;
  background: #f5f7fb;
  box-shadow: 0 16px 40px rgba(16, 24, 40, .09);
}

.portal-document-heading {
  position: relative;
  z-index: 1;
}

.portal-document-header .eyebrow {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  letter-spacing: .02em;
}

.portal-document-header h1 {
  margin-top: 9px;
  color: #fff;
  font-size: 32px;
  letter-spacing: -.03em;
}

.portal-document-header .portal-document-status {
  color: #fff;
}

.portal-document-header .portal-document-status b {
  padding: 6px 12px;
  border-color: rgba(255, 255, 255, .34);
  background: rgba(14, 48, 112, .26);
  color: #fff;
}

.portal-document-header .portal-document-status small {
  color: rgba(255, 255, 255, .76);
  font-size: 10px;
}

.portal-identity-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  position: relative;
  z-index: 2;
  margin: -36px 28px 18px;
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 41, 55, .09);
}

.portal-identity-grid > span {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 80px;
  padding: 12px 10px;
  border-right: 1px solid #e9edf3;
  text-align: center;
}

.portal-identity-grid > span:first-child {
  padding-left: 10px;
}

.portal-identity-grid > span:nth-child(6n),
.portal-identity-grid > span:last-child {
  border-right: 0;
}

.portal-identity-grid small {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.portal-identity-grid strong {
  color: #101828;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.portal-body {
  padding-top: 18px;
}

.portal-document-body {
  padding: 0 24px 30px;
}

.portal-statement-heading {
  display: flex;
  margin: 2px 2px 14px;
  padding-top: 0;
}

.portal-statement-heading h2 {
  margin: 0;
}

.portal-statement-heading h2 {
  color: #101828;
  font-size: 20px;
  letter-spacing: -.02em;
}

.portal-statement {
  display: grid;
  gap: 16px;
}

.portal-statement-group + .portal-statement-group {
  border-top: 0;
}

.portal-statement-group {
  overflow: hidden;
  border: 1px solid #e5e9f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .06);
}

.portal-statement-group header,
.portal-statement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
}

.portal-statement-group header {
  padding: 17px 20px;
  border-bottom: 1px solid #e6edf8;
  background: #f2f7ff;
  color: #344054;
}

.portal-statement-group header strong {
  color: #215fbf;
  font-size: 16px;
  letter-spacing: .01em;
}

.portal-statement-row strong {
  color: #101828;
  font-variant-numeric: tabular-nums;
}

.portal-statement-row {
  min-height: 62px;
  padding: 17px 20px;
  border-top: 1px solid #edf0f4;
}

.portal-statement-group header + .portal-statement-row {
  border-top: 0;
}

.portal-statement-row span {
  color: #344054;
  font-size: 16px;
}

.portal-statement-row strong {
  color: #101828;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
  text-align: right;
  white-space: nowrap;
}

.portal-document-footer {
  padding-top: 22px;
  color: #8a94a6;
  font-size: 12px;
  text-align: center;
}

.portal-detail-page .portal-actions {
  gap: 10px;
  margin-top: 18px;
}

.portal-detail-page .portal-actions a {
  min-width: 112px;
  padding: 9px 16px;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  background: #fff;
  color: #475467;
  text-align: center;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .04);
}

.portal-detail-page .portal-actions a:hover {
  border-color: #9bbcf2;
  color: #175cd3;
}

.portal-footer {
  margin: 26px 0 0;
  color: #98a2b3;
  text-align: center;
  font-size: 12px;
}

.slip-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.slip-group-title,
.slip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slip-group-title {
  padding: 10px 12px;
  color: var(--text);
  background: #f0f6ff;
  border-bottom: 1px solid var(--line);
}

.slip-group-title span {
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.slip-item {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.slip-item:last-child {
  border-bottom: 0;
}

.slip-item span {
  color: var(--muted);
}

.slip-item strong {
  font-variant-numeric: tabular-nums;
}

.empty-panel {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
}

.app-main {
  min-width: 0;
}

.pagebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.pagebar h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.userbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.user-identity {
  display: grid;
  line-height: 1.2;
}

.user-identity strong {
  color: var(--text);
  font-size: 13px;
}

.user-identity small {
  color: var(--muted);
  font-size: 11px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.choice-card {
  display: grid;
  gap: 6px;
  min-height: 140px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.choice-card b {
  font-size: 19px;
}

.choice-card span {
  color: var(--muted);
}

.choice-card.primary-choice {
  border-color: #b2ccff;
  background: #f4f8ff;
}

.entry-company-list {
  display: grid;
  gap: 10px;
}

.entry-company-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.entry-company-card:hover {
  border-color: #9dbdff;
  background: #f7faff;
}

.entry-company-card > span {
  display: grid;
  gap: 3px;
}

.entry-company-card strong {
  font-size: 16px;
}

.entry-company-card small {
  color: var(--muted);
}

.entry-company-card > b {
  color: var(--primary);
  font-size: 24px;
}

.unified-entry-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-color: #bad0ff;
  background: #f7faff;
}

.unified-entry-panel h2 {
  margin: 4px 0 6px;
}

.unified-entry-panel p {
  margin: 0;
}

.unified-entry-panel > code {
  max-width: 100%;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid #c9d9fa;
  border-radius: 7px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 14px;
}

.company-entry-table th:nth-child(5) {
  min-width: 360px;
}

.company-entry-cell {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.company-entry-cell code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  white-space: normal;
}

.company-entry-cell small {
  display: block;
}

.disabled-choice {
  pointer-events: none;
  opacity: .55;
}

.personal-slip-list {
  display: grid;
}

.personal-slip-list > a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 88px;
  padding: 16px 4px;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  color: var(--text);
  transition: background .16s ease;
}

.personal-slip-list > a:last-child {
  border-bottom: 0;
}

.personal-slip-list > a:hover {
  background: #f9fbff;
}

.slip-month-block {
  display: grid;
  align-content: center;
  width: 66px;
  min-height: 52px;
  flex: 0 0 auto;
  padding-right: 16px;
  border-right: 1px solid #e4e7ec;
}

.slip-month-block > small {
  color: #98a2b3;
  font-size: 9px;
  font-weight: 600;
}

.slip-month-block > span {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 2px;
}

.slip-month-block strong {
  color: #101828;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.slip-month-block em {
  color: #667085;
  font-size: 10px;
  font-style: normal;
}

.slip-list-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 5px;
  min-width: 0;
}

.slip-list-copy strong {
  color: #101828;
  font-size: 16px;
  letter-spacing: -.01em;
}

.slip-list-copy small,
.slip-list-state {
  color: var(--muted);
}

.slip-list-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slip-list-state {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.slip-status {
  position: relative;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
}

.is-unread .slip-status {
  padding-left: 11px;
  color: #175cd3;
}

.is-unread .slip-status::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f80ed;
  content: "";
  transform: translateY(-50%);
}

.slip-list-state b {
  color: #98a2b3;
  font-size: 22px;
}

.portal-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 40px 20px;
  color: #98a2b3;
  text-align: center;
}

.portal-empty strong {
  color: #475467;
}

.portal-empty span {
  font-size: 12px;
}

.portal-statement-empty {
  min-height: 150px;
  align-content: center;
}

.portal-auth {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .035);
}

.portal-auth h2,
.portal-auth > p {
  margin-top: 0;
}

.portal-auth-mark {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 14px;
  padding: 0 11px;
  border-radius: 7px;
  background: #e6f4f1;
  color: #087443;
  letter-spacing: 0;
  font-weight: 700;
}

.portal-password-input {
  min-height: 46px;
  font-size: 18px;
  letter-spacing: 0;
}

.portal-auth .primary {
  min-height: 44px;
  margin-top: 4px;
}

.portal-forgot-link {
  justify-self: center;
  margin-top: 4px;
  font-size: 13px;
}

.portal-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
}

.portal-actions a {
  padding: 6px 2px;
  color: #667085;
  font-weight: 600;
}

.portal-actions a:hover {
  color: #175cd3;
}

.danger-button {
  color: var(--danger);
  border-color: #f3b7b2;
}

.review-heading {
  align-items: flex-start;
  flex-wrap: wrap;
}

.review-heading-summary {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.review-heading-summary > span {
  display: grid;
  gap: 3px;
  min-width: 112px;
  padding: 9px 11px;
  border: 1px solid #e4e7ec;
  border-radius: 9px;
  background: #f8fafc;
}

.review-heading-summary small {
  color: #667085;
  font-size: 10px;
}

.review-heading-summary b {
  color: #101828;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.review-heading-summary i {
  margin-left: 3px;
  color: #98a2b3;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

@media (max-width: 640px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 116px;
  }

  .user-identity small {
    display: none;
  }

  .unified-entry-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .company-entry-table th:nth-child(5) {
    min-width: 280px;
  }

  .employee-portal {
    padding: 16px 12px 38px;
  }

  .portal-header {
    margin-top: 12px;
    padding: 23px 19px;
    border-radius: 15px;
  }

  .portal-header h1 {
    font-size: 25px;
  }

  .portal-lock {
    max-width: 132px;
    padding-inline: 8px;
    text-align: right;
  }

  .portal-body {
    padding-top: 16px;
  }

  .portal-ledger,
  .portal-document {
    margin-top: 12px;
    border-radius: 15px;
  }

  .portal-ledger-header {
    gap: 14px;
    padding: 24px 19px 21px;
  }

  .portal-ledger-header h1,
  .portal-document-header h1 {
    font-size: 25px;
  }

  .portal-ledger-count {
    min-width: 58px;
    padding-left: 14px;
  }

  .portal-ledger-count strong {
    font-size: 25px;
  }

  .portal-ledger-body {
    padding: 5px 17px 12px;
  }

  .portal-document-header {
    padding: 28px 20px 70px;
  }

  .portal-document-body {
    padding: 0 19px 22px;
  }

  .portal-document-heading {
    gap: 12px;
  }

  .portal-document-header h1 {
    font-size: 28px;
  }

  .portal-identity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: -32px 12px 16px;
    border-radius: 13px;
  }

  .portal-identity-grid > span {
    min-height: 70px;
    padding: 8px 7px;
  }

  .portal-identity-grid > span:first-child {
    padding-left: 7px;
  }

  .portal-identity-grid > span:nth-child(3n) {
    border-right: 0;
  }

  .portal-identity-grid small {
    font-size: 11px;
  }

  .portal-identity-grid strong {
    font-size: 15px;
  }

  .portal-statement-group header,
  .portal-statement-row {
    padding-inline: 15px;
  }

  .portal-statement-heading h2 {
    font-size: 19px;
  }

  .portal-statement-group {
    border-radius: 15px;
  }

  .portal-statement-group header {
    padding-block: 15px;
  }

  .portal-statement-row {
    min-height: 58px;
    padding-block: 15px;
  }

  .portal-statement-row span {
    font-size: 15px;
  }

  .portal-statement-row strong {
    font-size: 17px;
  }

  .review-heading-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .review-heading-summary > span {
    min-width: 0;
    padding: 8px 9px;
  }

  .portal-auth {
    padding: 20px 16px;
  }

  .personal-slip-list > a {
    gap: 12px;
    min-height: 82px;
    padding: 14px 2px;
  }

  .slip-list-state small {
    display: none;
  }

  .slip-month-block {
    width: 58px;
    min-height: 48px;
    padding-right: 12px;
  }

  .slip-month-block strong {
    font-size: 22px;
  }
}

@media print {
  .bare-page:has(.employee-portal) {
    background: #fff;
  }

  .employee-portal {
    width: 100%;
    padding: 0;
  }

  .portal-top,
  .portal-actions,
  .portal-document-footer {
    display: none;
  }

  .portal-ledger,
  .portal-document {
    margin-top: 0;
    border-color: #cfd4dc;
    border-radius: 0;
    box-shadow: none;
  }

  .portal-document-header,
  .portal-ledger-header {
    border-top-color: #175cd3;
  }

  .portal-document-body {
    padding-bottom: 0;
  }
}

main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 28px 36px;
}

main:focus {
  outline: 0;
}

.hero,
.section,
.panel,
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.hero h1,
.section h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.hero p,
.section p {
  margin: 8px 0 0;
  color: var(--muted);
}

.dashboard-hero .actions {
  flex: 0 0 auto;
}

.section {
  padding: 18px;
  margin-top: 16px;
  overflow-x: auto;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.section.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section.compact h1 {
  margin: 0;
}

.section.compact p {
  margin: 4px 0 0;
}

.page-intro > div:first-child {
  max-width: 820px;
}

.page-intro .tag + h1 {
  margin-top: 8px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.workflow-strip span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.workflow-strip span + span {
  border-left: 1px solid var(--line);
}

.workflow-strip b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  font-size: 11px;
}

.workflow-strip .active {
  background: #eff6ff;
  color: var(--primary-dark);
}

.workflow-strip .active b {
  background: var(--primary);
  color: #fff;
}

.workflow-strip .done {
  background: #f0fbf8;
  color: #087443;
}

.workflow-strip .done b {
  background: var(--accent);
  color: #fff;
}

.month-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.month-title h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 23px;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.metric-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: #475467;
}

.action-bar {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.more-menu {
  position: relative;
}

.more-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-soft);
  color: #344054;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.more-menu summary::-webkit-details-marker {
  display: none;
}

.more-menu[open] summary {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.more-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 3;
  display: grid;
  gap: 8px;
  min-width: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.14);
}

.more-menu > div .button,
.more-menu > div button {
  width: 100%;
}

.login-box {
  max-width: 420px;
  margin: 70px auto;
  padding: 26px;
}

.login-box h1 {
  margin: 0 0 14px;
  font-size: 23px;
}

.login-box form {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.import-layout > .section {
  margin-top: 0;
}

.review-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.panel {
  padding: 17px;
  min-width: 0;
}

.panel b {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.15;
}

.panel span {
  color: var(--muted);
}

.panel.stat {
  display: flex;
  flex-direction: column-reverse;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workflow a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.workflow a:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.workflow b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e6f4f1;
  color: var(--accent);
}

.workflow span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.override-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.actions,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar-actions {
  justify-content: flex-end;
}

.employee-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 340px;
}

.employee-row-actions .employee-link-form {
  flex: 1 1 auto;
}

.employee-link-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.employee-link-controls .member-select {
  flex: 1 1 auto;
  min-width: 230px;
}

.review-wecom-name {
  display: block;
  margin-top: 5px;
  color: var(--text);
}

.review-association-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 320px;
  margin-top: 8px;
}

.review-association-actions .employee-link-form {
  flex: 0 0 auto;
  min-width: 0;
}

.review-association-actions .employee-link-controls {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
}

.review-association-actions .employee-link-controls .member-select {
  flex: 0 1 160px;
  width: 160px;
  min-width: 140px;
  max-width: 160px;
}

.review-association-actions button {
  width: auto;
  white-space: nowrap;
}

#review-employee-table td > .review-association-actions + .button {
  margin-top: 8px;
}

.member-select {
  min-height: 40px;
  border-color: #b7d7cf;
  background-color: #f8fcfb;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  color: #263b36;
  font-weight: 600;
}

.member-select:hover:not(:disabled) {
  border-color: var(--accent);
  background-color: #ffffff;
}

.member-select:focus {
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 122, 104, 0.1);
}

.member-select:disabled {
  background-color: #f2f4f7;
  color: #98a2b3;
  box-shadow: none;
}

.member-picker {
  max-width: 820px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.administrator-create {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.administrator-search-field {
  display: grid;
  gap: 5px;
}

.administrator-search-field > span,
.administrator-search-field > small {
  color: var(--muted);
  font-size: 12px;
}

.administrator-search-field input,
.administrator-create button {
  width: 100%;
}

.hero-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.dashboard-company-selector label {
  color: #475467;
}

.attention-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #fedf89;
  background: #fffcf5;
}

.attention-band h2 {
  margin: 2px 0 0;
}

.period-filter-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.period-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.period-filters label {
  min-width: 190px;
}

.filter-summary {
  padding-bottom: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.table-progress {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.table-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #475467;
  font-size: 12px;
}

.table-progress > div b {
  color: var(--text);
}

.table-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef2f6;
}

.table-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.table-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
}

.search-field {
  width: min(420px, 100%);
}

.search-field span {
  font-size: 12px;
}

.inline-form label {
  min-width: 160px;
}

.withdraw-all-form {
  display: grid;
  grid-template-columns: minmax(190px, 280px) auto;
  flex-wrap: nowrap;
  gap: 8px;
  width: auto;
}

.withdraw-all-form input,
.withdraw-all-form button {
  min-width: 0;
  width: auto;
  flex: none;
}

.withdraw-all-form input {
  width: 100%;
}

.withdraw-all-form button {
  white-space: nowrap;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button.primary,
.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

button.danger-button,
.button.danger-button {
  border-color: #fda29b;
  color: var(--danger);
}

.button.ghost {
  min-height: 32px;
  background: var(--panel-soft);
}

button:hover,
.button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

button.primary:hover,
.button.primary:hover {
  color: #ffffff;
  background: var(--primary-dark);
}

form {
  margin: 0;
}

.form-stack {
  display: grid;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 7px 9px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  padding: 0;
}

.form-stack label:has(input[type="checkbox"]),
.save-bar label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #b2ddff;
  outline-offset: 1px;
  border-color: var(--primary);
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

textarea {
  min-height: 110px;
  resize: vertical;
  margin: 8px 0;
}

input[type="hidden"] {
  display: none;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.checkline {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
}

.checkline input {
  width: auto;
  min-height: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #ffffff;
}

.section table {
  margin-top: 4px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

td.wrap {
  max-width: 520px;
  white-space: pre-wrap;
  word-break: break-word;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #344054;
  font-weight: 600;
}

tbody tr:hover td {
  background: #fcfcfd;
}

.empty-row {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 22px;
  color: var(--muted);
  white-space: normal;
  text-align: center;
}

.empty-row strong {
  color: var(--text);
}

ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

code {
  white-space: pre-wrap;
  color: #475467;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #edf4ff;
  color: #175cd3;
}

.tag.ok {
  background: #ecfdf3;
  color: #027a48;
}

.tag.warn {
  background: #fff7e6;
  color: var(--warning);
}

.danger {
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.notice {
  padding: 11px 13px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #7a3f00;
}

.notice-inline {
  color: #8a4b00;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 7px;
  padding: 8px 10px;
}

.success-notice {
  color: #087443;
  background: #ecfdf3;
  border-color: #abefc6;
}

.status-notice {
  margin-top: 16px;
}

.status-notice:focus,
.notice:focus,
.error-panel:focus {
  outline: 3px solid rgba(21, 112, 239, .18);
}

.check-list {
  display: grid;
  gap: 9px;
  padding: 10px 0 4px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check-list label > span {
  display: grid;
  gap: 2px;
}

.check-list label small {
  color: var(--muted);
}

.blocking-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fef3f2;
  color: var(--danger);
}

.blocking-list span::before {
  content: "•";
  margin-right: 7px;
}

.publish-confirm {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 240px) auto;
  align-items: end;
  gap: 16px;
  border-color: #b2ccff;
  background: linear-gradient(110deg, #fff 0%, #f4f8ff 100%);
}

.publish-confirm h2 {
  margin-bottom: 0;
}

.publish-confirm .checkline {
  min-height: 34px;
  color: var(--text);
}

.publish-confirm > small {
  grid-column: 1 / -1;
}

.publish-confirm.is-blocked {
  border-color: #fedf89;
  background: #fffaeb;
}

.sticky-save {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 18px -18px -18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.import-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-context > span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
}

.import-context small,
.config-workspace-header p,
.config-save-bar small {
  color: var(--muted);
}

.payroll-type-panel {
  padding-bottom: 0;
  overflow: hidden;
}

.payroll-type-panel .section-heading {
  align-items: end;
}

.payroll-type-create {
  flex-wrap: nowrap;
  width: min(460px, 100%);
}

.payroll-type-create input {
  min-width: 220px;
}

.payroll-type-tabs {
  display: flex;
  gap: 4px;
  margin: 16px -18px 0;
  padding: 0 18px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: #f8faf9;
}

.payroll-type-tabs a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  white-space: nowrap;
}

.payroll-type-tabs a:hover,
.payroll-type-tabs a[aria-current="page"] {
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
}

.payroll-type-tabs a[aria-current="page"] {
  background: #ffffff;
  font-weight: 700;
}

.payroll-type-tabs small {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e6f4f1;
  color: var(--accent);
  font-size: 10px;
}

.payroll-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #b7d7cf;
  border-radius: 6px;
  background: #f1faf7;
  color: #176b5a;
  font-size: 12px;
  font-weight: 700;
}

.config-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 2px;
}

.config-workspace-header > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
}

.config-type-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.config-type-actions form {
  margin: 0;
}

.config-workspace-header h2,
.config-workspace-header p {
  margin: 0;
}

.config-workspace-header p {
  grid-column: 2;
}

.config-group-create {
  flex-wrap: nowrap;
}

.config-save-bar > span {
  display: grid;
  gap: 2px;
  margin-right: auto;
}

.config-items-section {
  overflow: visible;
  padding-bottom: 92px;
}

.config-items-section > .table-scroll {
  max-height: none;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.config-items-section #config-item-table {
  margin-top: 0;
}

.config-save-bar {
  position: fixed;
  right: 28px;
  bottom: 20px;
  z-index: 8;
  max-width: min(620px, calc(100vw - 300px));
  padding: 12px 14px;
  border: 1px solid #b2ccff;
  border-radius: 9px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 30px rgba(16, 24, 40, .16);
  backdrop-filter: blur(12px);
}

.error-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 26px;
  overflow: visible;
}

.error-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fef3f2;
  color: var(--danger);
  font-size: 22px;
  font-weight: 700;
}

.error-panel p {
  color: var(--danger);
  white-space: pre-wrap;
  word-break: break-word;
}

.employee-link-form {
  min-width: 360px;
  padding: 5px;
  border: 1px solid #dce9e5;
  border-radius: 8px;
  background: #f8faf9;
}

.disclosure-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.disclosure-section > summary::-webkit-details-marker {
  display: none;
}

.disclosure-section > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 20px;
}

.disclosure-section[open] > summary {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.disclosure-section[open] > summary::after {
  content: "−";
}

.disclosure-section > summary > span:first-child {
  display: grid;
  gap: 2px;
}

.disclosure-section > summary small {
  color: var(--muted);
  font-weight: 400;
}

/* Keep compact employee actions on one line on desktop. */
@media (min-width: 901px) {
  .administrator-create button {
    width: auto;
  }

  .company-selector {
    flex-wrap: nowrap;
  }

  .company-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
  }

  .company-selector select {
    width: auto;
    min-width: 150px;
    flex: 1 1 auto;
  }

  .table-scroll .inline-form {
    flex-wrap: nowrap;
    min-width: 270px;
  }

  .table-scroll .inline-form select {
    width: auto;
    min-width: 150px;
    flex: 1 1 auto;
  }

  .table-scroll .inline-form button {
    flex: 0 0 auto;
  }

  .employee-link-form select {
    min-width: 240px;
  }

  .employee-link-controls {
    flex-wrap: nowrap;
  }
}

button[aria-busy="true"] {
  cursor: wait;
}

button[aria-busy="true"]::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin .7s linear infinite;
}

form.is-submitting input,
form.is-submitting select,
form.is-submitting textarea {
  opacity: .72;
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 900px) {
  .pagebar,
  .hero,
  .month-header,
  .section.compact,
  .attention-band,
  .period-filter-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 14px;
  }

  .grid,
  .grid.two,
  .workflow {
    grid-template-columns: 1fr;
  }

  .review-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .publish-confirm {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .publish-confirm > div,
  .publish-confirm > small {
    grid-column: 1 / -1;
  }

  .dashboard-hero .actions,
  .hero-actions,
  .actions,
  .inline-form {
    width: 100%;
  }

  .period-filters {
    width: 100%;
  }

  .filter-summary {
    padding-bottom: 0;
  }

  .action-bar {
    justify-items: stretch;
    width: 100%;
  }

  .actions .button,
  .actions button {
    flex: 1 1 140px;
  }

  .more-menu > div {
    left: 0;
    right: auto;
  }

  .inline-form label,
  .inline-form input,
  .inline-form select,
  .inline-form button {
    min-width: 0;
    flex: 1 1 180px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

}

@media (min-width: 641px) and (max-width: 900px) {
  .portal-identity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-identity-grid > span:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .pagebar {
    position: static;
    padding: 12px 16px;
  }
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-note { display: none; }
  .side-nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 2px; }
  .nav-group { display: flex; gap: 4px; flex: 0 0 auto; }
  .nav-title { display: none; }
  .side-nav a { min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 12px; }
  .side-nav a i { display: none; }
  .hero, .month-hero, .section.compact { display: grid; align-items: start; gap: 14px; padding: 18px; }
  .administrator-create { grid-template-columns: 1fr; max-width: none; }
  .administrator-create button { width: 100%; }
  .workflow-strip { grid-template-columns: 1fr 1fr; }
  .workflow-strip span:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .workflow-strip span:nth-child(4) { border-top: 1px solid var(--line); }
  .actions { width: 100%; }
  .actions .button, .actions form, .actions button { flex: 1 1 auto; }
  .actions .withdraw-all-form { grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .actions .withdraw-all-form input { width: 100%; flex: none; }
  .actions .withdraw-all-form button { width: auto; flex: none; }
  .dashboard-metrics { grid-template-columns: 1fr 1fr; }
  .workflow { grid-template-columns: 1fr 1fr; }
  .slip-grid { grid-template-columns: 1fr; }
  .section:has(table) { overflow: hidden; }
  table { min-width: 680px; }
}

@media (max-width: 520px) {
  body {
    font-size: 13px;
  }

  .brand {
    padding-left: 2px;
  }

  .pagebar h1,
  .hero h1,
  .section h1 {
    font-size: 20px;
  }

  .section,
  .hero,
  .panel {
    padding: 14px;
  }

  .override-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-metrics, .grid.two, .employee-summary, .payslip-detail { grid-template-columns: 1fr; }
  .review-metrics { grid-template-columns: 1fr 1fr; }
  .workflow { grid-template-columns: 1fr; }
  .button, button { width: 100%; }
  .userbar .button { width: auto; }
  .workflow-strip { grid-template-columns: 1fr; }
  .workflow-strip span + span,
  .workflow-strip span:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .file-drop { padding: 16px; }
  .file-drop-visual { align-items: flex-start; flex-wrap: wrap; }
  .file-browse { width: 100%; margin-top: 4px; }
  .slip-view-status { align-items: flex-start; flex-direction: column; gap: 4px; }
  .slip-view-status small { text-align: left; white-space: normal; }
  .portal-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: 10px;
  }
  .portal-identity-grid > span {
    border-right: 1px solid #edf0f4;
    min-height: 68px;
    padding: 8px 7px;
  }
  .portal-identity-grid > span:nth-child(2n),
  .portal-identity-grid > span:last-child {
    border-right: 0;
  }
  .portal-identity-grid small {
    font-size: 12px;
  }
  .portal-identity-grid strong {
    font-size: 16px;
  }
  .employee-link-form { min-width: 300px; }
  .employee-link-controls { align-items: stretch; flex-direction: column; }
  .employee-link-controls .member-select { min-width: 0; width: 100%; }
  .disclosure-section > summary { align-items: flex-start; }
  .publish-confirm { grid-template-columns: 1fr; }
  .publish-confirm > * { grid-column: 1; }
  .error-panel { grid-template-columns: 1fr; margin-top: 14px; }
  .sticky-save { align-items: stretch; flex-direction: column; }
  .config-save-bar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 760px) {
  .payroll-type-panel .section-heading,
  .config-workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .payroll-type-create,
  .config-group-create {
    flex-wrap: wrap;
    width: 100%;
  }

  .payroll-type-tabs {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .config-workspace-header .button {
    width: 100%;
  }

  .config-type-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .config-type-actions form,
  .config-type-actions button {
    width: 100%;
  }

  .config-items-section {
    padding-bottom: 116px;
  }

  .config-save-bar {
    right: 14px;
    bottom: 12px;
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 900px) {
  .audit-log-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .audit-log-filters {
    grid-template-columns: 1fr;
  }
}
