/* ========================================
   Prometheus Config Analyzer – Premium UI
   ======================================== */

:root {
  /* Background layers */
  --bg-base: #060b18;
  --bg-card: #0d1526;
  --bg-card2: #111e33;
  --bg-hover: #172242;
  --border: rgba(99, 140, 255, .12);
  --border-soft: rgba(99, 140, 255, .07);

  /* Brand accent */
  --blue: #4f8ef7;
  --blue-dim: #1d4ed8;
  --blue-glow: rgba(79, 142, 247, .22);
  --blue-vivid: #60a5fa;

  /* Status colours */
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, .14);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, .14);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, .14);
  --purple: #c084fc;
  --purple-dim: rgba(192, 132, 252, .14);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, .14);

  /* Text */
  --text-1: #e8f0ff;
  --text-2: #8fa8cc;
  --text-3: #4a6080;

  /* Geometry */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 5px;

  /* Shadows */
  --shadow: 0 8px 32px rgba(0, 0, 0, .55);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .4);
  --glow-blue: 0 0 24px rgba(79, 142, 247, .3);

  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  /* Subtle grid texture */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 142, 247, .06) 0%, transparent 100%),
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

/* ────── App Shell Layout ────── */
#app-root {
  display: flex;
  min-height: 100vh;
}

.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #080f1e;
  border-right: 1px solid rgba(99, 140, 255, .1);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(99, 140, 255, .08);
}

.sidebar-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .35);
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #e8f0ff;
  letter-spacing: -.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #5a7599;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .18s;
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-item svg {
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .18s;
}

.sidebar-item:hover {
  background: rgba(79, 142, 247, .08);
  color: #8fa8cc;
}

.sidebar-item:hover svg {
  opacity: 1;
}

.sidebar-item.active {
  background: rgba(79, 142, 247, .12);
  color: #60a5fa;
  font-weight: 600;
}

.sidebar-item.active svg {
  opacity: 1;
  color: #60a5fa;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #4f8ef7;
  border-radius: 0 3px 3px 0;
}

.sidebar-badge {
  margin-left: auto;
  background: rgba(79, 142, 247, .2);
  color: #60a5fa;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

.sidebar-footer {
  margin-top: auto;
}

/* ── Main area ── */
.main-area {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ── */
.topbar {
  background: rgba(8, 15, 30, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99, 140, 255, .1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Page views ── */
.page-view {
  display: none;
  flex: 1;
}

.page-view.active {
  display: flex;
  flex-direction: column;
}

.page-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.page-view-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.page-view-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
}

/* ────── Header (legacy – keep for analysis view) ────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 24, .8);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}

.header-inner {
  max-width: 1700px;
  margin: 0 auto;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f8ef7 0%, #a855f7 100%);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(79, 142, 247, .45), 0 0 40px rgba(168, 85, 247, .2);
  flex-shrink: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(90deg, #e8f0ff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ────── Buttons ────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #4f8ef7, #6366f1);
  color: white;
  box-shadow: 0 2px 16px rgba(79, 142, 247, .35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79, 142, 247, .5);
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--text-2);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(79, 142, 247, .08);
  color: var(--text-1);
  border-color: rgba(79, 142, 247, .3);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}


/* ────── Upload View ────── */
.upload-view {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.upload-hero {
  max-width: 700px;
  width: 100%;
  text-align: center;
}

.upload-icon-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 142, 247, .15), rgba(168, 85, 247, .15));
  border: 1.5px solid rgba(79, 142, 247, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  animation: pulse-ring 3s ease-in-out infinite;
  color: var(--blue);
  box-shadow: 0 0 40px rgba(79, 142, 247, .15);
}

@keyframes pulse-ring {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(79, 142, 247, .25), 0 0 40px rgba(79, 142, 247, .1);
  }

  50% {
    box-shadow: 0 0 0 14px rgba(79, 142, 247, .0), 0 0 60px rgba(79, 142, 247, .2);
  }
}

.upload-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #e8f0ff 30%, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.upload-desc {
  color: var(--text-2);
  margin-bottom: 32px;
  line-height: 1.8;
  font-size: 14px;
}

.upload-desc code {
  background: rgba(79, 142, 247, .1);
  color: var(--blue-vivid);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
}

.drop-zone {
  position: relative;
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  margin-bottom: 20px;
  /* Animated gradient border */
  border: 1.5px solid rgba(79, 142, 247, .2);
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(79, 142, 247, .04), rgba(168, 85, 247, .04));
  pointer-events: none;
}

.drop-zone.drag-over {
  border-color: var(--blue);
  background: rgba(79, 142, 247, .06);
  box-shadow: 0 0 40px rgba(79, 142, 247, .2), inset 0 0 30px rgba(79, 142, 247, .04);
}

.drop-zone-inner {
  padding: 52px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-icon {
  color: var(--blue);
  margin-bottom: 10px;
  opacity: .7;
}

.drop-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
}

.drop-sub {
  font-size: 12px;
  color: var(--text-3);
}


/* ---- File List ---- */
.file-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-2);
}

.file-items {
  max-height: 260px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background: var(--bg-card2);
}

.file-item-icon {
  color: var(--blue);
  flex-shrink: 0;
}

.file-item-name {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-1);
}

.file-item-size {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.file-item-remove {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color .15s;
  display: flex;
  align-items: center;
}

.file-item-remove:hover {
  color: var(--red);
}

/* ---- Info banner ---- */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(59, 130, 246, .25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  text-align: left;
  margin-bottom: 16px;
}

.info-banner svg {
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.info-banner code {
  background: rgba(59, 130, 246, .15);
  color: var(--blue);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
}

/* ---- Step boxes ---- */

.step-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  text-align: left;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.customer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 32px;
}

.customer-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  transition: border-color .2s;
}

.customer-tag:hover {
  border-color: var(--blue);
}

.customer-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.customer-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  padding: 0;
  transition: color .15s;
}

.customer-tag-remove:hover {
  color: var(--red);
}

.customer-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.customer-input {
  flex: 1;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.customer-input:focus {
  border-color: var(--blue);
}

.customer-input::placeholder {
  color: var(--text-3);
}

.demo-hint {
  margin-top: 8px;
}

/* ---- Upload mode toggle ---- */
.upload-mode-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-2);
  transition: all .2s;
  font-family: var(--font);
}

.mode-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.mode-btn:hover:not(.active) {
  border-color: var(--blue);
  color: var(--blue);
}

/* ---- File type chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.chip-prom {
  background: rgba(59, 130, 246, .15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, .3);
}

.chip-am {
  background: rgba(245, 158, 11, .15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, .3);
}

.chip-rule {
  background: rgba(168, 85, 247, .15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, .3);
}

.chip-unk {
  background: rgba(100, 116, 139, .15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, .3);
}

.type-summary {
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ────── Summary Bar ────── */
.summary-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 28px;
  background: rgba(13, 21, 38, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 28px;
  min-width: 120px;
  transition: transform .2s, box-shadow .2s;
  backdrop-filter: blur(8px);
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.summary-card.diff {
  border-color: rgba(251, 191, 36, .25);
  background: rgba(251, 191, 36, .04);
}

.summary-card.warn {
  border-color: rgba(248, 113, 113, .25);
  background: rgba(248, 113, 113, .04);
}

.summary-card.ok {
  border-color: rgba(52, 211, 153, .25);
  background: rgba(52, 211, 153, .04);
}

.summary-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.summary-card.diff .summary-num {
  color: var(--amber);
  text-shadow: 0 0 20px rgba(251, 191, 36, .4);
}

.summary-card.warn .summary-num {
  color: var(--red);
  text-shadow: 0 0 20px rgba(248, 113, 113, .4);
}

.summary-card.ok .summary-num {
  color: var(--green);
  text-shadow: 0 0 20px rgba(52, 211, 153, .4);
}

.summary-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ────── Tabs ────── */
.tab-nav {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  padding: 15px 18px;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-2);
}

.tab-btn.active {
  color: var(--blue-vivid);
  border-bottom-color: var(--blue);
  text-shadow: 0 0 12px rgba(79, 142, 247, .35);
}


.tab-content {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ────── Customer Cards ────── */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s;
  position: relative;
}

.customer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  opacity: .7;
}

.customer-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55), 0 0 0 1px rgba(79, 142, 247, .18);
}

.customer-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .025);
  border-bottom: 1px solid var(--border);
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
}

.customer-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-1);
}

.customer-files {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.customer-file {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}

.customer-body {
  padding: 16px 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-key {
  color: var(--text-3);
}

.info-val {
  font-family: var(--mono);
  color: var(--text-1);
  font-weight: 500;
}

.info-val.missing {
  color: var(--red);
  font-family: var(--font);
}

.info-val.ok {
  color: var(--green);
}

/* ────── Badges ────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue {
  background: rgba(79, 142, 247, .15);
  color: var(--blue);
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
}

.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
}

.badge-purple {
  background: var(--purple-dim);
  color: var(--purple);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}



/* ---- Compare Table ---- */
.compare-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-2);
  transition: all .2s;
}

.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.filter-btn:hover:not(.active) {
  border-color: var(--blue);
  color: var(--blue);
}

.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

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

.compare-table th {
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-card2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.compare-table th:first-child {
  min-width: 200px;
}

.compare-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table tr:hover td {
  background: var(--bg-hover);
}

.compare-table .row-key {
  font-family: var(--mono);
  color: var(--text-2);
  font-weight: 500;
}

.compare-table .row-section {
  font-weight: 700;
  color: var(--blue);
  background: rgba(59, 130, 246, .05);
}

.compare-table .row-section td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.cell-same {
  color: var(--text-1);
}

.cell-diff {
  color: var(--amber);
  font-weight: 500;
}

.cell-missing {
  color: var(--red);
  font-style: italic;
  opacity: .6;
}

.cell-val {
  font-family: var(--mono);
  word-break: break-all;
}

.row-all-same td {
  opacity: .65;
}

.row-has-diff .row-key {
  color: var(--amber);
}

.diff-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.diff-indicator.diff {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.diff-indicator.same {
  background: var(--green);
}

.diff-indicator.missing {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

/* ---- Scrape / Alerting section ---- */
.section-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header svg {
  color: var(--blue);
}

.scrape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.scrape-job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: transform .2s;
}

.scrape-job-card:hover {
  transform: translateY(-2px);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.job-name {
  font-weight: 600;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-1);
}

.job-targets {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.job-owners {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.owner-chip {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.alertmanager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.alertmanager-table th {
  padding: 10px 14px;
  background: var(--bg-card2);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.alertmanager-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  color: var(--text-1);
  word-break: break-all;
}

.alertmanager-table tr:last-child td {
  border-bottom: none;
}

.alertmanager-table tr:hover td {
  background: var(--bg-hover);
}

/* ---- Global Settings ---- */
.global-matrix {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.global-row {
  display: grid;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  align-items: start;
  gap: 16px;
  transition: background .15s;
}

.global-row:last-child {
  border-bottom: none;
}

.global-row:hover {
  background: var(--bg-hover);
}

.global-key {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

/* ---- Raw YAML ---- */
.raw-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.raw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.raw-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-2);
  transition: all .2s;
}

.raw-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.raw-tab:hover:not(.active) {
  border-color: var(--blue);
  color: var(--blue);
}

.raw-yaml {
  background: #060910;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-1);
  overflow-x: auto;
  white-space: pre;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

/* YAML syntax highlight */
.yaml-key {
  color: #79c0ff;
}

.yaml-str {
  color: #a5d6ff;
}

.yaml-num {
  color: #ffa657;
}

.yaml-bool {
  color: #ff7b72;
}

.yaml-comment {
  color: #8b949e;
  font-style: italic;
}

.yaml-dash {
  color: #f85149;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-1);
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---- HID badges ---- */
.hid-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(168, 85, 247, .15);
  border: 1px solid rgba(168, 85, 247, .3);
  color: #c084fc;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.hid-badge.hid-small {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
}

.hid-badge.hid-missing {
  background: rgba(239, 68, 68, .1);
  border-color: rgba(239, 68, 68, .25);
  color: var(--red);
}

.hid-cell {
  vertical-align: top;
}

.hid-rule-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-soft);
}

.hid-rule-row:last-child {
  border-bottom: none;
}

.val-missing {
  color: var(--red) !important;
  font-weight: 600;
}

/* HID detail block */
.hid-detail-block {
  transition: box-shadow .2s;
}

.hid-detail-block:hover {
  box-shadow: 0 0 0 1px var(--blue);
}

.hid-detail-block.hid-has-issues {
  border-color: rgba(239, 68, 68, .35) !important;
}

.hid-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

/* ---- Severity badges ---- */
.sev-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.sev-critical {
  background: rgba(239, 68, 68, .2);
  color: #f87171;
}

.sev-warning {
  background: rgba(245, 158, 11, .2);
  color: #fbbf24;
}

.sev-info {
  background: rgba(59, 130, 246, .2);
  color: #60a5fa;
}

.sev-none,
.sev-—,
.sev-unknown {
  background: var(--bg-card2);
  color: var(--text-3);
}


::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .tab-content {
    padding: 16px;
  }

  .summary-bar {
    gap: 10px;
  }

  .summary-card {
    min-width: 80px;
    padding: 10px 14px;
  }

  .summary-num {
    font-size: 22px;
  }
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: .4;
}

.empty-state p {
  font-size: 14px;
}