:root {
  color-scheme: light;
  --ink: #192725;
  --muted: #566763;
  --subtle: #6f807b;
  --paper: #f6f8f5;
  --surface: #fff;
  --line: #dce6df;
  --sidebar: #142522;
  --sidebar-hover: #233b35;
  --accent: #12644e;
  --accent-hover: #0d513e;
  --mint: #a8e5c2;
  --radius: 14px;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { font-weight: 650; }
:focus-visible { outline: 3px solid #368d6c; outline-offset: 3px; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 2; inset: 12px auto auto 12px; padding: 10px; background: white; }

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  align-self: start;
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  padding: 26px 16px 15px;
  background: var(--sidebar);
  color: #f4fcf7;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  margin: 0 10px 34px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -.04em;
  line-height: 1.12;
}
.brand small { display: block; margin-top: 4px; color: #b5cfc4; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.brand-mark { position: relative; flex: 0 0 39px; height: 39px; border-radius: 11px; background: var(--mint); }
.brand-mark::before { content: ''; position: absolute; inset: 11px 8px; border: 2px solid var(--sidebar); border-radius: 3px; }
.brand-mark::after { content: ''; position: absolute; top: 9px; left: 14px; width: 11px; height: 11px; border: solid var(--sidebar); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.navigation { display: grid; gap: 4px; }
.navigation a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #bed2ca;
  font-size: 14px;
  font-weight: 570;
  text-decoration: none;
}
.navigation a:hover { color: #fff; background: var(--sidebar-hover); }
.navigation a[aria-current='page'] { color: #eafff3; background: #30594b; }
.navigation a:focus-visible, .brand:focus-visible { outline-color: var(--mint); }
.nav-icon { position: relative; display: inline-grid; flex: 0 0 15px; height: 15px; place-items: center; opacity: .9; }
.nav-icon::before, .nav-icon::after { position: absolute; content: ''; }
.icon-overview::before { width: 6px; height: 6px; top: 0; left: 0; background: currentColor; border-radius: 1px; box-shadow: 9px 0, 0 9px, 9px 9px; }
.icon-tenants::before { top: 0; width: 6px; height: 6px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-tenants::after { bottom: 0; width: 13px; height: 8px; border: 1.5px solid currentColor; border-radius: 7px 7px 3px 3px; }
.icon-domains::before { inset: 0; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-domains::after { inset: 0 4px; border: solid currentColor; border-width: 0 1.5px; border-radius: 50%; }
.icon-sources::before { width: 14px; height: 1.5px; background: currentColor; box-shadow: 0 -4px, 0 4px; }
.icon-sources::after { width: 4px; height: 4px; background: currentColor; box-shadow: -4px -4px, 4px 4px; border-radius: 50%; }
.icon-jobs::before { inset: 0 2px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon-jobs::after { width: 5px; height: 1px; background: currentColor; box-shadow: 0 -3px, 0 3px; }
.icon-suppressions::before { inset: 0; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-suppressions::after { width: 12px; height: 1.5px; transform: rotate(-45deg); background: currentColor; }
.icon-mta::before { width: 2px; height: 7px; background: currentColor; box-shadow: 4px -4px, -4px 2px; transform: translateY(1px); }
.service { display: flex; gap: 10px; align-items: center; margin: auto 0 0; padding: 12px 10px; border-top: 1px solid #395047; }
.service strong, .service small { display: block; }
.service strong { font-size: 13px; }
.service small { margin-top: 2px; color: #b5cfc4; font-size: 12px; }
.service-light { flex: 0 0 8px; height: 8px; border-radius: 50%; background: #b0bdb8; }
.service-light.is-online { background: #90e3b5; box-shadow: 0 0 0 4px #254c3d; }
.service-light.is-offline { background: #ffab9e; box-shadow: 0 0 0 4px #50332d; }

.workspace { min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 67px;
  padding: 12px clamp(18px, 3.1vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.breadcrumb, .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb > strong { color: var(--ink); }
.main { max-width: 1570px; margin-inline: auto; padding: 37px clamp(18px, 3.1vw, 48px) 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading h1, .login-intro h1 { margin: 0 0 9px; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); }
.page-heading .actions { flex-shrink: 0; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  line-height: 1.2;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.button:disabled { opacity: .52; cursor: wait; }
.button-quiet { border-color: #d4e0d8; background: var(--surface); color: #244139; }
.button-quiet:not(:disabled):hover { background: #edf5ef; }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button-primary:not(:disabled):hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button-danger { background: #9a3528; color: #fff; }
.button-danger:not(:disabled):hover { background: #7d2419; }
.icon-button { width: 37px; min-height: 37px; padding: 0 0 3px; font-size: 24px; font-weight: 400; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px #19272509; }
.panel-title { margin: 0; padding: 19px 20px 12px; font-size: 17px; letter-spacing: -.012em; }
.empty { margin: 0; padding: 28px 20px; color: var(--muted); text-align: center; }
#page-content > .empty { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notice { padding: 11px 14px; border: 1px solid #c9e1d3; border-radius: 8px; background: #eaf7ee; color: #195840; font-size: 14px; }

.login-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(270px, .85fr); gap: 22px; max-width: 950px; margin-top: clamp(16px, 5vh, 64px); }
.login-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 370px;
  padding: clamp(22px, 4.4vw, 42px);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 103% 111%, #2c6d54 0%, transparent 65%), #18332e;
  color: #f7fffa;
}
.login-intro > p { max-width: 31ch; margin: 16px 0 0; color: #d4e9df; font-size: 16px; }
.login-pattern {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-radial-gradient(ellipse 180px 110px at 80% 115%, transparent 0 25px, #8cc3a435 26px 27px, transparent 28px 40px);
  mask-image: linear-gradient(transparent 20%, #000 90%);
}
.login-card { align-self: center; padding: clamp(20px, 3vw, 32px); }
.login-card h2 { margin-bottom: 20px; font-size: 23px; letter-spacing: -.03em; }
.login-card select { margin-bottom: 5px; }
.login-card .button { justify-content: space-between; min-height: 43px; margin-top: 5px; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat { display: flex; position: relative; flex-direction: column; align-items: start; justify-content: space-between; gap: 11px; min-height: 111px; padding: 15px 17px; text-decoration: none; }
.stat:hover { border-color: #91bca5; background: #f9fffb; }
.stat > span:first-child { color: var(--muted); font-size: 13px; font-weight: 580; }
.stat > strong { line-height: 1; font-size: clamp(28px, 3vw, 38px); font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.stat-arrow { position: absolute; right: 15px; bottom: 15px; color: var(--accent); }
.overview-layout { display: grid; grid-template-columns: minmax(240px, 1.6fr) minmax(200px, 1fr); gap: 18px; }
.connection-details { padding: 0 20px 16px; }
.connection-details > p { color: var(--muted); margin: 0 0 8px; }
.status-lines { display: grid; gap: 14px; margin: 0; padding: 10px 20px 23px; list-style: none; }
.status-line { display: grid; grid-template-columns: minmax(100px, 146px) 1fr auto; gap: 14px; align-items: center; }
.status-line .badge { justify-self: start; }
.status-line > strong { min-width: 2ch; color: var(--muted); font-size: 13px; text-align: right; }
.status-bar { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 6px; appearance: none; background: #e6efe8; color: var(--accent); }
.status-bar::-webkit-progress-bar { background: #e6efe8; }
.status-bar::-webkit-progress-value { border-radius: 6px; background: var(--accent); }
.status-bar::-moz-progress-bar { border-radius: 6px; background: var(--accent); }
.shortcuts { display: grid; gap: 9px; padding: 8px 20px 20px; }
.shortcuts .button { justify-content: start; }

.table-scroll { overflow: auto; border-radius: inherit; }
.table-scroll:focus-visible { outline-offset: -4px; }
.table-tools { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.filter-field { width: min(100%, 320px); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { padding: 12px 16px; background: #f0f5f1; color: #496559; font-size: 12px; font-weight: 680; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid #e7eee9; vertical-align: middle; }
tbody tr:hover { background: #fbfdfb; }
.table-value { min-width: 9ch; overflow-wrap: anywhere; }
.table-value strong, .table-value small { display: block; }
.table-value small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.row-actions { flex-wrap: nowrap; }
.row-actions .button { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 100px; font-size: 12px; font-weight: 660; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good { background: #e1f3e7; color: #17563d; }
.badge-warn { background: #fcf0ce; color: #744600; }
.badge-bad { background: #fbe9e5; color: #893c30; }
.badge-neutral { background: #edf1f1; color: #405852; }

.form, .field { display: grid; gap: 7px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field-wide { grid-column: 1 / -1; }
label { color: #364e45; font-size: 13px; font-weight: 650; }
.field-hint, .copy-feedback { color: var(--muted); font-size: 12px; font-weight: 400; }
.field-hint { line-height: 1.35; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid #cbd9d0; border-radius: 7px; background: white; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #63776e; opacity: 1; }
textarea { resize: vertical; }
input:disabled, select:disabled { background: #eef3ef; color: #566763; }
.form-error, .error-text { color: #923b2e; }
.form-error { margin: 7px 0; overflow-wrap: anywhere; font-size: 13px; }

dialog { width: min(600px, calc(100% - 24px)); max-height: min(88vh, 830px); padding: 0; border: 1px solid #cbdad1; border-radius: var(--radius); color: var(--ink); box-shadow: 0 20px 65px #08261d45; }
dialog::backdrop { background: #102a228f; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 19px; border-bottom: 1px solid var(--line); background: #f8fbf8; }
.dialog-heading h2 { margin: 0; overflow-wrap: anywhere; font-size: 20px; letter-spacing: -.024em; }
.dialog-heading > button { flex-shrink: 0; }
#dialog-content { padding: 19px; }
.dialog-copy { margin-bottom: 13px; color: var(--muted); font-size: 14px; }
.dialog-actions { justify-content: end; margin-top: 14px; }
.dialog-actions:empty { display: none; }
.details { display: grid; gap: 8px; margin-top: 0; margin-bottom: 8px; }
.detail-pair { display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, 2fr); gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #e8efe9; }
.detail-pair dt { color: var(--muted); font-size: 13px; font-weight: 620; }
.detail-pair dd { margin: 0; overflow-wrap: anywhere; }
.copy-value { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; }
.copy-value code { padding: 6px 8px; border-radius: 5px; background: #edf4ef; }
.copy-feedback { grid-column: 1 / -1; }
.copy-feedback:empty { display: none; }
.history, .detail-heading { margin-top: 18px; }
.history h3, .detail-heading { margin-bottom: 8px; font-size: 15px; }
.event-detail { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; }
.event-detail + .event-detail { margin-top: 6px; }
.event-detail summary { cursor: pointer; font-weight: 600; }
.json-details { max-height: 280px; overflow: auto; margin: 7px 0 0; padding: 10px; border-radius: 6px; background: #edf4ef; color: #29493c; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1160px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); }
  th, td { padding-inline: 12px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .login-layout { grid-template-columns: 1fr; margin-top: 0; }
  .login-intro { min-height: 285px; }
  .stat { min-height: 97px; }
}
@media (max-width: 690px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 0 0; }
  .brand { margin: 0 14px 12px; }
  .brand-mark { flex-basis: 36px; height: 36px; }
  .brand-mark::after { top: 8px; left: 13px; width: 10px; height: 10px; }
  .navigation { display: flex; overflow: auto; gap: 5px; padding: 0 12px 10px; }
  .navigation a { flex-shrink: 0; gap: 6px; padding-inline: 9px; }
  .service { position: absolute; top: 13px; right: 12px; min-height: 42px; margin: 0; padding: 0; border: 0; }
  .service strong { display: none; }
  .service small { font-size: 11px; }
  .topbar { min-height: 55px; gap: 8px; padding: 7px 12px; }
  .topbar .actions { flex-wrap: nowrap; flex-shrink: 0; }
  .topbar .button { padding-inline: 8px; }
  .main { padding: 22px 12px 40px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 17px; }
  .page-heading .actions { flex-shrink: 1; }
  .overview-layout { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar .breadcrumb { gap: 4px; }
  .login-intro { min-height: 255px; }
  .copy-value { grid-template-columns: 1fr; }
  .copy-value .button { justify-self: start; }
}
