:root {
  color-scheme: dark;
  --bg: #08090a;
  --surface: #191a1b;
  --surface-raised: #202124;
  --surface-hover: #28282c;
  --line: rgba(255, 255, 255, .08);
  --line-soft: rgba(255, 255, 255, .05);
  --text: #f7f8f8;
  --muted: #8a8f98;
  --subtle: #8a8f98;
  --mint: #7170ff;
  --mint-soft: #5e6ad2;
  --success: #10b981;
  --amber: #e4bd72;
  --amber-soft: #342c1f;
  --red: #ed8c85;
  --red-soft: #382321;
  --blue: #8dbbd7;
  --blue-soft: #202d36;
  --radius: 8px;
  font-family: 'Inter Variable', Inter, 'SF Pro Display', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
  font-synthesis: none;
  font-feature-settings: 'cv01', 'ss03';
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex="-1"]:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; background: var(--mint); color: #fff; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: 238px; padding: 25px 15px 17px; background: #0f1011; border-right: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; min-height: 44px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #494780; border-radius: 8px; color: var(--mint); font-size: 13px; font-weight: 800; }
.brand-name { font-size: 14px; letter-spacing: -.035em; color: #c9cecb; }
.brand-name strong { color: #f3f5f3; font-weight: 800; }
.primary-nav { display: grid; gap: 5px; margin-top: 37px; }
.primary-nav a { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 0 12px; color: #d0d6e0; border-radius: 8px; font-size: 14px; font-weight: 510; transition: background .15s, color .15s; }
.primary-nav a:hover { background: #1c2025; color: var(--text); }
.primary-nav a[aria-current="page"] { background: #5e6ad233; color: #828fff; }
.nav-icon { display: grid; place-items: center; width: 17px; font-family: 'Segoe UI Symbol', sans-serif; font-size: 17px; font-weight: 400; }
.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 15px 9px 0; border-top: 1px solid var(--line-soft); }
.connection-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.pulse-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px #e4bd721c; }
.connection-state[data-state="ok"] .pulse-dot { background: var(--success); box-shadow: 0 0 0 3px #10b9811c; }
.connection-state[data-state="error"] .pulse-dot { background: var(--red); box-shadow: 0 0 0 3px #ed8c851c; }
.workspace { min-height: 100vh; margin-left: 238px; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding: 0 38px; background: #111317ed; border-bottom: 1px solid var(--line-soft); backdrop-filter: blur(16px); }
.breadcrumb, .topbar-actions { display: flex; align-items: center; }
.breadcrumb { gap: 10px; color: var(--subtle); font-size: 12px; }
.breadcrumb strong { color: #d9ddda; font-weight: 600; }
.breadcrumb-separator { color: #454c49; }
.topbar-actions { gap: 17px; }
.updated-label { color: var(--subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.icon-button, .avatar { display: grid; place-items: center; border: 1px solid var(--line); background: #ffffff05; color: var(--muted); cursor: pointer; transition: .15s ease; }
.icon-button { width: 44px; height: 44px; border-radius: 8px; font-size: 20px; line-height: 1; }
.icon-button:hover, .avatar:hover { color: #828fff; border-color: #7170ff80; background: #5e6ad21f; }
.icon-button:disabled, .button:disabled { cursor: wait; opacity: .55; }
.avatar { width: 44px; height: 44px; border-radius: 50%; color: #828fff; font-size: 12px; font-weight: 700; }
main { width: 100%; max-width: 1440px; flex: 1; margin: 0 auto; padding: 37px 40px 62px; }
.global-message { margin: 0 0 18px; padding: 12px 15px; color: var(--amber); background: var(--amber-soft); border: 1px solid #635032; border-radius: 9px; font-size: 12px; }
.global-message[data-kind="error"] { color: var(--red); background: var(--red-soft); border-color: #633b38; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 4px 0 0; font-size: clamp(24px, 3vw, 31px); line-height: 1.2; letter-spacing: -.055em; font-weight: 700; }
.page-heading p { margin: 9px 0 0; color: #d0d6e0; font-size: 14px; line-height: 1.6; }
.eyebrow { color: var(--mint); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 27px 0 12px; }
.section-title h2 { margin: 0; color: #dfe3e0; font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.section-title small { color: var(--subtle); font-size: 11px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.metric-card { min-height: 111px; padding: 17px 18px; }
.metric-card .metric-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card .metric-value { margin-top: 12px; font-size: 25px; line-height: 1; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-card .metric-note { margin-top: 8px; color: var(--subtle); font-size: 10px; }
.metric-card[data-tone="mint"] .metric-value { color: var(--mint); }
.metric-card[data-tone="red"] .metric-value { color: var(--red); }
.metric-card[data-tone="amber"] .metric-value { color: var(--amber); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 13px; align-items: start; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 53px; padding: 0 17px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 12px; font-weight: 700; }
.panel-head .subtle-link { color: var(--subtle); font-size: 10px; }
.panel-head .subtle-link:hover { color: var(--mint); }
.list { display: grid; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.row-main { min-width: 0; }
.row-title { overflow: hidden; color: #d0d6e0; font-size: 13px; font-weight: 510; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { margin-top: 5px; color: var(--subtle); font-size: 10px; line-height: 1.45; }
.row-side { flex: 0 0 auto; color: var(--muted); font-size: 10px; text-align: right; }
.status-pill, .tag { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 0 9px; border-radius: 999px; background: var(--surface-raised); color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ''; }
.status-ok { color: var(--success); background: #10b9811f; }
.status-degraded, .status-pending, .status-running { color: var(--amber); background: var(--amber-soft); }
.status-down, .status-open, .status-failed { color: var(--red); background: var(--red-soft); }
.status-unknown, .status-muted, .status-queued { color: #a6afb0; background: #252a2e; }
.status-resolved, .status-success { color: var(--mint); background: var(--mint-soft); }
.status-info { color: var(--blue); background: var(--blue-soft); }
.host-card { padding: 17px; }
.host-name { font-size: 15px; font-weight: 700; letter-spacing: -.025em; }
.host-meta { margin-top: 5px; color: var(--subtle); font-family: 'DM Mono', Consolas, monospace; font-size: 10px; }
.host-stats { display: grid; gap: 15px; margin-top: 23px; }
.resource-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.resource-head strong { color: #dce1dd; font-family: 'DM Mono', Consolas, monospace; font-size: 10px; font-weight: 500; }
.meter { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #2b3036; }
.meter > span { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: var(--mint); }
.resource-caption { margin-top: 6px; color: var(--subtle); font-size: 9px; }
.load-value { color: var(--mint); }
.compact-list .list-row { padding-top: 11px; padding-bottom: 11px; }
.empty-state, .error-state, .loading-state { padding: 30px 18px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.65; }
.empty-icon { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 11px; border: 1px solid #7170ff66; border-radius: 50%; color: var(--mint); font-size: 14px; }
.error-state { color: var(--red); }
.inline-retry { margin-top: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff05; color: #d0d6e0; cursor: pointer; font-size: 12px; font-weight: 510; transition: .15s; }
.button:hover { border-color: #424a51; background: #292e34; }
.button-primary { min-height: 44px; border-color: #5e6ad2; background: #5e6ad2; color: #fff; }
.button-primary:hover { border-color: #828fff; background: #7170ff; }
.button-danger { border-color: #69413d; color: var(--red); background: #2b201f; }
.button-danger:hover { background: #3a2624; }
.button-small { min-height: 44px; padding: 0 10px; font-size: 12px; }
.full-width { width: 100%; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 13px; }
.filters input, .filters select, .form-control, input, textarea, select { color: var(--text); background: #14171b; border: 1px solid var(--line); border-radius: 8px; }
.filters input, .filters select { min-height: 44px; padding: 0 11px; font-size: 12px; }
.filters input { min-width: 190px; }
.filters select { min-width: 145px; }
.filters input::placeholder, textarea::placeholder { color: #68716d; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 11px 14px; color: var(--subtle); border-bottom: 1px solid var(--line); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.data-table td { padding: 13px 14px; color: #d0d6e0; border-bottom: 1px solid var(--line-soft); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.mono { font-family: 'DM Mono', Consolas, monospace; font-size: 10px !important; font-variant-numeric: tabular-nums; }
.project-grid, .command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-card, .command-card { padding: 17px; }
.card-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.card-copy { margin: 9px 0 0; color: #d0d6e0; font-size: 13px; line-height: 1.6; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--subtle); font-size: 10px; }
.command-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.reason { color: var(--amber); font-size: 10px; line-height: 1.5; }
.job-result { margin-top: 13px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: #14171a; color: var(--muted); font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.incident-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px 17px; border-bottom: 1px solid var(--line-soft); }
.incident-card:last-child { border-bottom: 0; }
.incident-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.incident-heading .row-title { white-space: normal; }
.incident-body { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.incident-actions { display: flex; align-items: center; gap: 8px; }
.decision-card { padding: 17px; border-bottom: 1px solid var(--line-soft); }
.decision-card:last-child { border-bottom: 0; }
.decision-context { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.option-list { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.answer-line { margin-top: 12px; padding: 10px 12px; border-left: 2px solid var(--mint); background: #5e6ad21a; color: #d0d6e0; font-size: 13px; }
.decision-answer { display: flex; gap: 8px; margin-top: 12px; }
.decision-answer input { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; }
.form-panel { padding: 18px; margin-bottom: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-field { display: grid; align-content: start; gap: 6px; }
.form-field.span-two { grid-column: 1 / -1; }
.field-label { color: #d0d6e0; font-size: 12px; font-weight: 510; }
.form-field input, .form-field textarea, .form-field select, .dialog-card input { width: 100%; min-height: 44px; padding: 9px 10px; font-size: 13px; }
.form-field textarea { min-height: 83px; resize: vertical; line-height: 1.5; }
.form-hint { color: var(--subtle); font-size: 9px; line-height: 1.4; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.form-error { color: var(--red); font-size: 10px; line-height: 1.5; }
.form-success { color: var(--mint); font-size: 10px; }
.timeline { display: grid; }
.timeline-row { display: grid; grid-template-columns: 125px 72px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-message { color: #cbd1cd; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.assistant-panel { display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 15px; padding: 20px; }
.assistant-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #7170ff55; border-radius: 8px; background: #5e6ad21a; color: var(--mint); font-size: 17px; }
.assistant-panel h2 { margin: 1px 0 7px; font-size: 14px; }
.assistant-panel p { margin: 0; max-width: 680px; color: #d0d6e0; font-size: 14px; line-height: 1.7; }
.notification-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; padding: 11px 14px; border: 1px solid var(--line-soft); border-radius: 8px; color: var(--muted); background: #ffffff05; font-size: 12px; }
.notification-strip strong { color: #d0d6e0; font-size: 12px; font-weight: 510; }
.project-editor { display: grid; gap: 11px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.project-editor .form-field input, .project-editor .form-field textarea { min-height: 40px; font-size: 13px; }
.project-editor .form-field textarea { min-height: 63px; }
.project-source { margin-top: 8px; color: var(--subtle); font-size: 11px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 40px; border-top: 1px solid var(--line-soft); color: var(--subtle); font-size: 9px; }
.dialog { width: min(420px, calc(100vw - 30px)); max-width: none; padding: 0; border: 1px solid #343a40; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 90px #0009; }
.dialog::backdrop { background: #07090bbd; backdrop-filter: blur(4px); }
.dialog-card { position: relative; padding: 27px; }
.dialog-close { position: absolute; top: 14px; right: 14px; }
.dialog-card h2 { margin: 8px 0; font-size: 21px; letter-spacing: -.04em; }
.dialog-card p { margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.dialog-card .field-label { display: block; margin-bottom: 7px; }
.dialog-card .form-error { margin: 10px 0; }
.dialog-card .button { margin-top: 16px; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--subtle); cursor: pointer; font-size: 10px; }
.text-button:hover { color: var(--mint); }
[hidden] { display: none !important; }

@media (max-width: 1050px) {
  .sidebar { width: 208px; }
  .workspace { margin-left: 208px; }
  main { padding-right: 27px; padding-left: 27px; }
  .topbar { padding-right: 27px; padding-left: 27px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: auto; padding: 10px 13px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { min-height: 36px; padding: 0 3px; }
  .brand-mark { width: 26px; height: 26px; }
  .primary-nav { display: flex; gap: 4px; margin: 9px -13px 0; padding: 0 11px 8px; overflow-x: auto; scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a { flex: 0 0 auto; gap: 7px; min-height: 44px; padding: 0 11px; font-size: 12px; }
  .nav-icon { width: auto; font-size: 14px; }
  .sidebar-bottom { display: none; }
  .workspace { min-height: calc(100vh - 83px); margin-left: 0; }
  .topbar { position: static; min-height: 54px; padding: 0 17px; }
  .topbar-actions { gap: 9px; }
  .updated-label { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
  .topbar .icon-button { width: 44px; height: 44px; }
  .avatar { width: 44px; height: 44px; }
  main { padding: 25px 16px 42px; }
  .page-heading { align-items: flex-start; margin-bottom: 19px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { max-width: 580px; font-size: 13px; }
  .overview-grid { grid-template-columns: 1fr; }
  .project-grid, .command-grid { grid-template-columns: 1fr; }
  .footer { padding: 12px 17px; }
}
@media (max-width: 480px) {
  .metrics-grid { gap: 8px; }
  .metric-card { min-height: 96px; padding: 14px; }
  .metric-card .metric-value { font-size: 22px; }
  .metric-card .metric-note { font-size: 9px; }
  .page-heading { display: block; }
  .page-heading > .button { margin-top: 13px; }
  .list-row { gap: 8px; padding: 12px; }
  .row-title { font-size: 12px; }
  .row-side { font-size: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.span-two { grid-column: auto; }
  .incident-card { grid-template-columns: 1fr; }
  .incident-actions { justify-content: flex-start; }
  .decision-answer { align-items: stretch; flex-direction: column; }
  .timeline-row { grid-template-columns: 92px 61px minmax(0, 1fr); gap: 7px; padding: 11px 10px; }
  .timeline-row .mono, .timeline-message { font-size: 9px !important; }
  .footer { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
