/* =============================================================
   Cloud Dashboard — shared styles
   Add new service pages without editing this file; just use
   the existing classes.  Page-specific accent overrides can be
   added as a tiny <style> block after the <link> tag.
   ============================================================= */

/* Palette follows the Roche brand tokens published on roche.com. */
:root {
  --bg: #f5f5f2;
  --surface: #fff;
  --surface-alt: #fbfbfa;
  --border: #eae8e5;
  --border-soft: #f1f0ef;
  --border-strong: #dbd6d1;
  --text: #21201f;
  --text-2: #544f4f;
  --muted: #706b69;
  --subtle: #9d948e;
  --primary: #0b41cd;
  --primary-hover: #0936ab;
  --primary-dark: #022366;
  --primary-weak: #d7e0f7;
  --primary-faint: #f1f9fe;
  --light-blue: #1482fa;
  --success: #00724a;
  --success-weak: #d2f3e3;
  --danger: #b8002c;
  --danger-weak: #f8d1d8;
  --danger-faint: #fff7f5;
  --warning: #b22b0d;
  --warning-weak: #fff7ce;
  --violet: #7d0096;
  --violet-weak: #f2d4ff;
  --teal: #1482fa;
  --teal-weak: #f1f9fe;
  --aws: #ff7d29;
  --ali: #ed4a0d;
  --chart-a: #0b41cd;
  --chart-b: #ff8782;
  --chart-c: #ffbd69;
  --side: #022366;
  --side-hover: #072b89;
  --side-text: #d7e0f7;
  --side-muted: #85a0e6;
  --radius: 4px;
  --radius-sm: 2px;
  --shadow: none;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
}

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Layout ── */
body {
  font-family: "Roche Sans", "roche-sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}
.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Sidebar ── */
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--side);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--side-hover);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.brand-logo {
  flex-shrink: 0;
  display: grid; place-items: center;
  color: #bde3ff;
}
.brand-logo .icon { width: 24px; height: 24px; }
.brand-name { font-weight: 400; font-size: 16px; line-height: 1.15; }
.brand-sub  { font-size: 11px; color: var(--side-muted); }
.env-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: #fbdd7a;
  color: var(--text);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.sidebar nav::-webkit-scrollbar       { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: var(--side-hover); border-radius: 3px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  margin: 1px 0;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s;
}
.sidebar nav a .icon        { opacity: .75; }
.sidebar nav a:hover        { background: var(--side-hover); color: #fff; }
.sidebar nav a.active       { background: var(--primary); color: #fff; }
.sidebar nav a.active .icon { opacity: 1; color: #bde3ff; }
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 0; bottom: 0;
  width: 3px;
  background: #bde3ff;
}
.nav-section { margin-top: 12px; }
.nav-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  color: var(--side-muted);
  cursor: pointer;
  text-align: left;
}
.nav-section-label:hover { color: var(--side-text); }
.nav-section-label .dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--side-muted)); }
.nav-section-label .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.nav-section.collapsed .chev      { transform: rotate(-90deg); }
.nav-section.collapsed .nav-items { display: none; }
.side-foot { padding: 10px; border-top: 1px solid var(--side-hover); }
.theme-picker { display: flex; align-items: center; gap: 8px; padding: 4px 10px; color: var(--side-muted); font-size: 12.5px; }
.theme-picker select {
  margin-left: auto; padding: 4px 6px;
  border: 1px solid var(--side-hover); border-radius: var(--radius-sm);
  background: var(--side); color: var(--side-text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.theme-picker select:focus-visible { outline: 2px solid var(--side-muted); }

/* ── Content area ── */
.content { flex: 1; min-width: 0; padding: 24px 28px 40px; }
h1       { font-size: 30px; font-weight: 300; line-height: 1.2; margin-bottom: 6px; }
.meta    { color: var(--muted); font-size: 13px; margin-bottom: 20px; line-height: 1.6; }

/* ── Page header (title + actions) ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p  { color: var(--muted); font-size: 13px; }
.page-head .meta { margin-bottom: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover   { background: var(--primary-faint); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.link    { border: 0; background: none; color: var(--primary); padding: 4px 6px; }

/* ── KPI cards (home + rebuilt pages) ── */
.kpis {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1150px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
a.kpi:hover { border-color: var(--primary); }
.kpi-label  { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 400; color: var(--muted); }
.kpi-icon   { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; }
.kpi-value  { margin-top: 14px; font-size: 32px; font-weight: 300; line-height: 1; color: var(--value-color, var(--text)); font-variant-numeric: tabular-nums; }
.kpi-value small { margin-left: 4px; font-size: 14px; font-weight: 400; color: var(--muted); }
.kpi-foot   { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.kpi-foot .i  { display: inline-flex; align-items: center; gap: 5px; }
.kpi-foot .sw { width: 8px; height: 8px; border-radius: 2px; }
.kpi-split  { display: flex; gap: 22px; margin-top: 12px; }
.kpi-split .kpi-value { margin-top: 0; }
.kpi-split .lbl { margin-bottom: 6px; font-size: 11.5px; color: var(--muted); }
.stack      { display: flex; height: 4px; margin-top: 14px; overflow: hidden; background: var(--border-soft); }
.tone-blue   { background: var(--primary-weak); color: var(--primary); }
.tone-green  { background: var(--success-weak); color: var(--success); }
.tone-red    { background: var(--danger-weak);  color: var(--danger); }
.tone-amber  { background: var(--warning-weak); color: var(--warning); }
.tone-violet { background: var(--violet-weak);  color: var(--violet); }
.tone-orange { background: #fbe9dd; color: var(--ali); }
.tone-teal   { background: var(--teal-weak); color: var(--teal); }
.tone-grey   { background: var(--border-soft); color: var(--muted); }
.c-green { color: var(--success); }
.c-red   { color: var(--danger); }
.c-amber { color: var(--warning); }
.c-blue  { color: var(--primary); }
.c-muted { color: var(--subtle); }

/* ── Panels ── */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-2 > .stack-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1200px) { .grid-2 { grid-template-columns: 1fr; } }
.panel {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.grid-2 .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.panel-head h3   { font-size: 15px; font-weight: 500; }
.panel-head .sub { font-size: 12px; color: var(--muted); }
.panel-head .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.panel-empty { padding: 20px 18px; color: var(--subtle); font-size: 13px; font-style: italic; }
.cloud-tag     { padding: 2px 6px; border-radius: var(--radius-sm); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.cloud-tag.aws { background: #fbe9dd; color: var(--warning); }
.cloud-tag.ali { background: #ffe8de; color: #664533; }

/* Resource tiles */
.tiles { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1px; background: var(--border); }
.tile  { display: block; padding: 14px 18px; background: var(--surface); color: inherit; text-decoration: none; }
.tile:hover  { background: var(--surface-alt); }
.tile .t-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.tile .t-name .icon { width: 15px; height: 15px; }
.tile .t-val { margin-top: 8px; font-size: 26px; font-weight: 300; font-variant-numeric: tabular-nums; }
.tile .t-sub { margin-top: 3px; font-size: 11.5px; color: var(--subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "Needs attention" list */
.att { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); color: inherit; text-decoration: none; }
.att:last-child { border-bottom: 0; }
.att:hover   { background: var(--surface-alt); }
.att .ico    { width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; }
.att .t      { font-size: 13.5px; font-weight: 400; }
.att .d      { margin-top: 2px; font-size: 12px; color: var(--muted); }
.att .go     { margin-left: auto; align-self: center; color: var(--subtle); }
.all-clear   { display: flex; align-items: center; gap: 10px; padding: 18px; color: var(--success); font-size: 13px; }

/* Data freshness */
.fresh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--border-soft); color: inherit; text-decoration: none; font-size: 13px; white-space: nowrap; }
.fr-row:hover { background: var(--surface-alt); }
.fr-row .dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fr-row .when { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot.fresh   { background: var(--success); }
.dot.aging   { background: var(--warning); }
.dot.stale   { background: var(--danger); }
.dot.missing { background: var(--border-strong); }

/* Distribution bars (e.g. accounts by payer) */
.dist  { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 32px; padding: 12px 18px; }
@media (max-width: 1100px) { .dist { grid-template-columns: 1fr; } }
.dist-row { display: grid; grid-template-columns: 118px 1fr 64px; align-items: center; gap: 12px; padding: 5px 8px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; text-align: left; cursor: pointer; }
.dist-row:hover { background: var(--surface-alt); }
.dist-row.on    { background: var(--primary-faint); box-shadow: inset 3px 0 0 var(--primary); }
.dist-row.on .mono { color: var(--primary); font-weight: 600; }
.bar   { display: flex; height: 8px; overflow: hidden; background: var(--border-soft); }
.bar .a { background: var(--chart-a); }
.bar .s { background: var(--chart-b); }
.bar .o { background: var(--chart-c); }
.dist-row .n    { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.dist-row .n em { margin-left: 3px; font-style: normal; font-size: 11.5px; color: var(--danger); }
.legend   { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

/* ── Summary cards ── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.summary-card {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.summary-card .label        { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-bottom: 8px; }
.summary-card .value        { font-size: 28px; font-weight: 300; line-height: 1.1; color: var(--value-color, var(--text)); font-variant-numeric: tabular-nums; }
.summary-card .value.green  { color: var(--success); }
.summary-card .value.red    { color: var(--danger); }
.summary-card .value.grey   { color: var(--subtle); }
.summary-card .value.orange { color: var(--ali); }
.summary-card .sub          { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel > .toolbar { margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.toolbar label { font-size: 13px; font-weight: 500; color: var(--muted); }
.toolbar select, .toolbar input:not([type=checkbox]):not([type=radio]) {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.toolbar select:focus, .toolbar input:focus, .toolbar button:focus-visible {
  outline: 2px solid var(--primary-weak);
  border-color: var(--primary);
}
.toolbar input:not([type=checkbox]):not([type=radio]) { min-width: 240px; cursor: text; }
.toolbar input[type=date], .toolbar input[type=number] { min-width: 0; }
.toolbar select { min-width: 140px; }
.toolbar > button:not(.seg-btn) {
  padding: 7px 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.toolbar > button:not(.seg-btn):hover { background: var(--primary-faint); }
.toolbar .count-info   { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.toolbar .count-info b { color: var(--text); }
.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--subtle); pointer-events: none; }
.toolbar .search input[type=text] { padding-left: 32px; min-width: 280px; }
.seg { display: inline-flex; border: 1px solid var(--primary); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { padding: 7px 12px; border: 0; border-right: 1px solid var(--primary); background: var(--surface); color: var(--primary); font: inherit; font-size: 13px; cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--primary-faint); }
.seg-btn.on    { background: var(--primary); color: #fff; }
/* col-menu label overrides (inside toolbar) */
#col-menu label { font-size: 13px; font-weight: 400; color: var(--text); display: block; margin: 4px 0; }

/* ── Data section containers ── */
.section {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
/* Section headers are neutral; the variant only changes the accent marker. */
.section-header {
  --accent: var(--primary);
  display: block;
  padding: 13px 18px;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
}
.section-header::before {
  content: "";
  display: inline-block;
  width: 3px; height: 14px;
  margin-right: 10px;
  background: var(--accent);
  vertical-align: -2px;
}
summary.section-header { list-style: none; cursor: pointer; }
summary.section-header::-webkit-details-marker { display: none; }
.section-header.dark    { --accent: var(--primary-dark); }
.section-header.rds     { --accent: var(--light-blue); }
.section-header.sp      { --accent: var(--primary); }
.section-header.ri-util { --accent: var(--success); }
.section-header.sp-util { --accent: var(--violet); }
.section-header.sp-cov  { --accent: var(--warning); }
.section-header.orange  { --accent: var(--ali); }
.section-header.aws     { --accent: var(--aws); }
.section-header.eks     { --accent: var(--aws); }
.section-header.cost    { --accent: var(--primary-dark); }
.section-header.uc      { --accent: var(--teal); }
.section.empty-section  { display: none; }

/* ── Tables ── */
/* Long tables scroll inside the card so the header row and horizontal scrollbar stay in view. */
.table-wrap { max-height: calc(100vh - 120px); overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
td    { padding: 9px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-alt); }
tr.hidden-row    { display: none; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable .sort { display: inline-block; width: 10px; margin-left: 4px; color: var(--subtle); }
th.sortable.sorted .sort { color: var(--primary); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.copy { padding: 2px; margin-left: 6px; border: 0; background: none; color: var(--subtle); cursor: pointer; opacity: 0; vertical-align: middle; }
.copy .icon { width: 13px; height: 13px; }
tr:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--primary); }
.tag { display: inline-block; padding: 1px 7px; border-radius: var(--radius-sm); background: var(--border-soft); color: var(--text-2); font-size: 11.5px; }
.muted { color: var(--muted); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 400; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* AWS account status */
.badge-ACTIVE           { background: var(--success-weak); color: var(--success); }
.badge-SUSPENDED        { background: var(--danger-weak);  color: var(--danger); }
.badge-PENDING_CLOSURE  { background: var(--warning-weak); color: var(--warning); }

/* Alibaba Cloud account status */
.badge-Active           { background: var(--success-weak); color: var(--success); }
.badge-Inactive         { background: var(--danger-weak);  color: var(--danger); }
.badge-TimedOut         { background: var(--warning-weak); color: var(--warning); }
.badge-CreateFailed     { background: var(--danger-weak);  color: var(--danger); }
.badge-SuspendedByUser  { background: var(--violet-weak);  color: var(--violet); }
/* Resource Directory member (join) status */
.badge-CreateSuccess,
.badge-InviteSuccess,
.badge-SwitchSuccess    { background: var(--success-weak); color: var(--success); }
.badge-PromoteExpired,
.badge-PromoteVerifying,
.badge-CreateVerifying,
.badge-Removing         { background: var(--warning-weak); color: var(--warning); }
.badge-InviteFailed,
.badge-PromoteFailed,
.badge-CreateExpired    { background: var(--danger-weak);  color: var(--danger); }

/* EC2 instance state */
.badge-running          { background: var(--success-weak); color: var(--success); }
.badge-stopped          { background: var(--danger-weak);  color: var(--danger); }
.badge-stopping         { background: var(--warning-weak); color: var(--warning); }
.badge-pending          { background: var(--primary-weak); color: var(--primary); }
.badge-terminated       { background: var(--border-soft);  color: var(--muted); }
.badge-default          { background: var(--violet-weak);  color: var(--violet); }

/* RI/SP */
.badge-active           { background: var(--success-weak); color: var(--success); }

/* Use-case cloud provider */
.badge-AwsChina         { background: var(--primary-weak); color: var(--primary); }
.badge-AliCloud         { background: #fbe9dd; color: var(--ali); }

/* Use-case support model */
.badge-FullyManaged     { background: var(--success-weak); color: var(--success); }
.badge-SelfManaged      { background: var(--violet-weak);  color: var(--violet); }

/* EOL status */
.badge-expired          { background: var(--danger-weak);  color: var(--danger); }
.badge-expiring_soon    { background: var(--warning-weak); color: var(--warning); }
.badge-ok               { background: var(--success-weak); color: var(--success); }
.badge-tbd              { background: var(--border-soft);  color: var(--muted); }
.badge-unknown          { background: var(--border-soft);  color: var(--muted); }

/* ── RI/SP specific ── */
.pct      { font-weight: 600; }
.pct-high { color: var(--success); }
.pct-mid  { color: var(--warning); }
.pct-low  { color: var(--danger); }
.num      { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Misc ── */
code    { font-family: var(--mono); font-size: 12px; background: var(--border-soft); color: var(--text-2); padding: 1px 5px; border-radius: var(--radius-sm); }
.no-data { color: var(--subtle); font-size: 13px; font-style: italic; padding: 24px; }
td code { white-space: nowrap; }
.toast {
  position: fixed; left: 50%; top: 24px; z-index: 300;
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--primary-dark); color: #fff; font-size: 13px;
  transform: translateX(-50%); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* =============================================================
   Themes — the sidebar picker sets <html data-theme="...">
   (kept in localStorage, default "classic"). The base styles
   above are the Roche theme; the blocks below override them.
   ============================================================= */

/* ── Original: the look of the dashboard before the redesign ── */
html[data-theme="classic"] {
  --bg: #f4f6f9;
  --surface-alt: #fafafa;
  --border: #e0e0e0;
  --border-soft: #f0f0f0;
  --border-strong: #ccc;
  --text: #333;
  --text-2: #555;
  --muted: #666;
  --subtle: #888;
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-dark: #232f3e;
  --primary-weak: #e3f2fd;
  --primary-faint: #f0f4ff;
  --light-blue: #0073bb;
  --success: #2e7d32;
  --success-weak: #e8f5e9;
  --danger: #c62828;
  --danger-weak: #fce4ec;
  --danger-faint: #fff5f5;
  --warning: #f57f17;
  --warning-weak: #fff8e1;
  --violet: #6a1b9a;
  --violet-weak: #f3e5f5;
  --teal: #00695c;
  --teal-weak: #e0f2f1;
  --aws: #ff9900;
  --ali: #ff6a00;
  --chart-a: #1a73e8;
  --chart-b: #c62828;
  --chart-c: #f57f17;
  --side: #232f3e;
  --side-hover: #3a4a5c;
  --side-text: #d5d9de;
  --side-muted: #6b7a8d;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .1);
  --value-color: #1a73e8;
}
html[data-theme="classic"] body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
html[data-theme="classic"] .sidebar { width: 220px; }
html[data-theme="classic"] .brand { padding: 22px 20px 18px; }
html[data-theme="classic"] .brand-logo { color: var(--aws); }
html[data-theme="classic"] .brand-name { color: var(--aws); font-size: 1.05rem; font-weight: 700; }
html[data-theme="classic"] .brand-sub { display: none; }
html[data-theme="classic"] .env-badge { background: #b7791f; color: #fff; }
html[data-theme="classic"] .sidebar nav { padding: 12px 0; }
html[data-theme="classic"] .sidebar nav a { margin: 0; padding: 8px 20px; border-radius: 0; font-size: .87rem; }
html[data-theme="classic"] .sidebar nav a .icon,
html[data-theme="classic"] .sidebar nav a.active::before,
html[data-theme="classic"] .nav-section-label .dot { display: none; }
html[data-theme="classic"] .sidebar nav > .nav-items a.active { background: #555f6e; }
html[data-theme="classic"] .nav-section[data-key="aws"] a.active { background: #1a73e8; }
html[data-theme="classic"] .nav-section[data-key="ali"] a.active { background: #ff6a00; }
html[data-theme="classic"] .nav-section[data-key="uc"]  a.active { background: #00695c; }
html[data-theme="classic"] .nav-section[data-key="mon"] a.active { background: #c62828; }
html[data-theme="classic"] .nav-section-label { padding: 10px 20px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
html[data-theme="classic"] .content { padding: 28px; }
html[data-theme="classic"] h1 { font-size: 1.6rem; font-weight: 700; line-height: normal; }
html[data-theme="classic"] .meta { color: #666; font-size: .85rem; }
html[data-theme="classic"] .kpi,
html[data-theme="classic"] .panel,
html[data-theme="classic"] .section,
html[data-theme="classic"] .summary-card { border-color: transparent; }
html[data-theme="classic"] .kpi { padding: 22px 24px; border-radius: 10px; box-shadow: 0 1px 5px rgba(0, 0, 0, .1); transition: box-shadow .15s, transform .15s; }
html[data-theme="classic"] a.kpi:hover { border-color: transparent; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); transform: translateY(-2px); }
html[data-theme="classic"] .kpi-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #888; }
html[data-theme="classic"] .kpi-value,
html[data-theme="classic"] .summary-card .value { font-weight: 700; }
html[data-theme="classic"] .kpi-value { font-size: 2rem; }
html[data-theme="classic"] .summary-card { padding: 16px 24px; }
html[data-theme="classic"] .summary-card .label { font-size: .8rem; color: #666; }
html[data-theme="classic"] .summary-card .value { font-size: 1.8rem; }
html[data-theme="classic"] .tile .t-val { font-weight: 700; }
html[data-theme="classic"] .panel-head h3 { font-size: 1rem; font-weight: 700; }
html[data-theme="classic"] .cloud-tag.aws { background: #232f3e; color: #ff9900; }
html[data-theme="classic"] .cloud-tag.ali,
html[data-theme="classic"] .tone-orange { background: #fff3e0; color: #e65100; }
html[data-theme="classic"] .stack,
html[data-theme="classic"] .bar { border-radius: 3px; }
html[data-theme="classic"] .dist-row.on { background: var(--primary-weak); box-shadow: none; }
html[data-theme="classic"] .toolbar { gap: 12px; margin-bottom: 20px; padding: 0; background: none; border: 0; box-shadow: none; }
html[data-theme="classic"] .panel > .toolbar { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--border); }
html[data-theme="classic"] .toolbar label { font-size: .9rem; font-weight: 600; color: #555; }
html[data-theme="classic"] .toolbar select,
html[data-theme="classic"] .toolbar input:not([type=checkbox]):not([type=radio]) { padding: 7px 12px; border-radius: 6px; font-size: .9rem; }
html[data-theme="classic"] .toolbar select:focus,
html[data-theme="classic"] .toolbar input:focus { outline: 2px solid #1a73e8; }
html[data-theme="classic"] .btn,
html[data-theme="classic"] .toolbar > button:not(.seg-btn) { padding: 6px 14px; border-color: #ccc; border-radius: 4px; color: #333; font-size: .85rem; }
html[data-theme="classic"] .btn:hover,
html[data-theme="classic"] .toolbar > button:not(.seg-btn):hover { background: #f5f5f5; }
html[data-theme="classic"] .seg { border-color: #ccc; border-radius: 6px; }
html[data-theme="classic"] .seg-btn { border-right-color: #ccc; color: #333; }
html[data-theme="classic"] .seg-btn:hover { background: #f5f5f5; }
html[data-theme="classic"] .seg-btn.on { background: #1a73e8; color: #fff; }
/* Solid colored section bars with white text, as before the redesign. */
html[data-theme="classic"] .section-header { padding: 12px 20px; background: var(--accent); color: #fff; border-bottom: 0; font-size: 1rem; font-weight: 600; }
html[data-theme="classic"] .section-header::before { display: none; }
html[data-theme="classic"] .section-header.aws,
html[data-theme="classic"] .section-header.eks { --accent: #1a73e8; }
html[data-theme="classic"] .section-header.cost   { --accent: #2c3e50; }
html[data-theme="classic"] .section-header.sp-cov { --accent: #e65100; }
html[data-theme="classic"] table { font-size: .85rem; }
html[data-theme="classic"] th { background: #f1f3f4; border-bottom: 2px solid #e0e0e0; color: #333; font-size: .85rem; font-weight: 700; }
html[data-theme="classic"] .badge { padding: 2px 8px; border-radius: 12px; font-size: .75rem; font-weight: 600; }
html[data-theme="classic"] .badge::before { display: none; }
html[data-theme="classic"] .badge-pending,
html[data-theme="classic"] .badge-AwsChina { color: #1565c0; }
html[data-theme="classic"] .badge-AliCloud { background: #fff3e0; color: #e65100; }
html[data-theme="classic"] .tag { padding: 0; background: none; color: inherit; font-size: inherit; }
html[data-theme="classic"] code { background: #f1f3f4; border-radius: 3px; }
html[data-theme="classic"] .toast { background: #333; border-radius: 6px; }

/* ── Modern: slate sidebar, blue accents, rounded cards ── */
html[data-theme="modern"] {
  --bg: #f5f7fa;
  --surface-alt: #f9fafb;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-dark: #334155;
  --primary-weak: #eff6ff;
  --primary-faint: #eff6ff;
  --light-blue: #0284c7;
  --success: #16a34a;
  --success-weak: #f0fdf4;
  --danger: #dc2626;
  --danger-weak: #fef2f2;
  --danger-faint: #fff5f5;
  --warning: #d97706;
  --warning-weak: #fffbeb;
  --violet: #7c3aed;
  --violet-weak: #f5f3ff;
  --teal: #0d9488;
  --teal-weak: #f0fdfa;
  --aws: #ff9900;
  --ali: #ff6a00;
  --chart-a: #60a5fa;
  --chart-b: #f87171;
  --chart-c: #fbbf24;
  --side: #0f172a;
  --side-hover: #1e293b;
  --side-text: #cbd5e1;
  --side-muted: #64748b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
html[data-theme="modern"] body { font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif; }
html[data-theme="modern"] .brand-logo { color: #60a5fa; }
html[data-theme="modern"] .brand-name { font-size: 15px; font-weight: 600; }
html[data-theme="modern"] .env-badge { background: #78350f; color: #fde68a; }
html[data-theme="modern"] .sidebar nav a.active { background: rgba(59, 130, 246, .18); }
html[data-theme="modern"] .sidebar nav a.active .icon { color: #93c5fd; }
html[data-theme="modern"] .sidebar nav a.active::before { top: 6px; bottom: 6px; border-radius: 0 3px 3px 0; background: #60a5fa; }
html[data-theme="modern"] .nav-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
html[data-theme="modern"] .nav-section-label:hover { color: #94a3b8; }
html[data-theme="modern"] h1 { font-size: 22px; font-weight: 600; line-height: normal; letter-spacing: -.01em; }
html[data-theme="modern"] .btn,
html[data-theme="modern"] .toolbar > button:not(.seg-btn) { padding: 7px 12px; border-color: var(--border-strong); border-radius: 8px; color: var(--text); }
html[data-theme="modern"] .btn:hover,
html[data-theme="modern"] .toolbar > button:not(.seg-btn):hover { background: var(--surface-alt); }
html[data-theme="modern"] a.kpi:hover { border-color: #bfdbfe; box-shadow: 0 4px 12px rgba(37, 99, 235, .08); }
html[data-theme="modern"] .kpi-label,
html[data-theme="modern"] .summary-card .label { font-weight: 500; }
html[data-theme="modern"] .kpi-icon { border-radius: 8px; }
html[data-theme="modern"] .kpi-value { margin-top: 12px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
html[data-theme="modern"] .kpi-split .kpi-value { margin-top: 0; }
html[data-theme="modern"] .kpi-value small { font-weight: 500; }
html[data-theme="modern"] .stack { height: 6px; margin-top: 12px; border-radius: 3px; }
html[data-theme="modern"] .tone-orange { background: #fff7ed; }
html[data-theme="modern"] .panel-head h3 { font-size: 14px; font-weight: 600; }
html[data-theme="modern"] .cloud-tag { border-radius: 4px; }
html[data-theme="modern"] .cloud-tag.aws { background: #fff7e6; color: #b45309; }
html[data-theme="modern"] .cloud-tag.ali { background: #fff1e6; color: #c2410c; }
html[data-theme="modern"] .tile .t-val { font-size: 22px; font-weight: 600; }
html[data-theme="modern"] .att .t { font-size: 13px; font-weight: 500; }
html[data-theme="modern"] .dist-row.on { background: var(--primary-weak); box-shadow: none; }
html[data-theme="modern"] .bar { border-radius: 4px; }
html[data-theme="modern"] .summary-card .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
html[data-theme="modern"] .toolbar select,
html[data-theme="modern"] .toolbar input:not([type=checkbox]):not([type=radio]) { border-radius: 8px; }
html[data-theme="modern"] .toolbar select:focus,
html[data-theme="modern"] .toolbar input:focus { outline-color: #bfdbfe; }
html[data-theme="modern"] .seg { border-color: var(--border-strong); border-radius: 8px; }
html[data-theme="modern"] .seg-btn { border-right-color: var(--border); color: var(--text-2); }
html[data-theme="modern"] .seg-btn:hover { background: var(--surface-alt); }
html[data-theme="modern"] .seg-btn.on { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
html[data-theme="modern"] .section-header { font-size: 14px; font-weight: 600; }
html[data-theme="modern"] .section-header::before { width: 8px; height: 8px; border-radius: 2px; vertical-align: 1px; }
html[data-theme="modern"] th { border-bottom-color: var(--border); color: #4b5563; font-weight: 600; }
html[data-theme="modern"] .tag { color: #4b5563; }
html[data-theme="modern"] .badge { padding: 2px 9px; border-radius: 999px; font-weight: 500; }
html[data-theme="modern"] .toast { background: var(--text); }

/* ── Cyberpunk: neon on near-black ── */
html[data-theme="cyberpunk"] {
  color-scheme: dark;
  --bg: #07070d;
  --surface: #0d0d17;
  --surface-alt: #121222;
  --border: rgba(0, 240, 255, .18);
  --border-soft: rgba(0, 240, 255, .07);
  --border-strong: rgba(0, 240, 255, .38);
  --text: #e6f6ff;
  --text-2: #b4c4d8;
  --muted: #7d8aa3;
  --subtle: #56607a;
  --primary: #00f0ff;
  --primary-hover: #5cf6ff;
  --primary-dark: #ff2a6d;
  --primary-weak: rgba(0, 240, 255, .16);
  --primary-faint: rgba(0, 240, 255, .07);
  --light-blue: #3d9dff;
  --success: #05ffa1;
  --success-weak: rgba(5, 255, 161, .12);
  --danger: #ff2a6d;
  --danger-weak: rgba(255, 42, 109, .15);
  --danger-faint: rgba(255, 42, 109, .07);
  --warning: #f9f002;
  --warning-weak: rgba(249, 240, 2, .12);
  --violet: #b967ff;
  --violet-weak: rgba(185, 103, 255, .15);
  --teal: #00f0ff;
  --teal-weak: rgba(0, 240, 255, .1);
  --aws: #f9f002;
  --ali: #ff8a00;
  --chart-a: #00f0ff;
  --chart-b: #ff2a6d;
  --chart-c: #f9f002;
  --side: #05050a;
  --side-hover: rgba(0, 240, 255, .08);
  --side-text: #9fb3c8;
  --side-muted: #4f5b73;
  --radius: 0;
  --radius-sm: 0;
  --display: "Bahnschrift", "Segoe UI", sans-serif;
  --notch: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

/* Backdrop: faint grid, magenta haze and scanlines */
html[data-theme="cyberpunk"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 85% -10%, rgba(255, 42, 109, .16), transparent 45%),
    radial-gradient(circle at 10% 110%, rgba(0, 240, 255, .10), transparent 45%),
    linear-gradient(rgba(0, 240, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
html[data-theme="cyberpunk"] body::after {
  content: "";
  position: fixed; inset: 0; z-index: 500; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
}
html[data-theme="cyberpunk"] ::selection { background: #ff2a6d; color: #05050a; }
html[data-theme="cyberpunk"] ::-webkit-scrollbar { width: 8px; height: 8px; }
html[data-theme="cyberpunk"] ::-webkit-scrollbar-track { background: #05050a; }
html[data-theme="cyberpunk"] ::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, .35); }

/* Sidebar */
html[data-theme="cyberpunk"] .sidebar { border-right: 1px solid rgba(255, 42, 109, .4); box-shadow: 4px 0 24px rgba(255, 42, 109, .08); }
html[data-theme="cyberpunk"] .brand { border-bottom-color: rgba(255, 42, 109, .3); }
html[data-theme="cyberpunk"] .brand-logo { color: var(--primary); filter: drop-shadow(0 0 6px rgba(0, 240, 255, .6)); }
html[data-theme="cyberpunk"] .brand-name { font-family: var(--display); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 0 10px rgba(0, 240, 255, .5); }
html[data-theme="cyberpunk"] .env-badge { top: 1px; right: 6px; background: #f9f002; color: #05050a; }
html[data-theme="cyberpunk"] .brand-sub { font-family: var(--mono); color: #ff2a6d; letter-spacing: .04em; }
html[data-theme="cyberpunk"] .nav-section-label { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; }
html[data-theme="cyberpunk"] .nav-section-label .dot { border-radius: 0; box-shadow: 0 0 6px var(--dot); }
html[data-theme="cyberpunk"] .sidebar nav a.active {
  background: linear-gradient(90deg, rgba(255, 42, 109, .28), rgba(255, 42, 109, 0));
  color: #fff; text-shadow: 0 0 8px rgba(255, 42, 109, .8);
}
html[data-theme="cyberpunk"] .sidebar nav a.active .icon { color: #ff2a6d; }
html[data-theme="cyberpunk"] .sidebar nav a.active::before { background: #ff2a6d; box-shadow: 0 0 10px #ff2a6d; }
html[data-theme="cyberpunk"] .side-foot { border-top-color: rgba(255, 42, 109, .3); }
html[data-theme="cyberpunk"] .theme-picker { font-family: var(--mono); color: #f9f002; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
html[data-theme="cyberpunk"] .theme-picker select { background: #05050a; border-color: rgba(255, 42, 109, .45); color: #f9f002; font-size: 11px; }

/* Typography */
html[data-theme="cyberpunk"] h1 {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; text-shadow: 0 0 18px rgba(0, 240, 255, .45), 2px 0 0 rgba(255, 42, 109, .55);
}
html[data-theme="cyberpunk"] h1::after { content: "_"; margin-left: 4px; color: #f9f002; animation: cd-blink 1s steps(1) infinite; }
@keyframes cd-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html[data-theme="cyberpunk"] h1::after { animation: none; } }
html[data-theme="cyberpunk"] .meta,
html[data-theme="cyberpunk"] .page-head p { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
html[data-theme="cyberpunk"] .kpi-label,
html[data-theme="cyberpunk"] .summary-card .label,
html[data-theme="cyberpunk"] .tile .t-name,
html[data-theme="cyberpunk"] .kpi-split .lbl,
html[data-theme="cyberpunk"] th,
html[data-theme="cyberpunk"] .toolbar label,
html[data-theme="cyberpunk"] .legend { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
html[data-theme="cyberpunk"] .kpi-value,
html[data-theme="cyberpunk"] .summary-card .value,
html[data-theme="cyberpunk"] .tile .t-val { font-family: var(--display); font-weight: 400; text-shadow: 0 0 14px rgba(0, 240, 255, .4); }
html[data-theme="cyberpunk"] .kpi-value.c-red,
html[data-theme="cyberpunk"] .summary-card .value.red { text-shadow: 0 0 14px rgba(255, 42, 109, .55); }
html[data-theme="cyberpunk"] .kpi-value.c-green,
html[data-theme="cyberpunk"] .summary-card .value.green { text-shadow: 0 0 14px rgba(5, 255, 161, .45); }
html[data-theme="cyberpunk"] .kpi-value.c-amber { text-shadow: 0 0 14px rgba(249, 240, 2, .45); }

/* Cards with a cut corner and a neon top edge */
html[data-theme="cyberpunk"] .kpi,
html[data-theme="cyberpunk"] .summary-card,
html[data-theme="cyberpunk"] .panel,
html[data-theme="cyberpunk"] .section { clip-path: var(--notch); background: linear-gradient(180deg, rgba(0, 240, 255, .05), transparent 40%), var(--surface); }
html[data-theme="cyberpunk"] .kpi,
html[data-theme="cyberpunk"] .summary-card { box-shadow: inset 0 2px 0 var(--primary); }
html[data-theme="cyberpunk"] .kpis > :nth-child(2) { box-shadow: inset 0 2px 0 #ff2a6d; }
html[data-theme="cyberpunk"] .kpis > :nth-child(3) { box-shadow: inset 0 2px 0 #f9f002; }
html[data-theme="cyberpunk"] .kpis > :nth-child(4) { box-shadow: inset 0 2px 0 #b967ff; }
html[data-theme="cyberpunk"] .kpis > :nth-child(5) { box-shadow: inset 0 2px 0 #05ffa1; }
html[data-theme="cyberpunk"] a.kpi:hover { border-color: var(--primary); box-shadow: inset 0 2px 0 var(--primary), 0 0 18px rgba(0, 240, 255, .25); }
html[data-theme="cyberpunk"] .kpi-icon,
html[data-theme="cyberpunk"] .att .ico { border: 1px solid currentColor; box-shadow: 0 0 8px currentColor inset; background: none; }
html[data-theme="cyberpunk"] .tiles { background: var(--border); }
html[data-theme="cyberpunk"] .tile { background: var(--surface); }
html[data-theme="cyberpunk"] .tile:hover,
html[data-theme="cyberpunk"] .att:hover,
html[data-theme="cyberpunk"] .fr-row:hover { background: var(--primary-faint); }
html[data-theme="cyberpunk"] .panel-head h3,
html[data-theme="cyberpunk"] .section-header { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
html[data-theme="cyberpunk"] .section-header { background: rgba(0, 240, 255, .04); }
html[data-theme="cyberpunk"] .section-header::before { box-shadow: 0 0 8px var(--accent); }
html[data-theme="cyberpunk"] .cloud-tag { background: none; border: 1px solid currentColor; font-family: var(--mono); }
html[data-theme="cyberpunk"] .cloud-tag.aws { color: #f9f002; }
html[data-theme="cyberpunk"] .cloud-tag.ali { color: #ff8a00; }
html[data-theme="cyberpunk"] .stack span,
html[data-theme="cyberpunk"] .bar span { box-shadow: 0 0 8px currentColor; }
html[data-theme="cyberpunk"] .bar .a { color: #00f0ff; }
html[data-theme="cyberpunk"] .bar .s { color: #ff2a6d; }
html[data-theme="cyberpunk"] .bar .o { color: #f9f002; }
html[data-theme="cyberpunk"] .dot.fresh { box-shadow: 0 0 6px var(--success); }
html[data-theme="cyberpunk"] .dot.stale { box-shadow: 0 0 6px var(--danger); }
html[data-theme="cyberpunk"] .dist-row.on { box-shadow: inset 3px 0 0 #ff2a6d; background: rgba(255, 42, 109, .1); }
html[data-theme="cyberpunk"] .dist-row.on .mono { color: #ff2a6d; }

/* Controls */
html[data-theme="cyberpunk"] .btn,
html[data-theme="cyberpunk"] .toolbar > button:not(.seg-btn),
html[data-theme="cyberpunk"] .seg-btn { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
html[data-theme="cyberpunk"] .btn:hover,
html[data-theme="cyberpunk"] .toolbar > button:not(.seg-btn):hover { background: var(--primary); color: #05050a; box-shadow: 0 0 14px rgba(0, 240, 255, .55); }
html[data-theme="cyberpunk"] .btn.primary { background: #f9f002; border-color: #f9f002; color: #05050a; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
html[data-theme="cyberpunk"] .seg-btn.on { color: #05050a; box-shadow: 0 0 12px rgba(0, 240, 255, .5); }
html[data-theme="cyberpunk"] .toolbar select,
html[data-theme="cyberpunk"] .toolbar input:not([type=checkbox]):not([type=radio]) { background: #08080f; font-family: var(--mono); font-size: 12.5px; }
html[data-theme="cyberpunk"] .toolbar select:focus,
html[data-theme="cyberpunk"] .toolbar input:focus { outline: none; box-shadow: 0 0 0 1px var(--primary), 0 0 12px rgba(0, 240, 255, .4); }
html[data-theme="cyberpunk"] #col-menu { background: var(--surface) !important; border-color: var(--border-strong) !important; box-shadow: 0 0 18px rgba(0, 240, 255, .2) !important; }

/* Tables */
html[data-theme="cyberpunk"] th { background: #0a0a14; color: var(--primary); }
html[data-theme="cyberpunk"] tbody tr:hover td { background: rgba(0, 240, 255, .06); }
html[data-theme="cyberpunk"] .mono,
html[data-theme="cyberpunk"] td.num { color: #cfe9ff; }
html[data-theme="cyberpunk"] code { background: rgba(185, 103, 255, .12); color: #d6b3ff; }
html[data-theme="cyberpunk"] .tag { background: none; border: 1px solid var(--border-strong); font-family: var(--mono); }
html[data-theme="cyberpunk"] .badge {
  background: none; border: 1px solid currentColor;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  text-shadow: 0 0 6px currentColor;
}
html[data-theme="cyberpunk"] .badge::before { border-radius: 0; box-shadow: 0 0 6px currentColor; }
html[data-theme="cyberpunk"] .toast { background: #ff2a6d; color: #05050a; font-family: var(--mono); box-shadow: 0 0 18px rgba(255, 42, 109, .6); }

/* ── Terminal: flat HUD look from 文档/cloud-dashboard-cyberpunk.html (style only) ── */
html[data-theme="terminal"] {
  color-scheme: dark;
  --bg: #0a0d0e;
  --surface: #101617;
  --surface-alt: #151d1e;
  --border: #293638;
  --border-soft: #1c2626;
  --border-strong: #3b514f;
  --text: #e5eeec;
  --text-2: #c2d0ce;
  --muted: #91a5a5;
  --subtle: #718787;
  --primary: #66f5e8;
  --primary-hover: #8ff8ee;
  --primary-dark: #dfff68;
  --primary-weak: #142d2c;
  --primary-faint: #132321;
  --light-blue: #66f5e8;
  --success: #87e7b7;
  --success-weak: #142b24;
  --danger: #ff758c;
  --danger-weak: #311c23;
  --danger-faint: #1d1416;
  --warning: #dfff68;
  --warning-weak: #272d17;
  --violet: #c39bff;
  --violet-weak: #231c33;
  --teal: #66f5e8;
  --teal-weak: #142d2c;
  --aws: #66f5e8;
  --ali: #dfff68;
  --chart-a: #65bfb2;
  --chart-b: #ff758c;
  --chart-c: #dfff68;
  --side: #0c1112;
  --side-hover: #142120;
  --side-text: #91a5a5;
  --side-muted: #718787;
  --radius: 0;
  --radius-sm: 0;
  --shadow: none;
  --value-color: var(--text);
  --display: "Chakra Petch", "Bahnschrift", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}
html[data-theme="terminal"] body {
  font-family: "IBM Plex Sans", "Segoe UI", "Microsoft YaHei", sans-serif;
  background-image:
    linear-gradient(rgba(131, 249, 233, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(131, 249, 233, .025) 1px, transparent 1px);
  background-size: 40px 40px;
}
html[data-theme="terminal"] ::selection { background: #dfff68; color: #151b0c; }
html[data-theme="terminal"] * { scrollbar-width: thin; scrollbar-color: #344a49 transparent; }

/* Sidebar: lime active row with a dark notch, square markers */
html[data-theme="terminal"] .sidebar { border-right: 1px solid var(--border); }
html[data-theme="terminal"] .brand { border-bottom-color: var(--border); }
html[data-theme="terminal"] .brand-logo { color: var(--primary); }
html[data-theme="terminal"] .brand-name { font-family: var(--display); font-size: 14px; font-weight: 600; text-transform: uppercase; }
html[data-theme="terminal"] .brand-sub { font-family: var(--mono); font-size: 9.5px; color: var(--subtle); }
html[data-theme="terminal"] .env-badge { top: 4px; right: 6px; background: #dfff68; color: #151b0c; }
html[data-theme="terminal"] .nav-section-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
html[data-theme="terminal"] .nav-section-label .dot { width: 4px; height: 4px; border-radius: 0; }
html[data-theme="terminal"] .sidebar nav a { font-size: 12.5px; }
html[data-theme="terminal"] .sidebar nav a:hover { color: var(--primary); background: var(--side-hover); }
html[data-theme="terminal"] .sidebar nav a.active { background: #dfff68; color: #151b0c; font-weight: 600; }
html[data-theme="terminal"] .sidebar nav a.active .icon { color: #151b0c; }
html[data-theme="terminal"] .sidebar nav a.active::before { display: none; }
html[data-theme="terminal"] .sidebar nav a.active::after { content: ""; position: absolute; right: 10px; top: 8px; width: 5px; height: 5px; background: #10170a; }
html[data-theme="terminal"] .side-foot { border-top-color: var(--border); }
html[data-theme="terminal"] .theme-picker { font-family: var(--mono); font-size: 11px; color: var(--primary); }
html[data-theme="terminal"] .theme-picker select { background: #0c1213; border-color: var(--border); color: var(--primary); font-size: 11px; }

/* Typography: display face for titles and numbers, mono for labels */
html[data-theme="terminal"] h1 { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.2; text-transform: uppercase; }
html[data-theme="terminal"] h1::after { content: ""; display: inline-block; width: 11px; height: .75em; margin-left: 10px; background: #dfff68; opacity: .8; }
html[data-theme="terminal"] .meta,
html[data-theme="terminal"] .page-head p { font-family: var(--mono); font-size: 11px; }
html[data-theme="terminal"] .kpi-label,
html[data-theme="terminal"] .summary-card .label,
html[data-theme="terminal"] .tile .t-name,
html[data-theme="terminal"] .kpi-split .lbl,
html[data-theme="terminal"] .toolbar label,
html[data-theme="terminal"] .legend,
html[data-theme="terminal"] .kpi-foot,
html[data-theme="terminal"] .tile .t-sub,
html[data-theme="terminal"] .att .d,
html[data-theme="terminal"] .fr-row .when,
html[data-theme="terminal"] th { font-family: var(--mono); }
html[data-theme="terminal"] .kpi-label,
html[data-theme="terminal"] .summary-card .label,
html[data-theme="terminal"] .tile .t-name,
html[data-theme="terminal"] .toolbar label,
html[data-theme="terminal"] th { font-size: 10px; text-transform: uppercase; }
html[data-theme="terminal"] .kpi-value,
html[data-theme="terminal"] .summary-card .value,
html[data-theme="terminal"] .tile .t-val { font-family: var(--display); font-weight: 500; }
html[data-theme="terminal"] .kpi-value { font-size: 34px; }
html[data-theme="terminal"] .kpi-value small { font-family: var(--mono); font-size: 12px; }
html[data-theme="terminal"] .tile .t-val { font-size: 24px; }
html[data-theme="terminal"] .panel-head h3,
html[data-theme="terminal"] .section-header { font-family: var(--display); font-weight: 500; }

/* Cards: accent tick top-left, corner bracket bottom-right */
html[data-theme="terminal"] .kpi,
html[data-theme="terminal"] .summary-card { position: relative; --accent: var(--primary); --value-color: var(--accent); }
html[data-theme="terminal"] .kpis > :nth-child(2),
html[data-theme="terminal"] .kpis > :nth-child(3) { --accent: #dfff68; }
html[data-theme="terminal"] .kpis > :last-child { --accent: #ff758c; }
html[data-theme="terminal"] .kpi::before,
html[data-theme="terminal"] .summary-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 20px; height: 3px; background: var(--accent); }
html[data-theme="terminal"] .kpi::after,
html[data-theme="terminal"] .summary-card::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); }
html[data-theme="terminal"] a.kpi:hover { border-color: var(--accent); background: var(--side-hover); }
html[data-theme="terminal"] .kpi-icon,
html[data-theme="terminal"] .att .ico { width: auto; height: auto; background: none; }
html[data-theme="terminal"] .kpi-icon { color: var(--accent); }
html[data-theme="terminal"] .section-header { background: #0d1314; }
html[data-theme="terminal"] .section-header::before { width: 14px; height: 3px; vertical-align: middle; }
html[data-theme="terminal"] .tile .t-name .icon { color: var(--primary); }
html[data-theme="terminal"] .tile:hover,
html[data-theme="terminal"] .att:hover,
html[data-theme="terminal"] .fr-row:hover { background: var(--primary-faint); }
html[data-theme="terminal"] .cloud-tag { background: none; border: 1px solid currentColor; font-family: var(--mono); font-weight: 500; }
html[data-theme="terminal"] .cloud-tag.aws { color: var(--aws); }
html[data-theme="terminal"] .cloud-tag.ali { color: var(--ali); }
html[data-theme="terminal"] .legend i,
html[data-theme="terminal"] .dot { border-radius: 0; }
html[data-theme="terminal"] .stack { height: 6px; background: #1c2929; }
html[data-theme="terminal"] .bar { height: 6px; background: #1c2929; }
html[data-theme="terminal"] .bar .a { background: repeating-linear-gradient(90deg, var(--chart-a) 0 5px, transparent 5px 7px); }
html[data-theme="terminal"] .bar .s { background: repeating-linear-gradient(90deg, var(--chart-b) 0 5px, transparent 5px 7px); }
html[data-theme="terminal"] .bar .o { background: repeating-linear-gradient(90deg, var(--chart-c) 0 5px, transparent 5px 7px); }
html[data-theme="terminal"] .dist-row.on { background: var(--primary-weak); box-shadow: inset 0 0 0 1px #366b64; }
html[data-theme="terminal"] .dist-row.on .mono { color: var(--primary); }

/* Controls */
html[data-theme="terminal"] .btn,
html[data-theme="terminal"] .toolbar > button:not(.seg-btn) { background: transparent; border-color: #387a74; color: var(--primary); font-family: var(--mono); font-size: 11.5px; }
html[data-theme="terminal"] .btn:hover,
html[data-theme="terminal"] .toolbar > button:not(.seg-btn):hover { background: #17302c; border-color: var(--primary); }
html[data-theme="terminal"] .btn.primary { background: #dfff68; border-color: #dfff68; color: #18200b; }
html[data-theme="terminal"] .seg { gap: 2px; padding: 2px; border-color: var(--border); background: #0c1112; }
html[data-theme="terminal"] .seg-btn { border-right: 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; }
html[data-theme="terminal"] .seg-btn:hover { background: var(--side-hover); }
html[data-theme="terminal"] .seg-btn.on { background: #203936; color: var(--primary); }
html[data-theme="terminal"] .toolbar select,
html[data-theme="terminal"] .toolbar input:not([type=checkbox]):not([type=radio]) { background: #0c1213; border-color: var(--border); font-family: var(--mono); font-size: 12px; }
html[data-theme="terminal"] .toolbar select:focus,
html[data-theme="terminal"] .toolbar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px rgba(102, 245, 232, .25); }
html[data-theme="terminal"] .search .icon { color: var(--primary); }
html[data-theme="terminal"] #col-menu { background: var(--surface) !important; border-color: var(--border-strong) !important; box-shadow: none !important; }

/* Tables and badges */
html[data-theme="terminal"] th { background: #15211f; color: #93a9a5; font-weight: 500; }
html[data-theme="terminal"] td { border-bottom-color: #22302e; }
html[data-theme="terminal"] tbody tr:hover td { background: #132321; }
html[data-theme="terminal"] code { background: rgba(102, 245, 232, .08); color: #9ff7ee; }
html[data-theme="terminal"] .tag { background: none; border: 1px solid var(--border); font-family: var(--mono); }
html[data-theme="terminal"] .badge { border: 1px solid color-mix(in srgb, currentColor 35%, transparent); font-family: var(--mono); font-size: 10.5px; }
html[data-theme="terminal"] .badge::before { width: 3px; height: 3px; border-radius: 0; }
html[data-theme="terminal"] .badge-AliCloud { background: var(--warning-weak); color: var(--ali); }
html[data-theme="terminal"] .toast { background: #132520; color: var(--primary); border: 1px solid #4a8275; font-family: var(--mono); }

/* ── Roche Light: white sidebar, light-weight type, from 文档/cloud-dashboard-ui-concept.html (style only) ── */
html[data-theme="roche-light"] {
  --bg: #fbfbfa;
  --surface-alt: #f5f5f4;
  --border: #eae8e5;
  --border-soft: #f1f0ef;
  --border-strong: #dce2e9;
  --text: #21201f;
  --text-2: #4a4645;
  --muted: #706b69;
  --subtle: #959daa;
  --primary: #0b41cd;
  --primary-hover: #072b89;
  --primary-dark: #022366;
  --primary-weak: #edf2fc;
  --primary-faint: #f7faff;
  --light-blue: #5c80de;
  --success: #087d67;
  --success-weak: #eaf6f0;
  --danger: #c40000;
  --danger-weak: #fcedee;
  --danger-faint: #fdf6f7;
  --warning: #98601b;
  --warning-weak: #fff5e7;
  --teal: #087d67;
  --teal-weak: #eaf6f0;
  --aws: #e8a642;
  --ali: #f17655;
  --chart-a: #5c80de;
  --chart-b: #db8993;
  --chart-c: #e8a642;
  --side: #fff;
  --side-hover: #f5f5f4;
  --side-text: #706b69;
  --side-muted: #9098a3;
  --radius: 2px;
  --radius-sm: 4px;
  --shadow: none;
}

/* Sidebar on white with a blue inset marker for the current page */
html[data-theme="roche-light"] .sidebar { border-right: 1px solid var(--border); }
html[data-theme="roche-light"] .brand { color: var(--text); border-bottom-color: var(--border); padding: 22px 20px 18px; }
html[data-theme="roche-light"] .brand-logo { color: var(--primary); }
html[data-theme="roche-light"] .brand-name { font-size: 18px; font-weight: 400; }
html[data-theme="roche-light"] .brand-sub { color: var(--muted); font-size: 10px; }
html[data-theme="roche-light"] .env-badge { background: #fff; border: 1px solid #dfe4eb; color: var(--muted); font-family: var(--mono); font-weight: 400; }
html[data-theme="roche-light"] .sidebar nav::-webkit-scrollbar-thumb { background: #dcd8d4; }
html[data-theme="roche-light"] .sidebar nav a { color: var(--muted); font-size: 13px; }
html[data-theme="roche-light"] .sidebar nav a .icon { color: #706b69; opacity: 1; }
html[data-theme="roche-light"] .sidebar nav a:hover { background: var(--side-hover); color: var(--text); }
html[data-theme="roche-light"] .sidebar nav a.active { background: var(--primary-weak); color: var(--primary); font-weight: 500; box-shadow: inset 2px 0 var(--primary); }
html[data-theme="roche-light"] .sidebar nav a.active .icon { color: var(--primary); }
html[data-theme="roche-light"] .sidebar nav a.active::before { display: none; }
html[data-theme="roche-light"] .nav-section-label { font-size: 10px; font-weight: 500; text-transform: uppercase; }
html[data-theme="roche-light"] .nav-section-label:hover { color: var(--text); }
html[data-theme="roche-light"] .side-foot { border-top-color: var(--border); }
html[data-theme="roche-light"] .theme-picker { color: var(--muted); }
html[data-theme="roche-light"] .theme-picker select { background: #fff; border-color: var(--border-strong); color: var(--text); }

/* Type: very light headings and figures */
html[data-theme="roche-light"] h1 { font-size: 32px; font-weight: 200; line-height: 1.3; }
html[data-theme="roche-light"] .meta,
html[data-theme="roche-light"] .page-head p { font-size: 12px; }
html[data-theme="roche-light"] .kpi-label { font-size: 12px; font-weight: 400; }
html[data-theme="roche-light"] .kpi-icon { width: auto; height: auto; background: none; color: #939ca8; }
html[data-theme="roche-light"] .kpi-value { margin: 11px 0 9px; font-size: 36px; font-weight: 200; line-height: 1.2; }
html[data-theme="roche-light"] .kpi-split .kpi-value { margin: 0; }
html[data-theme="roche-light"] .kpi-value small { font-size: 13px; font-weight: 400; }
html[data-theme="roche-light"] .kpi-foot { font-size: 11px; }
html[data-theme="roche-light"] a.kpi:hover { border-color: #a5bfea; }
html[data-theme="roche-light"] .summary-card .value { font-weight: 200; }
html[data-theme="roche-light"] .tile .t-val { font-size: 24px; font-weight: 200; }
html[data-theme="roche-light"] .tile .t-name .icon { color: var(--primary); }
html[data-theme="roche-light"] .tile:hover { background: var(--primary-faint); }
html[data-theme="roche-light"] .panel-head h3,
html[data-theme="roche-light"] .section-header { font-size: 16px; font-weight: 400; }
html[data-theme="roche-light"] .section-header::before { display: none; }
html[data-theme="roche-light"] .att .ico { border-radius: 5px; }
html[data-theme="roche-light"] .att .t { font-size: 13px; font-weight: 400; }
html[data-theme="roche-light"] .cloud-tag { border-radius: 3px; font-weight: 500; }
html[data-theme="roche-light"] .cloud-tag.aws { background: #fdf3e3; color: var(--warning); }
html[data-theme="roche-light"] .cloud-tag.ali { background: #fdeee9; color: #b4472a; }

/* Bars and selection */
html[data-theme="roche-light"] .stack,
html[data-theme="roche-light"] .bar { height: 5px; border-radius: 2px; background: #e8edf4; }
html[data-theme="roche-light"] .dist-row.on { background: var(--primary-weak); box-shadow: inset 0 0 0 1px #ccddff; }
html[data-theme="roche-light"] .legend i { border-radius: 1px; }

/* Controls: blue outline buttons, grey segmented control with a white thumb */
html[data-theme="roche-light"] .btn,
html[data-theme="roche-light"] .toolbar > button:not(.seg-btn) { padding: 8px 14px; border-radius: 4px; font-size: 12px; }
html[data-theme="roche-light"] .btn:hover,
html[data-theme="roche-light"] .toolbar > button:not(.seg-btn):hover { background: var(--primary-faint); border-color: #a8bce1; }
html[data-theme="roche-light"] .seg { gap: 2px; padding: 2px; border-color: var(--border); border-radius: 5px; background: #edf0f4; }
html[data-theme="roche-light"] .seg-btn { border: 0; border-radius: 3px; background: none; color: var(--muted); font-size: 12px; }
html[data-theme="roche-light"] .seg-btn:hover { background: rgba(255, 255, 255, .6); }
html[data-theme="roche-light"] .seg-btn.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(20, 36, 59, .07); }
html[data-theme="roche-light"] .toolbar select,
html[data-theme="roche-light"] .toolbar input:not([type=checkbox]):not([type=radio]) { border-radius: 5px; font-size: 12px; }
html[data-theme="roche-light"] .toolbar select:focus,
html[data-theme="roche-light"] .toolbar input:focus { outline: 2px solid #8cb4ff; outline-offset: 2px; }

/* Tables and badges */
html[data-theme="roche-light"] th { background: #f5f5f4; border-bottom-color: var(--border); color: var(--muted); font-size: 11.5px; font-weight: 400; }
html[data-theme="roche-light"] td { border-bottom-color: var(--border); }
html[data-theme="roche-light"] tbody tr:hover td { background: #f9fbfe; }
html[data-theme="roche-light"] .badge { padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 400; }
html[data-theme="roche-light"] .badge::before { display: none; }
html[data-theme="roche-light"] .tag { background: none; padding: 0; color: #798594; }
html[data-theme="roche-light"] code { background: #f5f5f4; }
html[data-theme="roche-light"] .toast { background: #28343e; border-radius: 5px; }


/* ── "Regenerate" button (refresh.js) ── */
.refresh-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -8px 0 20px; }
.refresh-btn[disabled] { opacity: .55; cursor: not-allowed; }
.refresh-msg { font-size: 13px; color: var(--muted); }
.refresh-msg.ok    { color: var(--success); }
.refresh-msg.error { color: var(--danger); }
.refresh-msg.running::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 2px solid var(--primary-weak);
  border-top-color: var(--primary);
  border-radius: 50%;
  vertical-align: -1px;
  animation: refresh-spin .8s linear infinite;
}
@keyframes refresh-spin { to { transform: rotate(360deg); } }