@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600&family=Fira+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #172033;
  --ink-soft: #4d5b71;
  --muted: #748197;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --line: #e1e6ee;
  --line-strong: #cfd7e3;
  --blue: #1536a5;
  --blue-bright: #1f8ef1;
  --blue-soft: #e9f2ff;
  --teal: #0f8a72;
  --teal-soft: #e5f5f1;
  --amber: #c77606;
  --amber-soft: #fff3dc;
  --red: #c94135;
  --sidebar: #101829;
  --sidebar-soft: #1a2438;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 31, 51, 0.04), 0 8px 24px rgba(20, 31, 51, 0.05);
  --font-body: "Fira Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font: 400 14px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(31, 142, 241, 0.3);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 244px;
  flex-direction: column;
  overflow: hidden;
  color: #dce4f1;
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 11px;
  padding: 0 22px;
  color: #fff;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand strong { font-weight: 600; }

.brand-mark {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-mark span { display: block; border-radius: 2px 2px 1px 1px; background: #4aa8ff; }
.brand-mark span:nth-child(1) { height: 42%; opacity: 0.72; }
.brand-mark span:nth-child(2) { height: 72%; }
.brand-mark span:nth-child(3) { height: 100%; background: #6fdbc5; }

.primary-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding: 8px 12px 22px;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  color: #9eabc0;
  border-radius: 8px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.055); }
.nav-link.is-active { color: #fff; background: var(--sidebar-soft); }
.nav-link.is-active::before {
  position: absolute;
  inset: 9px auto 9px -12px;
  width: 3px;
  content: "";
  background: #4aa8ff;
  border-radius: 0 3px 3px 0;
}

.nav-link svg, .icon-button svg, .menu-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-block { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; }
.user-block > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.user-block strong { overflow: hidden; color: #f7f9fd; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.user-block small { color: #7f8da5; font-size: 11px; text-transform: capitalize; }
.user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: #244fc3;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.icon-button, .menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: #93a1b7;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.icon-button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.menu-button { display: none; color: var(--ink-soft); }

.main-content { min-height: 100vh; margin-left: 244px; padding: 30px 32px 48px; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 22px;
  max-width: 1600px;
}

.page-heading { min-width: 0; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font: 600 10px/1.3 var(--font-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-heading h1 { margin: 0; font-size: clamp(24px, 2vw, 31px); line-height: 1.15; letter-spacing: -0.035em; }
.page-heading > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.live-status {
  display: grid;
  min-width: 185px;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  padding-top: 5px;
}

.live-status > span { width: 8px; height: 8px; grid-row: span 2; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px var(--teal-soft); }
.live-status strong { color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.live-status small { color: var(--muted); font-size: 11px; }
.live-status.is-stale > span { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }

.filter-bar, .kpi-strip, .dashboard-grid { max-width: 1600px; margin-right: auto; margin-left: auto; }

.filter-bar {
  display: flex;
  min-height: 58px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 31, 51, 0.025);
}

.filter-placeholder, .kpi-skeleton, .chart-skeleton {
  overflow: hidden;
  background: linear-gradient(90deg, #eef1f5 25%, #f8f9fb 50%, #eef1f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.filter-placeholder { width: 172px; height: 40px; border-radius: 8px; }

.filter { position: relative; }
.filter-trigger {
  display: flex;
  min-width: 158px;
  max-width: 245px;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color 160ms ease, background 160ms ease;
}

.filter-trigger:hover, .filter.is-open .filter-trigger { background: #fff; border-color: var(--line-strong); }
.filter-trigger span { display: flex; min-width: 0; flex-direction: column; }
.filter-trigger small { color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.filter-trigger strong { overflow: hidden; max-width: 190px; color: var(--ink); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.filter-trigger::after { width: 7px; height: 7px; flex: 0 0 auto; content: ""; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); }

.filter-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  display: none;
  width: min(300px, calc(100vw - 42px));
  max-height: 310px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(20, 31, 51, 0.14);
}

.filter.is-open .filter-menu { display: block; }
.filter-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  cursor: pointer;
  border-radius: 7px;
}
.filter-option:hover { background: var(--surface-soft); }
.filter-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.filter-option span { font-size: 12px; }

.reset-filters {
  min-height: 38px;
  margin-left: auto;
  padding: 0 13px;
  cursor: pointer;
  color: var(--blue);
  background: var(--blue-soft);
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}
.reset-filters:hover { background: #dcecff; }

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(var(--kpi-columns, 5), minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-item { position: relative; min-width: 0; min-height: 104px; padding: 18px 18px 15px; background: var(--surface); }
.kpi-label { min-height: 34px; margin: 0; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.3; }
.kpi-value { margin: 2px 0 0; overflow: hidden; font: 600 clamp(19px, 1.65vw, 27px)/1.15 var(--font-mono); letter-spacing: -0.045em; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value.is-empty { color: var(--muted); }
.kpi-delta { display: inline-flex; margin-top: 8px; align-items: center; gap: 4px; color: var(--teal); font-size: 10px; font-weight: 600; }
.kpi-delta.is-negative { color: var(--red); }
.kpi-skeleton { height: 104px; border-right: 1px solid var(--line); }

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

.panel {
  grid-column: span 6;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel.is-wide { grid-column: 1 / -1; }
.panel-header { display: flex; min-height: 59px; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 18px 10px; }
.panel-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.panel-note { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { position: relative; min-height: 280px; padding: 0 10px 10px; }
.chart { width: 100%; height: 100%; min-height: 280px; }
.chart-skeleton { grid-column: span 6; min-height: 360px; border-radius: var(--radius); }
.chart-skeleton--wide { grid-column: 1 / -1; }

.funnel { display: flex; min-height: 290px; align-items: stretch; gap: 5px; padding: 12px 18px 22px; }
.funnel-step { position: relative; display: flex; min-width: 92px; flex: 1; flex-direction: column; justify-content: flex-end; padding: 16px; color: #fff; background: var(--blue); border-radius: 8px; }
.funnel-step:nth-child(2) { background: #1d58c5; }
.funnel-step:nth-child(3) { background: #237cd9; }
.funnel-step:nth-child(4) { background: #168b91; }
.funnel-step:nth-child(5) { background: var(--teal); }
.funnel-step::before { position: absolute; inset: 0; content: ""; opacity: 0.12; background: linear-gradient(150deg, transparent 50%, #fff 50%); }
.funnel-step small, .funnel-step strong, .funnel-step span { position: relative; }
.funnel-step small { margin-bottom: auto; opacity: 0.75; font: 500 10px var(--font-mono); }
.funnel-step strong { margin-top: 20px; font: 600 clamp(18px, 2vw, 27px) var(--font-mono); }
.funnel-step span { margin-top: 5px; font-size: 11px; opacity: 0.85; }

.data-table-wrap, .matrix-wrap { max-height: 520px; overflow: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.data-table th { position: sticky; z-index: 2; top: 0; padding: 10px 12px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { max-width: 340px; padding: 10px 12px; overflow: hidden; border-bottom: 1px solid #eef1f5; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr:hover td { background: #f7faff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.matrix-table td:not(:first-child), .matrix-table th:not(:first-child) { min-width: 82px; text-align: right; font-family: var(--font-mono); }
.matrix-table td:first-child, .matrix-table th:first-child { position: sticky; z-index: 1; left: 0; background: #fff; }
.matrix-table th:first-child { z-index: 3; background: var(--surface-soft); }
.matrix-cell { transition: background 160ms ease; }

.empty-state, .error-state { display: grid; min-height: 330px; place-items: center; padding: 36px; text-align: center; }
.state-content { max-width: 440px; }
.state-icon { display: grid; width: 46px; height: 46px; margin: 0 auto 15px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 12px; font: 600 19px var(--font-mono); }
.state-content h2 { margin: 0 0 6px; font-size: 18px; }
.state-content p { margin: 0; color: var(--muted); }
.retry-button, .primary-button {
  min-height: 44px;
  margin-top: 18px;
  padding: 0 20px;
  cursor: pointer;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  transition: background 160ms ease, box-shadow 160ms ease;
}
.retry-button:hover, .primary-button:hover { background: #102d8e; box-shadow: 0 5px 16px rgba(21, 54, 165, 0.22); }

/* Login */
.login-page { overflow: hidden; background: #fff; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(460px, 1.05fr) minmax(420px, 0.95fr); }
.login-context { position: relative; display: flex; overflow: hidden; flex-direction: column; padding: 34px 7vw 54px; color: #fff; background: #101829; }
.login-context::before { position: absolute; inset: -20% -10% auto auto; width: 55vw; height: 55vw; content: ""; opacity: 0.5; background: radial-gradient(circle, rgba(31, 142, 241, 0.23), transparent 62%); }
.brand--large { position: relative; min-height: auto; padding: 0; font-size: 16px; }
.login-copy { position: relative; max-width: 640px; margin: auto 0; }
.login-copy .eyebrow { color: #6fdbc5; }
.login-copy h1 { max-width: 600px; margin: 0; font-size: clamp(42px, 5vw, 76px); line-height: 0.98; letter-spacing: -0.055em; }
.login-copy > p:last-child { max-width: 560px; margin: 25px 0 0; color: #aebacf; font-size: 17px; line-height: 1.6; }
.login-signal { position: relative; display: flex; height: 92px; align-items: end; gap: clamp(10px, 2vw, 28px); margin-top: 35px; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.login-signal span { width: clamp(12px, 2vw, 28px); height: var(--h); background: #2253c6; border-radius: 3px 3px 0 0; }
.login-signal span:nth-child(even) { background: #1f8ef1; }
.login-signal i { position: absolute; inset: 8px 0 auto; height: 2px; background: #6fdbc5; transform: rotate(-7deg); transform-origin: left center; }
.login-panel { display: grid; place-items: center; padding: 42px; background: #fff; }
.login-form { width: min(390px, 100%); }
.login-form header { margin-bottom: 30px; }
.login-form h2 { margin: 0; font-size: 30px; letter-spacing: -0.035em; }
.login-form header > p:last-child { margin: 8px 0 0; color: var(--muted); }
.field { display: grid; gap: 7px; margin-top: 17px; }
.field > span { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.field input { width: 100%; height: 48px; padding: 0 13px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; transition: border 160ms ease, box-shadow 160ms ease; }
.field input:focus { background: #fff; border-color: var(--blue-bright); outline: 0; box-shadow: 0 0 0 3px rgba(31, 142, 241, 0.13); }
.login-form .primary-button { width: 100%; margin-top: 22px; }
.form-error { padding: 11px 12px; color: #922d26; background: #fff0ee; border: 1px solid #f4cec9; border-radius: 8px; font-size: 12px; }
.login-footnote { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

/* Authentication and security administration */
.auth-card { width: min(520px, calc(100% - 32px)); margin: max(36px, 8vh) auto; padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 55px rgba(19, 34, 57, 0.11); }
.auth-card--wide { width: min(680px, calc(100% - 32px)); }
.brand--dark { min-height: auto; padding: 0; color: var(--ink); }
.auth-card > .eyebrow { margin-top: 46px; }
.auth-card h1 { margin: 0; font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.045em; }
.auth-lead { max-width: 590px; margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.auth-form { width: 100%; margin-top: 24px; }
.code-input { font: 600 24px var(--font-mono); letter-spacing: 0.16em; }
.text-link { display: inline-block; margin-top: 24px; color: var(--blue); font-size: 12px; font-weight: 600; }
.mfa-setup-grid { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 25px; margin: 26px 0 8px; padding: 20px; background: var(--surface-soft); border-radius: 12px; }
.qr-code { display: block; width: 190px; height: 190px; background: #fff; border-radius: 8px; }
.field-caption { margin: 0 0 8px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.secret-code { display: block; overflow-wrap: anywhere; font: 600 15px/1.6 var(--font-mono); }
.security-note { color: var(--muted); font-size: 11px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 28px 0; padding: 20px; background: var(--surface-soft); border-radius: 12px; }
.recovery-grid code { padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; font: 600 15px var(--font-mono); text-align: center; }
.primary-button--link { display: inline-flex; align-items: center; text-decoration: none; }
.nav-link--security { margin-top: 15px; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0 0 7px 7px; }

.admin-page { min-height: 100vh; background: var(--canvas); }
.admin-topbar { display: flex; max-width: 1500px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 26px 20px; }
.admin-topbar h1 { margin: 0; font-size: 34px; letter-spacing: -0.04em; }
.admin-topbar p:last-child { margin: 7px 0 0; color: var(--muted); }
.admin-shell { display: grid; max-width: 1500px; gap: 14px; margin: 0 auto; padding: 0 26px 50px; }
.admin-panel { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-panel > header h2 { margin: 0; font-size: 18px; }
.admin-panel > header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.success-banner { padding: 12px 15px; color: #096654; background: #e7f7f3; border: 1px solid #bce8dd; border-radius: 9px; }
.admin-create-grid, .user-edit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 13px; margin-top: 18px; }
.admin-create-grid .field, .user-edit-grid .field { margin: 0; }
.field select { width: 100%; height: 48px; padding: 0 13px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.page-checks { display: flex; min-height: 48px; align-items: center; gap: 12px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; }
.page-checks legend { padding: 0 5px; color: var(--muted); font-size: 10px; }
.page-checks label, .toggle-field { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.user-admin-list { display: grid; gap: 12px; margin-top: 18px; }
.user-admin-card { padding: 18px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 10px; }
.user-admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.user-admin-heading strong, .user-admin-heading span { display: block; }
.user-admin-heading span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.security-badges { display: flex; gap: 6px; }
.security-badges span { padding: 5px 8px; color: var(--blue); background: var(--blue-soft); border-radius: 5px; font: 600 10px var(--font-mono); }
.user-security-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.user-security-actions form { display: flex; gap: 6px; }
.user-security-actions input { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; }
.user-security-actions button, .secondary-button { display: inline-flex; min-height: 34px; align-items: center; padding: 0 11px; cursor: pointer; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; font-weight: 600; text-decoration: none; }
.audit-table-wrap { margin-top: 18px; overflow: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.audit-table th, .audit-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.audit-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; }

@keyframes shimmer { to { background-position-x: -200%; } }

@media (max-width: 1120px) {
  .panel { grid-column: 1 / -1; }
  .kpi-strip { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); transition: transform 220ms ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 18px 0 48px rgba(8, 15, 28, 0.28); }
  .sidebar-scrim { position: fixed; z-index: 25; inset: 0; display: block; background: rgba(11, 18, 31, 0.5); }
  .main-content { margin-left: 0; padding: 24px 20px 42px; }
  .menu-button { display: grid; flex: 0 0 auto; }
  .login-shell { grid-template-columns: 1fr; }
  .login-context { display: none; }
  .admin-create-grid, .user-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .main-content { padding: 17px 12px 34px; }
  .topbar { align-items: center; }
  .page-heading > p:last-child, .live-status strong { display: none; }
  .live-status { min-width: 0; grid-template-columns: auto 1fr; }
  .live-status small { max-width: 90px; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; }
  .filter { flex: 0 0 auto; }
  .filter-trigger { min-width: 148px; }
  .reset-filters { position: sticky; right: 0; flex: 0 0 auto; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-item { min-height: 92px; padding: 14px; }
  .kpi-label { min-height: 30px; }
  .kpi-value { font-size: 19px; }
  .dashboard-grid { gap: 9px; }
  .panel-header { padding: 14px 14px 8px; }
  .funnel { overflow-x: auto; padding: 8px 12px 16px; }
  .funnel-step { flex: 0 0 128px; }
  .login-panel { padding: 28px 20px; }
  .auth-card { padding: 24px 20px; }
  .mfa-setup-grid { grid-template-columns: 1fr; }
  .qr-code { margin: auto; }
  .recovery-grid { grid-template-columns: 1fr; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .admin-shell, .admin-topbar { padding-right: 14px; padding-left: 14px; }
  .admin-create-grid, .user-edit-grid { grid-template-columns: 1fr; }
  .user-admin-heading { align-items: flex-start; flex-direction: column; }
}

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