:root {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe4ee;
  --line-strong: #c7d4e2;
  --text: #172033;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --emerald: #047857;
  --emerald-soft: #dff7ea;
  --amber: #b45309;
  --amber-soft: #fff3d6;
  --rose: #be123c;
  --rose-soft: #ffe4e8;
  --sidebar-bg: #111827;
  --sidebar-line: rgba(255, 255, 255, 0.12);
  --sidebar-text: #e5edf7;
  --sidebar-muted: #9fb0c3;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111821;
  --surface: #182230;
  --surface-soft: #121b27;
  --line: #2d3b4c;
  --line-strong: #46586d;
  --text: #edf4fb;
  --muted: #9caec3;
  --blue: #60a5fa;
  --blue-dark: #3b82f6;
  --emerald: #34d399;
  --emerald-soft: #143629;
  --amber: #fbbf24;
  --amber-soft: #3b2e13;
  --rose: #fb7185;
  --rose-soft: #3d1821;
  --sidebar-bg: #0b1220;
  --sidebar-line: rgba(255, 255, 255, 0.13);
  --sidebar-text: #e5edf7;
  --sidebar-muted: #9caec3;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

select,
textarea,
input {
  font: inherit;
}

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

.app-shell.has-drawer {
  grid-template-columns: 244px minmax(0, 1fr) 390px;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.sidebar-collapsed.has-drawer {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.sidebar {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 6px 14px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.brand span,
.sidebar-foot span {
  display: block;
  color: var(--sidebar-muted);
  font-size: 12px;
  margin-top: 2px;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.rail-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  cursor: pointer;
}

.rail-toggle:hover,
.rail-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  outline: none;
}

.rail-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.topbar-menu-toggle {
  color: var(--muted);
  border-color: var(--line);
  background: #ffffff;
}

.topbar-menu-toggle:hover,
.topbar-menu-toggle:focus-visible {
  color: var(--blue);
  border-color: #bfdbfe;
  background: #eff6ff;
}

html[data-theme="dark"] .topbar-menu-toggle {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}

html[data-theme="dark"] .topbar-menu-toggle:hover,
html[data-theme="dark"] .topbar-menu-toggle:focus-visible {
  color: var(--blue);
  border-color: color-mix(in oklab, var(--blue) 42%, var(--line));
  background: color-mix(in oklab, var(--blue) 12%, var(--surface));
}

.company-brand-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
}

.company-brand-card:hover,
.company-brand-card:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.company-brand-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.45);
}

.company-brand-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.company-brand-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e6f7ed;
  color: #065f46;
  font-size: 14px;
  font-weight: 900;
}

.company-brand-logo-image {
  object-fit: contain;
}

html[data-theme="dark"] .company-brand-logo {
  background: #143629;
  color: #86efac;
}

.company-brand-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.company-brand-meta strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-brand-meta span {
  overflow: hidden;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-switcher {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sidebar-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--sidebar-text);
  cursor: pointer;
}

.company-switcher:hover,
.company-switcher:focus-within {
  background: rgba(255, 255, 255, 0.12);
}

.company-switcher svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.company-switcher .company-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.company-switcher .company-select:focus {
  outline: none;
}

.sidebar-collapsed .sidebar {
  padding: 16px 10px;
  align-items: center;
}

.sidebar-collapsed .brand {
  width: 100%;
  justify-content: center;
  padding: 4px 0 10px;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .company-brand-card,
.sidebar-collapsed .nav-list {
  display: none;
}

.mobile-sidebar-scrim {
  display: none;
}

.nav-list {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.nav-item,
.link-button {
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  border-radius: 7px;
  padding: 10px 11px;
  cursor: pointer;
}

.nav-item {
  color: #b9c7d8;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 8px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.compact-brand {
  color: var(--text);
  border-bottom-color: var(--line);
  padding-left: 0;
}

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

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

.login-actions {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
}

.login-error {
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
}

.login-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.link-button {
  padding: 0;
  color: #bfdbfe;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  overflow-x: hidden;
  padding: 18px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.home-topbar {
  min-height: 54px;
  margin-bottom: 4px;
}

.workflow-topbar {
  min-height: 54px;
  margin-bottom: 10px;
}

.topbar-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.2;
}

.product-breadcrumb strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.workflow-back-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.workflow-back-button:hover,
.workflow-back-button:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.workflow-back-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crumb,
.section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  line-height: 1.25;
}

.topbar-actions,
.button-row,
.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell-actions {
  position: relative;
  gap: 7px;
}

.state-chip,
.quiet-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.state-chip {
  color: #1e3a8a;
  background: #dbeafe;
}

html[data-theme="dark"] .state-chip {
  color: #bfdbfe;
  background: #17263a;
}

.state-finalised,
.state-payslips_generated,
.state-payment_exported,
.state-accounting_posted,
.state-locked {
  color: #065f46;
  background: var(--emerald-soft);
}

html[data-theme="dark"] .state-finalised,
html[data-theme="dark"] .state-payslips_generated,
html[data-theme="dark"] .state-payment_exported,
html[data-theme="dark"] .state-accounting_posted,
html[data-theme="dark"] .state-locked {
  color: #86efac;
  background: #143629;
}

.quiet-chip {
  color: var(--muted);
  background: #e8eef5;
}

html[data-theme="dark"] .quiet-chip {
  color: #cbd5e1;
  background: #243244;
}

.primary-button,
.secondary-button,
.mini-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 34px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

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

.primary-button:hover {
  background: var(--blue-dark);
}

html[data-theme="dark"] .primary-button {
  background: #2563eb;
  color: #ffffff;
}

html[data-theme="dark"] .primary-button:hover {
  background: #1d4ed8;
}

.secondary-button,
.mini-button,
.icon-button {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
}

.secondary-button:hover,
.mini-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
}

html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .mini-button,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .workflow-back-button,
html[data-theme="dark"] .select-control,
html[data-theme="dark"] .login-form input,
html[data-theme="dark"] .import-textarea {
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .mini-button:hover,
html[data-theme="dark"] .icon-button:hover {
  background: var(--surface-soft);
}

.profile-menu-trigger {
  cursor: pointer;
}

.profile-menu-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-menu {
  position: relative;
}

.profile-menu > summary {
  list-style: none;
}

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

.profile-menu-trigger {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.profile-menu[open] .profile-menu-trigger {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-menu-group {
  display: grid;
  gap: 7px;
}

.profile-menu-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.profile-segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.profile-segmented button.active {
  background: var(--blue);
  color: #ffffff;
}

html[data-theme="dark"] .profile-segmented button.active {
  background: #2563eb;
}

.profile-menu-actions {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.profile-menu-actions .secondary-button {
  width: 100%;
}

.branding-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
}

.branding-dialog-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(3px);
  cursor: default;
}

html[data-theme="dark"] .branding-dialog-scrim {
  background: rgba(2, 6, 23, 0.54);
}

.branding-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.branding-dialog:focus {
  outline: none;
}

.branding-dialog-header,
.branding-dialog-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.branding-dialog-header h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.1;
}

.branding-dialog-close {
  font-size: 22px;
  font-weight: 850;
}

.branding-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  gap: 16px;
  align-items: start;
  overflow: auto;
  padding: 18px;
}

.branding-dialog-fields {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.branding-dialog-preview {
  position: sticky;
  top: 0;
  min-width: 0;
}

.branding-dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.branding-dialog-footer > div {
  min-width: 0;
  margin-right: auto;
  display: grid;
  gap: 2px;
}

.branding-dialog-footer span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.branding-dialog-footer strong {
  color: var(--text);
  font-size: 13px;
}

.profile-logo-upload-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-logo-preview {
  width: 58px;
  height: 58px;
  border-radius: 10px;
}

.profile-logo-upload-row strong,
.brand-color-editor strong,
.brand-live-preview strong {
  display: block;
  color: var(--text);
}

.profile-logo-upload-row p,
.brand-color-editor p {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.brand-color-editor {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.brand-color-editor-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

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

.brand-color-field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.brand-color-field small {
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.brand-color-control {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.brand-color-control input[type="color"] {
  width: 38px;
  height: 38px;
  padding: 2px;
  border-radius: 999px;
}

.brand-color-text {
  min-width: 0;
}

.brand-live-preview {
  display: grid;
  padding: 14px;
  border: 1px solid color-mix(in oklab, var(--brand-primary) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--brand-secondary) 54%, var(--surface)) 0%, var(--surface) 74%);
}

.payslip-preview-paper {
  overflow: hidden;
  border: 1px solid #d9e2ee;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 18px 36px color-mix(in oklab, var(--brand-primary) 12%, transparent);
}

.payslip-preview-accent {
  height: 6px;
  background: var(--brand-primary);
}

.payslip-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid #e5edf5;
}

.payslip-preview-company {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.payslip-preview-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid #d9e2ee;
  background: var(--brand-secondary);
  color: var(--brand-primary);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 850;
}

.payslip-preview-logo.company-brand-logo-image {
  object-fit: contain;
  background: #ffffff;
}

.payslip-preview-company strong,
.payslip-preview-title strong,
.payslip-preview-summary strong,
.payslip-preview-lines strong {
  color: #172033;
}

.payslip-preview-company strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.payslip-preview-company span,
.payslip-preview-title span,
.payslip-preview-title small,
.payslip-preview-summary span,
.payslip-preview-lines small,
.payslip-preview-footer {
  color: #64748b;
}

.payslip-preview-company span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

.payslip-preview-title {
  flex: 0 0 auto;
  min-width: 128px;
  text-align: right;
}

.payslip-preview-title span,
.payslip-preview-title small {
  display: block;
  font-size: 11px;
  font-weight: 750;
}

.payslip-preview-title strong {
  display: block;
  margin: 3px 0;
  font-size: 18px;
}

.payslip-preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 10px;
}

.payslip-preview-summary div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e5edf5;
  border-radius: 5px;
  background: color-mix(in oklab, var(--brand-secondary) 22%, #ffffff);
}

.payslip-preview-summary span,
.payslip-preview-lines small {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.payslip-preview-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.payslip-preview-lines {
  display: grid;
  padding: 0 16px 12px;
}

.payslip-preview-lines div {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(78px, 0.8fr) minmax(82px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid #e5edf5;
}

.payslip-preview-lines span {
  min-width: 0;
  color: #172033;
  font-size: 12px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.payslip-preview-lines strong {
  justify-self: end;
  font-size: 12px;
}

.payslip-preview-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 14px;
  font-size: 10px;
  font-weight: 750;
}

.payslip-brand-preview.compact {
  padding: 10px;
}

.payslip-brand-preview.compact .payslip-preview-header {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.payslip-brand-preview.compact .payslip-preview-title {
  text-align: left;
}

.payslip-brand-preview.compact .payslip-preview-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px;
}

.payslip-brand-preview.compact .payslip-preview-lines {
  padding: 0 12px 10px;
}

.payslip-brand-preview.compact .payslip-preview-lines div {
  grid-template-columns: minmax(0, 1fr) minmax(78px, auto);
}

.payslip-brand-preview.compact .payslip-preview-lines small {
  display: none;
}

.payslip-brand-preview.compact .payslip-preview-footer {
  display: none;
}

.danger-button {
  color: var(--rose);
  border-color: color-mix(in oklab, var(--rose) 25%, var(--line));
}

.profile-menu-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 900;
}

.profile-menu-person strong,
.profile-menu-fact strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-person span,
.profile-menu-fact span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-fact {
  display: grid;
  gap: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.branding-save-button {
  min-width: 92px;
  gap: 8px;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top-color: transparent;
  border-radius: 999px;
  animation: button-spin 0.7s linear infinite;
}

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

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.content-grid.leave-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.primary-panel,
.issue-panel,
.table-panel,
.side-panel,
.page-panel,
.profile-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.primary-panel,
.issue-panel,
.table-panel,
.page-panel {
  padding: 16px;
}

.side-panel,
.profile-card {
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line));
  border-radius: 8px;
  background: var(--amber-soft);
}

.admin-preview-banner strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.admin-preview-banner p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.module-grid,
.readiness-band {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

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

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

.readiness-band > div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 12px;
}

.readiness-band strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

.has-drawer .metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.metric-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 7px;
  padding: 10px;
  min-width: 0;
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.metric-card small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 11px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.step {
  position: relative;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 10px 10px 32px;
  background: #ffffff;
}

.step-dot {
  position: absolute;
  left: 10px;
  top: 13px;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: #cbd5e1;
}

.step.complete .step-dot {
  background: var(--emerald);
}

.step.current {
  border-color: #93c5fd;
  background: #eff6ff;
}

.step.current .step-dot {
  background: var(--blue);
}

.step strong {
  display: block;
  font-size: 12px;
}

.step small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.issue-list {
  display: grid;
  gap: 8px;
  max-height: 252px;
  overflow: auto;
  padding-right: 2px;
}

.issue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.issue-row strong,
.issue-row p,
.issue-row small {
  display: block;
}

.issue-row p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.issue-row small {
  color: var(--muted);
  margin-top: 5px;
  font-size: 11px;
}

.issue-kind {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.severity-blocking {
  border-left-color: var(--rose);
  background: linear-gradient(90deg, var(--rose-soft), #ffffff 34%);
}

.severity-warning {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, var(--amber-soft), #ffffff 34%);
}

.severity-info {
  border-left-color: var(--blue);
}

.issue-actions {
  display: grid;
  gap: 6px;
  align-content: start;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.search-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.search-field {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
}

.search-field:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-field svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.search-field input::placeholder {
  color: #94a3b8;
}

.search-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.search-clear {
  color: var(--blue);
  font-weight: 800;
}

.filter-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  margin-top: -2px;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chip.active {
  color: #075f4f;
  border-color: #a7f3d0;
  background: #edfdf5;
}

.filter-chip strong {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8eef5;
  color: inherit;
  font-size: 11px;
}

.filter-chip.active strong {
  background: #d1fae5;
}

.leave-table-panel {
  border-color: #cbdff5;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.leave-action-row {
  align-items: stretch;
}

.leave-action-row .primary-button,
.leave-action-row .secondary-button {
  min-height: 38px;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.leave-action-row .secondary-button {
  border-color: #cbdff5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.leave-action-row .secondary-button:hover {
  border-color: #8bb9ed;
  background: #eef6ff;
  transform: translateY(-1px);
}

.leave-table-scroll {
  border-color: #cbdff5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.leave-table {
  border-collapse: separate;
  border-spacing: 0;
}

.leave-table th {
  background: #f1f6fc;
  color: #52657c;
  letter-spacing: 0;
}

.leave-table td {
  padding-block: 9px;
  border-bottom-color: #e3edf8;
}

.leave-request-row {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.leave-request-row:nth-child(even) {
  background: #fbfdff;
}

.leave-request-row:hover,
.leave-request-row:focus-visible {
  position: relative;
  background: #eef7ff;
  box-shadow: inset 3px 0 0 #38bdf8, inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe;
  outline: 0;
}

.leave-request-row:active {
  transform: scale(0.998);
}

.leave-employee-cell {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.leave-employee-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.leave-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.leave-type-chip,
.leave-status-pill,
.leave-payroll-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.leave-type-chip.annual {
  color: #075985;
  background: #e0f2fe;
}

.leave-type-chip.sick {
  color: #7c2d12;
  background: #ffedd5;
}

.leave-type-chip.compassionate {
  color: #5b21b6;
  background: #ede9fe;
}

.leave-type-chip.unpaid {
  color: #991b1b;
  background: #fee2e2;
}

.leave-date-range {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-weight: 650;
}

.leave-date-range span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.leave-days,
.leave-balance {
  color: #172033;
  font-weight: 850;
}

.leave-status-pill.approved {
  color: #047857;
  background: #dff7ea;
}

.leave-status-pill.pending {
  color: #92400e;
  background: #fef3c7;
}

.leave-status-pill.cancelled {
  color: #9f1239;
  background: #ffe4e8;
}

.leave-payroll-pill {
  color: #64748b;
  background: #eef2f7;
}

.leave-payroll-pill.linked {
  color: #1d4ed8;
  background: #dbeafe;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}

.table-input {
  width: 128px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--text);
  background: #ffffff;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

tr:last-child td {
  border-bottom: 0;
}

.table-empty {
  color: var(--muted);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 650;
}

.selected-row {
  background: #eff6ff;
}

html[data-theme="dark"] .readiness-band > div,
html[data-theme="dark"] .step,
html[data-theme="dark"] .issue-row,
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] table,
html[data-theme="dark"] .table-input {
  background: #101923;
}

html[data-theme="dark"] .readiness-band > div,
html[data-theme="dark"] .step,
html[data-theme="dark"] .issue-row,
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] .table-input {
  border-color: #3a4d63;
}

html[data-theme="dark"] th {
  background: var(--surface-soft);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-bottom-color: #2a394b;
  color: var(--text);
}

html[data-theme="dark"] .table-input::placeholder,
html[data-theme="dark"] .search-field input::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] .selected-row {
  background: #1d2c40;
}

html[data-theme="dark"] .step.current {
  border-color: #5f8fc5;
  background: #17263a;
}

html[data-theme="dark"] .step.complete {
  border-color: #2f765d;
  background: #132b24;
}

html[data-theme="dark"] .step-dot {
  background: #4b5f77;
}

html[data-theme="dark"] .severity-blocking {
  border-left-color: var(--rose);
  background: linear-gradient(90deg, color-mix(in oklab, var(--rose-soft) 72%, #101923) 0%, #101923 42%);
}

html[data-theme="dark"] .severity-warning {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, color-mix(in oklab, var(--amber-soft) 72%, #101923) 0%, #101923 42%);
}

html[data-theme="dark"] .filter-chip.active {
  color: #86efac;
  border-color: #2f765d;
  background: #132b24;
}

html[data-theme="dark"] .filter-chip strong {
  background: #2a394b;
}

html[data-theme="dark"] .filter-chip.active strong {
  background: #174231;
}

.people-workspace {
  margin-top: 16px;
}

.people-db-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.people-search-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.people-search-field {
  margin: 0;
}

.people-search-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.people-lifecycle-button {
  gap: 8px;
  white-space: nowrap;
}

.people-lifecycle-button strong {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8eef5;
  color: var(--muted);
  font-size: 11px;
}

.people-db-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.people-db-stats {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.people-stat {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.people-stat strong {
  font-size: 13px;
}

.people-stat.ready {
  color: #065f46;
  background: var(--emerald-soft);
}

.people-stat.attention {
  color: #92400e;
  background: var(--amber-soft);
}

.people-stat.neutral {
  color: #334155;
  background: #e8eef5;
}

.people-action-row {
  flex: 0 0 auto;
  margin-left: auto;
}

.people-action-row .secondary-button {
  min-height: 36px;
  border-color: #cbdff5;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  padding: 8px 11px;
}

.people-db-scroll {
  overflow: auto;
  max-height: calc(100vh - 250px);
  min-height: 320px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #94a3b8 #edf2f7;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.people-db-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.people-db-scroll::-webkit-scrollbar-track {
  background: #edf2f7;
  border-radius: 999px;
}

.people-db-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #edf2f7;
  border-radius: 999px;
  background: #94a3b8;
}

.people-db-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.people-db-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  box-shadow: inset 0 -1px 0 var(--line);
  white-space: nowrap;
}

.people-db-table th:first-child,
.people-db-table td:first-child {
  padding-left: 14px;
}

.people-db-row {
  --people-accent: #2563eb;
  --people-accent-soft: #eff6ff;
  cursor: pointer;
  outline: none;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.people-db-row.people-accent-0 {
  --people-accent: #2563eb;
  --people-accent-soft: #eff6ff;
}

.people-db-row.people-accent-1 {
  --people-accent: #0f766e;
  --people-accent-soft: #ecfdf5;
}

.people-db-row.people-accent-2 {
  --people-accent: #9333ea;
  --people-accent-soft: #f5f3ff;
}

.people-db-row.people-accent-3 {
  --people-accent: #c2410c;
  --people-accent-soft: #fff7ed;
}

.people-db-row.people-accent-4 {
  --people-accent: #be123c;
  --people-accent-soft: #fff1f2;
}

.people-db-row.people-accent-5 {
  --people-accent: #0369a1;
  --people-accent-soft: #f0f9ff;
}

.people-db-row:hover,
.people-db-row:focus-visible {
  background: var(--people-accent-soft);
  box-shadow: inset 3px 0 0 var(--people-accent);
}

.people-db-row:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--people-accent) 55%, transparent);
  outline-offset: -2px;
}

.people-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 270px;
}

.people-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in oklab, var(--people-accent, var(--blue)) 14%, #ffffff);
  color: var(--people-accent, var(--blue));
  font-size: 11px;
  font-weight: 900;
}

.people-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 16px;
}

.people-name-stack {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.people-name-stack strong {
  color: var(--text);
  font-size: 13px;
}

.people-name-stack small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.people-color-chip,
.people-soft-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.people-color-chip.department {
  color: #1e3a8a;
  background: #dbeafe;
}

.people-color-chip.location {
  color: #075985;
  background: #e0f2fe;
}

.people-soft-chip {
  color: #475569;
  background: #eef2f7;
}

.people-status-pill {
  min-height: 26px;
  padding: 5px 9px;
}

.people-employment-status {
  min-width: 72px;
  justify-content: center;
}

.people-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 850;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.people-sort-button:hover,
.people-sort-button:focus-visible {
  color: var(--blue);
  outline: none;
}

.people-sort-glyph {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #94a3b8;
  background: #e8eef5;
  font-size: 11px;
  line-height: 1;
}

.people-sort-active .people-sort-button {
  color: var(--blue);
}

.people-sort-active .people-sort-glyph {
  color: #ffffff;
  background: var(--blue);
}

.people-open-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.people-db-row:hover .people-open-cell,
.people-db-row:focus-visible .people-open-cell {
  color: var(--people-accent);
}

.people-overlay-dialog-wide {
  width: min(920px, calc(100vw - 32px));
}

.people-overlay-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.people-overlay-body {
  gap: 14px;
}

.people-overlay-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.people-overlay-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.people-workflow-chips {
  gap: 7px;
}

.people-lifecycle-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.people-lifecycle-stats div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.people-lifecycle-stats span,
.people-record-hero p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.people-lifecycle-stats strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.people-record-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff 0%, #eefdf5 100%);
}

.people-record-hero h3 {
  margin-top: 7px;
  font-size: 21px;
}

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

.people-fact-list strong {
  max-width: 60%;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-overlay-footer {
  flex-wrap: wrap;
}

html[data-theme="dark"] .people-lifecycle-button strong,
html[data-theme="dark"] .people-stat.neutral,
html[data-theme="dark"] .people-soft-chip {
  color: #cbd5e1;
  background: #243244;
}

html[data-theme="dark"] .people-stat.ready {
  color: #86efac;
  background: #143629;
}

html[data-theme="dark"] .leave-table-panel {
  border-color: #334963;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .leave-action-row .secondary-button {
  border-color: #3a5572;
  background: #1b2a3b;
}

html[data-theme="dark"] .leave-action-row .secondary-button:hover {
  border-color: #5f8fc5;
  background: #22364b;
}

html[data-theme="dark"] .leave-table-scroll {
  border-color: #334963;
  background: #101923;
}

html[data-theme="dark"] .leave-table th {
  background: #132033;
  color: #b6c6d8;
}

html[data-theme="dark"] .leave-table td {
  border-bottom-color: #26384d;
}

html[data-theme="dark"] .leave-request-row:nth-child(even) {
  background: #111c2a;
}

html[data-theme="dark"] .leave-request-row:hover,
html[data-theme="dark"] .leave-request-row:focus-visible {
  background: #18314c;
  box-shadow: inset 3px 0 0 #60a5fa, inset 0 1px 0 #315b85, inset 0 -1px 0 #315b85;
}

html[data-theme="dark"] .leave-avatar,
html[data-theme="dark"] .leave-type-chip.annual {
  color: #bae6fd;
  background: #12364d;
}

html[data-theme="dark"] .leave-type-chip.sick {
  color: #fed7aa;
  background: #3f2412;
}

html[data-theme="dark"] .leave-type-chip.compassionate {
  color: #ddd6fe;
  background: #2b1d4f;
}

html[data-theme="dark"] .leave-type-chip.unpaid,
html[data-theme="dark"] .leave-status-pill.cancelled {
  color: #fecdd3;
  background: #3d1821;
}

html[data-theme="dark"] .leave-date-range,
html[data-theme="dark"] .leave-days,
html[data-theme="dark"] .leave-balance {
  color: var(--text);
}

html[data-theme="dark"] .leave-status-pill.approved {
  color: #86efac;
  background: #143629;
}

html[data-theme="dark"] .people-stat.attention {
  color: #fbbf24;
  background: #3b2e13;
}

html[data-theme="dark"] .people-action-row .secondary-button {
  border-color: var(--line);
  background: color-mix(in oklab, var(--surface) 88%, var(--bg));
  box-shadow: none;
}

html[data-theme="dark"] .people-db-scroll,
html[data-theme="dark"] .people-db-table {
  background: #101923;
}

html[data-theme="dark"] .people-db-scroll {
  scrollbar-color: #64748b #1e293b;
}

html[data-theme="dark"] .people-db-scroll::-webkit-scrollbar-track {
  background: #1e293b;
}

html[data-theme="dark"] .people-db-scroll::-webkit-scrollbar-thumb {
  border-color: #1e293b;
  background: #64748b;
}

html[data-theme="dark"] .people-db-table th {
  background: var(--surface-soft);
}

html[data-theme="dark"] .people-db-row.people-accent-0,
html[data-theme="dark"] .people-db-row.people-accent-1,
html[data-theme="dark"] .people-db-row.people-accent-2,
html[data-theme="dark"] .people-db-row.people-accent-3,
html[data-theme="dark"] .people-db-row.people-accent-4,
html[data-theme="dark"] .people-db-row.people-accent-5 {
  --people-accent-soft: #162233;
}

html[data-theme="dark"] .people-avatar {
  background: color-mix(in oklab, var(--people-accent, var(--blue)) 22%, #101923);
}

html[data-theme="dark"] .people-color-chip.department {
  color: #bfdbfe;
  background: #17263a;
}

html[data-theme="dark"] .leave-status-pill.pending {
  color: #fde68a;
  background: #3b2e13;
}

html[data-theme="dark"] .leave-payroll-pill {
  color: #cbd5e1;
  background: #243244;
}

html[data-theme="dark"] .leave-payroll-pill.linked {
  color: #bfdbfe;
  background: #17263a;
}

html[data-theme="dark"] .people-color-chip.location {
  color: #bae6fd;
  background: #103348;
}

html[data-theme="dark"] .people-overlay-section,
html[data-theme="dark"] .people-record-hero {
  background: var(--surface-soft);
}

html[data-theme="dark"] .people-lifecycle-stats div {
  background: var(--surface);
}

.status-ready {
  color: var(--emerald);
  background: var(--emerald-soft);
}

.status-warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-risk {
  color: var(--rose);
  background: var(--rose-soft);
}

.stacked-panels {
  display: grid;
  gap: 16px;
}

.company-brand-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.settings-brand-doc-preview {
  margin-bottom: 14px;
}

.settings-brand-meta strong {
  color: var(--text);
}

.settings-brand-meta span {
  color: var(--muted);
}

.journal-mini,
.artifact-list,
.line-list {
  display: grid;
  gap: 9px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journal-mini div,
.artifact-list div,
.line-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-size: 13px;
}

.journal-mini div:last-child,
.artifact-list div:last-child,
.line-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ready-text {
  color: var(--emerald);
}

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

.drawer {
  position: sticky;
  top: 0;
  right: 0;
  height: 100vh;
  width: 390px;
  overflow: auto;
  background: #ffffff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px;
}

html[data-theme="dark"] .drawer {
  background: var(--surface);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.drawer-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.drawer-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.drawer-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.breakdown {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.breakdown span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.page-panel {
  min-height: calc(100vh - 126px);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.subsection {
  margin-top: 18px;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  padding: 16px;
  background: var(--surface-soft);
  font-size: 13px;
}

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

.note-list p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.note-list p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.select-control {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 650;
}

.compact-select {
  max-width: 220px;
}

.import-textarea {
  width: 100%;
  min-height: 152px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.preview-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.profile-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.balance-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.balance-row strong {
  color: var(--emerald);
}

.launchpad-shell {
  display: grid;
  gap: 13px;
}

.launchpad-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 4px 2px 8px;
  animation: launchpad-rise 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.launchpad-welcome h2 {
  margin-top: 5px;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.launchpad-context,
.launchpad-subtle {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.launchpad-subtle {
  margin-top: 7px;
}

.notification-bell {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.notification-bell svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-bell span {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--rose);
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
}

.notification-bell.urgent {
  color: var(--rose);
  border-color: #fecdd3;
  background: #fff7f8;
}

.notification-bell.topbar-bell {
  width: 36px;
  height: 36px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.notification-bell.topbar-bell svg {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .notification-bell {
  background: var(--surface);
}

html[data-theme="dark"] .notification-bell.urgent {
  background: var(--rose-soft);
  border-color: color-mix(in oklab, var(--rose) 45%, var(--line));
}

html[data-theme="dark"] .notification-bell span {
  border-color: var(--bg);
  background: #be123c;
  color: #ffffff;
}

.notification-dialog {
  width: min(540px, calc(100vw - 32px));
}

.notification-dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.notification-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.notification-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #065f46;
  background: var(--emerald-soft);
  font-size: 12px;
  font-weight: 850;
}

.notification-chip strong {
  font-size: 13px;
}

.notification-chip.attention {
  color: #92400e;
  background: var(--amber-soft);
}

.notification-chip.risk {
  color: var(--rose);
  background: var(--rose-soft);
}

.notification-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.notification-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 3px solid var(--emerald);
  border-radius: 8px;
  background: var(--surface-soft);
}

.notification-item.attention {
  border-left-color: var(--amber);
}

.notification-item.risk {
  border-left-color: var(--rose);
}

.notification-item strong {
  font-size: 13px;
}

.notification-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.notification-dialog-footer {
  padding-top: 12px;
}

html[data-theme="dark"] .launchpad-urgent-banner {
  border-color: color-mix(in oklab, var(--rose) 40%, var(--line));
  background: color-mix(in oklab, var(--rose-soft) 78%, var(--surface));
  color: #ff9bad;
}

html[data-theme="dark"] .launchpad-urgent-banner span {
  color: #ffc2cc;
}

.launchpad-urgent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: #fff7f8;
  color: var(--rose);
  padding: 11px 12px;
  animation: launchpad-rise 360ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.launchpad-urgent-banner .secondary-button {
  flex: 0 0 auto;
}

.launchpad-urgent-banner strong,
.launchpad-urgent-banner span {
  display: block;
}

.launchpad-urgent-banner strong {
  font-size: 14px;
}

.launchpad-urgent-banner span {
  margin-top: 2px;
  color: #9f1239;
  font-size: 12px;
  line-height: 1.3;
}

.launchpad-hidden-actions {
  display: none;
}

.workflow-card-footer,
.workflow-progress-meter span,
.workflow-step-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workflow-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.workflow-action-grid.primary {
  grid-template-columns: 1.2fr repeat(3, minmax(132px, 1fr));
  align-items: stretch;
}

.workflow-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 9px;
}

.workflow-card {
  min-width: 0;
  min-height: 116px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  text-align: left;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  animation: workflow-card-in 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
  animation-delay: calc(var(--stagger) * 35ms);
}

html[data-theme="dark"] .workflow-card {
  color: var(--text);
  background: #192433;
  border-color: #33455b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.workflow-card.featured {
  grid-row: span 2;
  min-height: 238px;
  align-content: space-between;
  background: #123a34;
  border-color: #123a34;
  color: #f8fffc;
  box-shadow: 0 14px 34px rgba(18, 58, 52, 0.22);
}

.workflow-card:hover,
.workflow-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
  outline: none;
}

html[data-theme="dark"] .workflow-card:hover,
html[data-theme="dark"] .workflow-card:focus-visible {
  border-color: #54708f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.workflow-card.active {
  border-color: #93c5fd;
  background: #f8fbff;
}

html[data-theme="dark"] .workflow-card.active {
  border-color: #5f8fc5;
  background: #1d2c40;
}

.workflow-card.featured.active {
  border-color: #123a34;
  background: #123a34;
}

html[data-theme="dark"] .workflow-card.featured,
html[data-theme="dark"] .workflow-card.featured.active {
  background: #143f36;
  border-color: #1f5f51;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.workflow-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workflow-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf5f2;
  color: #075f4f;
}

html[data-theme="dark"] .workflow-card-icon {
  background: #17342b;
  color: #86efac;
}

.workflow-card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workflow-card.featured .workflow-card-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fffc;
}

.workflow-card-signal {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
}

html[data-theme="dark"] .workflow-card-signal {
  background: color-mix(in oklab, var(--amber-soft) 82%, var(--surface));
  color: #facc15;
}

.tone-risk .workflow-card-signal {
  background: var(--rose-soft);
  color: var(--rose);
}

html[data-theme="dark"] .tone-risk .workflow-card-signal {
  background: color-mix(in oklab, var(--rose-soft) 78%, var(--surface));
  color: #fb9aaa;
}

.workflow-card.featured .workflow-card-signal {
  background: #ffffff;
  color: var(--rose);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

html[data-theme="dark"] .workflow-card.featured .workflow-card-signal {
  background: #4c1424;
  color: #ffb4c2;
  box-shadow: none;
}

.workflow-card strong {
  display: block;
  align-self: end;
  font-size: 14px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.workflow-card.featured strong {
  align-self: start;
  max-width: 9ch;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 0.95;
}

.workflow-card-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

html[data-theme="dark"] .workflow-card-meta,
html[data-theme="dark"] .workflow-card-footer {
  color: var(--muted);
}

.workflow-card.featured .workflow-card-meta,
.workflow-card.featured .workflow-card-footer {
  color: #c6efe4;
}

.workflow-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.workflow-more {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

html[data-theme="dark"] .workflow-more {
  border-top-color: #33455b;
}

.workflow-more summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: auto;
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
  padding: 7px 10px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .workflow-more summary {
  background: var(--surface);
  border-color: #33455b;
  color: var(--text);
  box-shadow: none;
}

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

.workflow-more summary span:last-child {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf5f2;
  color: #075f4f;
  font-size: 11px;
}

html[data-theme="dark"] .workflow-more summary span:last-child {
  background: #17342b;
  color: #86efac;
}

.workflow-more[open] summary {
  margin-bottom: 9px;
}

.workflow-more summary:hover,
.workflow-more[open] summary {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.workflow-mini-track,
.progress-track {
  display: block;
  height: 6px;
  overflow: hidden;
  background: #e8eef5;
  border-radius: 99px;
}

html[data-theme="dark"] .workflow-mini-track,
html[data-theme="dark"] .progress-track {
  background: #2a394b;
}

.workflow-mini-track span,
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.workflow-progress-shell {
  min-width: 0;
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

html[data-theme="dark"] .workflow-progress-shell {
  background: var(--surface);
}

.workflow-focus-shell {
  animation: workflow-card-in 260ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.workflow-back-row {
  display: flex;
  margin: 0 0 10px;
}

.workflow-progress-shell.focused {
  margin-top: 0;
}

.workflow-progress-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.workflow-progress-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 6px;
}

.workflow-progress-meter {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
}

.workflow-progress-meter strong {
  font-size: 28px;
  line-height: 1;
}

.workflow-step-stack {
  display: grid;
  gap: 10px;
  max-width: 920px;
}

.workflow-step-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

html[data-theme="dark"] .workflow-step-card {
  background: #192433;
  border-color: #33455b;
}

.workflow-step-card.current {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.08);
}

html[data-theme="dark"] .workflow-step-card.current {
  border-color: #4ade80;
  background: #152e25;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.workflow-step-card.complete {
  border-color: #a7f3d0;
}

html[data-theme="dark"] .workflow-step-card.complete {
  border-color: #2f765d;
}

.workflow-step-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  padding: 14px 16px;
  cursor: pointer;
}

.workflow-step-heading:hover {
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="dark"] .workflow-step-heading:hover {
  background: rgba(255, 255, 255, 0.04);
}

.workflow-step-card.current .workflow-step-heading:hover {
  background: rgba(21, 128, 61, 0.04);
}

.workflow-step-index {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: #e8eef5;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

html[data-theme="dark"] .workflow-step-index {
  background: #2a394b;
  color: var(--muted);
}

.workflow-step-card.complete .workflow-step-index {
  color: #ffffff;
  background: var(--emerald);
}

.workflow-step-card.current .workflow-step-index {
  color: #ffffff;
  background: #166534;
}

.workflow-step-heading strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}

.workflow-step-action-panel {
  display: grid;
  gap: 14px;
  margin: 0 16px 16px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fef9 100%);
  padding: 16px;
}

html[data-theme="dark"] .workflow-step-action-panel {
  border-color: #2f765d;
  background: linear-gradient(180deg, #182a25 0%, #14241f 100%);
}

.workflow-action-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.workflow-action-head h3 {
  font-size: 22px;
}

.workflow-step-action-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workflow-answer-field {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.workflow-answer-field input,
.workflow-answer-field select,
.workflow-answer-field textarea {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  padding: 13px 16px;
  outline: none;
}

html[data-theme="dark"] .workflow-answer-field input,
html[data-theme="dark"] .workflow-answer-field select,
html[data-theme="dark"] .workflow-answer-field textarea {
  background: #101923;
  border-color: #3a4d63;
  color: var(--text);
}

.workflow-answer-field select {
  min-height: 48px;
  appearance: none;
}

.workflow-answer-field textarea {
  min-height: 96px;
  border-radius: 8px;
  resize: vertical;
}

.workflow-answer-field input:focus,
.workflow-answer-field select:focus,
.workflow-answer-field textarea:focus {
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

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

.workflow-answer-field.wide {
  grid-column: 1 / -1;
}

.workflow-check-field {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  color: var(--text);
}

html[data-theme="dark"] .workflow-check-field {
  background: #101923;
  border-color: #3a4d63;
}

.workflow-check-field input {
  width: 22px;
  height: 22px;
  padding: 0;
  accent-color: #2563eb;
}

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

.workflow-stat-card {
  display: grid;
  gap: 6px;
  min-height: 76px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
}

html[data-theme="dark"] .workflow-stat-card {
  background: #101923;
  border-color: #3a4d63;
}

.workflow-stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.workflow-stat-card strong {
  font-size: 18px;
  line-height: 1.15;
}

.workflow-stat-card.tone-risk {
  border-color: #fecdd3;
  background: #fff5f7;
}

html[data-theme="dark"] .workflow-stat-card.tone-risk {
  border-color: #7f3345;
  background: #311a24;
}

.workflow-stat-card.tone-risk strong {
  color: #be123c;
}

html[data-theme="dark"] .workflow-stat-card.tone-risk strong {
  color: #fb9aaa;
}

.workflow-stat-card.tone-warn {
  border-color: #fde68a;
  background: #fffbeb;
}

html[data-theme="dark"] .workflow-stat-card.tone-warn {
  border-color: #8a6724;
  background: #2d2514;
}

.workflow-stat-card.tone-warn strong {
  color: #b45309;
}

html[data-theme="dark"] .workflow-stat-card.tone-warn strong {
  color: #fbbf24;
}

.workflow-mini-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

html[data-theme="dark"] .workflow-mini-table-wrap {
  background: #101923;
}

.workflow-mini-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.workflow-mini-table th,
.workflow-mini-table td {
  border-bottom: 1px solid #e8eef5;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

html[data-theme="dark"] .workflow-mini-table th,
html[data-theme="dark"] .workflow-mini-table td {
  border-bottom-color: #2a394b;
}

.workflow-mini-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.workflow-mini-table tr:last-child td {
  border-bottom: 0;
}

.workflow-cycle-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workflow-cycle-summary {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
}

html[data-theme="dark"] .workflow-cycle-summary {
  background: #101923;
  border-color: #3a4d63;
}

.workflow-cycle-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-cycle-summary strong {
  font-size: 15px;
}

.workflow-output-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-output-row span {
  border-radius: 999px;
  background: #e8eef5;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 750;
}

html[data-theme="dark"] .workflow-output-row span {
  background: #2a394b;
  color: var(--muted);
}

.workflow-output-row.compact span {
  background: #dcfce7;
  color: #166534;
}

html[data-theme="dark"] .workflow-output-row.compact span,
html[data-theme="dark"] .workflow-saved-chip {
  background: #17342b;
  color: #86efac;
}

.workflow-saved-chip {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
}

.workflow-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.workflow-bottom-progress {
  position: sticky;
  bottom: 10px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.5fr) auto;
  align-items: center;
  gap: 14px;
  max-width: 920px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
  padding: 12px 16px;
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] .workflow-bottom-progress {
  background: rgba(24, 34, 48, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

.workflow-bottom-progress strong,
.workflow-bottom-progress span {
  font-size: 13px;
  font-weight: 850;
  color: #166534;
}

html[data-theme="dark"] .workflow-bottom-progress strong,
html[data-theme="dark"] .workflow-bottom-progress span {
  color: #86efac;
}

.workflow-progress-shell.idle .table-scroll {
  margin-top: 8px;
}

@keyframes launchpad-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes workflow-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .launchpad-welcome,
  .workflow-focus-shell,
  .workflow-card {
    animation: none;
  }

  .workflow-card:hover,
  .workflow-card:focus-visible {
    transform: none;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #111827;
  color: #ffffff;
  border-radius: 7px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 750;
  z-index: 10;
}

@media (max-width: 1240px) {
  .app-shell.has-drawer {
    grid-template-columns: 244px minmax(0, 1fr);
  }

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

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

  .command-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .workflow-action-grid.primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workflow-card.featured {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 146px;
  }

  .launchpad-welcome,
  .workflow-progress-header {
    grid-template-columns: 1fr;
  }

  .drawer {
    position: fixed;
    z-index: 8;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .app-shell.has-drawer {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(320px, 82vw);
    max-width: calc(100vw - 34px);
    height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
    gap: 14px;
    overflow-y: auto;
    box-shadow: 24px 0 56px rgba(0, 0, 0, 0.34);
  }

  .brand {
    padding: 4px 6px 14px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .brand span,
  .sidebar-foot {
    display: none;
  }

  .mobile-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    border: 0;
    background: rgba(7, 12, 20, 0.58);
    backdrop-filter: blur(2px);
    cursor: pointer;
  }

  .nav-list {
    display: grid;
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-item {
    width: 100%;
    padding: 10px 11px;
    font-size: 14px;
  }

  .workspace {
    padding: calc(18px + env(safe-area-inset-top)) 12px calc(72px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .workflow-topbar {
    flex-direction: row;
    align-items: center;
  }

  .topbar-actions {
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .topbar-meta {
    min-width: 0;
    flex: 1 1 auto;
  }

  .product-breadcrumb {
    min-width: 0;
  }

  .product-breadcrumb span,
  .product-breadcrumb strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-grid,
  .module-grid,
  .readiness-band,
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .people-search-strip,
  .people-db-toolbar,
  .people-record-grid,
  .people-lifecycle-stats {
    grid-template-columns: 1fr;
  }

  .people-db-toolbar {
    display: grid;
    align-items: stretch;
  }

  .people-action-row {
    justify-content: flex-start;
  }

  .people-search-actions {
    justify-content: space-between;
  }

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

  .branding-dialog-backdrop {
    align-items: start;
    padding: 12px;
  }

  .branding-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .branding-dialog-body {
    grid-template-columns: 1fr;
  }

  .branding-dialog-preview {
    position: static;
  }

  .brand-color-grid,
  .brand-editor-fields {
    grid-template-columns: 1fr;
  }

  .payslip-preview-header,
  .payslip-preview-footer {
    display: grid;
  }

  .payslip-preview-title {
    text-align: left;
  }

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

  .payslip-preview-lines div {
    grid-template-columns: minmax(0, 1fr) minmax(82px, auto);
  }

  .payslip-preview-lines small {
    display: none;
  }

  .brand-color-editor-header,
  .branding-dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .branding-dialog-footer > div {
    margin-right: 0;
  }

  .workflow-action-grid.primary,
  .workflow-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-card.featured {
    grid-column: 1 / -1;
    min-height: 142px;
  }

  .workflow-card {
    min-height: 104px;
  }

  .has-drawer .metric-grid,
  .has-drawer .stepper {
    grid-template-columns: 1fr;
  }

  .drawer {
    position: static;
    width: 100%;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    box-shadow: none;
  }
}

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

  .panel-head,
  .issue-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .button-row,
  .topbar-actions,
  .workflow-control-row {
    width: 100%;
  }

  .topbar-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions.shell-actions {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .workflow-topbar .topbar-actions {
    align-items: flex-end;
    width: auto;
  }

  .home-topbar {
    display: flex;
  }

  .topbar-actions .compact-select,
  .topbar-actions .primary-button {
    max-width: none;
    width: 100%;
  }

  .topbar-actions .state-chip,
  .topbar-actions .quiet-chip {
    display: none;
  }

  .search-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .search-meta {
    justify-content: space-between;
  }

  .people-db-panel {
    padding: 10px;
  }

  .people-db-stats,
  .people-action-row,
  .people-search-actions {
    width: 100%;
  }

  .people-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-lifecycle-button {
    width: auto;
  }

  .people-fact-list strong {
    max-width: none;
  }

  .primary-button,
  .secondary-button,
  .mini-button,
  .icon-button {
    width: 100%;
    justify-content: center;
  }

  .people-search-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .people-search-actions .search-meta {
    justify-content: flex-start;
  }

  .people-lifecycle-button {
    width: 100%;
    min-height: 38px;
  }

  .people-db-stats {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .people-stat {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .people-action-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .people-action-row .secondary-button {
    width: auto;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
  }

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

  .workflow-action-grid.primary,
  .workflow-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-card {
    min-height: 100px;
    padding: 10px;
  }

  .workflow-card.featured {
    min-height: 132px;
  }

  .workflow-card-icon {
    width: 31px;
    height: 31px;
  }

  .workflow-card-icon svg {
    width: 17px;
    height: 17px;
  }

  .workflow-card strong {
    font-size: 13px;
  }

  .workflow-card.featured strong {
    font-size: 28px;
  }

  .workflow-card-footer {
    font-size: 10px;
  }

  .workflow-progress-shell {
    padding: 12px;
  }

  .workflow-step-heading {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 76px;
  }

  .workflow-step-action-panel {
    margin: 0 10px 12px;
    padding: 14px;
  }

  .workflow-cycle-fields {
    grid-template-columns: 1fr;
  }

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

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

  .workflow-mini-table {
    min-width: 460px;
  }

  .workflow-action-head {
    display: grid;
  }

  .workflow-bottom-progress {
    grid-template-columns: 1fr auto;
    border-radius: 22px;
  }

  .workflow-bottom-progress .progress-track {
    grid-column: 1 / -1;
    order: 3;
  }

  .launchpad-welcome h2 {
    font-size: 34px;
  }

  .launchpad-urgent-banner {
    align-items: center;
    flex-direction: row;
  }

  .launchpad-urgent-banner .secondary-button {
    width: auto;
    padding-inline: 14px;
  }
}
