:root {
  --green-950: #0c3029;
  --green-900: #123f35;
  --green-800: #1b5848;
  --green-700: #2e7d5b;
  --green-100: #e5f2eb;
  --green-50: #f1f8f4;
  --gold: #efc266;
  --ink: #17201d;
  --muted: #66736e;
  --line: #dde5e1;
  --line-dark: #cbd7d1;
  --background: #f3f6f4;
  --white: #fff;
  --red: #b54842;
  --red-bg: #fbeceb;
  --amber: #93651a;
  --amber-bg: #fff5dc;
  --blue: #356987;
  --blue-bg: #eaf4fa;
  --shadow: 0 16px 44px rgba(25, 53, 43, .075);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); font-family: "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif; font-size: 14px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; z-index: 30; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px 18px; overflow-y: auto; background: linear-gradient(165deg, var(--green-950), var(--green-900) 55%, #174b3f); color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 0 5px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border-radius: 14px; background: var(--gold); color: #173e34; font-size: 13px; font-weight: 800; letter-spacing: -.03em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand-copy strong, .brand-copy small, .profile-copy strong, .profile-copy small { display: block; }
.brand-copy strong { font-size: 15px; letter-spacing: -.01em; }
.brand-copy small, .profile-copy small { margin-top: 2px; color: #b9cec7; font-size: 10px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 34px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 11px; border-radius: 10px; color: #dceae5; text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-link.active { box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.disabled { color: #9fb8af; cursor: default; }
.nav-link.disabled small { margin-left: auto; padding: 3px 6px; border: 1px solid rgba(255,255,255,.13); border-radius: 99px; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-divider { margin: 22px 10px 8px; color: #88a79d; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 18px 5px 0; border-top: 1px solid rgba(255,255,255,.12); min-width: 0; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 75px; padding: 13px 36px; border-bottom: 1px solid var(--line); background: rgba(243,246,244,.92); backdrop-filter: blur(14px); }
.company-switcher { min-width: min(390px, 45vw); }
.company-switcher label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.company-switcher label > span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.company-switcher select { height: 42px; margin: 0; background-color: #fff; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions form { margin: 0; }
.top-actions .icon-button svg { width: 18px; height: 18px; }
.portal-admin { --admin: #325b86; --admin-dark: #112b45; --admin-soft: #eaf1f8; }
.portal-admin .sidebar { background: linear-gradient(165deg, #0c2136, var(--admin-dark) 56%, #183e60); }
.portal-admin .brand-mark { background: #9fc7eb; color: #102c47; }
.portal-admin .nav-link.active { box-shadow: inset 3px 0 0 #9fc7eb; }
.portal-admin .eyebrow, .portal-admin .back-link, .portal-admin .section-head > a, .portal-admin .row-link { color: var(--admin); }
.portal-admin .button.primary { background: var(--admin); }
.portal-admin .button.primary:hover { background: #294d72; }
.portal-context { display: flex; align-items: center; gap: 10px; }
.portal-context-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; background: var(--admin-soft, var(--green-100)); color: var(--admin, var(--green-700)); }
.portal-context-icon svg { width: 19px; height: 19px; }
.portal-context small, .portal-context strong { display: block; }
.portal-context small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.portal-context strong { margin-top: 2px; font-size: 12px; }
.portal-chip { padding: 6px 9px; border-radius: 999px; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.portal-chip.admin { background: #e4eef8; color: #315d86; }
.portal-chip.company { background: var(--green-100); color: var(--green-700); }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--green-800); text-decoration: none; cursor: pointer; }
.text-button { padding: 9px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.menu-button { display: none; }
.sidebar-overlay { display: none; }
.page-content { padding: 34px 38px 55px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-head h1 { margin: 3px 0 8px; font-size: clamp(30px, 4vw, 43px); line-height: 1.04; letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 7px !important; color: var(--green-700) !important; font-size: 10px !important; font-weight: 800 !important; text-transform: uppercase; letter-spacing: .12em; }
.portal-admin .eyebrow { color: var(--admin) !important; }
.back-link { display: inline-block; margin-bottom: 17px; color: var(--green-700); font-size: 12px; font-weight: 700; text-decoration: none; }
.muted { color: var(--muted); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green-700); color: #fff; }
.button.primary:hover { background: #276d50; }
.button.secondary { border-color: var(--line-dark); background: #fff; color: var(--green-800); }

.card { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.025em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-head > a { color: var(--green-700); font-size: 12px; font-weight: 700; text-decoration: none; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metrics article { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.metrics strong, .metrics span, .metrics small { display: block; }
.metrics strong { font-size: 29px; line-height: 1; letter-spacing: -.04em; }
.metrics span { margin-top: 9px; font-weight: 700; }
.metrics small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 16px; }
.phase-card { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(240px, .8fr) auto; align-items: center; gap: 24px; margin-top: 16px; background: linear-gradient(135deg, #fff, #f7fbf8); }
.phase-card h2 { margin: 3px 0 5px; }
.phase-card p { margin: 0; color: var(--muted); }
.phase-card > strong { color: var(--green-700); font-size: 12px; white-space: nowrap; }
.phase-progress { height: 8px; border-radius: 999px; background: #e8eeeb; overflow: hidden; }
.phase-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-700), #66a584); }

.avatar { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 12px; background: var(--green-100); color: var(--green-800); font-size: 11px; font-weight: 800; }
.avatar.large { width: 48px; height: 48px; border-radius: 15px; font-size: 13px; }
.avatar.inverse { background: rgba(255,255,255,.11); color: #fff; }
.compact-list, .activity-list, .user-list, .audit-list { display: grid; }
.list-row, .user-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px 5px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.list-row:first-child, .user-row:first-child { border-top: 0; }
.list-row:hover, .user-row:hover, .user-row.selected { background: var(--green-50); }
.portal-admin .user-row:hover, .portal-admin .user-row.selected { background: var(--admin-soft); }
.list-row > span:nth-child(2), .user-row > span:nth-child(2) { min-width: 0; }
.list-row strong, .list-row small, .user-row strong, .user-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small, .user-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.activity-item { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; padding: 12px 3px; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 12px; }
.activity-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.activity-dot { width: 8px; height: 8px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: var(--green-700); box-shadow: 0 0 0 2px var(--green-100); }

.status { display: inline-flex; align-items: center; width: max-content; padding: 6px 9px; border-radius: 999px; background: #eef2f0; color: #56645e; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.status.active { background: #e1f3e8; color: #236645; }
.status.inactive, .status.archived, .status.retired { background: #eff1f0; color: #748079; }
.status.draft { background: var(--amber-bg); color: var(--amber); }
.status.on_leave, .status.on_hold { background: var(--amber-bg); color: var(--amber); }
.status.terminated { background: var(--red-bg); color: var(--red); }
.status.valid, .status.imported, .status.completed { background: #e1f3e8; color: #236645; }
.status.invalid, .status.failed, .status.completed_with_errors { background: var(--red-bg); color: var(--red); }
.status.processing, .status.validated { background: var(--blue-bg); color: var(--blue); }
.status.neutral { background: #eef2f0; color: var(--muted); }
.alert { margin-bottom: 16px; padding: 12px 15px; border: 1px solid; border-radius: 11px; font-size: 12px; }
.alert.error { border-color: #eac8c5; background: var(--red-bg); color: #893d38; }
.alert.success { border-color: #bddbc9; background: #e8f5ed; color: #236645; }

.directory-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 17px; align-items: start; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.search-field { flex: 1; max-width: 480px; }
.search-field > span, .toolbar label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.company-card { display: flex; flex-direction: column; min-height: 210px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.company-card:hover { transform: translateY(-2px); border-color: #9bbdac; }
.company-card-head { display: flex; align-items: flex-start; justify-content: space-between; }
.company-card h2 { margin: 20px 0 5px; font-size: 18px; letter-spacing: -.02em; }
.company-card p { margin: 0; color: var(--muted); font-size: 11px; }
.company-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.company-stats small, .company-stats strong { display: block; }
.company-stats small { color: var(--muted); font-size: 9px; }
.company-stats strong { margin-top: 2px; font-size: 12px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr); gap: 17px; align-items: start; }
.side-stack { display: grid; gap: 15px; }
.readiness-card h2, .next-card h2 { margin: 4px 0 15px; }
.next-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.readiness-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.readiness-item > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: #eef1f0; color: var(--muted); font-weight: 800; }
.readiness-item.ready > span { background: var(--green-100); color: var(--green-700); }
.readiness-item strong { font-size: 11px; }
.readiness-item small { color: var(--muted); font-size: 9px; }

.form-card { padding: 22px; }
.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payroll-month-bar, .payroll-month-form { display: flex; align-items: end; gap: 16px; }
.payroll-month-bar { justify-content: space-between; margin-bottom: 20px; }
.payroll-month-form label { min-width: 190px; }
.payroll-month-count { text-align: right; }
.payroll-month-count strong, .payroll-month-count span { display: block; }
.payroll-month-count strong { font-size: 23px; }
.payroll-month-count span { color: var(--muted); font-size: 11px; }
.payroll-detail-head { margin: 10px 0 16px; }
.payroll-detail-head .back-link { margin-bottom: 8px; }
.payroll-detail-head h2 { margin: 0 0 3px; font-size: 25px; }
.payroll-detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.payroll-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); gap: 16px; align-items: start; }
.payroll-items-grid { margin-top: 16px; }
label { color: #35423d; font-size: 11px; font-weight: 700; }
label small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.4; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid var(--line-dark); border-radius: 9px; outline: none; background: #fff; color: var(--ink); transition: border .15s ease, box-shadow .15s ease; }
input, select { min-height: 41px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: #71a68d; box-shadow: 0 0 0 3px rgba(46,125,91,.11); }
fieldset { min-width: 0; margin: 4px 0 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 7px; color: var(--green-800); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.narrow-card { max-width: 560px; }
.check-line { display: flex; align-items: center; gap: 9px; }
.check-line input, .check-card input { width: auto; min-height: 0; margin: 0; accent-color: var(--green-700); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.check-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.check-card strong, .check-card small { display: block; }
.check-card strong { font-size: 11px; }
.check-card small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }
.company-checks { max-height: 250px; margin-top: 12px; overflow-y: auto; }

.users-layout { display: grid; grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr); gap: 17px; align-items: start; }
.list-card { padding: 20px; }
.user-row { padding-inline: 8px; border-radius: 10px; }
.user-access-form { padding: 24px; }
.fieldset-help { margin: 0 0 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.company-assignment-list { display: grid; gap: 10px; }
.company-assignment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .55fr); align-items: center; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfb; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.company-assignment.selected { border-color: #8cb7a2; background: var(--green-50); box-shadow: 0 0 0 2px rgba(46,125,91,.08); }
.portal-admin .company-assignment.selected { border-color: #9cb9d1; background: #f3f7fb; box-shadow: 0 0 0 2px rgba(50,91,134,.08); }
.assignment-toggle { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; cursor: pointer; }
.assignment-toggle > span:last-child strong, .assignment-toggle > span:last-child small { display: block; }
.assignment-toggle > span:last-child small { margin-top: 3px; }
.assignment-role { font-size: 9px; }
.assignment-role select { margin-top: 4px; }
.assignment-role select:disabled { opacity: .62; background-color: #f3f6f5; cursor: not-allowed; }
.assignment-role .role-help { display: block; min-height: 30px; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.toggle-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fafcfb; cursor: pointer; }
.toggle-line span strong, .toggle-line span small { display: block; }
.toggle-line span small { margin-top: 3px; }
.toggle-input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; }
.toggle-input + i { position: relative; display: inline-block; width: 39px; height: 22px; border-radius: 999px; background: #cbd5d0; transition: background .15s ease; }
.toggle-input + i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform .15s ease; }
.toggle-input:checked + i { background: var(--green-700); }
.portal-admin .toggle-input:checked + i { background: var(--admin); }
.toggle-input:checked + i::after { transform: translateX(17px); }
.toggle-input:focus-visible + i { outline: 3px solid rgba(46,125,91,.2); outline-offset: 2px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.role-card { min-height: 245px; }
.role-card h2 { margin: 18px 0 6px; }
.role-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.role-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green-100); color: var(--green-700); font-weight: 800; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.permission-tags span { padding: 5px 7px; border-radius: 7px; background: #f0f4f2; color: #4d5d56; font-size: 8px; font-weight: 700; }

.statutory-page-head { align-items: center; }
.statutory-page-head > div { max-width: 780px; }
.statutory-safety-note { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #d8c68f; border-radius: 999px; background: #fffaf0; color: #775716; font-size: 10px; font-weight: 800; white-space: nowrap; }
.statutory-safety-note::before { content: "\2713"; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #f4df9d; }
.statutory-shell { display: grid; gap: 18px; }
.statutory-register { padding: 0; overflow: hidden; }
.statutory-register > .section-head { align-items: center; margin: 0; padding: 22px; }
.statutory-register-count { padding: 7px 10px; border-radius: 999px; background: var(--green-100); color: var(--green-700); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.statutory-empty { display: flex; align-items: center; gap: 16px; margin: 0 22px 22px; padding: 20px; border: 1px dashed #b8cfc4; border-radius: 13px; background: var(--green-50); }
.statutory-empty > span { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--green-700); font-family: Georgia, serif; font-size: 23px; }
.statutory-empty strong, .statutory-empty p { display: block; }
.statutory-empty p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.statutory-table td:nth-child(1) { min-width: 220px; }
.statutory-table td:nth-child(2) { min-width: 250px; color: #394741; }
.statutory-table td:nth-child(3) { min-width: 145px; }
.statutory-builder { padding: 0; overflow: hidden; }
.statutory-builder-head { align-items: center; margin: 0; padding: 25px 27px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff, #f6faf8); }
.statutory-builder-head > span { color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.statutory-form { gap: 0; }
.statutory-step { margin: 0; padding: 28px 27px 31px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.statutory-step:last-child { border-bottom: 0; }
.statutory-step > legend { display: flex; align-items: center; gap: 9px; padding: 0; color: var(--ink); font-size: 14px; text-transform: none; letter-spacing: 0; }
.statutory-step > legend span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: var(--green-800); color: #fff; font-size: 11px; }
.statutory-template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 12px; }
.statutory-template-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; min-height: 112px; padding: 15px; border: 1px solid var(--line-dark); border-radius: 13px; background: #fff; cursor: pointer; transition: border .15s ease, box-shadow .15s ease, background .15s ease; }
.statutory-template-card:hover { border-color: #8fb7a4; background: #fbfefc; }
.statutory-template-card:has(input:checked) { border-color: var(--green-700); background: var(--green-50); box-shadow: 0 0 0 2px rgba(46,125,91,.11); }
.statutory-template-card input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.statutory-template-card > span:nth-of-type(2) { min-width: 0; }
.statutory-template-card strong, .statutory-template-card small { display: block; }
.statutory-template-card strong { color: var(--ink); font-size: 11px; line-height: 1.3; }
.statutory-template-card small { margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.45; }
.statutory-template-card i { position: absolute; top: 9px; right: 9px; display: none; width: 18px; height: 18px; border-radius: 50%; background: var(--green-700); color: #fff; font-size: 10px; font-style: normal; place-items: center; }
.statutory-template-card:has(input:checked) i { display: grid; }
.template-badge { display: grid !important; place-items: center; min-width: 38px; height: 38px; padding: 0 7px; border-radius: 10px; background: #eef3f0; color: var(--green-800); font-size: 9px; font-weight: 900; }
.statutory-template-card:has(input:checked) .template-badge { background: #d9ecdf; }
.statutory-common-fields { margin-top: 13px; }
.optional-label { margin-left: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }
.statutory-panel { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfb; }
.statutory-panel[hidden] { display: none; }
.statutory-panel-intro { margin-bottom: 14px; }
.statutory-panel-intro strong { font-size: 12px; }
.statutory-panel-intro p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.money-input { position: relative; display: block; }
.money-input b { position: absolute; z-index: 1; left: 11px; top: 19px; color: var(--muted); font-size: 9px; }
.money-input input { padding-left: 43px; }
.statutory-band-table { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.statutory-band-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 9px 12px 9px 43px; background: #f1f5f3; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.statutory-band-row { display: grid; grid-template-columns: 22px repeat(3, minmax(0, 1fr)); align-items: center; gap: 10px; padding: 9px 11px; border-top: 1px solid var(--line); }
.statutory-band-row:first-child { border-top: 0; }
.statutory-band-row > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--green-100); color: var(--green-700); font-size: 9px; font-weight: 800; }
.statutory-band-row input { min-width: 0; min-height: 37px; margin: 0; }
.statutory-add-band { min-height: 36px; margin-top: 11px; padding: 7px 11px; font-size: 10px; }
.statutory-check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.statutory-example { margin-top: 17px; padding: 17px 19px; border: 1px solid #c7dced; border-radius: 12px; background: var(--blue-bg); }
.statutory-example > span { display: block; margin-bottom: 6px; color: var(--blue); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.statutory-example strong { display: block; color: #244f68; font-size: 12px; }
.statutory-example p { margin: 5px 0 0; color: #52758a; font-size: 9px; line-height: 1.5; }
.statutory-source-grid { align-items: start; margin-top: 13px; }
.statutory-activation { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; margin-top: 17px; padding: 15px; border: 1px solid #e3d39f; border-radius: 12px; background: #fffbef; cursor: pointer; }
.statutory-activation input { width: auto; min-height: 0; margin: 2px 0 0; accent-color: var(--green-700); }
.statutory-activation strong, .statutory-activation small { display: block; }
.statutory-activation strong { color: #52451d; font-size: 11px; }
.statutory-activation small { margin-top: 4px; color: #827447; font-size: 9px; font-weight: 400; line-height: 1.45; }
.statutory-submit { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; }
.statutory-submit > span { color: var(--muted); font-size: 10px; }
.statutory-submit > span strong { color: var(--ink); }
.table-card { padding: 0; overflow: hidden; }
.table-card > .section-head { padding: 22px 22px 0; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f4f7f5; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
td { font-size: 11px; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.empty-cell { padding: 40px; color: var(--muted); text-align: center; }

.audit-card { padding: 0; overflow: hidden; }
.audit-filter { justify-content: flex-start; margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.audit-filter label { min-width: 260px; }
.audit-entry { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 13px; padding: 17px 21px; border-top: 1px solid var(--line); }
.audit-entry:first-child { border-top: 0; }
.audit-icon { width: 11px; height: 11px; margin-top: 4px; border: 2px solid var(--green-700); border-radius: 50%; box-shadow: 0 0 0 4px var(--green-100); }
.audit-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.audit-entry-head strong { font-size: 12px; }
.audit-entry-head time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.audit-entry p { margin: 5px 0; color: var(--muted); font-size: 10px; }
.audit-action { color: var(--green-700); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }

.empty-state { grid-column: 1 / -1; display: grid; place-items: center; min-height: 180px; padding: 30px; border: 1px dashed var(--line-dark); border-radius: 14px; background: #fff; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--green-100); color: var(--green-700); font-size: 20px; }
.empty-state strong { margin-top: 12px; }
.empty-state p { max-width: 340px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* Module 4: employee management */
.employee-company-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.company-select-card { border: 1px solid var(--line); text-align: left; }
.company-select-card .button { margin-top: auto; }
.employee-metrics article { min-height: 125px; }
.employee-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, .55fr); gap: 17px; align-items: start; }
.employee-filter { display: grid; grid-template-columns: minmax(260px, 1fr) 180px auto; align-items: end; gap: 12px; margin-bottom: 15px; padding: 16px; }
.employee-filter .search-field { max-width: none; }
.employee-table-card { padding: 0; overflow: hidden; }
.employee-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.employee-cell > span:last-child { min-width: 0; }
.employee-table-card td > small { margin-top: 6px; }
.row-link { color: var(--green-700); font-size: 10px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.employee-create-card { max-height: calc(100vh - 105px); overflow-y: auto; }
.employee-head-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.employee-detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 17px; align-items: start; }
.employee-side-stack { display: grid; gap: 15px; }
.employee-profile-card { min-width: 0; }
.effective-date-field { padding: 13px; border: 1px solid #cce0d5; border-radius: 11px; background: var(--green-50); }
.sensitive-grid { padding-top: 13px; border-top: 1px dashed var(--line-dark); }
.sensitive-notice { grid-column: 1 / -1; padding: 13px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-size: 10px; }
.mini-list { display: grid; }
.mini-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.mini-list article:first-child { border-top: 0; }
.mini-list strong, .mini-list small { display: block; }
.mini-list strong { font-size: 11px; }
.mini-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.mini-list em { color: var(--green-700); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.small-copy { font-size: 10px; }
.inline-create { margin-top: 14px; border-top: 1px solid var(--line); }
.inline-create > summary { padding: 13px 0 0; color: var(--green-700); font-size: 10px; font-weight: 800; cursor: pointer; list-style: none; }
.inline-create > summary::before { content: "+"; display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 7px; border-radius: 6px; background: var(--green-100); }
.inline-create[open] > summary { margin-bottom: 14px; }
.employee-history-card { margin-top: 17px; }
.history-timeline { display: grid; }
.history-timeline article { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 11px; min-height: 58px; }
.history-timeline article:not(:last-child)::before { content: ""; position: absolute; top: 15px; bottom: -2px; left: 5px; width: 1px; background: var(--line-dark); }
.history-marker { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid var(--green-700); border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--green-100); }
.history-timeline strong, .history-timeline small { display: block; }
.history-timeline strong { font-size: 11px; }
.history-timeline small { margin-top: 4px; color: var(--muted); font-size: 9px; }

/* Module 5: spreadsheet imports */
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-bottom: 17px; }
.import-action-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 17px; align-items: start; }
.import-action-card h2 { margin: 3px 0 6px; font-size: 21px; }
.import-action-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.import-card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--green-100); color: var(--green-800); font-weight: 800; }
.template-link { grid-column: 1 / -1; color: var(--green-700); font-size: 11px; font-weight: 800; text-decoration: none; }
.template-link::before { content: "↓"; display: inline-block; margin-right: 7px; }
.upload-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line); }
.upload-form input[type="file"] { padding: 7px; background: #fbfcfb; }
.upload-form input[type="file"]::file-selector-button { margin-right: 9px; padding: 8px 10px; border: 0; border-radius: 7px; background: var(--green-100); color: var(--green-800); font-weight: 700; cursor: pointer; }
.batch-card { padding: 0; overflow: hidden; }
.batch-card > .section-head { padding: 22px 22px 0; }
.import-decision { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; background: linear-gradient(135deg, #fff, var(--green-50)); }
.import-decision h2 { margin: 0 0 5px; font-size: 20px; }
.import-decision p { margin: 0; color: var(--muted); font-size: 11px; }
.import-review-card { padding: 0; overflow: hidden; }
.import-row.invalid { background: #fff9f8; }
.validation-error { display: block; max-width: 330px; margin-top: 5px; color: var(--red); font-size: 9px; line-height: 1.35; }

.company-workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; max-width: 1060px; }
.workspace-choice-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); text-align: left; transition: transform .15s ease, border-color .15s ease; }
.workspace-choice-card:hover { transform: translateY(-2px); border-color: #9abaaa; }
.company-logo { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border-radius: 13px; background: var(--green-100); color: var(--green-800); font-size: 11px; font-weight: 900; }
.company-logo.large { width: 54px; height: 54px; border-radius: 16px; font-size: 14px; }
.workspace-choice-copy { min-width: 0; }
.workspace-choice-copy small, .workspace-choice-copy strong, .workspace-choice-copy em { display: block; }
.workspace-choice-copy small { color: var(--green-700); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.workspace-choice-copy strong { margin-top: 3px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-choice-copy em { margin-top: 4px; color: var(--muted); font-size: 9px; font-style: normal; }
.workspace-open { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 11px; background: var(--green-700); color: #fff; font-size: 17px; cursor: pointer; }
.workspace-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 23px; border: 1px solid #cfe0d7; border-radius: 18px; background: linear-gradient(135deg, #fff, var(--green-50)); box-shadow: var(--shadow); }
.workspace-welcome > div { display: flex; align-items: center; gap: 15px; }
.workspace-welcome h2 { margin: 2px 0 5px; font-size: 20px; }
.workspace-welcome p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.company-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.company-action-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: inherit; box-shadow: var(--shadow); text-decoration: none; }
.company-action-card > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--green-100); color: var(--green-700); }
.company-action-card > span svg { width: 20px; height: 20px; }
.company-action-card strong, .company-action-card small { display: block; }
.company-action-card small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.company-action-card b { color: var(--green-700); font-size: 9px; white-space: nowrap; }
.company-action-card.upcoming { box-shadow: none; opacity: .72; }

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 28px; background: radial-gradient(circle at 15% 15%, rgba(239,194,102,.17), transparent 26%), linear-gradient(135deg, #0c3029, #1a5446); }
.auth-page.admin-auth { background: radial-gradient(circle at 12% 18%, rgba(136,190,235,.2), transparent 28%), linear-gradient(135deg, #091c2d, #193f61); }
.admin-auth .button.primary { background: #325b86; }
.admin-auth .button.primary:hover { background: #294d72; }
.auth-layout { display: grid; grid-template-columns: minmax(310px, .9fr) minmax(420px, 1fr); width: min(100%, 980px); min-height: 620px; overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: 26px; background: rgba(255,255,255,.98); box-shadow: 0 35px 90px rgba(0,0,0,.26); }
.auth-visual { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 42px; overflow: hidden; background: linear-gradient(145deg, rgba(11,49,41,.96), rgba(29,92,73,.9)); color: #fff; }
.admin-auth .auth-visual { background: linear-gradient(145deg, #0b2237, #25557e); }
.auth-visual::before { content: ""; position: absolute; width: 340px; height: 340px; top: -135px; right: -130px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.auth-visual-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: auto; border-radius: 16px; background: rgba(255,255,255,.12); }
.auth-visual-icon svg { width: 26px; height: 26px; }
.auth-visual .eyebrow { color: #cde3d9 !important; }
.admin-auth .auth-visual .eyebrow { color: #d5e8f8 !important; }
.auth-visual h2 { max-width: 360px; margin: 5px 0 12px; font-size: 36px; line-height: 1.05; letter-spacing: -.045em; }
.auth-visual > p:not(.eyebrow) { max-width: 390px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.65; }
.auth-benefits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 27px; }
.auth-benefits span { padding: 7px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: rgba(255,255,255,.84); font-size: 8px; font-weight: 700; }
.auth-card { width: 100%; padding: 48px 46px; background: #fff; }
.auth-intro { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.auth-intro strong, .auth-intro small { display: block; }
.auth-intro strong { font-size: 14px; }
.auth-intro small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.auth-copy { margin-bottom: 24px; }
.auth-copy h1 { margin: 10px 0 9px; font-size: 35px; line-height: 1.05; letter-spacing: -.045em; }
.auth-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.portal-pill { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.portal-pill.admin { background: #e6eff8; color: #315e87; }
.portal-pill.company { background: var(--green-100); color: var(--green-700); }
.company-mark { background: var(--green-100); color: var(--green-800); }
.auth-form .button { width: 100%; margin-top: 3px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 62px; }
.password-field button { position: absolute; right: 7px; top: 13px; padding: 7px 8px; border: 0; border-radius: 7px; background: #eef3f0; color: var(--green-700); font-size: 8px; font-weight: 800; cursor: pointer; }
.admin-auth .password-field button { background: #eaf1f8; color: #315e87; }
.portal-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 21px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 9px; }
.portal-switch span { color: var(--muted); }
.portal-switch a { color: var(--green-700); font-weight: 800; text-decoration: none; }
.admin-auth .portal-switch a { color: #315e87; }
.auth-note { margin: 17px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
.setup-steps { margin-top: 22px; padding: 17px; border-radius: 12px; background: #f3f7f5; }
.setup-steps ol { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.setup-steps code { font-size: 10px; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .directory-layout { grid-template-columns: 1fr; }
  .statutory-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-card { max-width: none; }
  .company-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .employee-layout, .employee-detail-layout { grid-template-columns: 1fr; }
  .payroll-detail-grid { grid-template-columns: 1fr; }
  .import-grid { grid-template-columns: 1fr; }
  .employee-create-card { max-height: none; }
  .phase-card { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; width: min(100%, 560px); }
  .auth-visual { min-height: 260px; padding: 32px; }
  .auth-visual-icon { margin-bottom: 70px; }
  .auth-visual h2 { font-size: 30px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: 245px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.22); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 25; inset: 0; border: 0; background: rgba(9, 26, 21, .45); }
  .sidebar-open .sidebar-overlay { display: block; }
  .menu-button { display: grid; }
  .topbar { padding-inline: 22px; }
  .page-content { padding: 28px 22px 45px; }
  .company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .users-layout, .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .company-switcher { min-width: 0; flex: 1; }
  .company-switcher label { display: block; }
  .company-switcher label > span { display: none; }
  .top-actions .text-button { padding-inline: 6px; font-size: 10px; }
  .top-actions .portal-chip { display: none; }
  .page-content { padding: 23px 15px 38px; }
  .page-head { display: block; }
  .page-head > .button, .page-head > .status { margin-top: 14px; }
  .payroll-month-bar { align-items: stretch; flex-direction: column; }
  .payroll-month-form { align-items: end; }
  .payroll-month-form label { min-width: 0; flex: 1; }
  .payroll-month-count { text-align: left; }
  .metrics, .company-grid, .role-grid, .form-grid.two, .check-grid, .company-workspace-grid, .company-action-grid { grid-template-columns: 1fr; }
  .company-assignment { grid-template-columns: 1fr; }
  .workspace-welcome { align-items: flex-start; flex-direction: column; }
  .workspace-welcome > div { align-items: flex-start; }
  .employee-filter { grid-template-columns: 1fr; }
  .upload-form { grid-template-columns: 1fr; }
  .import-decision { align-items: stretch; flex-direction: column; }
  .employee-head-status { justify-content: flex-start; margin-top: 14px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .statutory-page-head { align-items: flex-start; }
  .statutory-safety-note { margin-top: 14px; }
  .statutory-builder-head { align-items: flex-start; padding: 21px; }
  .statutory-builder-head > span { display: none; }
  .statutory-step { padding: 24px 20px 27px; }
  .statutory-template-grid, .statutory-check-grid { grid-template-columns: 1fr; }
  .statutory-template-card { min-height: 0; }
  .statutory-band-head { padding-left: 11px; }
  .statutory-band-head span:first-child { grid-column: 1; }
  .statutory-band-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .statutory-band-row > span { display: none; }
  .statutory-submit { align-items: stretch; flex-direction: column; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .audit-entry-head { display: block; }
  .audit-entry-head time { display: block; margin-top: 4px; }
  .auth-page { padding: 14px; }
  .auth-layout { min-height: 0; border-radius: 20px; }
  .auth-visual { display: none; }
  .auth-card { padding: 29px 22px; }
  .portal-switch { align-items: flex-start; flex-direction: column; }
}
