:root {
  --ink: #1a1410;
  --ink-soft: #52525b;
  --ink-muted: #71717a;
  --canvas: #fdfcfb;
  --surface: #ffffff;
  --surface-soft: #faf8f7;
  --line: #e8e2de;
  --line-strong: #d8ceca;
  /* App brand red; darker variants keep small white/text labels readable. */
  --brand-primary: #EE3224;
  --brand-gradient-start: #FF7764;
  --brand-950: #5c1b16;
  --brand-900: #a8241b;
  --brand-800: #d92b1f;
  --brand-700: #c72a1e;
  --brand-100: #fde2df;
  --brand-50: #fff3f1;
  /* Semantic success colors are independent of the brand palette. */
  --green-700: #277157;
  --green-600: #34866a;
  --green-100: #deeee6;
  --green-50: #eef7f2;
  --amber-700: #9c6116;
  --amber-100: #fbeaca;
  --red-700: #a63b3b;
  --red-100: #fbe2e0;
  --blue-700: #35659a;
  --blue-100: #e3eef9;
  --shadow-sm: 0 1px 2px rgba(26, 20, 16, 0.04);
  --shadow-md: 0 14px 34px rgba(26, 20, 16, 0.09);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --sidebar-width: 252px;
  --focus: 0 0 0 3px rgba(238, 50, 36, 0.22);
  font-family:
    Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 119, 100, 0.09), transparent 30rem),
    var(--canvas);
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

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

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: white;
  background: var(--brand-900);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

.login-layout {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(135deg, rgba(255, 243, 241, 0.92), rgba(253, 252, 251, 0.68)),
    radial-gradient(circle at 20% 20%, var(--brand-100), transparent 34rem);
}

.login-card {
  width: min(100%, 430px);
  padding: 42px;
  border: 1px solid rgba(216, 206, 202, 0.78);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(26, 20, 16, 0.13);
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 17px;
  color: white;
  background: linear-gradient(145deg, var(--brand-gradient-start), var(--brand-primary));
  box-shadow: 0 9px 20px rgba(238, 50, 36, 0.2);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 28px;
  line-height: 1;
  place-items: center;
}

.brand-mark-small {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  font-size: 21px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.login-intro {
  margin: 12px 0 30px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label,
.field-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
}

.field input,
.field textarea,
.field select,
.table-tools input,
.table-tools select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.field input,
.field textarea,
.field select {
  padding: 10px 12px;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.table-tools input:focus,
.table-tools select:focus {
  border-color: var(--brand-primary);
  outline: none;
  box-shadow: var(--focus);
}

.field input::placeholder,
.field textarea::placeholder,
.table-tools input::placeholder {
  color: #a1a1aa;
}

.field-hint {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-error {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid #efc4c1;
  border-radius: 9px;
  color: var(--red-700);
  background: #fff5f4;
  font-size: 13px;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 130ms ease,
    background-color 130ms ease,
    border-color 130ms ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  color: white;
  background: var(--brand-800);
  box-shadow: 0 6px 14px rgba(238, 50, 36, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: var(--brand-900);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
  border-color: #c4b7b0;
  background: var(--surface-soft);
}

.button-danger {
  color: white;
  background: var(--red-700);
}

.button-danger:hover:not(:disabled) {
  background: #8d2f2f;
}

.button-quiet {
  border-color: var(--line);
  background: var(--surface-soft);
}

.button-quiet:hover:not(:disabled) {
  background: var(--brand-50);
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.button-wide {
  width: 100%;
}

.security-note {
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff3f1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 30%),
    var(--brand-950);
}

.sidebar-brand {
  display: flex;
  min-height: 83px;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.sidebar-brand small {
  margin-top: 3px;
  color: #f5bfba;
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 5px;
  padding: 22px 14px;
}

.main-nav a {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #f8d5d1;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
  transition:
    color 130ms ease,
    background-color 130ms ease;
}

.main-nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.main-nav a[aria-current="page"] {
  color: white;
  background: rgba(238, 50, 36, 0.28);
  box-shadow: inset 3px 0 var(--brand-gradient-start);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #f6c9c4;
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
  place-items: center;
}

.sidebar-footer {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.environment-label {
  color: #edada5;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.same-origin-label {
  color: #f8d5d1;
  font-size: 12px;
}

.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 83px;
  align-items: center;
  gap: 18px;
  padding: 13px 30px;
  border-bottom: 1px solid rgba(232, 226, 222, 0.86);
  background: rgba(253, 252, 251, 0.9);
  backdrop-filter: blur(16px);
}

.topbar-title {
  min-width: 0;
  margin-right: auto;
}

.topbar-title h1 {
  overflow: hidden;
  margin: 0;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.health-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1aa;
}

.health-ok {
  border-color: #c9e4d5;
  color: var(--green-700);
  background: var(--green-50);
}

.health-ok .status-dot {
  background: var(--green-600);
  box-shadow: 0 0 0 3px rgba(52, 134, 106, 0.13);
}

.health-warning {
  border-color: #f0d8aa;
  color: var(--amber-700);
  background: #fff9ed;
}

.health-warning .status-dot {
  background: #d18b2e;
}

.health-error {
  border-color: #efc9c7;
  color: var(--red-700);
  background: #fff5f4;
}

.health-error .status-dot {
  background: #c84c4c;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 18px;
  place-items: center;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-button.is-spinning span {
  animation: spin 800ms linear infinite;
}

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

.mobile-only {
  display: none;
}

.account-menu {
  position: relative;
}

.account-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 680;
}

.account-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: white;
  background: var(--brand-800);
  place-items: center;
}

.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 210px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.account-popover p {
  overflow: hidden;
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
}

.content {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px 30px 48px;
}

.page-lead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-lead h2 {
  margin: 0;
  font-size: 18px;
}

.page-lead p {
  max-width: 700px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.updated-at {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  right: -18px;
  bottom: -25px;
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: rgba(238, 50, 36, 0.055);
  content: "";
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 620;
}

.metric-icon {
  display: grid;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  color: var(--brand-700);
  background: var(--brand-50);
  font-size: 13px;
  place-items: center;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin: 17px 0 4px;
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 740;
  letter-spacing: -0.035em;
}

.metric-note {
  position: relative;
  z-index: 1;
  color: var(--ink-muted);
  font-size: 11px;
}

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

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

.panel-span-4 {
  grid-column: span 4;
}

.panel-span-5 {
  grid-column: span 5;
}

.panel-span-6 {
  grid-column: span 6;
}

.panel-span-7 {
  grid-column: span 7;
}

.panel-span-8 {
  grid-column: span 8;
}

.panel-span-12 {
  grid-column: span 12;
}

.panel-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.panel-body {
  padding: 18px;
}

.panel-body-flush {
  padding: 0;
}

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

.service-card {
  display: flex;
  min-height: 92px;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.service-indicator {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  place-items: center;
}

.service-card.is-ok .service-indicator {
  color: var(--green-700);
  background: var(--green-100);
}

.service-card.is-warning .service-indicator,
.service-card.is-degraded .service-indicator {
  color: var(--amber-700);
  background: var(--amber-100);
}

.service-card.is-error .service-indicator,
.service-card.is-down .service-indicator {
  color: var(--red-700);
  background: var(--red-100);
}

.service-card.is-unknown .service-indicator {
  color: var(--ink-soft);
  background: #f0ecea;
}

.service-name {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 720;
}

.service-status {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-ok,
.status-active,
.status-success,
.status-resolved {
  color: var(--green-700);
  background: var(--green-50);
}

.status-warning,
.status-pending,
.status-started,
.status-degraded {
  color: var(--amber-700);
  background: #fff7e8;
}

.status-error,
.status-down,
.status-failed,
.status-denied,
.status-disabled,
.status-open,
.status-critical {
  color: var(--red-700);
  background: #fff2f1;
}

.status-info,
.status-unknown {
  color: var(--blue-700);
  background: #edf5fc;
}

.definition-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.definition-row {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.definition-row dt {
  color: var(--ink-soft);
  font-size: 12px;
}

.definition-row dd {
  margin: 0;
  font-size: 12px;
  font-weight: 690;
  text-align: right;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--brand-100);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--brand-50);
  font-size: 12px;
  line-height: 1.55;
}

.notice-warning {
  border-color: #efddb7;
  background: #fff9ee;
}

.notice-error {
  border-color: #efcecb;
  background: #fff5f4;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-tools input,
.table-tools select {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 12px;
}

.search-input {
  width: min(260px, 44vw);
}

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

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

.data-table th,
.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  color: var(--ink-muted);
  background: #fdfcfb;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: var(--brand-50);
}

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

.table-primary {
  display: block;
  max-width: 270px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 670;
  text-overflow: ellipsis;
}

.table-secondary {
  display: block;
  max-width: 270px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.empty-state {
  display: grid;
  min-height: 230px;
  padding: 34px 20px;
  color: var(--ink-muted);
  text-align: center;
  place-items: center;
}

.empty-state-inner {
  max-width: 410px;
}

.empty-symbol {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 14px;
  color: var(--brand-700);
  background: var(--brand-50);
  font-size: 20px;
  place-items: center;
}

.empty-state h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

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

.skeleton {
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.82) 45%, transparent 65%)
      #eee9e6;
  background-size: 220% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
}

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

.error-state {
  padding: 30px;
  border: 1px solid #ecc7c4;
  border-radius: var(--radius-md);
  background: #fff7f6;
}

.error-state h2 {
  margin: 0 0 8px;
  color: var(--red-700);
  font-size: 17px;
}

.error-state p {
  margin: 0 0 17px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.progress-list {
  display: grid;
  gap: 15px;
}

.progress-item {
  display: grid;
  gap: 7px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 11px;
}

.progress-label strong {
  color: var(--ink);
}

.progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #f0ecea;
}

.progress-bar {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-gradient-start));
}

.config-form {
  display: grid;
  gap: 0;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 24px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.config-row:last-of-type {
  border-bottom: 0;
}

.config-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.config-copy span {
  display: block;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.5;
}

.config-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.config-control input:not([type="checkbox"]),
.config-control select {
  width: min(100%, 330px);
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 43px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d4d4d8;
  transition: background 140ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 140ms ease;
}

.switch input:checked + .switch-track {
  background: var(--brand-primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  box-shadow: var(--focus);
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
}

.alert-list,
.event-list {
  display: grid;
}

.alert-item,
.event-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.alert-item:last-child,
.event-item:last-child {
  border-bottom: 0;
}

.alert-severity,
.event-symbol {
  display: grid;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  color: var(--ink-soft);
  background: #f0ecea;
  font-size: 12px;
  font-weight: 800;
  place-items: center;
}

.alert-item.severity-critical .alert-severity,
.alert-item.severity-error .alert-severity {
  color: var(--red-700);
  background: var(--red-100);
}

.alert-item.severity-warning .alert-severity {
  color: var(--amber-700);
  background: var(--amber-100);
}

.alert-content strong,
.event-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.alert-content p,
.event-content p {
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  text-overflow: ellipsis;
}

.alert-meta,
.event-meta {
  color: var(--ink-muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
}

.pagination-info {
  color: var(--ink-muted);
  font-size: 11px;
}

.pagination-actions {
  display: flex;
  gap: 7px;
}

.confirm-dialog {
  width: min(calc(100% - 32px), 510px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(26, 20, 16, 0.24);
}

.confirm-dialog::backdrop {
  background: rgba(26, 20, 16, 0.55);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 24px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 18px;
}

.dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--red-700);
  background: var(--red-100);
  font-size: 18px;
  font-weight: 800;
  place-items: center;
}

.dialog-description {
  margin: 18px 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.confirm-target {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 9px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 180ms ease both;
}

.toast-success {
  border-left: 4px solid var(--green-600);
}

.toast-error {
  border-left: 4px solid var(--red-700);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.noscript-message {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  padding: 24px;
  color: white;
  background: var(--brand-950);
  text-align: center;
  place-items: center;
}

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

.text-danger {
  color: var(--red-700);
}

.text-success {
  color: var(--green-700);
}

.nowrap {
  white-space: nowrap;
}

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

.panel-span-4 .service-grid,
.panel-span-5 .service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .panel-span-4,
  .panel-span-5,
  .panel-span-6,
  .panel-span-7,
  .panel-span-8 {
    grid-column: span 6;
  }
}

@media (max-width: 850px) {
  .sidebar {
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

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

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: rgba(26, 20, 16, 0.45);
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-only {
    display: grid;
  }

  .topbar {
    padding-inline: 18px;
  }

  .content {
    padding-inline: 18px;
  }

  .health-pill {
    display: none;
  }

  .panel-span-4,
  .panel-span-5,
  .panel-span-6,
  .panel-span-7,
  .panel-span-8,
  .panel-span-12 {
    grid-column: span 12;
  }
}

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

  .topbar {
    min-height: 72px;
    gap: 10px;
    padding-inline: 12px;
  }

  .topbar-title h1 {
    max-width: 37vw;
    font-size: 19px;
  }

  .topbar-title .eyebrow,
  .account-name {
    display: none;
  }

  .account-button {
    padding-right: 6px;
  }

  .content {
    padding: 20px 12px 38px;
  }

  .page-lead {
    display: block;
  }

  .updated-at {
    display: block;
    margin-top: 8px;
  }

  .metric-grid,
  .loading-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 116px;
  }

  .panel-grid {
    gap: 13px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

  .config-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .config-control {
    justify-content: flex-start;
  }

  .config-control input:not([type="checkbox"]),
  .config-control select {
    width: 100%;
  }

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

  .alert-meta,
  .event-meta {
    grid-column: 2;
    text-align: left;
  }

  .pagination {
    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;
  }
}

.feedback-list { display: grid; gap: 16px; }
.feedback-item { padding: 20px; overflow-wrap: anywhere; }
.feedback-text { white-space: pre-wrap; }
.feedback-images { display: flex; flex-wrap: wrap; gap: 12px; }
.feedback-images img { width: 140px; max-height: 200px; object-fit: contain; border-radius: 10px; }
