:root {
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f7f9fa;
  --navy: #132466;
  --navy-deep: #0a1236;
  --navy-soft: #203875;
  --blue: #1b2f7a;
  --blue-dark: #132466;
  --blue-soft: #e9ecf6;
  --text: #17212b;
  --text-soft: #56636f;
  --text-muted: #697782;
  --line: #cbd5dc;
  --line-strong: #7f919e;
  --success: #217a4a;
  --success-soft: #ecfdf3;
  --warning: #8a5a00;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --sidebar-width: 252px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible,
summary:focus-visible {
  outline: 3px solid #5b74b8;
  outline-offset: 2px;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  border: 2px solid var(--blue);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  transform: translateY(-150%);
}

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

/* Authentication */

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 32px 20px;
  place-items: center;
  background: #f4f5f8;
}

.login-panel {
  width: min(100%, 460px);
  padding: 40px;
  border: 1px solid var(--line-strong);
  border-top: 4px solid var(--blue);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand--login {
  margin-bottom: 58px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--navy);
  color: #ffffff;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand-name,
.brand-product {
  display: block;
}

.brand-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.15;
}

.brand-product {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.login-copy {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 7px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-copy h1,
.page-heading h1,
.panel__header h2 {
  margin: 0;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.login-copy h1 {
  max-width: 360px;
  font-size: clamp(25px, 5vw, 31px);
  line-height: 1.2;
}

.login-copy > p:last-child {
  margin: 13px 0 0;
  color: var(--text-soft);
}

.login-form {
  display: grid;
  gap: 16px;
  padding-top: 26px;
}

.automatic-login {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}

.automatic-login__status {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--blue);
}

.automatic-login strong,
.automatic-login small {
  display: block;
}

.automatic-login strong {
  font-size: 14px;
}

.automatic-login small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.form-error {
  display: none;
  margin: 0;
  padding: 11px 12px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
}

.form-error:not(:empty) {
  display: block;
}

.primary-button,
.refresh-button,
.logout-button,
.menu-button,
.period-switcher button {
  border-radius: 0;
}

.primary-button {
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover:not(:disabled) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

/* Application frame */

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

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  background: var(--navy-deep);
  color: #ffffff;
}

.sidebar__brand {
  min-height: 76px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.sidebar .brand-mark {
  background: #ffffff;
  color: var(--navy);
}

.sidebar .brand-name {
  color: #ffffff;
}

.sidebar .brand-product {
  color: #c9d2ea;
}

.primary-nav {
  display: grid;
  gap: 1px;
  padding: 28px 0;
}

.nav-link {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  min-height: 50px;
  padding: 0 24px;
  border-left: 3px solid transparent;
  color: #d9def0;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
}

.nav-link.is-active {
  border-left-color: #7f92c8;
  background: var(--navy-soft);
  color: #ffffff;
}

.nav-index {
  color: #9babd8;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.nav-link.is-active .nav-index {
  color: #c9d2ea;
}

.sidebar__footer {
  margin-top: auto;
  padding: 21px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.session-info span,
.session-info strong {
  display: block;
}

.session-info span {
  color: #9babd8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-info strong {
  margin-top: 5px;
  color: #e9ecf6;
  font-size: 12px;
  font-weight: 550;
}

.logout-button {
  width: 100%;
  min-height: 38px;
  margin-top: 18px;
  border: 1px solid #7f92c8;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
}

.logout-button:hover:not(:disabled) {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.workspace {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--navy);
}

.issuer-control {
  display: flex;
  align-items: center;
  gap: 11px;
}

.issuer-control > label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.select-wrap {
  display: flex;
  min-width: 245px;
  height: 42px;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.issuer-avatar {
  display: grid;
  width: 41px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--navy);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.select-wrap select {
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  border: 0;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.period-switcher {
  display: flex;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.period-switcher button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.period-switcher button:last-child {
  border-right: 0;
}

.period-switcher button:hover {
  background: var(--surface-subtle);
}

.period-switcher button.is-active {
  background: var(--navy);
  color: #ffffff;
}

.refresh-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--blue);
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
}

.refresh-button:hover:not(:disabled) {
  background: var(--blue-soft);
}

.refresh-button:disabled,
.refresh-button.is-loading {
  cursor: wait;
  opacity: 0.55;
}

.dashboard {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 34px 32px 28px;
}

.page-status {
  position: fixed;
  z-index: 100;
  top: 92px;
  right: 24px;
  display: flex;
  max-width: min(420px, calc(100vw - 48px));
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.page-status.is-visible {
  opacity: 1;
  visibility: visible;
}

.page-status.is-error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-indicator {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--blue);
}

.page-status.is-error .status-indicator {
  background: var(--danger);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.page-heading h1 {
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.15;
}

.page-heading > div:first-child > p:last-child {
  margin: 9px 0 0;
  color: var(--text-muted);
}

/* Metrics */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  min-width: 0;
  min-height: 152px;
  padding: 19px 20px 17px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  background: var(--surface);
}

.metric-card--primary {
  border-top-color: var(--blue);
}

.metric-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  display: block;
  margin-top: 17px;
  color: var(--text);
  font-size: clamp(28px, 3vw, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-card > small,
.metric-card__top + .metric-value + small {
  display: block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

.metric-delta {
  flex: 0 0 auto;
  padding-left: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.metric-delta[data-direction="up"] {
  color: var(--success);
}

.metric-delta[data-direction="down"] {
  color: var(--danger);
}

.metric-card--compact {
  min-height: 124px;
  padding-top: 17px;
  border-top-width: 1px;
}

.metric-card--compact .metric-value {
  margin-top: 13px;
  font-size: 28px;
}

.skeleton {
  color: transparent !important;
  background: #e8ecf1;
}

/* Panels and charts */

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel__header {
  display: flex;
  min-height: 71px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

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

.panel__header .section-label {
  margin-bottom: 5px;
}

.trend-panel {
  margin-bottom: 18px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 14px;
  height: 3px;
  background: var(--blue);
}

.legend-dot--images {
  background: #7f919e;
}

.legend-dot--reads {
  background: #536eaf;
}

.legend-dot--valid {
  background: var(--success);
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 18px 16px 10px 5px;
}

.trend-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.chart-grid-line {
  stroke: #e3e7ec;
  stroke-width: 1;
}

.chart-axis-label,
.chart-empty {
  fill: var(--text-muted);
  font-size: 11px;
}

.chart-empty {
  font-size: 13px;
}

.chart-area {
  display: none;
}

.chart-path {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.chart-path--seals {
  stroke: var(--blue);
}

.chart-path--images {
  stroke: #7f919e;
}

.chart-path--reads {
  stroke: #536eaf;
}

.chart-path--valid {
  stroke: var(--success);
}

.chart-point {
  stroke: var(--surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.funnel {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.funnel__item {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.funnel__item:last-child {
  border-bottom: 0;
}

.funnel__fill {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: var(--funnel-width);
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.funnel__label strong,
.funnel__label small,
.funnel__value strong,
.funnel__value small {
  display: block;
}

.funnel__label strong,
.funnel__value strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.funnel__label small,
.funnel__value small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.funnel__value {
  text-align: right;
}

.funnel__value strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.mini-stat {
  color: var(--text-muted);
  font-size: 10px;
  text-align: right;
}

.mini-stat strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(130px, 1.2fr);
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.donut-chart {
  display: block;
  width: min(100%, 180px);
  margin: auto;
  overflow: visible;
}

.donut-track,
.donut-segment {
  fill: none;
  stroke-width: 24;
}

.donut-track {
  stroke: #edf0f3;
}

.donut-segment {
  transform: rotate(-90deg);
  transform-origin: 110px 110px;
}

.donut-number {
  fill: var(--text);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.donut-caption {
  fill: var(--text-muted);
  font-size: 10px;
}

.breakdown-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breakdown-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
}

.breakdown-list i {
  width: 8px;
  height: 8px;
}

.breakdown-list strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.outcome-list {
  display: grid;
  gap: 18px;
  padding: 22px 20px;
}

.outcome-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
}

.outcome-row__label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
}

.outcome-row__label i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--outcome-color, var(--blue));
}

.outcome-row > strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.outcome-track {
  grid-column: 1 / -1;
  height: 7px;
  background: #edf0f3;
  overflow: hidden;
}

.outcome-fill {
  display: block;
  width: var(--outcome-width, 0%);
  height: 100%;
  background: var(--outcome-color, var(--blue));
}

/* Security and data */

.security-panel {
  margin-bottom: 18px;
  scroll-margin-top: 96px;
}

.panel__header--split {
  align-items: flex-end;
}

.security-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.status-pill--ok {
  border-color: #a6d8c1;
  background: var(--success-soft);
  color: var(--success);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fafbfc;
}

.key-id {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 650;
}

.key-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-subtle);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
  text-transform: capitalize;
}

.key-status[data-status="active"] {
  border-color: #a6d8c1;
  background: var(--success-soft);
  color: var(--success);
}

.key-status[data-status="revoked"],
.key-status[data-status="expired"] {
  border-color: #f5b7b1;
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-cell {
  padding: 32px 20px !important;
  color: var(--text-muted);
  text-align: center !important;
}

.data-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  scroll-margin-top: 96px;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 18px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--text-muted);
  font-size: 11px;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.definitions {
  padding: 0 20px;
}

.definition {
  border-bottom: 1px solid var(--line);
}

.definition:last-child {
  border-bottom: 0;
}

.definition summary {
  padding: 15px 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.definition p {
  max-width: 720px;
  margin: -3px 0 16px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
  padding: 18px 2px 2px;
  border-top: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 10px;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1240px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar__actions {
    width: 100%;
    margin-left: 0;
  }

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

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

  .funnel-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .app-shell.is-menu-open .sidebar {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .menu-button {
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(11, 31, 51, 0.48);
  }

  .app-shell.is-menu-open .sidebar-backdrop {
    display: block;
  }

  body.has-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
    padding: 12px 16px;
  }

  .issuer-control {
    flex: 1;
  }

  .issuer-control > label {
    display: none;
  }

  .select-wrap {
    min-width: 0;
    width: 100%;
  }

  .topbar__actions {
    align-items: stretch;
    overflow-x: auto;
  }

  .period-switcher {
    min-width: max-content;
  }

  .dashboard {
    padding: 25px 16px 22px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-legend {
    justify-content: flex-start;
  }

  .panel__header,
  .panel__header--split {
    align-items: flex-start;
    flex-direction: column;
  }

  .security-summary {
    justify-content: flex-start;
  }

  .analytics-grid,
  .data-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .funnel-panel {
    grid-column: auto;
  }

  .donut-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .login-panel {
    padding: 30px 24px;
  }

  .brand--login {
    margin-bottom: 42px;
  }

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

  .metric-card,
  .metric-card--compact {
    min-height: 0;
  }

  .funnel__item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .funnel__value {
    text-align: right;
  }

  .detail-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .detail-list dd {
    text-align: left;
  }

  .dashboard-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
