:root {
  --ink: #17212b;
  --muted: #667481;
  --navy: #123f62;
  --navy-deep: #0c2c45;
  --teal: #087a73;
  --teal-dark: #05655f;
  --amber: #a65b12;
  --red: #b43b3b;
  --canvas: #f3f1ec;
  --surface: #fff;
  --line: #dde2e5;
  --soft: #eef2f3;
  --radius: 12px;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 3vw, 2.55rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 1.25rem; letter-spacing: -.015em; }
p { color: var(--muted); line-height: 1.55; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.muted { color: var(--muted); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; color: #e9f1f5; background: var(--navy-deep); }
.wordmark { display: flex; align-items: center; gap: 11px; padding: 0 6px 26px; text-decoration: none; }
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-size: 1.05rem; }
.wordmark small { margin-top: 1px; color: #9fb6c5; font-size: .72rem; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--teal); font-size: 1.65rem; font-weight: 900; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 9px; font-size: 1.1rem; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; color: #c5d5de; text-decoration: none; font-weight: 650; }
.sidebar nav a.active { color: #fff; background: #174c70; }
.sidebar-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid #21465e; }
.admin-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d9ebe9; color: var(--teal-dark); font-weight: 800; }
.admin-chip strong, .admin-chip small { display: block; }
.admin-chip small { color: #9fb6c5; }
.text-button { margin: 12px 0 0 44px; padding: 0; border: 0; color: #abc0cc; background: transparent; cursor: pointer; }
.mobile-signout { display: none; }
.content { width: min(1440px, 100%); min-width: 0; padding: 38px clamp(22px, 4vw, 58px) 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head p:last-child { margin-bottom: 0; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--navy); font-weight: 700; text-decoration: none; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--navy); border-color: #bfccd3; background: #fff; }
.button.danger-quiet { color: var(--red); border-color: #e2bcbc; background: #fff; }
.button.full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.health-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; padding: 20px 4px; border-radius: var(--radius); color: #fff; background: var(--navy); }
.health-strip > div { padding: 0 22px; border-left: 1px solid #39627e; }
.health-strip > div:first-child { border-left: 0; }
.health-strip span { display: block; }
.health-value { margin-bottom: 2px; font-size: 1.55rem; font-weight: 850; letter-spacing: -.03em; }
.health-strip span:last-child { color: #c5d8e4; font-size: .82rem; }
.surface { min-width: 0; margin-bottom: 22px; padding: 24px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(18, 45, 61, .05), 0 8px 24px rgba(32, 45, 54, .05); }
.surface.compact { margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head p { margin-bottom: 0; }
.count-pill { padding: 5px 10px; border-radius: 999px; color: var(--navy); background: #e9f0f4; font-size: .78rem; font-weight: 750; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; color: var(--muted); font-size: .7rem; letter-spacing: .065em; text-align: left; text-transform: uppercase; }
td { padding: 15px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
td small { display: block; margin-top: 5px; color: var(--muted); }
.entity { display: grid; gap: 3px; text-decoration: none; }
.entity strong { color: var(--navy); }
.entity span { color: var(--muted); font-size: .82rem; }
.text-link { color: var(--teal-dark); font-size: .84rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
code { padding: 4px 7px; border-radius: 5px; color: #394854; background: var(--soft); font-family: "Cascadia Mono", Consolas, monospace; font-size: .8rem; }
.badge { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.badge.large { padding: 8px 12px; font-size: .82rem; }
.badge.success { color: #08665f; background: #dcefeb; }
.badge.neutral { color: #596772; background: #edf0f1; }
.badge.danger { color: #973333; background: #f7e1e1; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #8b969d; }
.status-dot.online { background: #24a89c; box-shadow: 0 0 0 3px rgba(36, 168, 156, .16); }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; margin-bottom: 22px; }
.facts { margin: 16px 0 0; }
.facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.stack { display: grid; gap: 18px; }
.stack.small { gap: 13px; margin-top: 16px; }
label { display: grid; gap: 7px; color: #384650; font-size: .83rem; font-weight: 700; }
input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #bfc8cd; border-radius: 7px; color: var(--ink); background: #fff; outline: none; }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 122, 115, .12); }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; }
.timeline-item + .timeline-item { border-top: 1px solid var(--line); }
.timeline-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--teal); }
.timeline-item p { margin: 3px 0 0; font-size: .82rem; }
.timeline-item time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; }
.empty.small { padding: 24px; }
.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 8px; font-weight: 650; }
.alert.success { color: #075f59; background: #dcefeb; }
.alert.danger { color: #923333; background: #f7e1e1; }
.alert.neutral { color: #596772; background: #edf0f1; }
dialog { width: min(690px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 28px 80px rgba(9, 30, 44, .28); }
dialog::backdrop { background: rgba(8, 29, 44, .58); }
.dialog-card { padding: 26px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-head p:last-child { margin-bottom: 0; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--muted); background: var(--soft); font-size: 1.45rem; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--navy-deep); }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border-radius: 18px; background: #fff; box-shadow: 0 30px 100px rgba(0, 0, 0, .3); }
.login-brand { min-height: 580px; display: flex; flex-direction: column; justify-content: center; padding: 58px; color: #fff; background: #123f62; }
.login-brand .brand-mark { margin-bottom: 34px; }
.login-brand .eyebrow { color: #85d0ca; }
.login-brand h1 { max-width: 420px; font-size: clamp(2.2rem, 5vw, 3.7rem); }
.login-brand > p:not(.eyebrow) { max-width: 430px; color: #c4d7e2; }
.security-note { width: fit-content; display: flex; align-items: center; gap: 9px; margin-top: 34px; padding: 9px 12px; border: 1px solid #3c6782; border-radius: 8px; color: #d9e7ee; font-size: .82rem; }
.login-panel { display: grid; align-items: center; padding: 56px; }
.login-panel h2 { margin-bottom: 8px; font-size: 2rem; }
@media (max-width: 980px) {
  .health-strip { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .health-strip > div:nth-child(3) { border-left: 0; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 14px 18px; }
  .wordmark { padding: 0; }
  .sidebar nav { margin-left: auto; }
  .mobile-signout { display: block; margin-left: 8px; }
  .mobile-signout input { display: none; }
  .mobile-signout button { min-height: 42px; padding: 8px 11px; border: 1px solid #45677d; border-radius: 8px; color: #e9f1f5; background: transparent; font-weight: 700; cursor: pointer; }
  .sidebar-foot { display: none; }
  .content { padding: 28px 16px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .health-strip { grid-template-columns: 1fr 1fr; }
  .health-strip > div { padding: 0 14px; }
  .surface { padding: 18px; }
  .login-page { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .login-brand { min-height: auto; padding: 34px 26px; }
  .login-brand h1 { font-size: 2.3rem; }
  .login-brand .brand-mark, .security-note { display: none; }
  .login-panel { padding: 34px 26px 46px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .wordmark small, .sidebar nav span { display: none; }
  .sidebar nav a { padding: 9px 10px; }
  .health-strip { grid-template-columns: 1fr; gap: 15px; }
  .health-strip > div, .health-strip > div:nth-child(3) { border-left: 0; }
  .health-strip > div + div { padding-top: 15px; border-top: 1px solid #39627e; }
  .timeline-item { grid-template-columns: 12px 1fr; }
  .timeline-item time { grid-column: 2; }
}
