:root {
  color-scheme: dark;
  --bg: #08111d;
  --panel: #0d1a2a;
  --panel-strong: #102337;
  --line: #233a52;
  --muted: #8ca1b8;
  --text: #edf6ff;
  --accent: #55d6a8;
  --accent-deep: #143f35;
  --warn: #f0b75f;
  --danger: #fa7e91;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 88% 0, #102c46 0, transparent 34rem), var(--bg); color: var(--text); }
button, input, select { font: inherit; }

.auth-gate { display: grid; min-height: 100vh; padding: 1.25rem; place-items: center; }
.auth-gate[hidden] { display: none !important; }
.auth-card { width: min(100%, 34rem); padding: clamp(1.4rem, 5vw, 2.5rem); border: 1px solid #2d5971; border-radius: 1rem; background: linear-gradient(145deg, rgba(19, 43, 64, 0.96), rgba(9, 24, 40, 0.96)); box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 2.8rem; padding: 0; }
.auth-card h1 { margin-bottom: 0.8rem; }
.auth-copy, .auth-note { color: var(--muted); font-size: 0.86rem; line-height: 1.65; }
.auth-copy { min-height: 2.8rem; }
.auth-note { margin: 1rem 0 0; font-size: 0.76rem; }
.pairing-instructions { margin: 1.2rem 0; padding: 0.95rem; border: 1px dashed #34728a; border-radius: 0.7rem; background: rgba(6, 20, 31, 0.6); }
.pairing-instructions p { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.78rem; }
.pairing-instructions code { display: block; overflow-wrap: anywhere; color: #b8ffe1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.5; user-select: all; }
.auth-card > .button { width: 100%; margin-top: 0.55rem; }
.login-form { display: grid; gap: 0.85rem; margin-top: 1.1rem; }
.login-form label { display: grid; gap: 0.38rem; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.login-form .button { width: 100%; margin-top: 0.25rem; }

.shell { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 1.5rem 1rem; border-right: 1px solid var(--line); background: rgba(7, 17, 29, 0.88); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 0.65rem; padding: 0 0.45rem; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.16em; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.65rem; color: #07151b; background: linear-gradient(135deg, #82f6ca, #4eaef4); font-size: 1rem; letter-spacing: 0; }
.environment { display: flex; align-items: center; gap: 0.45rem; margin: 2.4rem 0 1.3rem; padding: 0 0.45rem; color: var(--muted); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.1em; }
.pulse { width: 0.48rem; height: 0.48rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0.25rem rgba(85, 214, 168, 0.11); }
nav { display: grid; gap: 0.25rem; }
nav a { padding: 0.7rem 0.75rem; border-radius: 0.55rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
nav a:hover, nav a.active { color: var(--text); background: var(--panel-strong); }
.sidebar-note { margin-top: auto; padding: 1rem 0.75rem; border: 1px solid var(--line); border-radius: 0.75rem; color: var(--muted); background: rgba(17, 37, 57, 0.45); font-size: 0.75rem; line-height: 1.6; }

.workspace { width: min(100%, 94rem); margin: 0 auto; padding: 2.1rem clamp(1rem, 3vw, 3rem) 4rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.eyebrow { margin: 0 0 0.35rem; color: #6ac7e8; font-size: 0.69rem; font-weight: 800; letter-spacing: 0.12em; }
h1, h2 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); }
h2 { font-size: 1.08rem; }
h3 { margin: 0; font-size: 1rem; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 0.65rem; }
.connection { padding: 0.5rem 0.7rem; border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 0.75rem; font-weight: 700; }
.connection.ok { color: #b3ffdf; background: var(--accent-deep); }
.connection.error { color: #ffd3da; background: #46202c; }
.top-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; margin-bottom: 1.5rem; padding: 0.4rem; border: 1px solid var(--line); border-radius: 0.9rem; background: rgba(10, 25, 41, 0.76); }
.top-tab { display: grid; gap: 0.16rem; min-height: 3.65rem; padding: 0.72rem 0.85rem; border: 1px solid transparent; border-radius: 0.62rem; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.top-tab strong { font-size: 0.91rem; }
.top-tab small { color: inherit; font-size: 0.69rem; }
.top-tab:hover { color: var(--text); background: rgba(27, 54, 79, 0.55); }
.top-tab.active { color: #dffff3; border-color: #24715a; background: linear-gradient(135deg, rgba(21, 75, 60, 0.88), rgba(18, 52, 72, 0.88)); }
.tab-panel[hidden] { display: none !important; }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; margin-bottom: 1.5rem; }
.metric-card, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(17, 35, 54, 0.94), rgba(9, 24, 40, 0.94)); box-shadow: var(--shadow); }
.metric-card { min-height: 8.4rem; padding: 1.15rem; border-radius: 0.9rem; }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-size: 0.82rem; }
.metric-card strong { display: block; margin: 0.55rem 0 0.2rem; color: var(--accent); font-size: 2rem; line-height: 1; }
.panel { margin-top: 1rem; padding: 1.2rem; border-radius: 0.9rem; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading > p { max-width: 22rem; margin: 0.25rem 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; text-align: right; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 48rem; border-collapse: collapse; }
th { color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
th, td { padding: 0.8rem 0.55rem; border-bottom: 1px solid rgba(35, 58, 82, 0.72); vertical-align: middle; }
td { color: #d7e4f1; font-size: 0.84rem; }
tbody tr:last-child td { border-bottom: 0; }
.host-cell strong, .host-cell small { display: block; }
.host-cell small { margin-top: 0.2rem; color: var(--muted); font-size: 0.7rem; }
.host-name-edit { display: inline-flex; align-items: center; gap: 0.28rem; margin-top: 0.46rem; padding: 0.2rem 0.38rem; border: 1px solid #36536b; border-radius: 0.35rem; color: #bfd4e3; background: rgba(16, 43, 59, 0.7); cursor: pointer; font-size: 0.66rem; font-weight: 800; white-space: nowrap; }
.host-name-edit:hover { border-color: #62c8ec; color: #f1fbff; background: #1b4059; }
.host-name-edit:focus-visible { outline: 2px solid #67cef2; outline-offset: 2px; }
.status { display: inline-flex; align-items: center; gap: 0.32rem; padding: 0.28rem 0.45rem; border-radius: 999px; color: var(--muted); background: #172738; font-size: 0.72rem; font-weight: 700; }
.status::before { content: ""; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: #73879b; }
.status.online { color: #b8ffe1; background: var(--accent-deep); }
.status.online::before { background: var(--accent); }
.status.disabled { color: #ffd9ac; background: #44301d; }
.status.disabled::before { background: #f4ab57; }
.status.failed { color: #ffd5dd; background: #4a2330; }
.status.failed::before { background: var(--danger); }

.split-panel { display: grid; grid-template-columns: minmax(15rem, 0.9fr) minmax(18rem, 1.1fr); gap: 2rem; }
.stack-form { display: grid; gap: 0.85rem; max-width: 25rem; }
.stack-form label { display: grid; gap: 0.38rem; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
input, select { width: 100%; min-height: 2.5rem; padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: 0.5rem; outline: none; color: var(--text); background: #0a1725; }
input:focus, select:focus { border-color: #51b5df; box-shadow: 0 0 0 0.2rem rgba(81, 181, 223, 0.13); }
.button { min-height: 2.5rem; padding: 0.55rem 0.85rem; border: 1px solid transparent; border-radius: 0.52rem; color: #052219; background: var(--accent); cursor: pointer; font-size: 0.82rem; font-weight: 800; }
.button:hover { filter: brightness(1.08); }
.button:disabled { cursor: not-allowed; opacity: 0.45; }
.button.quiet { color: var(--text); border-color: var(--line); background: var(--panel); }
.button.danger { color: #ffe9ed; border-color: #884353; background: #5c2835; }
.button.small { min-height: 1.9rem; padding: 0.28rem 0.55rem; font-size: 0.72rem; }
.host-actions { white-space: nowrap; }
.agent-toggle { display: inline-flex; align-items: center; gap: 0.28rem; min-width: 3.8rem; min-height: 1.9rem; margin-left: 0.4rem; padding: 0.2rem 0.36rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #172738; cursor: pointer; font-size: 0.66rem; font-weight: 800; }
.agent-toggle span { width: 0.76rem; height: 0.76rem; border-radius: 50%; background: #73879b; transition: transform 140ms ease, background 140ms ease; }
.agent-toggle.on { color: #b8ffe1; border-color: #1f8965; background: var(--accent-deep); }
.agent-toggle.on span { background: var(--accent); transform: translateX(0.2rem); }
.agent-toggle.off { color: #ffd9ac; border-color: #805d32; background: #44301d; }
.agent-toggle.off span { background: #f4ab57; }
.command-list, .audit-list { display: grid; gap: 0.4rem; max-height: 20rem; overflow: auto; }
.command-item, .audit-item { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(3.5rem, auto); align-items: center; gap: 0.7rem; padding: 0.65rem 0.1rem; border-bottom: 1px solid rgba(35, 58, 82, 0.6); }
.command-item:last-child, .audit-item:last-child { border-bottom: 0; }
.command-item > div, .audit-item > div { min-width: 0; }
.command-item strong, .audit-item strong { display: block; font-size: 0.79rem; overflow-wrap: anywhere; }
.command-item small, .audit-item small { display: block; color: var(--muted); font-size: 0.7rem; overflow-wrap: anywhere; }
.command-item > small, .audit-item > small { text-align: right; }
.command-item > .command-result { max-width: 23rem; color: #b9cadb; line-height: 1.45; text-align: left; white-space: pre-wrap; }
.token-result { display: grid; align-content: center; min-height: 12rem; padding: 1rem; border: 1px dashed #2b5970; border-radius: 0.7rem; background: rgba(9, 23, 37, 0.6); }
.token-result code { display: block; overflow-wrap: anywhere; color: #b8ffe1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.6; }
.token-result p:last-child { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.install-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.install-card { min-height: 20rem; padding: 1.1rem; border: 1px solid #28526a; border-radius: 0.75rem; background: rgba(8, 23, 38, 0.54); }
.install-card.muted-card { border-color: #3d4e61; background: rgba(14, 28, 43, 0.48); }
.install-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-bottom: 1rem; }
.platform-status { flex: 0 0 auto; padding: 0.28rem 0.46rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800; }
.platform-status.ready { color: #b8ffe1; background: var(--accent-deep); }
.platform-status.pending { color: #ffd9ac; background: #44301d; }
.setup-list { margin: 0.8rem 0; padding-left: 1.2rem; color: #c1d1df; font-size: 0.82rem; line-height: 1.65; }
.setup-list code, .install-note code { padding: 0.1rem 0.28rem; border-radius: 0.25rem; color: #b8ffe1; background: #102b38; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.copyable-code { position: relative; min-width: 0; }
.copyable-code > code { display: block; min-width: 0; }
.copy-code-button { position: absolute; top: 0.48rem; right: 0.48rem; display: inline-flex; align-items: center; gap: 0.32rem; min-width: 2.2rem; min-height: 2.05rem; padding: 0.32rem 0.44rem; border: 1px solid #41617b; border-radius: 0.44rem; color: #d8ecf8; background: rgba(19, 45, 65, 0.94); cursor: pointer; font-size: 0.68rem; font-weight: 800; line-height: 1; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.copy-code-button:hover { border-color: #66c8ed; color: #f3fbff; background: #1c405a; }
.copy-code-button:focus-visible { outline: 2px solid #67cef2; outline-offset: 2px; }
.copy-code-button.copied { border-color: #3bba87; color: #c8ffe5; background: #143f35; }
.copy-code-button.copy-failed { border-color: #cb6d80; color: #ffe1e6; background: #542a36; }
.copy-code-icon { position: relative; display: block; width: 0.86rem; height: 0.86rem; }
.copy-code-icon::before, .copy-code-icon::after { content: ""; position: absolute; width: 0.58rem; height: 0.66rem; border: 1.5px solid currentColor; border-radius: 0.14rem; }
.copy-code-icon::before { top: 0; right: 0; }
.copy-code-icon::after { bottom: 0; left: 0; background: inherit; }
.pairing-code { padding: 0.72rem 3.9rem 0.72rem 0.72rem; border: 1px solid #29566d; border-radius: 0.52rem; background: rgba(7, 21, 31, 0.82); }
.pairing-code .copy-code-button { top: 0.38rem; right: 0.38rem; }
.token-code { margin: 0.25rem 0 0.75rem; padding: 0.72rem 3.9rem 0.72rem 0.72rem; border: 1px solid #294b63; border-radius: 0.52rem; background: #07151f; }
.install-command { margin: 0.8rem 0; padding: 0.8rem 4.3rem 0.8rem 0.8rem; overflow-x: auto; border: 1px solid #294b63; border-radius: 0.58rem; color: #b8ffe1; background: #07151f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.install-command code { font-family: inherit; }
.install-note { margin: 0.8rem 0; color: var(--muted); font-size: 0.82rem; line-height: 1.65; }
.empty { padding: 1rem 0; color: var(--muted); font-size: 0.84rem; text-align: left; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: static; display: block; height: auto; padding: 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .environment, .sidebar-note { display: none; }
  .summary-grid, .split-panel, .install-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
  .panel-heading { flex-direction: column; }
  .panel-heading > p { max-width: none; text-align: left; }
  .top-tabs { gap: 0.35rem; margin-bottom: 1rem; padding: 0.3rem; }
  .top-tab { min-height: 3.2rem; padding: 0.55rem 0.62rem; text-align: center; }
  .top-tab small { display: none; }
  .install-card { min-height: 0; }
  .copy-code-label { display: none; }
  .copy-code-button { min-width: 2.05rem; padding: 0.32rem; justify-content: center; }
  .command-item, .audit-item { grid-template-columns: auto minmax(0, 1fr); }
  .command-item > small, .audit-item > small { grid-column: 2; text-align: left; }
}


/* === Host dashboard cards · 0.8.1 === */
.host-card-grid {
  display: grid;
  gap: 1rem;
}

.host-dashboard-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(63, 91, 121, 0.48);
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(13, 22, 36, 0.98), rgba(10, 17, 29, 0.98));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.host-dashboard-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.22rem;
  background: var(--accent);
  opacity: 0.95;
}

.host-dashboard-card.offline::after { background: var(--danger); }
.host-dashboard-card.disabled::after { background: var(--warn); }

.host-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.2rem 0.9rem;
  border-bottom: 1px solid rgba(50, 75, 104, 0.52);
}

.host-identity { min-width: 0; }
.host-title-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.host-title-line h3 {
  overflow: hidden;
  max-width: 34rem;
  color: #f0f5ff;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-identity > small {
  display: block;
  margin-top: 0.3rem;
  color: #6d7d94;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.host-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.host-card-body {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 1.1fr;
}

.host-card-section {
  min-width: 0;
  min-height: 10.2rem;
  padding: 1.25rem 1.45rem;
  border-right: 1px solid rgba(50, 75, 104, 0.52);
}

.host-card-section:last-child { border-right: 0; }

.host-card-kicker {
  margin: 0 0 1.05rem;
  color: #66758d;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.operations-layout {
  display: grid;
  grid-template-columns: minmax(6rem, 0.7fr) minmax(8rem, 1.3fr);
  align-items: end;
  gap: 0.9rem;
}

.host-big-number {
  display: block;
  color: #f4f7fd;
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.host-submetric {
  display: block;
  margin-top: 0.48rem;
  color: #697b93;
  font-size: 0.8rem;
  font-weight: 700;
}

.host-sparkline {
  width: 100%;
  height: 4.2rem;
  overflow: visible;
}
.host-sparkline polyline {
  stroke: #60dfcf;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(96, 223, 207, 0.15));
}

.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}
.lifecycle-grid div {
  min-width: 0;
}
.lifecycle-grid span {
  display: block;
  margin-bottom: 0.42rem;
  color: #65768e;
  font-size: 0.76rem;
}
.lifecycle-grid strong {
  display: block;
  overflow: hidden;
  color: #9ca9bf;
  font-size: 1.05rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  color: #63748b;
  font-size: 0.86rem;
}
.system-metrics span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.46rem;
}
.system-metrics strong {
  overflow: hidden;
  color: #9eaac0;
  font-size: 0.94rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-metrics .system-wide {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
}

.host-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.2rem 0.78rem;
  border-top: 1px solid rgba(50, 75, 104, 0.42);
  color: #617086;
  font-size: 0.7rem;
}

.host-dashboard-card .host-name-edit {
  margin-top: 0;
}

.host-dashboard-card .agent-toggle {
  margin-left: 0;
}

@media (max-width: 1100px) {
  .host-card-body {
    grid-template-columns: 1fr 1fr;
  }
  .host-card-section.system {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(50, 75, 104, 0.52);
  }
  .host-card-section:nth-child(2) { border-right: 0; }
}

@media (max-width: 760px) {
  .host-card-header {
    flex-direction: column;
  }
  .host-card-body {
    grid-template-columns: 1fr;
  }
  .host-card-section,
  .host-card-section:nth-child(2),
  .host-card-section.system {
    grid-column: auto;
    border-right: 0;
    border-top: 1px solid rgba(50, 75, 104, 0.52);
  }
  .host-card-section:first-child { border-top: 0; }
  .operations-layout { grid-template-columns: 0.8fr 1.2fr; }
}


/* Host ordering controls · 0.8.2 */
.host-order-button,
.host-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.2rem 0.42rem;
  border: 1px solid #36536b;
  border-radius: 0.35rem;
  color: #aebfd0;
  background: rgba(16, 43, 59, 0.7);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.host-order-button {
  width: 1.9rem;
  padding-inline: 0;
  font-size: 0.85rem;
}
.host-drag-handle { cursor: grab; }
.host-drag-handle:active { cursor: grabbing; }
.host-order-button:hover,
.host-drag-handle:hover {
  border-color: #62c8ec;
  color: #f1fbff;
  background: #1b4059;
}
.host-dashboard-card.dragging {
  opacity: 0.48;
  transform: scale(0.995);
}
.host-dashboard-card.drag-over {
  border-color: #60dfcf;
  box-shadow: 0 0 0 2px rgba(96, 223, 207, 0.14), 0 16px 36px rgba(0, 0, 0, 0.24);
}
@media (max-width: 760px) {
  .host-drag-handle { display: none; }
  .host-header-actions { flex-wrap: wrap; }
}


/* Compact host cards · 0.8.3 */
.host-card-grid { gap: 0.65rem; }

.host-card-header {
  padding: 0.62rem 0.9rem 0.55rem;
}
.host-title-line { gap: 0.5rem; }
.host-title-line h3 { font-size: 0.94rem; }
.host-identity > small {
  margin-top: 0.14rem;
  font-size: 0.59rem;
}
.host-header-actions { gap: 0.3rem; }
.host-order-button,
.host-drag-handle,
.host-dashboard-card .host-name-edit,
.host-dashboard-card .agent-toggle {
  min-height: 1.55rem;
  font-size: 0.6rem;
}
.host-order-button { width: 1.55rem; }
.host-drag-handle { padding: 0.12rem 0.34rem; }
.host-dashboard-card .host-name-edit { padding: 0.12rem 0.32rem; }
.host-dashboard-card .agent-toggle { min-width: 3.25rem; padding: 0.12rem 0.3rem; }

.host-card-section {
  min-height: 5.7rem;
  padding: 0.72rem 1rem 0.62rem;
}
.host-card-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.61rem;
  letter-spacing: 0.14em;
}
.operations-layout {
  grid-template-columns: minmax(4.8rem, 0.65fr) minmax(7rem, 1.35fr);
  gap: 0.6rem;
}
.host-big-number {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 0.9;
}
.host-submetric {
  margin-top: 0.25rem;
  font-size: 0.68rem;
}
.host-sparkline { height: 2.7rem; }

.lifecycle-grid { gap: 0.65rem; }
.lifecycle-grid span {
  margin-bottom: 0.18rem;
  font-size: 0.66rem;
}
.lifecycle-grid strong { font-size: 0.88rem; }

.system-metrics {
  gap: 0.42rem 0.75rem;
  font-size: 0.72rem;
}
.system-metrics strong { font-size: 0.8rem; }
.system-metrics .system-wide { margin-top: 0; }

.host-card-footer {
  padding: 0.38rem 0.9rem 0.48rem;
  font-size: 0.6rem;
}
.host-card-footer .button.small {
  min-height: 1.55rem;
  padding: 0.16rem 0.42rem;
  font-size: 0.62rem;
}

.host-dashboard-card { border-radius: 0.85rem; }
.host-dashboard-card::after { height: 0.16rem; }

@media (max-width: 760px) {
  .host-card-section {
    min-height: auto;
    padding: 0.72rem 0.85rem;
  }
}


/* Global top navigation · 0.8.4 */
.top-tabs-global {
  position: sticky;
  top: 0;
  z-index: 50;
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(7, 18, 31, 0.97);
  backdrop-filter: blur(14px);
}
.top-tabs-global .top-tab {
  min-height: 3rem;
  padding: 0.55rem 0.85rem;
}
.top-tabs-global + .sidebar { top: 3.75rem; height: calc(100vh - 3.75rem); }


/* Sidebar navigation · 0.8.7 */
.top-tabs-global { display: none !important; }

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-tabs {
  display: grid;
  gap: 0.42rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #1d3348;
}

.sidebar-tab {
  display: grid;
  gap: 0.18rem;
  width: 100%;
  padding: 0.7rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  color: #8292a8;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar-tab strong {
  color: inherit;
  font-size: 0.8rem;
}

.sidebar-tab small {
  color: #65778f;
  font-size: 0.64rem;
}

.sidebar-tab:hover {
  border-color: #29465e;
  color: #d6e5f3;
  background: rgba(18, 48, 67, 0.5);
}

.sidebar-tab.active {
  border-color: #257760;
  color: #e9fff8;
  background: linear-gradient(135deg, rgba(24, 93, 75, 0.68), rgba(17, 58, 70, 0.76));
}

.sidebar-tab.active small { color: #b5d8cd; }

/* Tabs no longer consume a top row. */
.shell {
  grid-template-rows: 1fr;
}
.sidebar,
.workspace {
  grid-row: 1;
}
.sidebar { grid-column: 1; }
.workspace { grid-column: 2; }

@media (max-width: 860px) {
  .sidebar-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.75rem;
  }
}


/* Sidebar nav directly below brand · 0.8.8 */
.sidebar-tabs {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #1d3348;
}
