:root {
  --ink: #182230;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --canvas: #f5f7fa;
  --panel: #ffffff;
  --nav: #111827;
  --nav-soft: #1f2937;
  --blue: #0972d3;
  --blue-dark: #075fae;
  --blue-soft: #eff8ff;
  --green: #16813c;
  --green-soft: #ecfdf3;
  --red: #c62b2b;
  --red-soft: #fff1f1;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --header-height: 56px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; min-width: 320px; overflow: hidden; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }

.app-header {
  height: var(--header-height);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--nav);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #111827;
  background: #ff9900;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.header-meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #cbd5e1; }
.header-divider { width: 1px; height: 20px; background: #334155; }
.api-state { display: inline-flex; align-items: center; gap: 7px; }
.api-state i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.12); }
.api-state.online i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.api-state.offline i { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.app-shell { height: calc(100vh - var(--header-height)); display: flex; min-height: 0; }
.account-sidebar {
  width: 268px;
  flex: 0 0 268px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 25;
}

.sidebar-heading { padding: 24px 20px 14px; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; line-height: 1; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-heading h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.icon-button:hover { background: #f8fafc; border-color: var(--line-strong); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.is-loading svg { animation: spin .8s linear infinite; }

.add-account-button {
  margin: 0 20px 16px;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #93bfe8;
  border-radius: 7px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.add-account-button:hover { background: #e4f3ff; border-color: var(--blue); }
.add-account-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.account-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 18px; border-top: 1px solid var(--line); }
.account-item {
  width: 100%;
  margin-top: 6px;
  padding: 11px 10px;
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) 16px;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.account-item:hover { background: #f8fafc; }
.account-item.active { background: var(--blue-soft); border-color: #b9daf7; box-shadow: inset 3px 0 0 var(--blue); }
.account-item-text { min-width: 0; }
.account-item strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.account-item small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { color: #94a3b8; font-size: 18px; line-height: 1; }

.status-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
.status-dot.connected { background: #22a447; box-shadow: 0 0 0 3px rgba(34,164,71,.12); }
.status-dot.failed { background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.11); }
.status-dot.unknown { background: #e8a317; box-shadow: 0 0 0 3px rgba(232,163,23,.12); }
.status-legend { padding: 13px 18px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.status-legend span { display: inline-flex; align-items: center; gap: 6px; }
.status-legend .status-dot { width: 6px; height: 6px; box-shadow: none; }

.sidebar-loading, .sidebar-message { min-height: 100px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; text-align: center; }
.sidebar-message { padding: 18px; line-height: 1.6; }
.spinner { width: 15px; height: 15px; display: inline-block; border: 2px solid #d8e0e8; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.large { width: 26px; height: 26px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.main-panel { flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: var(--canvas); }
.empty-state { height: 100%; padding: 40px; display: grid; place-items: center; }
.empty-state-card { width: min(520px,100%); padding: 48px; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 20px; display: grid; place-items: center; color: var(--blue); border-radius: 12px; background: var(--blue-soft); }
.empty-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2 { margin: 0 0 9px; font-size: 23px; letter-spacing: -.03em; }
.empty-state-card > p:last-child { max-width: 410px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.65; }

.account-detail { height: 100%; display: flex; flex-direction: column; }
.detail-topbar { min-height: 84px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
.account-title-row { display: flex; align-items: center; gap: 10px; }
.account-title-row h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.03em; }
.account-subtitle { margin-top: 7px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.account-subtitle code { padding: 2px 5px; border-radius: 4px; color: #475569; background: #f1f5f9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.pill.neutral { color: #475569; background: #f1f5f9; }
.pill.disabled { color: #64748b; background: #e2e8f0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.button { min-height: 36px; padding: 7px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; font-size: 12px; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button.primary { color: #fff; border: 1px solid var(--blue); background: var(--blue); }
.button.primary:hover:not(:disabled) { border-color: var(--blue-dark); background: var(--blue-dark); }
.button.secondary { color: #334155; border: 1px solid var(--line-strong); background: #fff; }
.button.secondary:hover:not(:disabled) { border-color: #94a3b8; background: #f8fafc; }
.button.danger { color: var(--red); border: 1px solid #f2b8b5; background: #fff; }
.button.danger:hover:not(:disabled) { background: var(--red-soft); }
.button.compact { min-height: 32px; padding: 5px 11px; }
.menu-button { width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 700; letter-spacing: 2px; }
.menu-button:hover { background: #f8fafc; }
.account-menu { position: absolute; top: 42px; right: 0; z-index: 12; width: 158px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.14); }
.account-menu button { width: 100%; padding: 9px 10px; text-align: left; color: var(--red); border: 0; border-radius: 5px; background: #fff; font-size: 12px; cursor: pointer; }
.account-menu button:hover { background: var(--red-soft); }

.pending-banner { margin: 14px 22px 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #f2cc8f; border-radius: 7px; background: var(--amber-soft); box-shadow: 0 3px 10px rgba(181,71,8,.05); }
.pending-banner > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.pending-banner strong { font-size: 13px; }
.pending-banner span { color: #7a4b12; font-size: 11px; }
.banner-actions { display: flex; gap: 7px; }

.detail-content { flex: 1; min-height: 0; padding: 18px 22px 28px; overflow-y: auto; }
.resource-loading { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; }
.resource-loading strong { color: var(--ink); font-size: 14px; }
.resource-error, .resource-empty { min-height: 260px; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.resource-error strong { color: var(--red); }
.resource-error p, .resource-empty p { max-width: 500px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.resource-section { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.resource-section-header { min-height: 50px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.resource-section-title { display: flex; align-items: center; gap: 10px; }
.resource-type-icon { width: 28px; height: 28px; display: grid; place-items: center; color: #475569; border-radius: 6px; background: #f1f5f9; font-size: 10px; font-weight: 800; }
.resource-section h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.count-badge { padding: 2px 7px; color: var(--muted); border-radius: 999px; background: #f1f5f9; font-size: 10px; font-weight: 650; }
.table-scroll { overflow-x: auto; }
.resource-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.resource-table th { padding: 9px 12px; text-align: left; color: var(--muted); border-bottom: 1px solid var(--line); background: #f8fafc; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.resource-table td { height: 48px; padding: 8px 12px; color: #334155; border-bottom: 1px solid #edf1f5; font-size: 12px; vertical-align: middle; }
.resource-table tbody tr:last-child td { border-bottom: 0; }
.resource-table tbody tr:hover { background: #fbfdff; }
.resource-table .managed-col { width: 70px; text-align: center; }
.resource-table .name-col { width: 26%; }
.resource-table .status-col { width: 115px; }
.resource-name { overflow: hidden; color: var(--ink); font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.resource-secondary { margin-top: 3px; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.managed-checkbox { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.running { color: var(--green); background: var(--green-soft); }
.status-badge.running::before { background: #22a447; }
.status-badge.stopped { color: var(--red); background: var(--red-soft); }
.status-badge.stopped::before { background: #e5484d; }
.status-badge.pending { color: var(--amber); background: var(--amber-soft); }
.status-badge.pending::before { background: #e8a317; }
.status-badge.unknown { color: #475569; background: #f1f5f9; }
.status-badge.unknown::before { background: #94a3b8; }
.row-actions { min-width: max-content; padding: 0 5px; display: flex; justify-content: center; gap: 8px; }
.row-button { min-width: 62px; padding: 6px 11px; color: #334155; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 10px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.row-button:hover { border-color: #94a3b8; background: #f8fafc; }
.row-button.stop { color: var(--red); }
.row-button.change { color: var(--blue-dark); }

.drawer-layer { position: fixed; inset: 0; z-index: 100; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(15,23,42,.42); backdrop-filter: blur(1px); }
.drawer { position: absolute; top: 0; right: 0; width: min(460px,100vw); height: 100%; display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 50px rgba(15,23,42,.2); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(30px); opacity: .7; } }
.drawer-header { min-height: 78px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.drawer-header .icon-button { font-size: 21px; }
.drawer form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drawer-body { flex: 1; min-height: 0; padding: 22px; overflow-y: auto; }
.drawer-intro { margin: 0 0 23px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.field { margin-bottom: 17px; display: flex; flex-direction: column; gap: 6px; }
.field > span, .switch-field > span { color: #334155; font-size: 12px; font-weight: 650; }
.field b { color: var(--red); }
.field input, .field textarea { width: 100%; padding: 9px 10px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; background: #fff; font-size: 12px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,114,211,.12); }
.field textarea { resize: vertical; min-height: 76px; }
.field .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.field small { color: var(--muted); font-size: 10px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.switch-field { min-height: 66px; display: grid; grid-template-columns: 1fr auto; align-content: center; align-items: center; position: relative; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-field i { width: 36px; height: 20px; padding: 2px; border-radius: 999px; background: #cbd5e1; cursor: pointer; transition: background .15s; }
.switch-field i::after { content: ""; width: 16px; height: 16px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .15s; }
.switch-field input:checked + i { background: var(--blue); }
.switch-field input:checked + i::after { transform: translateX(16px); }
.form-error { padding: 10px 12px; color: var(--red); border: 1px solid #f2b8b5; border-radius: 6px; background: var(--red-soft); font-size: 11px; line-height: 1.5; }
.drawer-footer { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #f8fafc; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; max-width: min(480px,calc(100vw - 32px)); padding: 11px 15px; color: #fff; border-radius: 7px; background: var(--nav); box-shadow: 0 10px 30px rgba(15,23,42,.25); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%,10px); transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.toast.error { background: #991b1b; }
.mobile-menu, .sidebar-scrim { display: none; }

@media (max-width: 900px) {
  .header-label, .header-divider { display: none; }
  .mobile-menu { width: 34px; height: 34px; padding: 7px; display: flex; flex-direction: column; justify-content: center; gap: 4px; color: #fff; border: 0; border-radius: 5px; background: #1f2937; cursor: pointer; }
  .mobile-menu span { width: 100%; height: 1.5px; border-radius: 2px; background: currentColor; }
  .brand { margin-right: auto; }
  .account-sidebar { position: fixed; top: var(--header-height); bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 35px rgba(15,23,42,.16); }
  .account-sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: var(--header-height) 0 0; z-index: 20; border: 0; background: rgba(15,23,42,.35); }
  .sidebar-scrim.show { display: block; }
  .detail-topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 640px) {
  .app-header { padding: 0 12px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 27px; height: 27px; }
  .api-state { font-size: 0; }
  .detail-topbar { padding: 16px; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: stretch; }
  .topbar-actions .button { flex: 1; }
  .account-menu { left: 0; right: auto; }
  .pending-banner { margin: 10px 12px 0; align-items: stretch; flex-direction: column; }
  .pending-banner > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .banner-actions { justify-content: flex-end; }
  .detail-content { padding: 12px 12px 24px; }
  .empty-state { padding: 18px; }
  .empty-state-card { padding: 32px 22px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
}

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

/* Consistent typography and spacing across the management console. */
body { font-size: 14px; }
.brand { font-size: 16px; }
.header-meta { font-size: 13px; }
.eyebrow { margin-bottom: 7px; font-size: 11px; letter-spacing: .12em; }
.sidebar-heading { padding: 22px 18px 15px; }
.sidebar-heading h1 { font-size: 23px; }
.add-account-button { margin: 0 18px 17px; min-height: 42px; font-size: 14px; }
.account-list { padding: 6px 10px 20px; }
.account-item { min-height: 58px; padding: 12px 11px; }
.account-item strong { font-size: 14px; }
.account-item small { margin-top: 4px; font-size: 11px; }
.resource-nav-item { min-height: 38px; padding: 8px 10px; font-size: 13px; }
.resource-nav-icon { width: 27px; height: 23px; font-size: 9px; }
.status-legend { font-size: 11px; }

.detail-topbar { min-height: 88px; }
.account-title-row h2 { font-size: 24px; }
.account-subtitle { margin-top: 8px; font-size: 13px; }
.account-subtitle code { font-size: 12px; }
.pill { padding: 4px 9px; font-size: 11px; }
.button { min-height: 39px; padding: 8px 14px; font-size: 13px; }
.button.compact { min-height: 34px; font-size: 12px; }
.menu-button { width: 39px; height: 39px; }
.pending-banner strong { font-size: 14px; }
.pending-banner span { font-size: 12px; }
.detail-content { padding-top: 22px; }

.view-heading h3, .managed-overview-heading h3 { font-size: 20px; }
.view-heading-actions, .managed-heading-actions { font-size: 12px; }
.text-button { padding: 5px 9px; font-size: 10px; }
.resource-section-header { min-height: 56px; }
.resource-section h3 { font-size: 15px; }
.resource-table th { padding: 11px 13px; font-size: 11px; }
.resource-table td { height: 54px; padding: 10px 13px; font-size: 13px; }
.resource-name { font-size: 13px; }
.resource-secondary { margin-top: 4px; font-size: 11px; }
.status-badge { padding: 4px 9px; font-size: 11px; }
.row-button { min-width: 66px; padding: 7px 12px; font-size: 11px; }
.cluster-group > summary { min-height: 52px; padding: 11px 16px; }
.cluster-name { font-size: 13px; }
.cluster-meta { font-size: 11px; }

.managed-summary-card header { min-height: 58px; padding: 12px 14px; }
.managed-summary-card header strong { font-size: 13px; }
.managed-summary-row { min-height: 64px; padding: 12px 14px; }
.managed-summary-row strong { font-size: 13px; }
.managed-summary-row small { margin-top: 5px; font-size: 11px; line-height: 1.35; }
.managed-label { padding: 4px 8px; font-size: 10px; }
.managed-cluster-group > summary { min-height: 52px; padding: 10px 13px; }
.managed-cluster-title { font-size: 12px; }
.managed-cluster-group > summary small { font-size: 10px; }

.drawer { width: min(500px,100vw); }
.drawer-header { min-height: 82px; padding: 19px 24px; }
.drawer-header h2 { font-size: 23px; }
.drawer-body { padding: 24px; }
.drawer-intro { margin-bottom: 25px; font-size: 13px; }
.field { margin-bottom: 19px; gap: 7px; }
.field > span, .switch-field > span { font-size: 13px; }
.field input, .field textarea { min-height: 42px; padding: 10px 12px; font-size: 14px; }
.field .mono { font-size: 12px; }
.field small { font-size: 11px; line-height: 1.4; }
.field-grid { gap: 20px; align-items: start; }
.switch-field { min-height: 82px; padding-top: 17px; }
.drawer-footer { padding: 15px 24px; }
.form-error { font-size: 12px; }

.action-modal { width: min(500px,100%); }
.action-modal-header h2 { font-size: 20px; }
.action-modal-body { padding: 22px; }
.confirmation-copy { font-size: 14px; }
.toast { font-size: 13px; }

/* Account-first lazy navigation */
.account-node { margin-top: 6px; border-radius: 8px; }
.account-node .account-item { margin-top: 0; }
.account-node.expanded > .account-item .account-chevron { transform: rotate(90deg); }
.account-chevron { transition: transform .15s ease; }
.account-resource-menu { margin: 2px 0 8px 27px; padding: 4px 0 4px 10px; border-left: 1px solid var(--line); }
.resource-nav-item { width: 100%; min-height: 34px; padding: 7px 9px; display: grid; grid-template-columns: 27px minmax(0,1fr); align-items: center; gap: 7px; color: #475569; text-align: left; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 12px; font-weight: 620; cursor: pointer; }
.resource-nav-item:hover { color: var(--ink); background: #f8fafc; }
.resource-nav-item.active { color: var(--blue-dark); border-color: #cce4f8; background: var(--blue-soft); }
.resource-nav-icon { width: 25px; height: 21px; display: grid; place-items: center; border-radius: 4px; color: #526579; background: #eef2f6; font-size: 8px; font-weight: 800; }
.resource-nav-item.active .resource-nav-icon { color: var(--blue-dark); background: #dceefe; }

.view-heading { margin: 0 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.view-heading h3 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.view-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.account-overview, .scheduler-card { min-height: 300px; display: grid; place-items: center; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.account-overview > div, .scheduler-card > div { max-width: 520px; padding: 48px 28px; }
.account-overview h3, .scheduler-card h3 { margin: 14px 0 8px; font-size: 20px; }
.account-overview p, .scheduler-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.overview-icon, .scheduler-icon { width: 48px; height: 48px; margin: auto; display: grid; place-items: center; color: var(--blue-dark); border-radius: 10px; background: var(--blue-soft); font-weight: 800; }

/* Account overview reads only the managed-resource registry. */
.managed-overview-heading { margin-bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.managed-overview-heading .eyebrow { margin: 0 0 4px; }
.managed-overview-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.managed-overview-heading > span { color: var(--muted); font-size: 12px; }
.managed-heading-actions, .view-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 11px; }
.text-button { padding: 4px 7px; color: var(--blue-dark); border: 1px solid #cce0f3; border-radius: 5px; background: #fff; font-size: 9px; font-weight: 650; cursor: pointer; }
.text-button:hover { border-color: #93bfe8; background: var(--blue-soft); }
.managed-overview-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.managed-summary-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.managed-summary-card header { min-height: 54px; padding: 11px 13px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); }
.managed-summary-card header strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.managed-summary-card header > span:last-child { min-width: 24px; padding: 2px 7px; color: var(--muted); text-align: center; border-radius: 999px; background: #f1f5f9; font-size: 10px; }
.managed-summary-list { max-height: 420px; overflow-y: auto; }
.managed-summary-row { min-height: 58px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #edf1f5; }
.managed-summary-row:last-child { border-bottom: 0; }
.managed-summary-row > div { min-width: 0; }
.managed-summary-row strong, .managed-summary-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.managed-summary-row strong { color: var(--ink); font-size: 11px; }
.managed-summary-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.managed-summary-row .managed-instance-id { color: #526579; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.managed-label { flex: none; padding: 3px 7px; color: var(--green); border-radius: 999px; background: var(--green-soft); font-size: 9px; font-weight: 700; }
.managed-row-actions { flex: none; display: flex; align-items: center; gap: 5px; }
.managed-remove-button { width: 22px; height: 22px; display: grid; place-items: center; color: #64748b; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.managed-remove-button:hover { color: var(--red); border-color: #f2b8b5; background: var(--red-soft); }
.managed-remove-button:disabled { cursor: wait; opacity: .5; }
.managed-summary-empty { margin: 0; padding: 24px 13px; color: var(--muted); text-align: center; font-size: 11px; }
.managed-cluster-group + .managed-cluster-group { border-top: 1px solid #edf1f5; }
.managed-cluster-group > summary { min-height: 48px; padding: 9px 12px; display: grid; grid-template-columns: 12px minmax(0,1fr) auto 24px; align-items: center; gap: 7px; list-style: none; cursor: pointer; background: #fbfdff; }
.managed-cluster-group > summary::-webkit-details-marker { display: none; }
.managed-cluster-group > summary:hover { background: #f7fafc; }
.managed-cluster-chevron { color: #718096; font-size: 13px; transition: transform .15s; }
.managed-cluster-group[open] .managed-cluster-chevron { transform: rotate(90deg); }
.managed-cluster-title { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.managed-cluster-group > summary small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.managed-cluster-group > summary > span:last-child { min-width: 22px; padding: 2px 6px; color: var(--muted); text-align: center; border-radius: 999px; background: #eef2f6; font-size: 9px; }
.managed-cluster-group > div { border-top: 1px solid #edf1f5; }
.managed-service-row { padding-left: 31px; background: #fff; }

/* A managed resource is visually active, not disabled. */
.resource-table tbody tr.managed-row td { background: #f1f8f6; }
.resource-table tbody tr.managed-row:hover td { background: #eaf5f1; }
.resource-table tbody tr.managed-row td:first-child { box-shadow: inset 3px 0 0 #38a169; }
.resource-table tbody tr.managed-row td.col-actions { background: #f1f8f6; }

@media (max-width: 1100px) {
  .managed-overview-grid { grid-template-columns: 1fr; }
}

/* Resizable resource tables */
.resource-table { width: max-content; min-width: 100%; table-layout: fixed; }
.resource-table th { position: relative; white-space: nowrap; }
.resource-table th.col-managed, .resource-table td.col-managed { text-align: center; }
.resource-table th.col-actions, .resource-table td.col-actions { position: sticky; right: 0; z-index: 2; text-align: center; background: #fff; box-shadow: -1px 0 0 var(--line); }
.resource-table th.col-actions { z-index: 3; text-align: center; background: #f8fafc; }
.resource-table .row-actions { justify-content: center; }
.column-resizer { position: absolute; top: 0; right: -4px; z-index: 4; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.column-resizer::after { content: ""; position: absolute; top: 22%; bottom: 22%; left: 4px; width: 1px; background: transparent; }
.column-resizer:hover::after, body.resizing-column .column-resizer::after { background: var(--blue); }
body.resizing-column { cursor: col-resize; user-select: none; }
.row-button:disabled { cursor: not-allowed; opacity: .42; }
.status-badge.degraded { color: #b54708; background: #fff4e5; }
.status-badge.degraded::before { background: #f59e0b; }
.status-badge.scaling { color: #175cd3; background: #eff8ff; }
.status-badge.scaling::before { background: #2e90fa; }

/* ECS is grouped by cluster before services. */
.cluster-group + .cluster-group { border-top: 1px solid var(--line); }
.cluster-group > summary { min-height: 45px; padding: 9px 15px; display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; background: #fbfdff; }
.cluster-group > summary::-webkit-details-marker { display: none; }
.cluster-group > summary:hover { background: #f7fafc; }
.cluster-chevron { color: #718096; font-size: 13px; transition: transform .15s; }
.cluster-group[open] .cluster-chevron { transform: rotate(90deg); }
.cluster-name { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cluster-meta { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.asg-group > summary .status-badge { margin-left: auto; }
.asg-group > summary .cluster-meta { margin-left: 6px; }
.asg-instances { padding: 0 15px 15px; background: #fff; }
.asg-instances h4 { margin: 14px 0 9px; color: #334155; font-size: 11px; letter-spacing: .02em; }
.asg-instances h4 span { margin-left: 5px; padding: 2px 7px; color: var(--muted); border-radius: 999px; background: #f1f5f9; font-size: 9px; }
.instance-id-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 7px; }
.instance-id-list code { padding: 8px 10px; overflow: hidden; color: #334155; border: 1px solid var(--line); border-radius: 5px; background: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.asg-no-instances { padding: 13px 15px 16px; color: var(--muted); border-top: 1px solid #edf1f5; background: #fff; font-size: 11px; }

/* ECS desired-task start dialog */
.modal-layer { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(15,23,42,.46); backdrop-filter: blur(1px); }
.action-modal { position: relative; z-index: 1; width: min(460px,100%); overflow: hidden; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.28); }
.action-modal-header { min-height: 68px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.action-modal-header h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.action-modal-header .icon-button { font-size: 20px; }
.action-modal-body { padding: 20px; }
.action-summary { margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.action-summary strong, .action-summary span { display: block; overflow-wrap: anywhere; }
.action-summary strong { font-size: 12px; }
.action-summary span { margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.action-modal-footer { padding: 13px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #f8fafc; }
.confirmation-copy { margin: 0 0 16px; color: #475569; font-size: 13px; line-height: 1.65; }
.confirmation-resource { margin-bottom: 0; }
.confirmation-resource strong { font-size: 13px; }

/* Final scale harmonization for components declared later in this file. */
.resource-nav-item { min-height: 38px; padding: 8px 10px; font-size: 13px; }
.resource-nav-icon { width: 27px; height: 23px; font-size: 9px; }
.view-heading h3 { font-size: 20px; }
.view-heading p { font-size: 12px; }
.managed-overview-heading h3 { font-size: 20px; }
.view-heading-actions, .managed-heading-actions { font-size: 12px; }
.text-button { padding: 5px 9px; font-size: 10px; }
.managed-summary-card header { min-height: 58px; padding: 12px 14px; }
.managed-summary-card header strong { font-size: 13px; }
.managed-summary-row { min-height: 64px; padding: 12px 14px; }
.managed-summary-row strong { font-size: 13px; }
.managed-summary-row small { margin-top: 5px; font-size: 11px; line-height: 1.35; }
.managed-label { padding: 4px 8px; font-size: 10px; }
.managed-cluster-group > summary { min-height: 52px; padding: 10px 13px; }
.managed-cluster-title { font-size: 12px; }
.managed-cluster-group > summary small { font-size: 10px; }
.cluster-group > summary { min-height: 52px; padding: 11px 16px; }
.cluster-name { font-size: 13px; }
.cluster-meta { font-size: 11px; }
.action-modal { width: min(500px,100%); }
.action-modal-header h2 { font-size: 20px; }
.action-modal-body { padding: 22px; }
.confirmation-copy { font-size: 14px; }
.confirmation-resource strong { font-size: 14px; }

.header-user { max-width: 260px; overflow: hidden; color: #e2e8f0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.header-logout { padding: 5px 8px; color: #cbd5e1; border: 1px solid #334155; border-radius: 5px; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.header-logout:hover { color: #fff; border-color: #64748b; background: #1e293b; }

/* Managed settings, health and automation history. */
.managed-edit-button { min-height: 27px; padding: 0 9px; color: var(--blue); border: 1px solid #b9d6f5; border-radius: 6px; background: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.managed-edit-button:hover { background: #edf6ff; }
.managed-label.missing { color: #b42318; background: #feeceb; }
.managed-label.warning { color: #9a6700; background: #fff4ce; }
.managed-capacity-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.row-actions.polling { min-height: 34px; justify-content: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.execution-history { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.execution-history-heading { min-height: 64px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.execution-history-heading .eyebrow { margin: 0 0 3px; }
.execution-history-heading h3 { margin: 0; font-size: 17px; }
.execution-history-heading > span { color: var(--muted); font-size: 11px; }
.execution-table-wrap { overflow-x: auto; }
.execution-history table { width: 100%; border-collapse: collapse; }
.execution-history th, .execution-history td { padding: 11px 16px; text-align: left; border-bottom: 1px solid #edf1f5; font-size: 11px; }
.execution-history .execution-log-row > td { padding: 0; background: #fbfcfe; }
.execution-log-details > summary { padding: 10px 16px; color: var(--blue-dark); font-size: 11px; font-weight: 700; cursor: pointer; list-style-position: inside; }
.execution-log-details > summary:hover { background: #f5f9fd; }
.execution-log-list { padding: 0 16px 14px; display: grid; gap: 9px; }
.execution-log-entry { overflow: hidden; border: 1px solid #f1c7c4; border-radius: 7px; background: #fff; }
.execution-log-entry > div { padding: 8px 10px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #f7dedc; background: #fff7f6; }
.execution-log-entry > div span { flex: none; padding: 2px 6px; color: #b42318; border-radius: 999px; background: #feeceb; font-size: 9px; font-weight: 800; }
.execution-log-entry code { overflow: hidden; color: #475569; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.execution-log-entry pre { margin: 0; padding: 10px; overflow-x: auto; color: #7f1d1d; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.execution-history th { color: var(--muted); background: #f8fafc; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.execution-history tbody tr:last-child td { border-bottom: 0; }
.execution-status { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #eef2f6; font-size: 9px; font-weight: 800; }
.execution-status.succeeded { color: var(--green); background: var(--green-soft); }
.execution-status.partial { color: #9a6700; background: #fff4ce; }
.execution-status.failed { color: var(--red); background: var(--red-soft); }
.execution-failure { color: var(--red); font-weight: 800; cursor: help; }
.execution-empty { margin: 0; padding: 22px 16px; color: var(--muted); font-size: 11px; }
@media (max-width: 700px) { .managed-capacity-grid { grid-template-columns: 1fr; } }
