/* ==========================================================================
   orchideo|cloud Design System — plain HTML, dark-mode only
   Generated from: infrastucture/cluster/arc42/08_cross_cutting_concepts/design-system.mdx
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. DIN OT — self-hosted (stub @font-face; drop the TTF files into
      public/assets/fonts/ when available from eXXcellent corporate design)
   -------------------------------------------------------------------------- */
/* Uncomment when font files are available:
@font-face {
  font-family: 'DIN OT';
  font-weight: 300;
  font-style:  normal;
  font-display: swap;
  src: url('/assets/fonts/DINOT-Light.woff2')  format('woff2'),
       url('/assets/fonts/DINOT-Light.woff')   format('woff'),
       url('/assets/fonts/DINOT-Light.ttf')    format('truetype');
}
@font-face {
  font-family: 'DIN OT';
  font-weight: 400;
  font-style:  normal;
  font-display: swap;
  src: url('/assets/fonts/DINOT.woff2')  format('woff2'),
       url('/assets/fonts/DINOT.woff')   format('woff'),
       url('/assets/fonts/DINOT.ttf')    format('truetype');
}
@font-face {
  font-family: 'DIN OT';
  font-weight: 500;
  font-style:  normal;
  font-display: swap;
  src: url('/assets/fonts/DINOT-Medium.woff2')  format('woff2'),
       url('/assets/fonts/DINOT-Medium.woff')   format('woff'),
       url('/assets/fonts/DINOT-Medium.ttf')    format('truetype');
}
@font-face {
  font-family: 'DIN OT';
  font-weight: 700;
  font-style:  normal;
  font-display: swap;
  src: url('/assets/fonts/DINOT-Bold.woff2')  format('woff2'),
       url('/assets/fonts/DINOT-Bold.woff')   format('woff'),
       url('/assets/fonts/DINOT-Bold.ttf')    format('truetype');
}
*/

/* --------------------------------------------------------------------------
   1. CSS Custom Properties — Brand Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --clr-new-dark:   #07264C;   /* Deepest navy — header gradient anchor */
  --clr-dark-blue:  #0d456b;   /* Primary blue — buttons, sidebar, key UI */
  --clr-lavendel:   #9d599f;   /* Secondary accent — destructive, code accents */
  --clr-light-blue: #35abe2;   /* Highlight — links, borders, active states */
  --clr-dark-grey:  #54585b;   /* Body text (light mode reference) */

  /* Semantic colors (kept close to brand palette) */
  --clr-success:  #50c850;
  --clr-warning:  #c8a032;
  --clr-danger:   #c83232;
  --clr-info:     var(--clr-light-blue);
  --clr-mock:     var(--clr-lavendel);

  /* Backgrounds */
  --bg-base:       #1c2230;
  --bg-surface:    rgba(13, 69, 107, 0.25);
  --bg-raised:     rgba(7, 38, 76, 0.55);
  --bg-overlay:    rgba(0, 0, 0, 0.45);

  /* Radial atmospheric glows */
  --bg-image:
    radial-gradient(ellipse at 25% 0%, rgba(13, 69, 107, 0.40) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 0%, rgba(157, 89, 159, 0.28) 0%, transparent 60%);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0d456b, #35abe2);
  --gradient-brand:   linear-gradient(135deg, #0d456b, #9d599f); /* 135° spec angle [fix H] */
  --gradient-header:  linear-gradient(135deg, #07264C, #0d456b);

  /* Typography */
  --font-family: 'DIN OT', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'Fira Code', 'Cascadia Code', 'JetBrains Mono', ui-monospace, monospace;

  /* Text colors */
  --text-primary:   #eaeaea;
  --text-secondary: rgba(234, 234, 234, 0.60);
  --text-muted:     rgba(234, 234, 234, 0.58); /* raised from 0.38 → ≥4.5:1 contrast [fix K] */

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 200ms;
  --duration-base: 250ms;

  /* Borders */
  --border-subtle:  rgba(53, 171, 226, 0.12);
  --border-default: rgba(53, 171, 226, 0.18);
  --border-strong:  rgba(53, 171, 226, 0.35);
  --divider:        rgba(255, 255, 255, 0.08);
  --page-pad: 1.25rem;
}

/* --------------------------------------------------------------------------
   2. Reset + Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  background-image: var(--bg-image);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. Scrollbar (webkit)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-lavendel);
}

/* --------------------------------------------------------------------------
   4. Links
   -------------------------------------------------------------------------- */
a {
  color: var(--clr-light-blue);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease);
}
a:hover {
  color: var(--clr-lavendel);
}

/* --------------------------------------------------------------------------
   5. Divider
   -------------------------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 1.5rem 0;
}

/* --------------------------------------------------------------------------
   6. .hub-header
   -------------------------------------------------------------------------- */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gradient-header);
  border-bottom: 1px solid rgba(53, 171, 226, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hub-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem var(--page-pad);
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap; /* [fix M] prevents overflow on narrow viewports */
}

/* eXXcellent logo — design system position 1 [fix D] */
.hub-exx-link {
  display: flex;
  align-items: center;
  opacity: 0.92;
  transition: opacity 0.2s;
  flex-shrink: 0;
  text-decoration: none;
}
.hub-exx-link:hover { opacity: 1; }
.hub-exx-logo {
  display: block;
  max-width: 90px;
  height: auto;
}

@media (max-width: 600px) {
  .hub-header-center { flex-basis: 100%; order: 3; }
  .hub-exx-logo      { max-width: 60px; }
  .hub-orchid        { max-width: 48px; height: auto; }
}

.hub-header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
}

.hub-orchid-link {
  display: flex;
  align-items: center;
  opacity: 0.9;
  transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hub-orchid-link:hover { opacity: 1; }

.hub-orchid {
  display: block;
  /* subtle scale on hover via parent */
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hub-orchid-link:hover .hub-orchid {
  transform: scale(1.05);
}

.hub-header-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hub-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Legacy aliases (kept for any remaining references) */
.hub-header .header-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.hub-header .header-actions {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   7. .wordmark — orchideo|cloud
   -------------------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-family);
  font-size: 1.25rem;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.wordmark:hover {
  color: #ffffff;
}

.brand-orchideo {
  position: relative;
  top: 0.25em;
  font-weight: 300;
}

.brand-pipe {
  font-weight: 300;
  color: var(--clr-light-blue);
  opacity: 0.7;
  margin: 0 1px;
}

.brand-cloud {
  position: relative;
  top: -0.15em;
  font-weight: 700;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   8. .card — Glassmorphism
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(13, 69, 107, 0.35),
    rgba(7, 38, 76, 0.25)
  );
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 1.5rem;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease),
              box-shadow var(--duration-base) var(--ease);
}

.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: var(--gradient-brand);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card h2,
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--divider);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   9. .stat-card — Glassmorphism stats card
   -------------------------------------------------------------------------- */
.stat-card {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(13, 69, 107, 0.35),
    rgba(7, 38, 76, 0.25)
  );
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  /* [fix L] color fallback for browsers that don't support background-clip: text */
  color: var(--clr-light-blue);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-card .label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Stats grid layout helper */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   10. .panel — Main content panels (less transparent than .card)
   -------------------------------------------------------------------------- */
.panel {
  background: rgba(7, 38, 76, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.20);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--divider);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   11. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease),
    background var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(13, 69, 107, 0.40);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(53, 171, 226, 0.35);
  color: #ffffff;
}
.btn-primary:active {
  transform: translateY(0);
}

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--clr-light-blue);
  box-shadow: inset 0 0 0 1px var(--clr-light-blue);
}
.btn-secondary:hover {
  background: rgba(53, 171, 226, 0.10);
  color: var(--clr-light-blue);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0);
}

/* Destructive */
.btn-destructive {
  background: rgba(157, 89, 159, 0.85);
  color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(157, 89, 159, 0.25);
}
.btn-destructive:hover {
  background: rgba(157, 89, 159, 1);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(157, 89, 159, 0.40);
}
.btn-destructive:active {
  transform: translateY(0);
}

/* Disabled — must come last to override everything */
.btn[disabled],
.btn:disabled {
  background: rgba(100, 100, 100, 0.40) !important;
  color: rgba(234, 234, 234, 0.35) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   12. Tables
   -------------------------------------------------------------------------- */
.table-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 680px;
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

th,
td {
  padding: 0.6875rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

th {
  background: rgba(7, 38, 76, 0.80);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}

th:hover {
  background: rgba(53, 171, 226, 0.15);
  color: var(--clr-light-blue);
}

th.sorted-asc::after  { content: ' ▲'; font-size: 0.7em; }
th.sorted-desc::after { content: ' ▼'; font-size: 0.7em; }

tbody tr {
  transition: background var(--duration-fast) var(--ease);
}

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

tbody tr.row-fade-in {
  opacity: 0;
  animation: rowFadeIn 0.22s ease forwards;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

tbody tr.selected {
  background: rgba(53, 171, 226, 0.10);
}

/* --------------------------------------------------------------------------
   13. Badges
   -------------------------------------------------------------------------- */

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.1875rem 0.5625rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-overprovisioned  { background: rgba(200, 160, 50, 0.18);  color: var(--clr-warning); }
.status-underprovisioned { background: rgba(200, 50, 50, 0.18);   color: var(--clr-danger); }
.status-optimal          { background: rgba(80, 200, 80, 0.18);   color: var(--clr-success); }
.status-nocurrent        { background: rgba(160, 160, 160, 0.15); color: var(--text-secondary); }

/* Cluster badge */
.cluster-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  /* [fix B] brand color — was #60a5fa / rgba(59,130,246,...) */
  background: rgba(53, 171, 226, 0.12);
  color: var(--clr-light-blue);
}

/* Delta badge */
.delta-badge {
  display: inline-block;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.delta-up   { background: rgba(80, 200, 80, 0.18);  color: var(--clr-success); }
.delta-down { background: rgba(200, 50, 50, 0.18);  color: var(--clr-danger); }
.delta-new  { background: rgba(53, 171, 226, 0.18); color: var(--clr-light-blue); }

/* OOM risk */
.oom-risk-high   { color: var(--clr-danger);  font-weight: 700; }
.oom-risk-medium { color: var(--clr-warning); font-weight: 700; }

/* --------------------------------------------------------------------------
   14. Filters / Selector groups
   -------------------------------------------------------------------------- */
.filters,
#api-selectors {
  background: rgba(7, 38, 76, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.sel-group,
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
}

.sel-group label,
.filter-group label {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

select,
input[type="text"],
input[type="search"] {
  font-family: var(--font-family);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(7, 38, 76, 0.70);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-sm);
  padding: 0.5625rem 0.875rem;
  min-width: 170px;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2335abe2' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

select:focus,
input[type="text"]:focus,
input[type="search"]:focus {
  border-color: var(--clr-light-blue);
  box-shadow: 0 0 0 2px rgba(53, 171, 226, 0.18);
}

/* [fix F] keyboard focus rings — WCAG AA 2.4.7 */
.btn:focus-visible,
.tab:focus-visible,
.mode-toggle button:focus-visible {
  outline: 2px solid var(--clr-light-blue);
  outline-offset: 2px;
}

select option {
  background: #1c2a40;
  color: var(--text-primary);
}

.filter-checks {
  display: flex;
  gap: 0.875rem;
  align-items: center;
}

.filter-checks label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}

.filter-checks input[type="checkbox"] {
  accent-color: var(--clr-light-blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   15. .toolbar (merged mode toggle + api selectors)
   -------------------------------------------------------------------------- */
.toolbar {
  background: rgba(7, 38, 76, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.625rem 1.25rem;
  margin: 0 var(--page-pad) 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-left  { flex-shrink: 0; }
.toolbar-right { margin-left: auto; flex-shrink: 0; }

.toolbar-selectors {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
}

/* Filter wrapper dissolves into the flex row */
.toolbar-filters {
  display: contents;
}

/* Checkboxes sit inline, no column layout */
.sel-group-checks {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.4rem;
}

/* Compact selector labels inside toolbar */
.toolbar-selectors .sel-group label {
  font-size: 0.68rem;
}
.toolbar-selectors select,
.toolbar-selectors input[type="text"] {
  min-width: 130px;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}
.toolbar-selectors #filter-search {
  min-width: 160px;
}

.mode-status-chip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.3s;
}
.mode-status-chip.loaded {
  color: var(--clr-light-blue);
}

.mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.30);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.mode-toggle button {
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 1.125rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}

.mode-toggle button.active {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 1px 8px rgba(13, 69, 107, 0.40);
}

.mode-toggle button:not(.active):hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   16. Alerts
   -------------------------------------------------------------------------- */
.alert-info,
.alert-success,
.alert-warning,
.alert-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border-left: 3px solid;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.alert-info {
  background: rgba(53, 171, 226, 0.08);
  border-color: rgba(53, 171, 226, 0.30);
  color: var(--clr-light-blue);
}

.alert-success {
  background: rgba(80, 200, 80, 0.10);
  border-color: rgba(80, 200, 80, 0.40);
  color: var(--clr-success);
}

.alert-warning {
  background: rgba(200, 160, 50, 0.10);
  border-color: rgba(200, 160, 50, 0.40);
  color: var(--clr-warning);
}

.alert-error {
  background: rgba(200, 50, 50, 0.10);
  border-color: rgba(200, 50, 50, 0.40);
  color: var(--clr-danger);
}

/* --------------------------------------------------------------------------
   17. Detail panel items + comparison bars
   -------------------------------------------------------------------------- */
.detail-item {
  background: rgba(7, 38, 76, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6875rem 0.75rem;
}

.detail-item .label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1875rem;
}

.detail-item .value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5625rem;
}

.detail-section {
  margin-bottom: 1.125rem;
}

.detail-section h4 {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5625rem;
}

/* Comparison bars */
.comparison-bar {
  margin-bottom: 0.8125rem;
}

.comparison-bar .bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.bar-container {
  height: 18px;
  background: rgba(0, 0, 0, 0.30);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 3px;
}

.bar-fill {
  height: 100%;
  border-radius: 9px;
  transition: width var(--duration-base) var(--ease);
}

.bar-recommended {
  background: linear-gradient(90deg, var(--clr-success), #86efac);
}

.bar-actual {
  background: linear-gradient(90deg, var(--clr-warning), #fcd34d);
}

/* --------------------------------------------------------------------------
   18. Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 0.3125rem;
  margin-bottom: 0.9375rem;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 0;
}

.tab {
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5625rem 1.125rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}

.tab:hover:not(.active) {
  background: rgba(53, 171, 226, 0.08);
  color: var(--text-primary);
}

.tab.active {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 -1px 8px rgba(13, 69, 107, 0.30);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* --------------------------------------------------------------------------
   19. .no-selection / .empty-state
   -------------------------------------------------------------------------- */
.no-selection,
.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--text-muted);
}

.no-selection svg,
.empty-state svg {
  display: block;
  margin: 0 auto 0.75rem;
  opacity: 0.35;
}

.no-selection svg  { width: 48px; height: 48px; }
.empty-state svg   { width: 60px; height: 60px; }

.no-selection p,
.empty-state p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   20. .manifest-path (monospace code block)
   -------------------------------------------------------------------------- */
.manifest-path {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  color: var(--text-secondary);
  word-break: break-all;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   21. .mock-auth-banner — purple, bottom fixed
   -------------------------------------------------------------------------- */
.mock-auth-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(157, 89, 159, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(157, 89, 159, 0.50);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: 0 -2px 16px rgba(157, 89, 159, 0.30);
}

.mock-auth-banner::before {
  content: '⚠';
  font-size: 1em;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   22. .hub-error-banner — red, top fixed (below sticky header)
   -------------------------------------------------------------------------- */
.hub-error-banner {
  /* In document flow — no layout shift, no overlap with header */
  position: relative;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: rgba(180, 40, 40, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(239, 68, 68, 0.40);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(200, 50, 50, 0.25);
  animation: slideDown var(--duration-base) var(--ease) both;
}

.hub-error-dismiss {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  padding: 0 0.25rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.hub-error-dismiss:hover { opacity: 1; }


@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* --------------------------------------------------------------------------
   23. Loading spinner
   -------------------------------------------------------------------------- */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.20);
  border-top-color: var(--clr-light-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   24. Upload area
   -------------------------------------------------------------------------- */
#upload-area {
  background: rgba(7, 38, 76, 0.40);
  border: 2px dashed rgba(53, 171, 226, 0.25);
  border-radius: var(--radius-lg);
  padding: 3.125rem 2.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  transition: border-color var(--duration-base) var(--ease),
              background var(--duration-base) var(--ease);
  cursor: pointer;
}

#upload-area:hover,
#upload-area.dragover {
  border-color: var(--clr-light-blue);
  background: rgba(53, 171, 226, 0.06);
}

#upload-area svg {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  color: var(--text-muted);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#upload-area h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

#upload-area p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.file-info {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: rgba(13, 69, 107, 0.50);
  border: 1px solid var(--border-default);
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.file-info .clear-btn {
  background: none;
  border: none;
  color: var(--clr-danger);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity var(--duration-fast) var(--ease);
}

.file-info .clear-btn:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   25. Namespace tree (API mode)
   -------------------------------------------------------------------------- */
.ns-tree {
  font-size: 0.875rem;
}

.ns-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}

.ns-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ns-item.active {
  background: rgba(53, 171, 226, 0.12);
  color: var(--clr-light-blue);
}

.ns-item .ns-name {
  font-weight: 500;
}

.ns-item .ns-count {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   26. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

#main-content {
  padding: var(--page-pad);
  box-sizing: border-box;
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.25rem;
  width: 100%;
  min-width: 0;
  transition: grid-template-columns 0.25s ease;
}

.main-grid:has(.right-column.hidden) {
  grid-template-columns: 1fr 0px;
  gap: 0;
}

/* [fix I] named column references used in index.html */
.left-column  { /* first grid child — charts + table */ }
.right-column { /* second grid child — detail panel */ }

@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.app-detail {
  position: sticky;
  top: 80px; /* below sticky header */
}

/* Detail panel helpers */
.detail-badges         { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid-single    { grid-template-columns: 1fr !important; }
.detail-value-sm       { font-size: 0.85rem; }
.detail-edit-cmd       { margin-top: 8px; font-size: 0.78rem; color: var(--text-secondary); }

/* Chart containers */
.chart-container {
  position: relative;
  height: 520px;
  margin-bottom: 1.25rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.chart-container.chart-ready {
  opacity: 1;
}

/* Header metadata chips */
.metadata {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.metadata span {
  background: rgba(13, 69, 107, 0.50);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-actions {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Onboarding card
   -------------------------------------------------------------------------- */
.onboarding-card {
  background: rgba(7, 38, 76, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  padding: 1.5rem 2rem;
  margin: 0 var(--page-pad) 1.5rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.onboarding-card.hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.onboarding-steps {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  cursor: default;
}
.onboarding-step.active {
  border-color: var(--clr-light-blue);
  background: rgba(53, 171, 226, 0.08);
}
.ob-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(53, 171, 226, 0.15);
  border: 1px solid rgba(53, 171, 226, 0.35);
  color: var(--clr-light-blue);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.onboarding-step.active .ob-num {
  background: var(--clr-light-blue);
  color: #fff;
}
.ob-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ob-text strong { font-size: 0.875rem; color: var(--text-primary); }
.ob-text span   { font-size: 0.75rem;  color: var(--text-secondary); }
.ob-arrow {
  font-size: 1.25rem;
  color: var(--border-subtle);
}

/* --------------------------------------------------------------------------
   Stat cards — clickable, active state
   -------------------------------------------------------------------------- */
.stat-card {
  cursor: pointer;
  user-select: none;
}
.stat-card:hover {
  border-color: rgba(53, 171, 226, 0.30);
}
.stat-card.stat-active {
  border-color: var(--clr-light-blue) !important;
  box-shadow: 0 0 0 1px var(--clr-light-blue), 0 4px 16px rgba(53, 171, 226, 0.20);
}
.stat-card.stat-over  .value { color: var(--clr-warning,  #f59e0b); }
.stat-card.stat-under .value { color: var(--clr-error,    #ef4444); }
.stat-card.stat-oom   .value { color: var(--clr-lavendel, #9d599f); }

/* --------------------------------------------------------------------------
   Table toolbar + pagination
   -------------------------------------------------------------------------- */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.table-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pg-btn {
  font-family: var(--font-family);
  font-size: 0.8rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(7, 38, 76, 0.50);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.pg-btn:hover:not(:disabled) {
  background: rgba(53, 171, 226, 0.12);
  color: var(--clr-light-blue);
  border-color: rgba(53, 171, 226, 0.35);
}
.pg-btn.active {
  background: var(--clr-light-blue);
  color: #fff;
  border-color: var(--clr-light-blue);
}
.pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pg-ellipsis { font-size: 0.8rem; color: var(--text-muted); padding: 0 2px; }

/* --------------------------------------------------------------------------
   Detail panel header + close button
   -------------------------------------------------------------------------- */
.detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.detail-panel-header h2 { margin-bottom: 0; }

.detail-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.detail-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

/* Slide-in effect when panel gets content */
.app-detail {
  transition: box-shadow 0.3s var(--ease);
}
.app-detail.has-content {
  box-shadow:
    0 0 0 1px rgba(53, 171, 226, 0.20),
    0 8px 32px rgba(0,0,0,0.25);
}

/* Mobile: detail panel as full-width block below table */
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr !important;
  }
  .app-detail {
    position: static;
  }
  .app-detail.has-content {
    margin-top: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Run Status Bar
   -------------------------------------------------------------------------- */
.run-status-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem var(--page-pad);
  margin: 0 0 0.75rem;
  background: rgba(7, 38, 76, 0.40);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.run-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.run-status-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  flex-shrink: 0;
}

.run-status-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.run-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.run-dot-ok      { background: #4ade80; }
.run-dot-error   { background: #ef4444; }
.run-dot-running {
  background: var(--clr-light-blue);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* Small button variant */
.btn-sm {
  font-size: 0.78rem;
  padding: 0.25rem 0.625rem;
}
.btn-sm svg { width: 13px; height: 13px; }

/* --------------------------------------------------------------------------
   Modal (Run History)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-panel {
  background: #1a2540;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.50);
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideDown 0.2s var(--ease) both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal-header h3 { margin: 0; font-size: 1rem; }

.modal-body {
  overflow-y: auto;
  padding: 1rem 1.25rem;
  flex: 1;
}

/* --------------------------------------------------------------------------
   Run History entries
   -------------------------------------------------------------------------- */
.run-history-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 1rem 0;
}

.run-history-entry {
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.run-entry-completed { border-left: 3px solid #4ade80; }
.run-entry-failed    { border-left: 3px solid #ef4444; }
.run-entry-partial   { border-left: 3px solid #f59e0b; }

.run-entry-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}
.run-entry-id  { flex: 1; font-size: 0.82rem; font-family: monospace; color: var(--text-primary); }
.run-entry-dur { font-size: 0.78rem; color: var(--text-secondary); }

.run-entry-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.run-entry-errcnt {
  color: #ef4444;
  font-weight: 600;
}

.run-global-error {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.5rem;
}

.run-errors { margin-top: 0.5rem; }
.run-error-item {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  padding: 0.2rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.run-error-location { color: var(--clr-light-blue); flex-shrink: 0; }
.run-error-msg      { color: #fca5a5; }

.hub-error-inline {
  color: #ef4444;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* Delta highlight in detail panel */
.delta-highlight {
  color: var(--clr-light-blue);
  font-weight: 600;
}

/* Run History tab */
.run-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.run-tab-header h2 { margin: 0; }

/* Error badge on tab button */
.tab-has-error {
  position: relative;
}
.tab-has-error::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
}

/* Run progress bar (shown during active runs) */
.run-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.run-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
  max-width: 220px;
}

.run-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-dark-blue), var(--clr-light-blue));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.run-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--clr-light-blue);
  flex-shrink: 0;
  min-width: 2.5rem;
}

.run-progress-ns {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Partial status dot (yellow) */
.run-dot-warning { background: #f59e0b; }

/* Partial run history entry */
.run-entry-partial { border-left: 3px solid #f59e0b; }

/* Stat chips in table toolbar */
.stat-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.stat-chip span {
  font-weight: 700;
  color: inherit;
}

.stat-chip:hover {
  background: rgba(255,255,255,0.10);
  color: var(--text-primary);
}

.stat-chip.stat-active,
.stat-chip:focus-visible {
  background: rgba(53,171,226,0.15);
  border-color: var(--clr-light-blue);
  color: var(--clr-light-blue);
  outline: none;
}

.stat-chip-over.stat-active  { background: rgba(245,158,11,0.15); border-color: #f59e0b; color: #f59e0b; }
.stat-chip-under.stat-active { background: rgba(239,68,68,0.15);  border-color: #ef4444; color: #ef4444; }
.stat-chip-oom.stat-active   { background: rgba(157,89,159,0.15); border-color: var(--clr-lavendel); color: var(--clr-lavendel); }
.stat-chip-over span  { color: #f59e0b; }
.stat-chip-under span { color: #ef4444; }
.stat-chip-oom span   { color: var(--clr-lavendel); }

/* table-toolbar needs flex-wrap for the chips row */
.table-toolbar {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* Runs panel — always visible, below status bar */
.runs-panel {
  margin: 0 var(--page-pad) 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.runs-panel-has-error {
  border-color: rgba(239,68,68,0.5);
}

.runs-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.runs-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

.runs-panel-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.runs-panel-toggle:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

#runs-panel-chevron { transition: transform 0.2s; }

.runs-panel-body {
  padding: 0.5rem 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.runs-panel-last-run {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 0.5rem;
}

.export-btns {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

/* Cost summary bar */
.cost-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: rgba(7, 38, 76, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}

.cost-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.3rem 0.75rem;
  border-right: 1px solid var(--border-subtle);
}

.cost-card:last-of-type { border-right: none; }

.cost-card-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cost-card-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-light-blue);
  font-variant-numeric: tabular-nums;
}

.cost-card-discounted .cost-card-value {
  color: #34d399;
}

.cost-card-count .cost-card-value {
  color: var(--text-primary);
  font-size: 1rem;
}

.cost-card-savings .cost-card-value {
  font-size: 1rem;
}

.cost-card-note {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-left: auto;
  font-style: italic;
}

.cost-table-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

#cost-table th { cursor: pointer; user-select: none; }
#cost-table th:hover { color: var(--clr-light-blue); }
#cost-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cost-discounted-cell { color: #34d399; }

/* Info tooltip */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 0.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.6rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  color: var(--text-secondary);
  cursor: help;
  flex-shrink: 0;
}

.info-tooltip:hover {
  color: var(--clr-light-blue);
  border-color: var(--clr-light-blue);
}

.info-tooltip svg { display: block; }

.info-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 20, 50, 0.97);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.72rem;
  line-height: 1.45;
  padding: 0.45rem 0.65rem;
  width: 220px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

.info-tooltip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 101;
}

.info-tooltip:hover::after,
.info-tooltip:hover::before { opacity: 1; }

.cluster-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}


/* Detail panel slide-in animation */
.right-column {
  overflow: hidden;
  width: 400px;
  opacity: 1;
  transition: width 0.25s ease, opacity 0.2s ease;
}

.right-column.hidden {
  width: 0;
  opacity: 0;
  pointer-events: none;
}


.empty-state {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-secondary);
}

.empty-state svg {
  display: block;
  margin: 0 auto 0.75rem;
  opacity: 0.4;
}

.empty-state span {
  font-size: 0.9rem;
}

/* Table column widths */
col.col-name    { min-width: 160px; }
col.col-cluster { width: 110px; }
col.col-ns      { width: 130px; }
col.col-num     { width: 90px; }
col.col-oom     { width: 70px; }
col.col-status  { width: 110px; }

/* Icon alignment helpers */
.icon-inline { vertical-align: -2px; }
.runs-empty  { color: var(--text-secondary); }
.chevron-collapsed { transform: rotate(-90deg); }

.cost-saving   { color: #34d399; }
.cost-increase { color: var(--clr-danger); }

/* ── Overview KPI cards ───────────────────────────────────── */
.overview-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: rgba(7, 38, 76, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  min-width: 110px;
  text-align: center;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--clr-light-blue);
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

.kpi-over  .kpi-value { color: var(--clr-warning); }
.kpi-under .kpi-value { color: var(--clr-danger); }
.kpi-oom   .kpi-value { color: var(--clr-danger); }
.kpi-cost  .kpi-value { color: var(--clr-light-blue); }
.kpi-savings .kpi-value { color: #34d399; }

.chart-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.chart-container-sm {
  height: 260px !important;
}

/* ── Cluster summary table ────────────────────────────────── */
.cluster-summary-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.cluster-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.cluster-summary-table th,
.cluster-summary-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cluster-summary-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.cluster-summary-table tr:hover td {
  background: rgba(255,255,255,0.03);
}

.cluster-summary-table .status-overprovisioned { color: var(--clr-warning); font-weight: 600; }
.cluster-summary-table .status-underprovisioned { color: var(--clr-danger); font-weight: 600; }
.cluster-summary-table .status-oom { color: var(--clr-danger); font-weight: 600; }

/* ── Cost bar sections ──────────────────────────────────────── */
.cost-bar {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
}

.cost-bar-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
}

.cost-bar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cost-bar-cards {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.cost-bar-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border-subtle);
  margin: 0.4rem 0;
}

.cost-basis-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(53,171,226,0.2);
  color: var(--clr-light-blue);
  border-radius: 3px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   Observability / Metrics Feature
   ============================================================ */

/* --- Compatibility Score Badge --- */
.compat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.compat-badge-full    { background: rgba(34,197,94,0.15);  color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.compat-badge-partial { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.compat-badge-none    { background: rgba(100,116,139,0.15);color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }

/* --- Observability inline check rows --- */
.obs-checks {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 4px;
}
.obs-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.obs-check-icon { font-size: 0.95rem; flex-shrink: 0; }
.obs-check-label { flex: 1; }
.obs-check-value { color: var(--text-primary); font-weight: 500; }

/* --- Resource attributes mini-list --- */
.obs-attrs {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.obs-attr {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
}
.obs-attr-key   { color: var(--text-muted); flex-shrink: 0; }
.obs-attr-val   { color: var(--text-primary); word-break: break-all; }

/* --- Loading spinner (reusable) --- */
.obs-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 0;
}
.obs-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--clr-light-blue);
  border-radius: 50%;
  animation: obs-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes obs-spin { to { transform: rotate(360deg); } }

/* --- "→ Metrics-Tab" link in detail panel --- */
.obs-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--clr-light-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  text-decoration: none;
}
.obs-tab-link:hover { text-decoration: underline; }

/* ============================================================
   Metrics Tab
   ============================================================ */
#tab-metrics .table-toolbar { margin-bottom: 10px; }

.metrics-compat-filters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.metrics-compat-filters label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 2px;
}

/* Score chips in metrics tab (reuse stat-chip, add score colors) */
.stat-chip-full.stat-active     { background: rgba(34,197,94,0.15);  border-color: #22c55e; color: #22c55e; }
.stat-chip-partial.stat-active  { background: rgba(245,158,11,0.15); border-color: #f59e0b; color: #f59e0b; }
.stat-chip-none.stat-active     { background: rgba(100,116,139,0.15);border-color: #94a3b8; color: #94a3b8; }
.stat-chip-full span    { color: #22c55e; }
.stat-chip-partial span { color: #f59e0b; }
.stat-chip-none span    { color: #94a3b8; }

/* Metrics table icon columns */
#metrics-table th, #metrics-table td { vertical-align: middle; }
#metrics-table td.metrics-td-icon { text-align: center; font-size: 1rem; }
#metrics-table td.metrics-td-count { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================
   Metriken-Modal
   ============================================================ */

.metrics-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: modal-fade-in 0.15s ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.metrics-modal-drawer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 860px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: drawer-slide-up 0.2s ease;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
}

@keyframes drawer-slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.metrics-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.metrics-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metrics-modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: monospace;
}

.metrics-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.metrics-modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.metrics-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.metrics-modal-search {
  flex: 1;
  background: var(--bg-input, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}
.metrics-modal-search:focus { border-color: var(--accent); }

.metrics-modal-otel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.metrics-modal-otel-toggle input { accent-color: #818cf8; cursor: pointer; }

.metrics-modal-stats {
  padding: 6px 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.metrics-modal-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px;
  align-content: start;
}

.metrics-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-secondary);
  transition: background 0.1s;
  gap: 8px;
}
.metrics-modal-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.metrics-modal-item.is-otel {
  color: #a5b4fc;
}
.metrics-modal-item.is-otel:hover { color: #c7d2fe; }

.metrics-otel-badge {
  font-size: 0.6rem;
  font-family: sans-serif;
  font-weight: 600;
  background: #312e81;
  color: #a5b4fc;
  border: 1px solid #4338ca;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.metrics-modal-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  font-size: 0.875rem;
  font-family: sans-serif;
}

.obs-metrics-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: left;
}
.obs-metrics-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-primary);
}
.obs-metrics-btn-count {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}
.obs-metrics-otel-hint {
  font-size: 0.7rem;
  background: #312e81;
  color: #a5b4fc;
  border-radius: 4px;
  padding: 1px 6px;
}

.metrics-modal-cat-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 7px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}
.metrics-modal-cat-select:focus { border-color: var(--accent); }

.metrics-modal-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-source-badge {
  font-size: 0.6rem;
  font-family: sans-serif;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.metrics-modal-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 6px;
}

.metrics-modal-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
