:root {
  --bg: #050607;
  --surface: rgba(18, 18, 22, .86);
  --surface-2: rgba(255,255,255,.045);
  --ink: #f8fafc;
  --muted: #a2a8b3;
  --line: rgba(255, 55, 62, .18);
  --blue: #2563eb;
  --cyan: #0891b2;
  --green: #17b26a;
  --amber: #c47b14;
  --red: #ff151d;
  --violet: #6941c6;
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 12%, rgba(255, 21, 29, .13), transparent 30%),
    radial-gradient(circle at 16% 86%, rgba(255, 21, 29, .10), transparent 28%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
body.auth-loading .sidebar,
body.auth-loading .app-shell,
body.login-active .sidebar,
body.login-active .app-shell {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  background: linear-gradient(180deg, #08090d, #0d0506);
  color: #f8fafc;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 54px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff151d, #76070b);
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .04em;
}
.brand-logo-only {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.brand-mark img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.18));
}
.brand-name { font-weight: 850; font-size: 20px; }
.brand-sub { color: #93a4bc; font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
}
.nav-item span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 21, 29, .12);
  color: #ff6b72;
  font-size: 11px;
  font-weight: 800;
}
.nav-item.active, .nav-item:hover { background: rgba(255,21,29,.13); color: #fff; }
.sidebar-card {
  margin-top: auto;
  background: rgba(255,21,29,.08);
  border: 1px solid rgba(255,70,76,.20);
  padding: 14px;
  border-radius: 8px;
}
.sidebar-card p { color: #aebdd0; font-size: 12px; line-height: 1.5; margin: 8px 0 0; }

.app-shell { margin-left: 268px; padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
h1, h2, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: 0; }
h2 { font-size: 18px; letter-spacing: 0; }
.eyebrow, .mini-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.top-actions {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) repeat(3, minmax(104px, auto));
  align-items: center;
  gap: 10px;
  min-width: min(760px, 100%);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}
.search-box input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  color: var(--ink);
  background: transparent;
}
.primary-btn, .ghost-btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.15;
  text-align: center;
}
.top-actions .primary-btn,
.top-actions .ghost-btn {
  min-width: 118px;
  max-width: none;
}
.primary-btn { color: white; background: linear-gradient(135deg, #ff151d, #a3070d); }
.ghost-btn, .icon-btn { color: var(--ink); background: var(--surface); border-color: var(--line); }
.full { width: 100%; margin-top: 16px; }
.backend-badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #fef3c7;
  color: #814d09;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.backend-badge.live { background: rgba(23,178,106,.18); color: #7ee7b4; }

.view { display: none; }
.view.active { display: block; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.metric, .panel, .panel-flat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
}
.metric { padding: 18px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; font-size: 28px; margin: 8px 0 3px; }
.metric small { color: var(--muted); }
.dashboard-grid, .payroll-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.span-2 { grid-column: span 2; }
.panel { padding: 18px; }
.panel-flat { overflow: hidden; }
.panel-head, .module-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.compact-select, .form-grid input, .form-grid select, .wide-label textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0,0,0,.28);
  color: var(--ink);
  color-scheme: dark;
}
.compact-select option,
.form-grid select option {
  background: #111114;
  color: #f8fafc;
}
.compact-select option:checked,
.form-grid select option:checked {
  background: #ff151d;
  color: #ffffff;
}
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; gap: 7px; }
.bar-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.bar-track { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff151d, #ff777d); }
.alert-list, .request-grid, .doc-grid, .score-grid, .settings-grid { display: grid; gap: 12px; }
.alert {
  border-left: 4px solid var(--amber);
  background: rgba(255, 21, 29, .08);
  padding: 12px;
  border-radius: 8px;
}
.alert strong { display: block; margin-bottom: 4px; }
.alert p { color: var(--muted); font-size: 13px; line-height: 1.4; }

.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: middle; }
th { color: var(--muted); background: rgba(255,255,255,.04); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
td strong { display: block; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff151d, #681015);
  font-weight: 850;
  font-size: 12px;
}
.subtle { color: var(--muted); font-size: 12px; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-weight: 850;
  font-size: 11px;
}
.status.good { color: #066040; background: #dcfce7; }
.status.warn { color: #814d09; background: #fef3c7; }
.status.bad { color: #991b1b; background: #fee2e2; }
.status.info { color: #1d4ed8; background: #dbeafe; }

.module-toolbar { margin-bottom: 14px; }
.segmented {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.segmented button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  font-weight: 800;
  color: var(--muted);
}
.segmented button.active { background: #ff151d; color: #fff; border-color: #ff151d; }
.payroll-summary { display: grid; gap: 12px; margin-top: 14px; }
.payroll-item { display: flex; justify-content: space-between; padding: 12px; background: var(--surface-2); border-radius: 8px; }
.score-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.score-card, .request-card, .doc-card, .settings-grid > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.score-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#ff151d var(--score), rgba(255,255,255,.08) 0);
  margin-bottom: 12px;
  font-weight: 900;
}
.request-grid, .doc-grid, .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.request-card p, .doc-card p, .settings-grid p { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 6px; }
.approval-list {
  display: grid;
  gap: 12px;
}
.approval-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(0,0,0,.22);
}
.approval-card p {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}
.approval-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.danger-btn {
  min-height: 36px;
  border: 1px solid rgba(255, 21, 29, .45);
  color: #ff777d;
  background: rgba(255, 21, 29, .08);
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 850;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tiny-btn {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 84% 24%, rgba(239, 20, 28, .24), transparent 28%),
    radial-gradient(circle at 33% 75%, rgba(239, 20, 28, .19), transparent 32%),
    linear-gradient(135deg, #010101 0%, #07080c 48%, #120406 100%);
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
}
.login-backdrop.hidden { display: none; }
.login-bg-grid {
  position: absolute;
  inset: 0;
  opacity: .42;
  background-image:
    linear-gradient(rgba(239, 20, 28, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 20, 28, .16) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at 50% 52%, black 0%, transparent 72%);
}
.login-bg-grid::before,
.login-bg-grid::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 2px;
  left: 6%;
  bottom: 19%;
  background: linear-gradient(90deg, transparent, rgba(255, 24, 32, .95), transparent);
  transform: rotate(-5deg);
  filter: blur(.2px) drop-shadow(0 0 10px rgba(255, 24, 32, .8));
}
.login-bg-grid::after {
  left: auto;
  right: 4%;
  bottom: 32%;
  width: 390px;
  transform: rotate(20deg);
  opacity: .7;
}
.login-energy {
  position: absolute;
  inset: auto -10% -7% -10%;
  height: 34%;
  background:
    radial-gradient(circle at 10% 60%, rgba(255, 34, 40, .8) 0 2px, transparent 3px),
    radial-gradient(circle at 26% 45%, rgba(255, 34, 40, .72) 0 2px, transparent 3px),
    radial-gradient(circle at 52% 22%, rgba(255, 34, 40, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 35%, rgba(255, 34, 40, .8) 0 2px, transparent 3px),
    linear-gradient(8deg, transparent 30%, rgba(255, 24, 32, .72) 32%, transparent 34%),
    linear-gradient(-6deg, transparent 41%, rgba(255, 24, 32, .55) 43%, transparent 45%);
  filter: blur(.2px) drop-shadow(0 0 16px rgba(255, 24, 32, .62));
  opacity: .74;
  pointer-events: none;
}
.login-stage {
  position: relative;
  z-index: 1;
  width: min(1480px, 100%);
  max-width: 100%;
  min-height: min(860px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(380px, .82fr);
  align-items: center;
  gap: clamp(24px, 4vw, 70px);
}
.login-left {
  color: #fff;
  min-width: 0;
  max-width: 100%;
}
.login-logo-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(44px, 7vh, 92px);
}
.login-logo-row img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255,255,255,.26));
}
.login-wordmark {
  font-size: clamp(25px, 2.1vw, 34px);
  font-weight: 900;
  letter-spacing: .30em;
}
.login-tagline {
  margin-top: 7px;
  color: #ff5b62;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.login-copy {
  max-width: 620px;
}
.login-kicker {
  color: rgba(255,255,255,.62);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.login-copy h2 {
  color: #fff;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 1.08;
  letter-spacing: 0;
  max-width: 720px;
  overflow-wrap: anywhere;
  text-shadow: 0 14px 42px rgba(0,0,0,.55);
}
.login-copy h2 span,
.login-card h2 span { color: #ff151d; }
.login-copy p:last-child {
  margin-top: 24px;
  color: rgba(255,255,255,.68);
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.65;
  max-width: 600px;
}
.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 14px;
  max-width: 700px;
  width: 100%;
  margin-top: 44px;
}
.login-feature {
  min-height: 116px;
  padding: 20px;
  border: 1px solid rgba(255, 80, 86, .20);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 42px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
}
.login-feature span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ff2028;
  border: 1px solid rgba(255, 32, 40, .38);
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 950;
}
.login-feature strong {
  display: block;
  font-size: 16px;
  color: #fff;
}
.login-feature small {
  display: block;
  color: rgba(255,255,255,.55);
  line-height: 1.45;
  margin-top: 7px;
}
.login-trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 760px;
  width: 100%;
  margin-top: clamp(42px, 7vh, 82px);
  border: 1px solid rgba(255, 80, 86, .28);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 18px 48px rgba(0,0,0,.32);
  backdrop-filter: blur(16px);
}
.login-trust-row div {
  padding: 22px 24px;
  border-right: 1px solid rgba(255,255,255,.10);
}
.login-trust-row div:last-child { border-right: 0; }
.login-trust-row strong {
  display: block;
  color: #fff;
  font-size: 18px;
  margin-bottom: 6px;
}
.login-trust-row span {
  color: rgba(255,255,255,.62);
  font-size: 13px;
}
.login-card {
  position: relative;
  width: min(520px, 100%);
  justify-self: end;
  color: #fff;
  border: 1px solid rgba(255, 116, 122, .48);
  border-radius: 28px;
  padding: clamp(34px, 4vw, 58px);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 33, 42, .17), transparent 35%),
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: 0 0 0 1px rgba(255,255,255,.035), 0 26px 90px rgba(0,0,0,.56), 0 0 56px rgba(255, 23, 31, .18);
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.login-card-glow {
  position: absolute;
  left: 10%;
  right: 10%;
  top: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff, #ff151d, transparent);
  filter: drop-shadow(0 0 12px #ff151d);
}
.login-card-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 26px;
  filter: drop-shadow(0 0 16px rgba(255,255,255,.22));
}
.access-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 21, 29, .18), transparent 30%),
    radial-gradient(circle at 18% 82%, rgba(255, 21, 29, .14), transparent 26%),
    #050607;
}
.access-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(320px, 720px);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}
.access-brand {
  color: #fff;
}
.access-brand img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(255,255,255,.24));
  margin-bottom: 26px;
}
.access-brand h1 {
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: 0;
  margin-bottom: 18px;
}
.access-brand p:not(.login-kicker) {
  color: rgba(255,255,255,.68);
  font-size: 18px;
  line-height: 1.65;
  max-width: 520px;
}
.access-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 28px;
  padding: 0 16px;
  border: 1px solid rgba(255,21,29,.45);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
}
.access-page-card {
  width: 100%;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 33, 42, .13), transparent 32%),
    rgba(17,17,20,.92);
}
.login-card h2 {
  text-align: center;
  color: #fff;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: 0;
}
.login-card-sub {
  text-align: center;
  color: rgba(255,255,255,.74);
  margin-top: 12px;
  margin-bottom: 34px;
  font-size: 16px;
}
.login-field {
  display: grid;
  gap: 8px;
  color: rgba(255,255,255,.58);
  font-weight: 700;
  font-size: 13px;
  margin-top: 18px;
}
.login-field input {
  width: 100%;
  min-height: 64px;
  border: 1px solid rgba(255, 128, 132, .36);
  border-radius: 12px;
  padding: 0 18px;
  color: #fff;
  background: rgba(3, 4, 8, .42);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.login-field input::placeholder { color: rgba(255,255,255,.42); }
.login-field input:focus {
  border-color: rgba(255, 35, 43, .92);
  box-shadow: 0 0 0 4px rgba(255, 21, 29, .12), 0 0 26px rgba(255, 21, 29, .16);
}
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 28px;
  color: rgba(255,255,255,.74);
  font-size: 14px;
}
.login-options label {
  display: flex;
  align-items: center;
  gap: 9px;
}
.login-options input {
  width: 18px;
  height: 18px;
  accent-color: #ff151d;
}
.login-options button,
.login-help button {
  border: 0;
  background: transparent;
  color: #ff3138;
  padding: 0;
  font-weight: 700;
}
.login-submit,
.login-request {
  width: 100%;
  min-height: 62px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 16px;
}
.login-submit {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff1d25, #b9070d);
  box-shadow: 0 16px 40px rgba(255, 17, 25, .28), inset 0 1px 0 rgba(255,255,255,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.login-submit span { font-size: 24px; line-height: 1; }
.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  color: rgba(255,255,255,.56);
  margin: 24px 0;
}
.login-divider span { height: 1px; background: rgba(255,255,255,.18); }
.login-divider em { font-style: normal; }
.login-request {
  border: 1px solid rgba(255, 23, 31, .72);
  color: #fff;
  background: rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.login-help {
  text-align: center;
  color: rgba(255,255,255,.62);
  margin-top: 28px;
}
.login-error {
  color: #ff5d64;
  min-height: 18px;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}
.modal {
  width: min(720px, 100%);
  background: #111114;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 28px 80px rgba(0,0,0,.25);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; font-size: 12px; }
.wide-label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.wide-label textarea {
  resize: vertical;
  min-height: 88px;
}
.form-message {
  min-height: 18px;
  color: #7ee7b4;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .app-shell { margin-left: 0; padding: 16px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }
  .search-box {
    grid-column: 1 / -1;
  }
  .search-box input { min-width: 0; width: 100%; }
  .metrics-grid, .dashboard-grid, .payroll-grid, .score-grid, .request-grid, .doc-grid, .settings-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .approval-card {
    grid-template-columns: 1fr;
  }
  .approval-actions {
    justify-content: stretch;
  }
  .approval-actions button {
    flex: 1;
  }
  .login-backdrop {
    align-items: start;
    padding: 18px;
  }
  .access-shell {
    grid-template-columns: 1fr;
  }
  .access-brand {
    text-align: center;
  }
  .access-brand img,
  .access-brand p:not(.login-kicker) {
    margin-left: auto;
    margin-right: auto;
  }
  .login-stage {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .login-left {
    text-align: center;
  }
  .login-logo-row {
    justify-content: center;
    margin-bottom: 28px;
  }
  .login-logo-row img {
    width: 68px;
    height: 68px;
  }
  .login-wordmark {
    font-size: 22px;
    letter-spacing: .22em;
  }
  .login-tagline {
    font-size: 11px;
    letter-spacing: .12em;
  }
  .login-copy {
    margin: 0 auto;
  }
  .login-copy h2 {
    font-size: clamp(34px, 11vw, 48px);
  }
  .login-copy p:last-child {
    margin: 16px auto 0;
    font-size: 15px;
  }
  .login-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 26px;
  }
  .login-feature {
    min-height: 104px;
    padding: 16px;
    text-align: left;
  }
  .login-trust-row {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 24px;
  }
  .login-trust-row div {
    padding: 16px;
  }
  .login-trust-row div:nth-child(2) {
    border-right: 0;
  }
  .login-trust-row div:nth-child(-n+2) {
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  .login-card {
    justify-self: center;
    border-radius: 22px;
    padding: 28px 20px;
  }
  .login-card-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 18px;
  }
  .login-card-sub {
    margin-bottom: 22px;
  }
  .login-field input,
  .login-submit,
  .login-request {
    min-height: 56px;
  }
  .login-options {
    align-items: flex-start;
    flex-direction: column;
    margin: 18px 0 22px;
  }
}

@media (max-width: 560px) {
  .top-actions {
    grid-template-columns: 1fr;
  }
  .top-actions .primary-btn,
  .top-actions .ghost-btn,
  .backend-badge {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .login-backdrop {
    padding: 14px;
  }
  .login-feature-grid {
    grid-template-columns: 1fr;
  }
  .login-feature {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
    min-height: 82px;
  }
  .login-feature span {
    grid-row: span 2;
    margin-bottom: 0;
  }
  .login-feature small {
    margin-top: 2px;
  }
  .login-trust-row {
    grid-template-columns: 1fr;
  }
  .login-trust-row div,
  .login-trust-row div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  .login-trust-row div:last-child {
    border-bottom: 0;
  }
}
