:root {
  color-scheme: dark;
  --color-bg: #191b1f;
  --color-bg-deep: #141619;
  --color-surface: #23262b;
  --color-surface-raised: #292d33;
  --color-surface-soft: #1e2126;
  --color-surface-accent: #25282d;
  --color-text: #f3f0e8;
  --color-text-muted: #a8a7a2;
  --color-text-faint: #777a7f;
  --color-border: #363a40;
  --color-border-strong: #474c54;
  --color-accent: #f06432;
  --color-accent-hover: #ff7443;
  --color-accent-soft: rgb(240 100 50 / 14%);
  --color-success: #356859;
  --color-success-text: #b8e0d2;
  --color-error: #a94a45;
  --color-error-text: #ffd0cc;
  --color-warning: #b47b35;
  --color-warning-text: #ffe1ae;
  --color-info: #4f6078;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-card: 0 18px 48px rgb(0 0 0 / 20%);
  --sidebar-width: 272px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: var(--color-bg); }
body { margin: 0; min-width: 0; min-height: 100vh; background: var(--color-bg); color: var(--color-text); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgb(240 100 50 / 35%); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .55; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; padding: 10px 14px; transform: translateY(-150%); border-radius: var(--radius-sm); background: var(--color-accent); color: #21130d; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; display: flex; height: 100vh; min-height: 680px; flex-direction: column; padding: 22px 16px 18px; overflow-y: auto; border-right: 1px solid var(--color-border); background: var(--color-bg-deep); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark { position: relative; display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid rgb(240 100 50 / 58%); border-radius: 13px; background: var(--color-accent-soft); color: var(--color-accent); font-size: 20px; font-weight: 850; }
.brand-mark::after { position: absolute; right: -8px; bottom: -13px; width: 28px; height: 28px; border: 6px solid rgb(240 100 50 / 24%); border-radius: 50%; content: ""; }
.brand-mark span { position: relative; z-index: 1; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy span { color: var(--color-text-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-close { display: none; margin-left: auto; }

.product-state { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; margin: 22px 4px 18px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-soft); color: var(--color-text-muted); font-size: 11px; }
.product-state__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-success-text); box-shadow: 0 0 0 4px rgb(53 104 89 / 25%); }
.product-state strong { color: var(--color-text-faint); font-size: 9px; letter-spacing: .09em; }
nav { display: grid; gap: 3px; }
.nav-label { margin: 18px 10px 6px; color: var(--color-text-faint); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-item { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-text-muted); text-align: left; cursor: pointer; transition: color 120ms ease, background 120ms ease, transform 120ms ease; }
.nav-item:hover { color: var(--color-text); background: var(--color-surface-soft); }
.nav-item.active { color: var(--color-text); background: var(--color-accent-soft); }
.nav-item.active::after { justify-self: end; width: 5px; height: 5px; border-radius: 50%; background: var(--color-accent); content: ""; }
.nav-item__mark { color: var(--color-text-faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-item__mark { color: var(--color-accent); }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--color-border); }
.sidebar-footer > div { display: grid; gap: 3px; min-width: 0; }
.sidebar-footer span { color: var(--color-text-faint); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.sidebar-footer strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.text-button { padding: 7px 0; border: 0; background: none; color: var(--color-accent); cursor: pointer; font-weight: 700; }

.content { width: 100%; max-width: 1680px; min-width: 0; margin: 0 auto; padding: 34px clamp(22px, 4vw, 54px) 24px; }
.mobile-header { display: none; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--color-accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.04; letter-spacing: -.045em; }
.page-description { max-width: 680px; margin: 10px 0 0; color: var(--color-text-muted); line-height: 1.55; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.connection-card { display: grid; justify-items: end; gap: 5px; }
.connection-card small { color: var(--color-text-faint); font-size: 11px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 15px; border: 1px solid transparent; border-radius: var(--radius-md); font-weight: 780; cursor: pointer; transition: transform 100ms ease, background 120ms ease, border-color 120ms ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button--primary { color: #21130d; background: var(--color-accent); }
.button--primary:hover:not(:disabled) { background: var(--color-accent-hover); }
.button--secondary { border-color: var(--color-border-strong); background: transparent; color: var(--color-text); }
.button--secondary:hover:not(:disabled) { border-color: rgb(240 100 50 / 55%); background: var(--color-accent-soft); }
.button--compact { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.button--large { width: 100%; min-height: 52px; font-size: 15px; }
.icon-button { display: inline-grid; width: 42px; height: 42px; place-items: center; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-soft); color: var(--color-text); cursor: pointer; font-size: 20px; }

.scope-notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 13px 16px; border: 1px solid var(--color-border); border-left-color: var(--color-accent); border-radius: var(--radius-md); background: linear-gradient(90deg, var(--color-accent-soft), transparent 52%), var(--color-surface-soft); }
.scope-notice > div { display: grid; gap: 3px; }
.scope-notice strong { font-size: 13px; }
.scope-notice span { color: var(--color-text-muted); font-size: 12px; }
.scope-notice__badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-accent) !important; font-size: 9px !important; font-weight: 850; letter-spacing: .1em; }

.state-panel { display: flex; align-items: center; gap: 15px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.state-panel strong { display: block; margin-bottom: 4px; }
.state-panel p { margin: 0; color: var(--color-text-muted); line-height: 1.45; }
.state-panel--error { border-color: rgb(169 74 69 / 60%); background: rgb(169 74 69 / 10%); }
.state-panel--error .button { margin-top: 12px; }
.state-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: rgb(169 74 69 / 26%); color: var(--color-error-text); font-weight: 850; }
.loader { width: 30px; height: 30px; flex: 0 0 auto; border: 3px solid var(--color-border); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { position: relative; min-width: 0; padding: 18px; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-card); }
.metric::after { position: absolute; top: -25px; right: -25px; width: 68px; height: 68px; border: 10px solid rgb(240 100 50 / 7%); border-radius: 50%; content: ""; }
.metric__label { display: block; margin-bottom: 16px; color: var(--color-text-muted); font-size: 11px; font-weight: 720; }
.metric strong { display: block; overflow-wrap: anywhere; font-size: clamp(25px, 3.6vw, 36px); line-height: 1; letter-spacing: -.04em; }
.metric small { display: block; margin-top: 8px; color: var(--color-text-faint); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; margin-bottom: 18px; padding: 19px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-card); }
.dashboard-grid .panel { margin-bottom: 0; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel-header h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-header p { margin: 5px 0 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.45; }
.panel-count { flex: 0 0 auto; min-width: 30px; padding: 5px 8px; border-radius: 999px; background: var(--color-surface-raised); color: var(--color-text-muted); font-size: 11px; text-align: center; }

.environment-list { display: grid; gap: 10px; }
.environment-card { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(120px, 1fr) auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-soft); }
.environment-card strong { overflow-wrap: anywhere; }
.environment-card small { min-width: 0; overflow-wrap: anywhere; color: var(--color-text-faint); }
.facts { display: grid; gap: 0; margin: 0; }
.fact { display: grid; grid-template-columns: minmax(115px, .45fr) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.fact:last-child { border-bottom: 0; }
.fact dt { color: var(--color-text-muted); font-size: 11px; }
.fact dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; text-align: right; }

.status-badge { display: inline-flex; width: fit-content; max-width: 100%; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; background: var(--color-surface-raised); color: var(--color-text-muted); font-size: 10px; font-weight: 800; line-height: 1.2; }
.status-badge::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; opacity: .8; }
.status-badge.good { background: rgb(53 104 89 / 28%); color: var(--color-success-text); }
.status-badge.bad { background: rgb(169 74 69 / 28%); color: var(--color-error-text); }
.status-badge.warn { background: rgb(180 123 53 / 24%); color: var(--color-warning-text); }
.status-badge.neutral { color: var(--color-text-muted); }

.collection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.search-field { position: relative; display: block; width: min(100%, 390px); }
.search-field::before { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--color-text-faint); content: "⌕"; }
.search-field input { width: 100%; min-height: 42px; padding: 10px 13px 10px 36px; border: 1px solid var(--color-border); border-radius: var(--radius-md); outline: 0; background: var(--color-surface-soft); color: var(--color-text); }
.search-field input::placeholder { color: var(--color-text-faint); }
.search-field input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.generated-at { color: var(--color-text-faint); font-size: 11px; text-align: right; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--color-border); vertical-align: top; text-align: left; font-size: 12px; }
th { position: sticky; top: 0; background: var(--color-surface-soft); color: var(--color-text-muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgb(255 255 255 / 2%); }
td { max-width: 330px; overflow-wrap: anywhere; line-height: 1.45; }
.mobile-records { display: none; }
.record-card { padding: 15px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-soft); }
.record-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.record-card__heading strong { overflow-wrap: anywhere; }
.record-fields { display: grid; gap: 10px; }
.record-field { display: grid; grid-template-columns: minmax(90px, .55fr) minmax(0, 1fr); gap: 12px; }
.record-field span:first-child { color: var(--color-text-muted); font-size: 11px; }
.record-field span:last-child { overflow-wrap: anywhere; font-size: 12px; text-align: right; }
.empty-state { display: grid; min-height: 190px; place-content: center; justify-items: center; padding: 30px 18px; text-align: center; }
.empty-state__mark { display: grid; width: 46px; height: 46px; margin-bottom: 14px; place-items: center; border: 1px solid var(--color-border); border-radius: 15px; background: var(--color-surface-soft); color: var(--color-accent); font-weight: 850; }
.empty-state strong { margin-bottom: 6px; }
.empty-state p { max-width: 430px; margin: 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.5; }
.page-footer { padding-top: 10px; color: var(--color-text-faint); font-size: 10px; text-align: center; }
.connection-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-text-faint); }
.connection-dot.good { background: var(--color-success-text); box-shadow: 0 0 0 4px rgb(53 104 89 / 24%); }
.connection-dot.bad { background: var(--color-error-text); box-shadow: 0 0 0 4px rgb(169 74 69 / 22%); }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 16% 12%, rgb(240 100 50 / 10%), transparent 30%), radial-gradient(circle at 86% 82%, rgb(79 96 120 / 14%), transparent 28%), var(--color-bg); }
.auth-layout { display: grid; width: min(100%, 980px); grid-template-columns: minmax(0, 1.05fr) minmax(330px, .75fr); align-items: center; gap: clamp(36px, 7vw, 80px); }
.brand--auth { padding: 0; margin-bottom: 42px; }
.auth-intro h1 { max-width: 650px; margin: 0; font-size: clamp(38px, 6vw, 68px); line-height: .98; letter-spacing: -.055em; }
.auth-intro > p:not(.eyebrow) { max-width: 570px; margin: 22px 0 0; color: var(--color-text-muted); font-size: 16px; line-height: 1.6; }
.auth-points { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--color-text-muted); font-size: 13px; }
.auth-points li { display: flex; align-items: center; gap: 9px; }
.auth-points li::before { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); content: ""; }
.auth-card { padding: clamp(24px, 5vw, 34px); border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: 0 28px 80px rgb(0 0 0 / 32%); }
.auth-card__label { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-accent); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.auth-card h2 { margin: 20px 0 8px; font-size: 27px; letter-spacing: -.035em; }
.auth-card .muted { margin: 0; color: var(--color-text-muted); font-size: 13px; }
form { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 8px; color: var(--color-text-muted); font-size: 12px; font-weight: 700; }
input { min-width: 0; }
label input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); outline: 0; background: var(--color-surface-soft); color: var(--color-text); }
label input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.form-error { margin: 0; padding: 10px 12px; border: 1px solid rgb(169 74 69 / 55%); border-radius: var(--radius-sm); background: rgb(169 74 69 / 12%); color: var(--color-error-text); font-size: 12px; line-height: 1.45; }
.auth-security { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--color-border); color: var(--color-text-faint); font-size: 10px; line-height: 1.5; }
.nav-overlay { position: fixed; z-index: 80; inset: 0; background: rgb(0 0 0 / 58%); backdrop-filter: blur(3px); }

@media (max-width: 1180px) {
  :root { --sidebar-width: 238px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .panel { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 90; top: 0; left: 0; width: min(88vw, 310px); min-height: 100vh; transform: translateX(-105%); box-shadow: none; transition: transform 180ms ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 30px 0 80px rgb(0 0 0 / 35%); }
  .sidebar-close { display: inline-grid; }
  .content { padding: 18px 16px 24px; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; }
  .mobile-brand__mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgb(240 100 50 / 55%); border-radius: 9px; background: var(--color-accent-soft); color: var(--color-accent); font-weight: 850; }
  .topbar h1 { font-size: clamp(30px, 8vw, 42px); }
  .auth-layout { grid-template-columns: 1fr; max-width: 520px; gap: 30px; }
  .auth-intro h1 { font-size: clamp(38px, 10vw, 56px); }
  .brand--auth { margin-bottom: 30px; }
  .auth-points { display: none; }
}

@media (max-width: 680px) {
  .topbar { display: grid; gap: 18px; }
  .topbar-actions { justify-content: space-between; }
  .connection-card { justify-items: start; }
  .scope-notice { align-items: flex-start; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 15px; box-shadow: none; }
  .metric__label { margin-bottom: 13px; }
  .metric strong { font-size: 26px; }
  .panel { padding: 15px; box-shadow: none; }
  .environment-card { grid-template-columns: 1fr auto; }
  .environment-card small { grid-column: 1 / -1; }
  .collection-toolbar { display: grid; }
  .search-field { width: 100%; }
  .generated-at { text-align: left; }
  .table-wrap { display: none; }
  .mobile-records { display: grid; gap: 10px; }
  .auth-intro > p:not(.eyebrow) { font-size: 14px; }
}

@media (max-width: 420px) {
  .content { padding-right: 12px; padding-left: 12px; }
  .metrics { grid-template-columns: 1fr; }
  .scope-notice__badge { display: none; }
  .topbar-actions { align-items: flex-end; }
  .topbar-actions .button { min-width: 104px; }
  .fact, .record-field { grid-template-columns: 1fr; gap: 4px; }
  .fact dd, .record-field span:last-child { text-align: left; }
  .auth-page { padding-right: 12px; padding-left: 12px; }
  .auth-card { border-radius: var(--radius-lg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
