:root {
  color-scheme: dark;
  --bg: #07090b;
  --sidebar: #090c0f;
  --surface: #0d1115;
  --surface-2: #11171c;
  --surface-3: #151c22;
  --line: #232c34;
  --line-strong: #34414c;
  --text: #edf3f7;
  --muted: #8d9ba7;
  --subtle: #61717e;
  --cyan: #59c7dc;
  --cyan-soft: #10252b;
  --blue: #72a8d7;
  --orange: #ff8618;
  --orange-hover: #ff9a3d;
  --orange-soft: #2c1a0a;
  --green: #55d68a;
  --green-soft: #10251a;
  --yellow: #e8bd5a;
  --yellow-soft: #2a210f;
  --red: #ff6969;
  --red-soft: #2a1214;
  --sidebar-width: 196px;
  --control-height: 35px;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.45; }
button, input, select, textarea { font: inherit; font-variant-numeric: tabular-nums; }
button { letter-spacing: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(89,199,220,.46); outline-offset: 1px; }
.hidden { display: none !important; }
.muted, .hint { color: var(--muted); }
.hint { margin: 5px 0 0; font-size: 12px; line-height: 1.45; }
.error, .bad-text { color: var(--red); }
.good-value { color: var(--green); }
.warn-value { color: var(--yellow); }
.bad-value { color: var(--red); }
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: 0; text-transform: uppercase; }
code, pre, .clock, time, .node-main small, .deployment-node-main small, .technical, .data-value { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #080a0c; }
.login-card { width: min(360px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 20px 60px rgba(0,0,0,.32); }
.login-card h1 { margin: 7px 0 5px; font-size: 22px; line-height: 1.2; }
.login-card p { margin: 0 0 17px; }
.login-card label { margin-bottom: 10px; }
.login-card .primary { width: 100%; margin-top: 5px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 15px 11px 12px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 7px 13px; border-bottom: 1px solid #151b20; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: var(--orange); color: #111; font-size: 13px; font-weight: 900; }
.brand-copy { min-width: 0; display: grid; line-height: 1.12; }
.brand-copy strong { font-size: 13px; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.sidebar nav { display: grid; gap: 3px; margin-top: 13px; }
.nav { width: 100%; min-height: 37px; display: flex; align-items: center; gap: 9px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #a9b6c0; text-align: left; cursor: pointer; }
.nav::before { content: attr(data-icon); width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #293641; border-radius: 5px; color: #77a9cc; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; font-weight: 800; }
.nav:hover { background: #10161b; color: var(--text); }
.nav.active { border-color: #26343e; background: #151c22; color: #fff; box-shadow: inset 2px 0 0 var(--cyan); }
.nav.active::before { border-color: #2f6570; background: var(--cyan-soft); color: var(--cyan); }
.account { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 7px 0; border-top: 1px solid var(--line); }
.account > div { min-width: 0; display: grid; }
.account strong { overflow: hidden; text-overflow: ellipsis; }
.account small { color: var(--muted); font-size: 10px; }

.main { min-width: 0; padding: 0 22px 48px; }
.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 15; padding: 9px 0; border-bottom: 1px solid var(--line); background: rgba(7,9,11,.96); }
.topbar-title { min-width: 170px; }
.topbar h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.15; font-weight: 700; }
.topbar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.project-switcher { display: flex; align-items: flex-end; gap: 5px; }
.project-switcher .danger { margin-left: 3px; }
.project-picker { width: 180px; margin: 0; }
.project-picker .eyebrow { display: block; margin-bottom: 4px; }
.project-picker select { width: 100%; }
.clock { color: var(--muted); font-size: 10px; white-space: nowrap; }
.view { width: 100%; max-width: 1500px; margin: 0 auto; padding-top: 19px; }

h3 { letter-spacing: 0; }
.overview-head, .section-intro, .actionbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.overview-head h3, .section-intro h3, .actionbar h3, .panel h3 { margin: 4px 0; font-size: 16px; line-height: 1.25; }
.overview-head p, .section-intro p, .actionbar p { max-width: 800px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.panel { min-width: 0; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.panel-head, .panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.panel-head { margin-bottom: 10px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-actions { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.panel-actions > span:first-child { min-width: 0; flex: 1; }

.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.metric { min-width: 0; min-height: 72px; padding: 11px 14px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric > span { display: block; color: var(--muted); font-size: 10px; font-weight: 650; text-transform: uppercase; }
.metric strong { display: block; margin: 7px 0 2px; overflow: hidden; color: var(--text); font-size: 23px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.metric strong small { display: inline; color: var(--muted); font-size: 10px; font-weight: 600; }
.metric .text-value { padding-top: 2px; font-size: 16px; }
.metric > small { color: var(--subtle); font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0,1.12fr) minmax(320px,.88fr); gap: 10px; }
.workflow-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 10px; }
.workflow-item { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 22px minmax(0,1fr) 14px; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.workflow-item:hover { border-color: var(--line-strong); background: var(--surface-2); }
.workflow-item.ready { border-color: #24513a; }
.workflow-item > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.workflow-item strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-item small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-item b { color: var(--subtle); font-size: 17px; }
.check { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); }
.check.done { border-color: #2f7650; background: var(--green-soft); color: var(--green); }

.button, .primary, .icon-button { min-height: var(--control-height); border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 650; cursor: pointer; transition: background .14s ease,border-color .14s ease,color .14s ease,opacity .14s ease; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; background: var(--surface-2); color: #dbe5eb; font-size: 11px; white-space: nowrap; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { border-color: #49606e; background: #192128; }
.primary, .primary-small, .button.primary-small { border-color: var(--orange); background: var(--orange); color: #15100a; }
.primary { min-height: 37px; padding: 0 14px; }
.primary-small, .button.primary-small { min-height: var(--control-height); padding: 0 12px; }
.primary:hover:not(:disabled), .primary-small:hover:not(:disabled), .button.primary-small:hover:not(:disabled) { border-color: var(--orange-hover); background: var(--orange-hover); }
.button.save-desired { border-color: var(--orange); background: var(--orange); color: #15100a; }
.button.save-desired:hover:not(:disabled) { border-color: var(--orange-hover); background: var(--orange-hover); }
.button.probe-action { border-color: #315b67; background: var(--cyan-soft); color: var(--cyan); }
.button.probe-action:hover:not(:disabled) { border-color: #45818e; background: #153139; }
.button.warning { border-color: #6e5928; background: var(--yellow-soft); color: var(--yellow); }
.icon-button { width: var(--control-height); min-width: var(--control-height); padding: 0; display: inline-grid; place-items: center; background: var(--surface-2); color: #c9d4db; font-size: 15px; }
.icon-button.danger, .button.danger { border-color: #553036; color: var(--red); }
.icon-button.danger:hover:not(:disabled), .button.danger:hover:not(:disabled) { border-color: #7d3c45; background: var(--red-soft); }
button:disabled { cursor: not-allowed; opacity: .43; }

label { display: grid; gap: 5px; min-width: 0; color: #cbd6dd; font-size: 11px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: var(--control-height); border: 1px solid #2a3540; border-radius: 6px; background: #080c0f; color: var(--text); }
input, select { padding: 0 10px; }
textarea { min-height: 82px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: #3b4a56; }
input:focus, select:focus, textarea:focus { border-color: #3f7884; }
input::placeholder, textarea::placeholder { color: #53616d; }
.stack { display: grid; gap: 9px; }
.compact { display: flex; align-items: flex-end; gap: 7px; }
.compact label { margin: 0; }
.form-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 10px; }
.span-2 { grid-column: 1/-1; }
.file-label input { padding: 5px; }

.status { min-height: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; padding: 2px 7px; border: 1px solid #33404a; border-radius: 999px; background: #12181d; color: #a8b5bf; font-size: 9px; font-weight: 750; line-height: 1; white-space: nowrap; text-transform: uppercase; }
.status::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #73808a; }
.status.ok { border-color: #285d40; background: var(--green-soft); color: var(--green); }
.status.ok::before { background: var(--green); }
.status.bad { border-color: #65343a; background: var(--red-soft); color: var(--red); }
.status.bad::before { background: var(--red); }
.status.warning, .status.pending { border-color: #665226; background: var(--yellow-soft); color: var(--yellow); }
.status.warning::before, .status.pending::before { background: var(--yellow); }
.inline-status { display: inline-block; font-size: 10px; }
.inline-status.ok { color: var(--green); }
.inline-status.bad { color: var(--red); }

.segmented { width: fit-content; display: flex; gap: 2px; margin-bottom: 14px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #0a0e11; }
.segmented button { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-3); color: #fff; }
.segmented button span { min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 4px; background: #1b252d; color: #aab6bf; font-size: 9px; }
.segmented .tab-warning { background: var(--yellow-soft); color: var(--yellow); }

.workflow-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 9px; margin-bottom: 15px; }
.step-panel { margin: 0; }
.step-panel .panel-head > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.step-panel h3 { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.automation-step .panel-head { align-items: flex-start; flex-direction: column; }
.automation-step .panel-head > div { width: 100%; }
.automation-step h3 { overflow: visible; text-overflow: clip; white-space: normal; }
.automation-step .head-actions { width: 100%; justify-content: flex-start; }
.step-number { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #315866; border-radius: 5px; background: var(--cyan-soft); color: var(--cyan); font-size: 10px; font-weight: 800; }
.step-panel textarea { min-height: 92px; }
.step-panel pre, #restart-command-text { max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #06090b; color: #bdcbd4; font-size: 10px; white-space: pre-wrap; }
.setup-checklist { display: grid; gap: 4px; margin: 10px 0; padding: 9px 10px; border-left: 2px solid var(--cyan); background: #0a1115; color: var(--muted); font-size: 11px; line-height: 1.45; }
.setup-checklist p { margin: 0; }
.setup-checklist strong { color: var(--text); }

.node-list, .deployment-node-list { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.node-row { min-width: 0; min-height: 50px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.node-row:last-child { border-bottom: 0; }
.node-row:hover { background: #10161b; }
.node-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #2d5260; border-radius: 5px; background: var(--cyan-soft); color: var(--cyan); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; font-weight: 850; }
.node-icon.origin { border-color: #36577a; background: #111d29; color: #83b9e5; }
.node-main, .deployment-node-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.node-main strong, .deployment-node-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-main small, .deployment-node-main small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
#access-editor, #origin-editor, #user-create { margin-top: 10px; }

.install-sequence { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.install-sequence-item { min-width: 0; min-height: 54px; display: grid; grid-template-columns: 25px minmax(0,1fr); align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface); }
.install-sequence-number { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #3a4650; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 800; }
.install-sequence-copy { min-width: 0; display: grid; gap: 2px; }
.install-sequence-copy strong, .install-sequence-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.install-sequence-copy strong { color: #dbe5eb; font-size: 10px; }
.install-sequence-copy small { color: var(--muted); font-size: 9px; }
.install-sequence-item.ready .install-sequence-number { border-color: #285a3f; background: var(--green-soft); color: var(--green); }
.install-sequence-item.ready .install-sequence-copy small { color: #8fc9a5; }
.install-sequence-item.pending .install-sequence-number { border-color: #684b20; background: var(--yellow-soft); color: var(--yellow); }
.install-sequence-item.pending .install-sequence-copy small { color: var(--yellow); }

.settings-role-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 9px; }
.settings-role-grid > .panel { height: 100%; display: flex; flex-direction: column; margin: 0; }
.settings-role-grid .panel > .hint { min-height: 51px; }
.settings-role-grid form.stack { flex: 1; display: flex; flex-direction: column; }
.settings-role-grid .panel-actions { margin-top: auto; }
.form-scope { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.fleet-install-panel { margin-top: 10px; border-color: #684b20; }
.fleet-install-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.fleet-install-head > div { min-width: 0; }
.fleet-install-head h3 { margin: 4px 0; font-size: 17px; }
.fleet-install-head p { max-width: 850px; margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.fleet-install-head .primary { min-width: 230px; }
.fleet-install-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.fleet-install-summary span { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.fleet-install-summary span:last-child { border-right: 0; }
.fleet-install-summary strong { color: var(--text); font-size: 13px; }
.fleet-progress { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin-top: 10px; }
.fleet-step { min-width: 0; min-height: 52px; display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.fleet-step > span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #3a4650; border-radius: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.fleet-step > div { min-width: 0; display: grid; gap: 2px; }
.fleet-step strong, .fleet-step small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-step strong { color: #d9e3e9; font-size: 10px; }
.fleet-step small { color: var(--muted); font-size: 9px; }
.fleet-step.running { border-color: #315b67; background: var(--cyan-soft); }
.fleet-step.running > span { border-color: #45818e; color: var(--cyan); }
.fleet-step.done { border-color: #28553d; background: var(--green-soft); }
.fleet-step.done > span { border-color: #34734f; color: var(--green); }
.fleet-step.error { border-color: #6f3039; background: var(--red-soft); }
.fleet-step.error > span { border-color: #8a3b46; color: var(--red); }
.fleet-install-result { min-height: 40px; display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.fleet-install-result strong { flex: 0 0 auto; font-size: 11px; }
.fleet-install-result span { min-width: 0; color: var(--muted); font-size: 10px; }
.fleet-install-result.running { border-color: #315b67; }
.fleet-install-result.success { border-color: #28553d; background: var(--green-soft); }
.fleet-install-result.success strong { color: var(--green); }
.fleet-install-result.error { border-color: #6f3039; background: var(--red-soft); }
.fleet-install-result.error strong { color: var(--red); }
.manual-install { margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.manual-install > summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; cursor: pointer; list-style: none; }
.manual-install > summary::-webkit-details-marker { display: none; }
.manual-install > summary > span:first-child { min-width: 0; display: grid; gap: 2px; }
.manual-install > summary strong { font-size: 11px; }
.manual-install > summary small { color: var(--muted); font-size: 10px; }
.manual-install[open] > summary { border-bottom: 1px solid var(--line); }
.manual-install-body { padding: 12px; }
.manual-toolbar { display: flex; justify-content: flex-end; gap: 7px; }
.deployment-role-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.deployment-role-section > .panel-head { align-items: flex-start; }
.deployment-role-section > .panel-head p { max-width: 900px; }
.deployment-node-row { min-width: 0; min-height: 57px; display: grid; grid-template-columns: 28px minmax(190px,1fr) auto minmax(250px,auto); align-items: center; gap: 9px; padding: 8px 9px; border-bottom: 1px solid var(--line); }
.deployment-node-row:last-child { border-bottom: 0; }
.deployment-node-row:hover { background: #10161b; }
.deployment-node-action { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.deployment-node-action .inline-status { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.config-tabs { margin-top: 8px; }
.config-tabs details { border-top: 1px solid var(--line); }
.config-tabs summary { padding: 9px 4px; color: #c6d2da; cursor: pointer; }
.config-tabs pre { max-height: 300px; overflow: auto; margin: 0 0 8px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #06090b; font-size: 10px; }
.blocker { margin-bottom: 6px; padding: 8px 10px; border: 1px solid #684b20; border-radius: 6px; background: var(--yellow-soft); color: var(--yellow); font-size: 11px; }

.ad-tag-panel { border-left: 2px solid var(--blue); }
.secret-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding: 9px 10px; border: 1px solid #285a3f; border-radius: 6px; background: var(--green-soft); }
.secret-result > div { display: grid; gap: 2px; }
.secret-result small { color: #8fbda1; }

.table { min-width: 0; }
.table-head, .table-row { display: grid; grid-template-columns: minmax(120px,.85fr) 90px 90px minmax(220px,2fr) minmax(210px,auto); align-items: center; gap: 9px; }
.table-head { min-height: 31px; padding: 0 9px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.table-row { min-height: 46px; padding: 6px 9px; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: #10161b; }
.table-row > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-link { min-width: 0; }
.user-link code { display: block; overflow: hidden; color: #9fc4d9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }

.monitor-table { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.monitor-table-head, .monitor-row { display: grid; grid-template-columns: minmax(190px,1.35fr) minmax(155px,.95fr) minmax(110px,.7fr) minmax(120px,.72fr) minmax(105px,.62fr) minmax(155px,.9fr); align-items: center; gap: 10px; }
.monitor-table-head { min-height: 32px; padding: 0 11px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.monitor-row { min-height: 66px; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.monitor-row:last-child { border-bottom: 0; }
.monitor-row:hover { background: #10161b; }
.monitor-identity { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; align-items: center; }
.monitor-identity > div:last-child { min-width: 0; display: grid; gap: 2px; }
.monitor-identity strong, .monitor-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-identity small, .monitor-meta, .monitor-source { color: var(--muted); font-size: 10px; }
.monitor-health { min-width: 0; display: grid; gap: 5px; justify-items: start; }
.service-strip { display: flex; flex-wrap: wrap; gap: 4px; }
.service-chip { min-height: 19px; display: inline-flex; align-items: center; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-3); color: #91a0aa; font-size: 9px; white-space: nowrap; }
.service-chip.ok { border-color: #28553d; background: var(--green-soft); color: var(--green); }
.monitor-stat { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.monitor-stat div { min-width: 0; }
.monitor-stat span { display: block; color: var(--subtle); font-size: 9px; text-transform: uppercase; }
.monitor-stat strong { display: block; margin-top: 2px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.monitor-traffic { min-width: 0; display: grid; gap: 3px; }
.monitor-traffic span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.event-row { min-height: 41px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 6px 1px; border-bottom: 1px solid var(--line); }
.event-row:last-child { border-bottom: 0; }
.event-row > div { min-width: 0; display: grid; gap: 2px; }
.event-row strong, .event-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-row small, .event-row time { color: var(--muted); font-size: 10px; }
.settings-grid.single { max-width: 520px; }
.empty { min-height: 84px; display: grid; place-content: center; gap: 4px; padding: 18px; color: #c5d0d7; text-align: center; }
.empty small { max-width: 520px; color: var(--muted); }
.loading { padding: 22px; color: var(--muted); text-align: center; }

@media (max-width: 1180px) {
  .settings-role-grid { grid-template-columns: 1fr; }
  .settings-role-grid > .panel { height: auto; }
  .settings-role-grid .panel > .hint { min-height: 0; }
  .monitor-table-head, .monitor-row { grid-template-columns: minmax(180px,1.3fr) minmax(140px,.9fr) minmax(110px,.7fr) minmax(115px,.72fr) minmax(140px,.9fr); }
  .monitor-table-head > :nth-child(5), .monitor-row > :nth-child(5) { display: none; }
}

@media (max-width: 980px) {
  :root { --sidebar-width: 178px; }
  .main { padding-inline: 16px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; }
  .clock { display: none; }
  .workflow-steps, .workflow-grid { grid-template-columns: 1fr; }
  .install-sequence { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .fleet-progress { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .deployment-node-row { grid-template-columns: 28px minmax(0,1fr) auto; }
  .deployment-node-action { grid-column: 2/-1; justify-content: flex-start; }
  .monitor-table-head { display: none; }
  .monitor-row { grid-template-columns: minmax(190px,1.2fr) minmax(150px,.8fr) repeat(2,minmax(110px,.65fr)); }
  .monitor-row > :nth-child(5), .monitor-row > :nth-child(6) { display: grid; }
  .monitor-traffic { grid-column: 2/-1; grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: auto; height: 62px; padding: 6px 8px; border-top: 1px solid var(--line); border-right: 0; }
  .brand, .account { display: none; }
  .sidebar nav { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 3px; margin: 0; }
  .nav { min-width: 0; min-height: 50px; display: grid; place-items: center; gap: 1px; padding: 3px 1px; font-size: 0; text-align: center; }
  .nav::before { width: auto; height: auto; border: 0; background: transparent !important; font-size: 9px; }
  .nav::after { content: attr(data-mobile-label); max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .nav.active { box-shadow: inset 0 -2px 0 var(--cyan); }
  .main { padding: 0 13px 80px; }
  .topbar { min-height: 61px; align-items: center; gap: 8px; }
  .topbar h2 { font-size: 18px; }
  .topbar-title .eyebrow { display: none; }
  .topbar-actions { flex: 1; flex-wrap: nowrap; }
  .project-picker { width: min(150px,32vw); }
  #global-health { margin-left: auto; }
  .view { padding-top: 14px; }
  .overview-head, .section-intro, .actionbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .overview-head > .button, .section-intro > .button, .actionbar > .button { align-self: stretch; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .compact { align-items: stretch; flex-direction: column; }
  .compact .button { width: 100%; }
  .form-layout { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .workflow-steps { gap: 7px; }
  .install-sequence { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .install-sequence-item:last-child { grid-column: 1/-1; }
  .fleet-install-head { align-items: stretch; flex-direction: column; }
  .fleet-install-head .primary { width: 100%; min-width: 0; }
  .fleet-install-summary { grid-template-columns: 1fr; }
  .fleet-install-summary span { border-right: 0; border-bottom: 1px solid var(--line); }
  .fleet-install-summary span:last-child { border-bottom: 0; }
  .fleet-progress { grid-template-columns: 1fr 1fr; }
  .fleet-step:last-child { grid-column: 1/-1; }
  .fleet-install-result { align-items: flex-start; flex-direction: column; }
  .manual-toolbar { align-items: stretch; flex-direction: column; }
  .manual-toolbar .button { width: 100%; }
  .segmented { width: 100%; }
  .segmented button { min-width: 0; flex: 1; justify-content: center; padding-inline: 6px; }
  .node-row { align-items: flex-start; flex-wrap: wrap; }
  .node-main { flex-basis: calc(100% - 38px); }
  .node-row > .status:first-of-type { margin-left: 36px; }
  .deployment-node-row { grid-template-columns: 28px minmax(0,1fr); }
  .deployment-node-row > .status { grid-column: 2; justify-self: start; }
  .deployment-node-action { grid-column: 1/-1; flex-wrap: wrap; padding-left: 36px; }
  .table-head { display: none; }
  .table-row { grid-template-columns: minmax(0,1fr) auto; gap: 6px 9px; padding: 9px; }
  .table-row > strong { font-size: 12px; }
  .table-row > span:nth-child(3)::before { content: "Connections: "; color: var(--muted); }
  .user-link { grid-column: 1/-1; }
  .user-actions { grid-column: 1/-1; justify-content: flex-start; }
  .monitor-row { grid-template-columns: 1fr 1fr; gap: 9px; padding: 10px; }
  .monitor-identity, .monitor-health { grid-column: 1/-1; }
  .monitor-health { display: flex; align-items: center; justify-content: space-between; }
  .monitor-stat { padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
  .monitor-traffic { grid-column: 1/-1; grid-template-columns: 1fr 1fr; }
  .monitor-traffic .monitor-source { grid-column: 1/-1; }
  .panel-actions { align-items: stretch; flex-direction: column; }
  .panel-actions .button { width: 100%; }
  .head-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .head-actions .button { width: 100%; }
  .event-row { grid-template-columns: minmax(0,1fr) auto; }
  .event-row time { grid-column: 1/-1; }
}

@media (max-width: 460px) {
  .main { padding-inline: 10px; }
  .topbar { display: grid; grid-template-columns: 1fr; align-items: start; padding-block: 9px; }
  .topbar-title { width: 100%; min-width: 0; }
  .topbar h2 { max-width: none; overflow: visible; font-size: 17px; text-overflow: clip; white-space: normal; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .project-picker { width: min(190px,58vw); }
  .project-switcher .icon-button { display: none; }
  .status { padding-inline: 6px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 10px; }
  .metric strong { font-size: 20px; }
  .panel { padding: 11px; }
  .install-sequence-item { min-height: 50px; padding: 7px 8px; }
  .segmented button { font-size: 10px; }
  .node-row > .button { flex: 1 1 auto; }
  .deployment-node-action { padding-left: 0; }
  .deployment-node-action .button { flex: 1 1 auto; }
  .service-strip { max-width: 100%; }
}
