:root {
  --brand-primary: #279528;
  --brand-secondary: #1558d6;
  --brand-surface: #eef5ff;
  --brand-accent: #3d8bff;
  --brand-neutral: #12304d;
  --text: var(--brand-neutral);
  --muted: #58708f;
  --line: #d8e4f3;
  --line-strong: #bfd0e4;
  --surface: #ffffff;
  --surface-alt: #f7fbff;
  --surface-emphasis: #edf4ff;
  --ok: #279528;
  --warn: #d97706;
  --partial: #ea580c;
  --down: #dc2626;
  --maintenance: #246a96;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow: 0 18px 44px rgba(15, 50, 100, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 50, 100, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(61, 139, 255, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(21, 88, 214, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--brand-surface) 56%, #ffffff 100%);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

img {
  max-width: 100%;
}

a {
  color: var(--brand-secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  color: var(--text);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(51, 153, 255, 0.16);
}

input[type="color"] {
  min-height: 48px;
  padding: 0.35rem;
}

textarea {
  resize: vertical;
}

fieldset {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

legend {
  padding: 0 0.35rem;
  color: var(--muted);
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

code {
  display: inline-block;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
  background: #eef2f6;
  color: #1f2937;
  font-size: 0.92em;
}

.shell {
  width: min(1160px, calc(100vw - 2rem));
  margin: 0 auto;
}

.public-page {
  min-height: 100vh;
  padding-bottom: 3rem;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(245, 250, 255, 0.94) 100%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.public-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 0;
}

.brand-home {
  display: inline-flex;
  align-items: center;
}

.brand-home:hover {
  text-decoration: none;
}

.brand-block,
.admin-sidebar__brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-block h1,
.brand-block p,
.admin-sidebar__top h1,
.admin-sidebar__top p,
.login-card h1,
.login-card p {
  margin: 0;
}

.brand-block h1,
.admin-sidebar__top h1,
.login-card h1 {
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

.brand-block p,
.admin-sidebar__top p,
.login-card p,
.component-group__header p,
.component-card p,
.empty-state {
  color: var(--muted);
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

.brand-logo--header {
  width: clamp(150px, 18vw, 190px);
  min-width: 150px;
}

.brand-logo--sidebar {
  width: 122px;
}

.brand-logo--login {
  width: 164px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: var(--shadow-soft);
}

.brand-mark--sidebar {
  width: 42px;
  height: 42px;
}

.brand-mark--login {
  height: 44px;
}

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

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.eyebrow {
  color: var(--brand-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  font-weight: 700;
}

.public-header__aside {
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  min-width: 320px;
}

.support-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.support-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  font-weight: 600;
  color: var(--brand-secondary);
}

.support-link:hover {
  text-decoration: none;
  border-color: var(--brand-accent);
}

.live-status-card {
  width: min(420px, 100%);
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: var(--shadow-soft);
}

.live-status-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.live-status-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-status-card__meta-item {
  white-space: nowrap;
}

.live-status-card__meta-separator {
  color: #7a8da2;
}

.public-main {
  padding: 1.25rem 0 1rem;
}

.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  padding-top: 0.75rem;
}

.public-footer__nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.public-footer__feeds {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.public-footer__nav a,
.public-footer__feeds a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.public-footer__nav a:hover,
.public-footer__feeds a:hover {
  text-decoration: none;
  border-color: var(--brand-accent);
}

.hero-panel,
.grid-two,
.metric-grid,
.settings-grid {
  display: grid;
  gap: 1rem;
}

.hero-panel {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
  margin-bottom: 1rem;
}

.hero-panel__main,
.overall-panel,
.panel,
.event-hero,
.login-card,
.metric-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero-panel__main {
  padding: 1.75rem;
  border-top: 4px solid var(--brand-primary);
}

.hero-panel__main h2,
.overall-panel p,
.event-hero h2,
.admin-header h2 {
  margin: 0;
}

.hero-panel__main h2 {
  margin: 0.4rem 0 0.8rem;
  font-size: clamp(1.8rem, 3.5vw, 2.7rem);
  line-height: 1.08;
}

.hero-panel__main p {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.overall-panel {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  padding: 1.5rem;
  border-top: 4px solid var(--brand-secondary);
}

.overall-panel__status {
  font-size: 1rem;
}

.overall-panel--major_outage {
  border-top-color: var(--down);
}

.overall-panel--maintenance {
  border-top-color: var(--maintenance);
}

.panel {
  padding: 1.25rem;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.section-head,
.component-card__row,
.timeline-item__top,
.event-card__meta,
.row-actions,
.list-row,
.event-hero__times,
.component-group__header,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head--summary {
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 0.55rem;
}

.section-head > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.section-head__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0 0.72rem;
  border: 1px solid #cfe0f7;
  border-radius: 999px;
  background: linear-gradient(180deg, #f4f9ff 0%, #e9f2ff 100%);
  color: var(--brand-secondary);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.section-head h3,
.component-group h4,
.component-card h5,
.event-card h3,
.event-hero h2 {
  margin: 0;
}

.section-head span,
.meta-line,
.helper-copy,
.timeline-item small,
.event-card__details,
.event-hero__times {
  color: var(--muted);
  font-size: 0.93rem;
}

.event-card,
.component-card,
.timeline-item,
.list-row,
.metric-card,
.helper-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.event-card,
.component-card,
.timeline-item,
.metric-card {
  padding: 1rem;
}

.event-card + .event-card,
.list-row + .list-row {
  margin-top: 0.75rem;
}

.event-card h3 {
  margin: 0.45rem 0 0.3rem;
  font-size: 1.03rem;
}

.event-card p,
.component-card p,
.timeline-item p {
  margin: 0.35rem 0 0;
}

.event-card__details {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.component-groups,
.component-list,
.timeline,
.simple-list {
  display: grid;
  gap: 0.8rem;
}

.component-group {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.chip-row,
.checkbox-list,
.checkbox-list__row,
.inline-choice,
.stack-form {
  display: grid;
  gap: 0.85rem;
}

.chip-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 0.75rem;
}

.component-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(var(--history-days, 30), minmax(0, 1fr));
  gap: 0.2rem;
  margin-top: 0.9rem;
}

.history-grid__cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: #dbe2ea;
  cursor: help;
}

.history-grid__cell:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.history-grid__cell--operational {
  background: #76c26a;
}

.history-grid__cell--degraded_performance {
  background: #f5b24b;
}

.history-grid__cell--partial_outage {
  background: #f28b46;
}

.history-grid__cell--major_outage {
  background: #e05f5f;
}

.history-grid__cell--maintenance {
  background: #6ca8d2;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.32rem 0.62rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill {
  border: 1px solid transparent;
}

.status-pill--operational {
  background: #e9f6e8;
  border-color: #c7e5c3;
  color: #1e6d1f;
}

.status-pill--degraded_performance {
  background: #fef3dd;
  border-color: #f7d99a;
  color: #9a5a02;
}

.status-pill--partial_outage {
  background: #fff0e7;
  border-color: #f6c49f;
  color: #b45309;
}

.status-pill--major_outage {
  background: #fee9e9;
  border-color: #f6bcbc;
  color: #b42318;
}

.status-pill--resolved {
  background: #e5f7f1;
  border-color: #b8e6d7;
  color: #14795c;
}

.status-pill--maintenance,
.status-pill--scheduled,
.status-pill--in_progress {
  background: #eaf3fb;
  border-color: #bad2e6;
  color: #1d5b82;
}

.status-pill--identified,
.status-pill--monitoring,
.status-pill--completed,
.status-pill--cancelled,
.status-pill--investigating {
  background: #eef2f6;
  border-color: #d5dde6;
  color: #445261;
}

.tag {
  background: var(--surface-emphasis);
  color: var(--brand-secondary);
  border: 1px solid #d7e5f2;
}

.history-toolbar,
.subscribe-layout {
  display: grid;
  gap: 1rem;
}

.history-toolbar {
  margin: -0.15rem 0 1rem;
}

.history-legend {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.history-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(18, 48, 77, 0.08);
}

.history-legend__swatch--operational {
  background: #76c26a;
}

.history-legend__swatch--degraded_performance {
  background: #f5b24b;
}

.history-legend__swatch--partial_outage {
  background: #f28b46;
}

.history-legend__swatch--major_outage {
  background: #e05f5f;
}

.history-legend__swatch--maintenance {
  background: #6ca8d2;
}

.history-range {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.history-range__link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-secondary);
  font-weight: 700;
}

.history-range__link:hover {
  text-decoration: none;
  border-color: var(--brand-accent);
}

.history-range__link.is-active {
  background: linear-gradient(180deg, rgba(61, 139, 255, 0.15) 0%, rgba(21, 88, 214, 0.08) 100%);
  border-color: rgba(21, 88, 214, 0.3);
  color: var(--brand-secondary);
}

.history-panel__footer {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.simple-list {
  margin: 0;
  padding-left: 1.2rem;
}

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

.checkbox-list label,
.inline-choice,
.checkbox-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-weight: 500;
}

.checkbox-list input,
.inline-choice input,
.checkbox-list__row input {
  width: auto;
  margin: 0;
}

.checkbox-list select {
  max-width: 220px;
}

.button,
.button-link,
.button--ghost,
.button--danger {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.button,
.button--ghost,
.button--danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 10px;
  font-weight: 700;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

.button:hover,
.button--ghost:hover,
.button--danger:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.button {
  color: #ffffff;
  background: var(--brand-secondary);
  box-shadow: 0 10px 24px rgba(36, 106, 150, 0.18);
}

.button:hover {
  background: #1d5677;
}

.button--ghost {
  background: #eef3f8;
  color: var(--brand-secondary);
}

.button--ghost:hover {
  background: #e3ebf4;
}

.button--danger {
  color: #ffffff;
  background: var(--down);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.18);
}

.button-link {
  background: transparent;
  color: var(--brand-secondary);
  padding: 0;
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1rem;
  font-weight: 600;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.flash--success {
  border-left-color: var(--ok);
}

.flash--error {
  border-left-color: var(--down);
}

.event-hero {
  margin-bottom: 1rem;
  padding: 1.5rem;
}

.event-hero__meta {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.timeline-item__top {
  align-items: flex-start;
}

.helper-box {
  padding: 1rem;
  background: linear-gradient(180deg, #fbfdff 0%, #f2f7ff 100%);
}

.helper-box summary {
  cursor: pointer;
  font-weight: 700;
}

.ui-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.ui-icon--nav {
  width: 1.05rem;
  height: 1.05rem;
}

.ui-icon--button {
  width: 0.95rem;
  height: 0.95rem;
}

.history-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.96);
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.danger-zone {
  margin-top: 1rem;
}

.admin-page {
  --admin-sidebar-width: 228px;
  display: grid;
  grid-template-columns: var(--admin-sidebar-width) 1fr;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(61, 139, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #f3f8ff 0%, #edf4ff 100%);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0.9rem 0.8rem 0.85rem;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #0d4fbf 0%, #1147a2 52%, #143a81 100%);
  color: #ffffff;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 14px 0 40px rgba(15, 50, 100, 0.12);
  overflow: hidden;
}

.admin-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 36%);
  pointer-events: none;
}

.admin-sidebar a {
  color: inherit;
}

.admin-sidebar__top,
.admin-nav,
.logout-form {
  position: relative;
  z-index: 1;
}

.admin-sidebar__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.admin-sidebar__toolbar {
  order: 2;
  display: flex;
  justify-content: flex-end;
}

.admin-sidebar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(7, 23, 56, 0.16);
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.admin-sidebar__toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

.admin-sidebar__toggle-icon {
  display: inline-flex;
}

.admin-sidebar__toggle-icon--expand {
  display: none;
}

.admin-sidebar__brand {
  order: 1;
  flex: 1;
  display: grid;
  justify-items: start;
  gap: 0.4rem;
}

.admin-sidebar__top p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.admin-nav {
  display: grid;
  gap: 0.2rem;
}

.admin-nav a {
  display: grid;
  grid-template-columns: 1rem 1fr auto;
  align-items: center;
  gap: 0.42rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.1;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.admin-nav a.is-active,
.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(7, 23, 56, 0.18);
  transform: translateX(1px);
}

.admin-nav__icon {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: rgba(255, 255, 255, 0.92);
}

.admin-nav__label {
  min-width: 0;
}

.admin-nav__chevron {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.9rem;
  line-height: 1;
  transition:
    transform 140ms ease,
    color 140ms ease;
}

.admin-nav a.is-active .admin-nav__chevron,
.admin-nav a:hover .admin-nav__chevron {
  color: rgba(255, 255, 255, 0.9);
  transform: translateX(2px);
}

.logout-form {
  align-self: end;
}

.logout-form .button {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  padding-inline: 0.72rem;
}

.admin-main {
  padding: 1.6rem 1.7rem 2rem;
  background:
    radial-gradient(circle at top right, rgba(61, 139, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(237, 244, 255, 0.88) 100%);
}

.admin-header {
  margin-bottom: 0.9rem;
}

.admin-header h2 {
  font-size: clamp(1.65rem, 3vw, 2.2rem);
}

@media (min-width: 1081px) {
  html[data-admin-sidebar="collapsed"] .admin-page {
    --admin-sidebar-width: 84px;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar {
    padding-inline: 0.6rem;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar__top {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar__toolbar {
    order: 2;
    justify-content: center;
    width: 100%;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar__brand {
    order: 1;
    justify-items: center;
    flex: none;
  }

  html[data-admin-sidebar="collapsed"] .brand-logo--sidebar {
    width: 46px;
  }

  html[data-admin-sidebar="collapsed"] .brand-mark--sidebar {
    width: 38px;
    height: 38px;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar__brand p,
  html[data-admin-sidebar="collapsed"] .admin-nav__label,
  html[data-admin-sidebar="collapsed"] .admin-nav__chevron,
  html[data-admin-sidebar="collapsed"] .logout-form .button span {
    display: none;
  }

  html[data-admin-sidebar="collapsed"] .admin-nav a {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.32rem 0;
  }

  html[data-admin-sidebar="collapsed"] .logout-form .button {
    width: 38px;
    min-width: 38px;
    padding: 0;
    justify-content: center;
    margin: 0 auto;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar__toggle-icon--collapse {
    display: none;
  }

  html[data-admin-sidebar="collapsed"] .admin-sidebar__toggle-icon--expand {
    display: inline-flex;
  }
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  padding: 1rem 1.05rem;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
}

.metric-card strong {
  font-size: 2rem;
}

.list-row {
  padding: 0.95rem 1rem;
}

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

.admin-page .panel,
.admin-page .metric-card,
.admin-page .helper-box,
.admin-page .component-group,
.admin-page .event-card,
.admin-page .timeline-item,
.admin-page .list-row {
  border-color: rgba(191, 208, 228, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 255, 0.95) 100%);
  box-shadow:
    0 14px 34px rgba(15, 50, 100, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.admin-page .panel {
  padding: 1.15rem;
}

.admin-page .section-head {
  margin-bottom: 0.85rem;
}

.admin-page .button,
.admin-page .button--ghost,
.admin-page .button--danger {
  min-height: 40px;
  padding: 0 0.9rem;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 50, 100, 0.12);
}

.admin-page .button {
  background: linear-gradient(180deg, #3d8bff 0%, #1558d6 100%);
}

.admin-page .button:hover {
  background: linear-gradient(180deg, #4c97ff 0%, #1651be 100%);
}

.admin-page .button--ghost {
  border: 1px solid rgba(21, 88, 214, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(233, 241, 255, 0.92) 100%);
  color: var(--brand-secondary);
}

.admin-page .button--ghost:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(223, 235, 255, 0.96) 100%);
}

.admin-page .button--danger {
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.16);
}

.button--icon {
  gap: 0.55rem;
}

.admin-page .button-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.55rem;
  border-radius: 7px;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.admin-page .button-link:hover {
  background: rgba(61, 139, 255, 0.08);
  text-decoration: none;
}

.admin-page .table th {
  font-size: 0.8rem;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  padding: 0.72rem 0.82rem;
  background: rgba(255, 255, 255, 0.95);
}

.admin-page .stack-form,
.admin-page .checkbox-list,
.admin-page .checkbox-list__row,
.admin-page .inline-choice {
  gap: 0.75rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compact-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compact-form select {
  min-width: 200px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: linear-gradient(180deg, var(--brand-surface) 0%, #ffffff 100%);
}

.login-shell {
  width: min(560px, 100%);
}

.login-card {
  padding: 2rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: nowrap;
  margin-bottom: 1rem;
}

.login-brand__copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.access-panel {
  max-width: 580px;
  margin: 4rem auto 0;
}

.subscribe-panel {
  max-width: 920px;
  margin: 0 auto;
}

@media (min-width: 960px) {
  .subscribe-layout,
  .history-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
}

@media (max-width: 1080px) {
  .hero-panel,
  .grid-two,
  .metric-grid,
  .settings-grid,
  .admin-page {
    grid-template-columns: 1fr;
  }

  .admin-page {
    min-height: auto;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    box-shadow: none;
  }

  .admin-sidebar__toggle {
    display: none;
  }

  .logout-form .button {
    width: auto;
  }
}

@media (max-width: 720px) {
  .public-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .shell {
    width: min(100vw - 1rem, 100%);
  }

  .public-header__inner,
  .brand-block,
  .admin-sidebar__brand,
  .login-brand,
  .public-header__aside,
  .admin-header,
  .section-head,
  .component-card__row,
  .timeline-item__top,
  .list-row,
  .event-card__meta,
  .event-hero__times,
  .row-actions,
  .component-group__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .public-footer,
  .support-links,
  .history-legend,
  .history-range {
    flex-direction: column;
    align-items: flex-start;
  }

  .public-header__aside {
    width: 100%;
    justify-items: stretch;
    min-width: 0;
  }

  .support-links {
    width: 100%;
  }

  .live-status-card__row {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }

  .live-status-card__meta {
    width: 100%;
    display: grid;
    justify-content: flex-start;
    gap: 0.2rem;
  }

  .live-status-card__meta-item {
    white-space: normal;
  }

  .live-status-card__meta-separator {
    display: none;
  }

  .live-status-card__meta {
    justify-content: flex-start;
  }

  .live-status-card {
    width: 100%;
  }

  .section-head--summary {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .section-head--summary h3 {
    line-height: 1.25;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-list__row,
  .checkbox-list label,
  .inline-choice {
    flex-direction: column;
    align-items: flex-start;
  }

  .compact-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}
