@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  /* Sizing (shared between themes) */
  --header-height: 52px;
  --sidebar-width: 320px;
  --bottom-panel-height: 200px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Status (same in both themes) */
  --status-online: #16a34a;
  --status-warning: #ca8a04;
  --status-offline: #dc2626;
  --status-synced: #16a34a;
  --status-progressing: #2563eb;
  --status-degraded: #ea580c;
  --status-outofsync: #dc2626;
}

/* ── Light theme (default) ─────────────────────────────────── */
[data-theme="light"] {
  /* Surface colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-sidebar: #ffffff;

  /* Border */
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-accent: #cbd5e1;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-muted: #cbd5e1;

  /* Accent */
  --accent-blue: #2563eb;
  --accent-blue-dim: #dbeafe;
  --accent-cyan: #0891b2;
  --accent-purple: #7c3aed;

  /* Priority */
  --priority-critical: #dc2626;
  --priority-critical-bg: rgba(220, 38, 38, 0.08);
  --priority-high: #ea580c;
  --priority-high-bg: rgba(234, 88, 12, 0.08);
  --priority-medium: #ca8a04;
  --priority-medium-bg: rgba(202, 138, 4, 0.08);
  --priority-low: #2563eb;
  --priority-low-bg: rgba(37, 99, 235, 0.08);
  --priority-info: #64748b;
  --priority-info-bg: rgba(100, 116, 139, 0.06);

  /* Broadcast */
  --broadcast-critical: #dc2626;
  --broadcast-critical-bg: rgba(220, 38, 38, 0.06);
  --broadcast-critical-border: rgba(220, 38, 38, 0.2);
  --broadcast-high: #ea580c;
  --broadcast-high-bg: rgba(234, 88, 12, 0.06);
  --broadcast-high-border: rgba(234, 88, 12, 0.2);
  --broadcast-medium: #ca8a04;
  --broadcast-medium-bg: rgba(202, 138, 4, 0.05);
  --broadcast-medium-border: rgba(202, 138, 4, 0.18);
  --broadcast-info: #2563eb;
  --broadcast-info-bg: rgba(37, 99, 235, 0.05);
  --broadcast-info-border: rgba(37, 99, 235, 0.15);

  /* Metrics */
  --metric-green: #16a34a;
  --metric-green-bg: rgba(22, 163, 74, 0.08);

  /* Badge/chip text (darker for light bg contrast) */
  --badge-green: #15803d;
  --badge-red: #dc2626;
  --badge-orange: #c2410c;
  --badge-yellow: #a16207;
  --badge-blue: #1d4ed8;
  --badge-purple: #6d28d9;
  --badge-gray: #64748b;

  /* Logo gradient (readable on light bg) */
  --logo-gradient-from: #0f172a;
  --logo-gradient-to: #475569;
}

/* ── Dark theme ────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Surface colors */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2332;
  --bg-card: #1e293b;
  --bg-card-hover: #243044;
  --bg-sidebar: #111827;

  /* Border */
  --border: #293548;
  --border-subtle: #1f2d3d;
  --border-accent: #3d5168;

  /* Text — WCAG AA 4.5:1 minimum on --bg-card (#1e293b) */
  --text-primary: #f1f5f9;
  --text-secondary: #a1b1c7;
  --text-tertiary: #7d8da1;
  --text-muted: #5b6b80;

  /* Accent */
  --accent-blue: #3b82f6;
  --accent-blue-dim: #1e3a5f;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;

  /* Priority */
  --priority-critical: #ef4444;
  --priority-critical-bg: rgba(239, 68, 68, 0.12);
  --priority-high: #f97316;
  --priority-high-bg: rgba(249, 115, 22, 0.12);
  --priority-medium: #eab308;
  --priority-medium-bg: rgba(234, 179, 8, 0.12);
  --priority-low: #3b82f6;
  --priority-low-bg: rgba(59, 130, 246, 0.12);
  --priority-info: #64748b;
  --priority-info-bg: rgba(100, 116, 139, 0.12);

  /* Broadcast */
  --broadcast-critical: #ef4444;
  --broadcast-critical-bg: rgba(239, 68, 68, 0.08);
  --broadcast-critical-border: rgba(239, 68, 68, 0.3);
  --broadcast-high: #f97316;
  --broadcast-high-bg: rgba(249, 115, 22, 0.08);
  --broadcast-high-border: rgba(249, 115, 22, 0.3);
  --broadcast-medium: #eab308;
  --broadcast-medium-bg: rgba(234, 179, 8, 0.06);
  --broadcast-medium-border: rgba(234, 179, 8, 0.25);
  --broadcast-info: #3b82f6;
  --broadcast-info-bg: rgba(59, 130, 246, 0.06);
  --broadcast-info-border: rgba(59, 130, 246, 0.2);

  /* Metrics */
  --metric-green: #22c55e;
  --metric-green-bg: rgba(34, 197, 94, 0.1);

  /* Badge/chip text (lighter for dark bg contrast) */
  --badge-green: #4ade80;
  --badge-red: #f87171;
  --badge-orange: #fb923c;
  --badge-yellow: #facc15;
  --badge-blue: #60a5fa;
  --badge-purple: #a78bfa;
  --badge-gray: #94a3b8;

  /* Logo gradient */
  --logo-gradient-from: #f1f5f9;
  --logo-gradient-to: #94a3b8;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT GRID
   ============================================================ */
.dashboard {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-columns: 1fr minmax(200px, 18%);
  grid-template-areas:
    "header   header"
    "main     sidebar";
  height: 100vh;
  gap: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--logo-gradient-from), var(--logo-gradient-to));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border-accent);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-online);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-time {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  display: none; /* hidden on desktop; shown on tablet/mobile via media query */
}
/* Show header clock only when sidebar (with large clock) is hidden */
@media (max-width: 1279px) {
  .header-time { display: inline; }
}
/* Also hide the divider before the clock on desktop */
.header-time-divider { display: none; }
@media (max-width: 1279px) {
  .header-time-divider { display: block; }
}

.last-updated {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.theme-icon {
  width: 16px;
  height: 16px;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main {
  grid-area: main;
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Carousel ─────────────────────────────────────────────── */
.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative; /* anchor for timer bar */
}
.carousel-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.carousel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.carousel-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 2px;
}
.carousel-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.carousel-next-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.carousel-next-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* Pause/play button — mirrors .carousel-next-btn sizing */
.carousel-pause-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-accent);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.carousel-pause-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

/* Countdown timer bar — thin line at bottom of carousel header */
.carousel-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}
.carousel-timer-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: var(--accent-blue);
  opacity: 0.75;
}

.carousel-slide {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 10px;
}
/* HTMX swap targets inside slides must propagate the flex height chain */
.carousel-slide > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
/* Sync App slides: let grid fill and allow scroll.
   display:grid overrides the .carousel-slide > div { display:flex } rule
   which has higher specificity (0,1,1) than the standalone grid rules (0,1,0). */
.carousel-slide .store-grid,
.carousel-slide .network-grid,
.carousel-slide .deploy-grid {
  display: grid;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Summary Cards */
.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  flex-shrink: 0;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s;
}

.summary-card:hover {
  border-color: var(--border-accent);
}

.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
}

.badge-up { background: rgba(34,197,94,0.15); color: var(--status-online); }
.badge-down { background: rgba(239,68,68,0.15); color: var(--priority-critical); }
.badge-neutral { background: rgba(100,116,139,0.15); color: var(--text-secondary); }

.summary-card-value {
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.summary-card-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

.value-blue { color: var(--accent-blue); }
.value-red { color: var(--priority-critical); }
.value-orange { color: var(--priority-high); }
.value-green { color: var(--metric-green); }
.value-yellow { color: var(--priority-medium); }

/* Clickable Cards */
.card-clickable { cursor: pointer; }
.card-clickable:active { transform: scale(0.98); }

/* Card Detail Drawer */
.card-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 4px;
}
.card-drawer-open {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
}
.card-detail-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 10px;
  padding: 8px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}
.card-detail-row:last-child { border-bottom: none; }
.card-detail-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-detail-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  flex-shrink: 0;
}
.card-detail-key:hover { text-decoration: underline; }
.card-detail-summary {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-detail-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.card-detail-assignee, .card-detail-resolver {
  font-size: 11px;
  color: var(--text-secondary);
}
.card-detail-unassigned {
  font-size: 11px;
  color: var(--priority-high);
  font-style: italic;
}
.card-detail-age {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.card-detail-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
}
.card-detail-more {
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
}

/* Content Split */
.content-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.panel-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  font-weight: 600;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* Hide scrollbar but allow scrolling */
.panel-body::-webkit-scrollbar { width: 3px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 10px; }

/* Ticket List */
.ticket-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 12px;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

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

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

.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-critical { background: var(--priority-critical); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.dot-high { background: var(--priority-high); box-shadow: 0 0 6px rgba(249,115,22,0.3); }
.dot-medium { background: var(--priority-medium); }
.dot-low { background: var(--priority-low); }

.ticket-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ticket-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticket-summary {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.ticket-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.ticket-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.ticket-age {
  font-size: 11px;
  color: var(--text-tertiary);
}

.age-warning { color: var(--priority-high); }
.age-critical { color: var(--priority-critical); }

/* Issue Type Badges */
.type-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.type-bug { background: rgba(239,68,68,0.15); color: var(--badge-red); }
.type-task { background: rgba(59,130,246,0.15); color: var(--badge-blue); }
.type-request { background: rgba(139,92,246,0.15); color: var(--badge-purple); }
.type-epic { background: rgba(34,197,94,0.15); color: var(--badge-green); }

/* Label Chips */
.ticket-labels {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.label-chip {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(100,116,139,0.12);
  color: var(--text-tertiary);
  white-space: nowrap;
}
.label-more { font-weight: 600; }

/* Stale Badge */
.stale-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(234,179,8,0.15);
  color: var(--badge-yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sla-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sla-ok { background: rgba(34,197,94,0.12); color: var(--badge-green); }
.sla-warn { background: rgba(234,179,8,0.12); color: var(--badge-yellow); }
.sla-breach { background: rgba(239,68,68,0.15); color: var(--badge-red); }

/* Agent Workload */
.agent-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

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

.agent-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.agent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.agent-status {
  font-size: 11px;
  color: var(--text-tertiary);
}

.agent-bar-container {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.agent-bar {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s ease;
}

.bar-low { background: linear-gradient(90deg, #22c55e, #4ade80); }
.bar-medium { background: linear-gradient(90deg, #eab308, #facc15); }
.bar-high { background: linear-gradient(90deg, #f97316, #fb923c); }
.bar-critical { background: linear-gradient(90deg, #ef4444, #f87171); }

.agent-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BROADCAST SIDEBAR
   ============================================================ */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar Clock */
.sidebar-clock {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.sidebar-clock-time {
  font-size: clamp(28px, 2.5vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sidebar-clock-ampm {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sidebar-clock-date {
  width: 100%;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Weather Card */
.weather-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.weather-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.weather-icon {
  font-size: 28px;
  line-height: 1;
}
.weather-temp {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.weather-loading {
  color: var(--text-tertiary);
}
.weather-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.weather-condition {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.weather-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.weather-location {
  font-size: 10px;
  color: var(--text-tertiary);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  font-weight: 600;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-body::-webkit-scrollbar { width: 3px; }
.sidebar-body::-webkit-scrollbar-track { background: transparent; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 10px; }

.broadcast-card {
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid;
  position: relative;
}

.broadcast-critical {
  background: var(--broadcast-critical-bg);
  border-color: var(--broadcast-critical);
  border-top: 1px solid var(--broadcast-critical-border);
  border-right: 1px solid var(--broadcast-critical-border);
  border-bottom: 1px solid var(--broadcast-critical-border);
}

.broadcast-high {
  background: var(--broadcast-high-bg);
  border-color: var(--broadcast-high);
  border-top: 1px solid var(--broadcast-high-border);
  border-right: 1px solid var(--broadcast-high-border);
  border-bottom: 1px solid var(--broadcast-high-border);
}

.broadcast-medium {
  background: var(--broadcast-medium-bg);
  border-color: var(--broadcast-medium);
  border-top: 1px solid var(--broadcast-medium-border);
  border-right: 1px solid var(--broadcast-medium-border);
  border-bottom: 1px solid var(--broadcast-medium-border);
}

.broadcast-info {
  background: var(--broadcast-info-bg);
  border-color: var(--broadcast-info);
  border-top: 1px solid var(--broadcast-info-border);
  border-right: 1px solid var(--broadcast-info-border);
  border-bottom: 1px solid var(--broadcast-info-border);
}

.broadcast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.broadcast-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
}

.tag-critical { background: rgba(239,68,68,0.2); color: var(--badge-red); }
.tag-high { background: rgba(249,115,22,0.2); color: var(--badge-orange); }
.tag-medium { background: rgba(234,179,8,0.15); color: var(--badge-yellow); }
.tag-info { background: rgba(59,130,246,0.15); color: var(--badge-blue); }

.broadcast-pin {
  font-size: 11px;
  color: var(--text-tertiary);
}

.broadcast-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.broadcast-body {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.broadcast-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-tertiary);
}

.broadcast-category {
  padding: 1px 6px;
  background: rgba(100,116,139,0.1);
  border-radius: 3px;
}

/* Broadcast Marquee (narrow viewports) */
.broadcast-marquee {
  grid-area: marquee;
  display: none; /* shown via media query on tablet/mobile */
  overflow: hidden;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 32px;
  align-items: center;
  white-space: nowrap;
  position: relative;
}
.broadcast-marquee::before,
.broadcast-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 1;
  pointer-events: none;
}
.broadcast-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-secondary), transparent);
}
.broadcast-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-secondary), transparent);
}
.broadcast-marquee-inner {
  display: inline-flex;
  gap: 0;
  animation: marqueeScroll 30s linear infinite;
  padding-left: 100%;
}
.marquee-item {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}
.marquee-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.marquee-critical { color: var(--priority-critical); }
.marquee-critical .marquee-tag { background: rgba(239,68,68,0.2); color: var(--badge-red); }
.marquee-high { color: var(--priority-high); }
.marquee-high .marquee-tag { background: rgba(249,115,22,0.2); color: var(--badge-orange); }
.marquee-medium { color: var(--text-secondary); }
.marquee-medium .marquee-tag { background: rgba(234,179,8,0.15); color: var(--badge-yellow); }
.marquee-info { color: var(--text-tertiary); }
.marquee-info .marquee-tag { background: rgba(59,130,246,0.15); color: var(--badge-blue); }

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* TV Broadcast Mode (visible on wide viewports) */
.broadcast-tv-mode { display: none; }
.broadcast-desktop-mode { display: flex; }

@media (min-width: 1800px) {
  .broadcast-tv-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
  }
  .broadcast-desktop-mode { display: none; }
}

.broadcast-card-tv {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid;
  min-height: 0;
  flex: 1;
}
.broadcast-card-tv-critical {
  background: var(--broadcast-critical-bg);
  border-color: var(--broadcast-critical);
  border-top: 1px solid var(--broadcast-critical-border);
  border-right: 1px solid var(--broadcast-critical-border);
  border-bottom: 1px solid var(--broadcast-critical-border);
  animation: criticalPulse 3s ease-in-out infinite;
}
.broadcast-card-tv-high {
  background: var(--broadcast-high-bg);
  border-color: var(--broadcast-high);
  border-top: 1px solid var(--broadcast-high-border);
  border-right: 1px solid var(--broadcast-high-border);
  border-bottom: 1px solid var(--broadcast-high-border);
}
.broadcast-card-tv-medium {
  background: var(--broadcast-medium-bg);
  border-color: var(--broadcast-medium);
  border-top: 1px solid var(--broadcast-medium-border);
  border-right: 1px solid var(--broadcast-medium-border);
  border-bottom: 1px solid var(--broadcast-medium-border);
}
.broadcast-card-tv-info {
  background: var(--broadcast-info-bg);
  border-color: var(--broadcast-info);
  border-top: 1px solid var(--broadcast-info-border);
  border-right: 1px solid var(--broadcast-info-border);
  border-bottom: 1px solid var(--broadcast-info-border);
}

@keyframes criticalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.3); }
}

.broadcast-header-tv {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.broadcast-title-tv {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.broadcast-body-tv {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.broadcast-footer-tv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-tertiary);
}
.broadcast-pin-tv {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Broadcast cycling transitions */
.broadcast-fade-in {
  animation: fadeIn 0.4s ease forwards;
}
.broadcast-fade-out {
  animation: fadeOut 0.3s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Broadcast progress dots */
.broadcast-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.broadcast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-accent);
  transition: all 0.3s;
}
.broadcast-dot-active {
  background: var(--accent-blue);
  width: 18px;
  border-radius: 3px;
}

/* Desktop click-to-expand */
.broadcast-body-full {
  -webkit-line-clamp: unset !important;
  display: block !important;
}

/* ============================================================
   BOTTOM ROTATING PANEL
   ============================================================ */
.bottom-panel {
  grid-area: bottom;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.bottom-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.bottom-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rotation-dots {
  display: flex;
  gap: 6px;
}

.rotation-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-accent);
  transition: all 0.3s;
}

.rotation-dot.active {
  background: var(--accent-blue);
  width: 18px;
  border-radius: 3px;
}

.bottom-panel-content {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.panel-slide {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 10px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.panel-slide.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* Store Status Grid */
.store-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.store-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s;
}

.store-card.online { border-left: 3px solid var(--status-online); }
.store-card.warning { border-left: 3px solid var(--status-warning); }
.store-card.offline { border-left: 3px solid var(--status-offline); }

.store-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.store-status-dot.online { background: var(--status-online); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.store-status-dot.warning { background: var(--status-warning); box-shadow: 0 0 6px rgba(234,179,8,0.4); }
.store-status-dot.offline { background: var(--status-offline); box-shadow: 0 0 6px rgba(239,68,68,0.4); }

.store-detail {
  font-size: 10px;
  color: var(--text-tertiary);
  display: flex;
  justify-content: space-between;
}

/* Network Health */
.network-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.network-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.network-site {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.network-nodes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.node-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
}

.node-healthy { background: rgba(34,197,94,0.12); color: var(--badge-green); }
.node-degraded { background: rgba(249,115,22,0.12); color: var(--badge-orange); }
.node-down { background: rgba(239,68,68,0.15); color: var(--badge-red); }

/* ArgoCD Deployments */
.deploy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 4px 2px;
  width: 100%;
  align-content: start;
  align-items: stretch;
}

.deploy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--deploy-health-color, var(--border));
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.3s;
  height: 100%;
  box-sizing: border-box;
}

.deploy-card.healthy   { --deploy-health-color: var(--status-green, #4ade80); }
.deploy-card.degraded  { --deploy-health-color: var(--status-red, #f87171); animation: pulse-border 1.5s ease-in-out infinite; }
.deploy-card.progressing { --deploy-health-color: var(--status-yellow, #facc15); animation: pulse-border 1.5s ease-in-out infinite; }
.deploy-card.suspended { --deploy-health-color: #94a3b8; }
.deploy-card.unknown   { --deploy-health-color: var(--border); }

.deploy-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.deploy-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.deploy-health-dot.healthy    { background: #4ade80; }
.deploy-health-dot.degraded   { background: #f87171; animation: pulse-dot 1.5s ease-in-out infinite; }
.deploy-health-dot.progressing { background: #facc15; animation: pulse-dot 1.5s ease-in-out infinite; }
.deploy-health-dot.suspended  { background: #94a3b8; }
.deploy-health-dot.unknown    { background: #64748b; }

.deploy-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deploy-card-project {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deploy-card-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.deploy-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.deploy-version {
  font-size: 10px;
  font-family: monospace;
  color: var(--text-tertiary);
}

.deploy-card-deployed {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Resource list within a deploy card */
.deploy-resources {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.deploy-resource-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-secondary);
  min-width: 0;
}
.deploy-resource-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deploy-resource-health {
  font-size: 10px;
  flex-shrink: 0;
}
.deploy-resource-health.healthy    { color: #4ade80; }
.deploy-resource-health.degraded   { color: #f87171; }
.deploy-resource-health.progressing { color: #facc15; }
.deploy-resource-health.suspended  { color: #94a3b8; }
.deploy-resource-health.unknown    { color: #64748b; }

/* Container image tags within a deploy card */
.deploy-images {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.deploy-image-tag {
  font-family: monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Health badges */
.deploy-health-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.deploy-health-badge.healthy    { background: rgba(34,197,94,0.12); color: #4ade80; }
.deploy-health-badge.degraded   { background: rgba(239,68,68,0.12); color: #f87171; animation: pulse-bg 1.5s ease-in-out infinite; }
.deploy-health-badge.progressing { background: rgba(234,179,8,0.12); color: #facc15; }
.deploy-health-badge.suspended  { background: rgba(148,163,184,0.12); color: #94a3b8; }
.deploy-health-badge.unknown    { background: rgba(100,116,139,0.12); color: #64748b; }

/* Sync badges */
.deploy-sync-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.deploy-sync-badge.synced      { background: rgba(34,197,94,0.12); color: #4ade80; }
.deploy-sync-badge.outofsync   { background: rgba(234,179,8,0.12); color: #facc15; }
.deploy-sync-badge.progressing { background: rgba(99,102,241,0.12); color: #818cf8; }
.deploy-sync-badge.unknown     { background: rgba(100,116,139,0.12); color: #64748b; }

/* Syncing shimmer pill */
.deploy-syncing-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.25) 50%, rgba(99,102,241,0.15) 100%);
  background-size: 200% 100%;
  color: #818cf8;
  animation: shimmer 1.4s linear infinite;
  flex-shrink: 0;
}

/* ── Deploy card tap hint ── */
.deploy-card-hint {
  font-size: 9px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 2px;
  opacity: 0.6;
}
@media (min-width: 1900px) {
  .deploy-card-hint { display: none; }
}

/* ============================================================
   DEPLOY MODAL
   ============================================================ */
.deploy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.deploy-modal-dialog {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 20px 24px;
  width: min(600px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: flip-grow 0.25s ease-out forwards;
}
@keyframes flip-grow {
  from { opacity: 0; transform: perspective(600px) rotateY(-12deg) scale(0.88); }
  to   { opacity: 1; transform: perspective(600px) rotateY(0deg)   scale(1);    }
}
.deploy-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.deploy-detail-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.deploy-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-secondary);
}
.deploy-modal-spinner {
  color: var(--accent-blue);
  opacity: 0.8;
}

/* ── Deploy detail content ── */
.deploy-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 32px; /* clear close button */
  margin-bottom: 6px;
}
.deploy-detail-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deploy-detail-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.deploy-detail-sep { margin: 0 3px; opacity: 0.5; }
.deploy-detail-version {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-secondary);
}
.deploy-detail-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.deploy-detail-kind {
  font-size: 10px;
  color: var(--text-tertiary);
}
.deploy-detail-replicas {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
}
.deploy-detail-degraded-count {
  color: #f87171;
  font-size: 11px;
}
.deploy-detail-operation {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  word-break: break-word;
}

/* Replica groups table */
.replica-groups {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}
.replica-groups th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.replica-groups td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.replica-groups tr:last-child td { border-bottom: none; }

@keyframes pulse-border {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes pulse-bg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: slideIn 0.3s ease forwards;
}

/* Stagger animation for cards */
.summary-card:nth-child(1) { animation-delay: 0ms; }
.summary-card:nth-child(2) { animation-delay: 60ms; }
.summary-card:nth-child(3) { animation-delay: 120ms; }
.summary-card:nth-child(4) { animation-delay: 180ms; }
.summary-card:nth-child(5) { animation-delay: 240ms; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover, var(--bg-tertiary)) 50%, var(--bg-card) 75%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 12px;
  border-radius: 4px;
}

.skeleton-text-lg {
  height: 20px;
  border-radius: 4px;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-chart {
  border-radius: var(--radius);
  height: 100%;
  min-height: 120px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.skeleton-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mono { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Desktop wide (1280–1919px): sidebar narrows */
@media (max-width: 1919px) {
  :root {
    --sidebar-width: 260px;
  }
  .dashboard {
    grid-template-columns: 1fr minmax(180px, 15%);
  }
  .broadcast-title { font-size: 12px; }
  .broadcast-body { font-size: 11px; }
}

/* Desktop (1280–1799px): sidebar visible but viewport may be shorter than TV.
   Allow vertical scrolling so bottom widgets are reachable. */
@media (min-width: 1280px) and (max-width: 1799px) {
  body { overflow-y: auto; height: auto; }
  .main { overflow-y: auto; }
  .carousel-slide { overflow-y: auto; }
}

/* Tablet/laptop (768–1279px): single column, sidebar hidden, marquee visible */
@media (max-width: 1279px) {
  body {
    overflow: auto;
    height: auto;
  }
  .dashboard {
    grid-template-rows: var(--header-height) auto auto;
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "marquee"
      "main";
    height: auto;
    min-height: 100vh;
  }
  .main { overflow: visible; min-height: 60vh; }
  .sidebar { display: none; }
  .broadcast-marquee { display: flex; }
  .content-split {
    grid-template-columns: 1fr;
  }
}

/* Mobile (<768px): compact layout */
@media (max-width: 767px) {
  .header { padding: 0 12px; }
  .header-divider { display: none; }
  .last-updated { display: none; }
  .main { padding: 10px; gap: 10px; }
  .summary-row { gap: 8px; }
  .summary-card { padding: 10px 12px; }
  .summary-card-label { font-size: 10px; }
  .summary-card-value { font-size: 20px; }
  .summary-card-sub { display: none; }
  .panel-header { padding: 10px 12px; }
  .ticket-row { padding: 8px 12px; gap: 8px; }
  .ticket-summary { font-size: 12px; }
  .ticket-assignee { display: none; }
  .ticket-labels { display: none; }
  .sidebar-body { flex-direction: column; }
  .broadcast-card { flex: 1 1 auto; }
  .bottom-panel { padding: 10px 12px; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .network-grid { grid-template-columns: 1fr; }
  .deploy-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ============================================================
   JIRA OVERVIEW SLIDE
   ============================================================ */

.jira-overview-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* KPI card color modifiers */
.summary-card.kpi-blue  { border-left: 3px solid #60a5fa; }
.summary-card.kpi-slate { border-left: 3px solid #94a3b8; }
.summary-card.kpi-red   { border-left: 3px solid #f87171; }
.summary-card.kpi-orange { border-left: 3px solid #fb923c; }
.summary-card.kpi-green { border-left: 3px solid #4ade80; }
.summary-card.kpi-teal  { border-left: 3px solid #2dd4bf; }

.summary-card.kpi-blue  .summary-card-value { color: #60a5fa; }
.summary-card.kpi-slate .summary-card-value { color: #94a3b8; }
.summary-card.kpi-red   .summary-card-value { color: #f87171; }
.summary-card.kpi-orange .summary-card-value { color: #fb923c; }
.summary-card.kpi-green .summary-card-value { color: #4ade80; }
.summary-card.kpi-teal  .summary-card-value { color: #2dd4bf; }

/* Chart row: 60% trend line + 40% doughnut */
.jira-chart-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-rows: 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.jira-chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

/* Chart.js requires a position:relative parent with resolved dimensions.
   The canvas is absolutely positioned inside so Chart.js reads the wrapper's
   clientWidth/clientHeight rather than guessing from an unconstrained flex item. */
.chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 140px; /* ensure skeleton shimmer is visible before Chart.js renders */
  overflow: hidden;
}

.chart-canvas-wrap canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.chart-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* Age-of-issues strip */
.jira-age-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.jira-age-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  text-align: center;
}

.jira-age-tile-count {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.1;
}

.jira-age-tile-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Age tile color classes */
.age-fresh { color: #4ade80; }
.age-warn1 { color: #facc15; }
.age-warn2 { color: #f97316; }
.age-warn3 { color: #f87171; }
.age-stale { color: #dc2626; }

/* Jira KPI row: 6 cards across */
.jira-kpi-row {
  grid-template-columns: repeat(6, 1fr);
}

/* ── Store Focus Breakdown ─────────────────────────────── */
.store-focus-widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.store-focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 0 2px;
}

.store-focus-total {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  color: #38bdf8;
}

.store-focus-total-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.store-focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.store-focus-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}
