/* ============================================================================
   CYWARENESS ANALYTICS DASHBOARD — Design System
   Production SaaS tool — complete component library
   ============================================================================
   Table of Contents:
   1.  Design Tokens (CSS Custom Properties)
   2.  Reset & Base
   3.  Scrollbar
   4.  Layout
   5.  Navigation
   6.  Sections
   7.  KPI Strip
   8.  Alert Zone
   9.  Generic Cards
   10. Charts
   11. Coverage Heatmap
   12. Insight Cards
   13. Data Table
   14. Row Detail (Expandable)
   15. Drill-Down Panel
   16. Filter Bar
   17. Badges (Tier, Category, Difficulty, Status, Region, Event)
   18. Monthly Timeline
   19. Pagination
   20. Recommendation Cards
   21. Footer
   22. Animations & Keyframes
   23. Skeleton Loading
   24. Utility Classes
   25. Responsive Breakpoints
   ============================================================================ */


/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */

:root {
  /* Backgrounds */
  --bg: #F8FAFC;
  --bg-subtle: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-float: #F1F5F9;

  /* Surfaces */
  --surface-1: rgba(0,0,0,0.02);
  --surface-2: rgba(0,0,0,0.03);
  --surface-3: rgba(0,0,0,0.05);
  --surface-hover: rgba(0,0,0,0.04);
  --surface-border: #E2E8F0;
  --surface-border-hover: #CBD5E1;

  /* Primary — Cyan */
  --cyan: #0891B2;
  --cyan-bright: #06B6D4;
  --cyan-dim: rgba(8,145,178,0.08);
  --cyan-glow: rgba(8,145,178,0.15);

  /* Secondary — Violet */
  --violet: #7C3AED;
  --violet-bright: #8B5CF6;
  --violet-dim: rgba(124,58,237,0.08);
  --violet-glow: rgba(124,58,237,0.15);

  /* Typography */
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  /* Semantic — Status */
  --pass: #059669;
  --pass-dim: rgba(5,150,105,0.08);
  --fail: #DC2626;
  --fail-dim: rgba(220,38,38,0.06);
  --warn: #D97706;
  --warn-dim: rgba(217,119,6,0.07);
  --skip: #94A3B8;
  --skip-dim: rgba(148,163,184,0.10);

  /* Extended palette */
  --gold: #D97706;
  --gold-dim: rgba(217,119,6,0.08);

  /* Radii */
  --radius-sm: 3px;
  --radius: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;

  /* Sidebar */
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 60px;

  /* Shadows */
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-cyan: 0 2px 12px var(--cyan-glow);

  /* Motion */
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}


/* ============================================================================
   2. RESET & BASE
   ============================================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--cyan-bright);
}


/* ============================================================================
   3. SCROLLBAR
   ============================================================================ */

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

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

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.20);
}


/* ============================================================================
   4. LAYOUT
   ============================================================================ */

.dash-app {
  max-width: 1320px;
  margin: 0 auto;
  margin-left: var(--sidebar-width);
  padding: 0 28px;
  position: relative;
  z-index: 1;
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

body.sidebar-collapsed .dash-app {
  margin-left: var(--sidebar-collapsed-width);
}


/* ============================================================================
   5. SIDEBAR NAVIGATION
   ============================================================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #0F172A;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

.sidebar[data-collapsed="true"] {
  width: var(--sidebar-collapsed-width);
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 24px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo .logo-dot {
  width: 4px;
  height: 20px;
  background: var(--cyan);
  border-radius: 2px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: opacity 0.25s ease;
}

.sidebar-logo-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #E2E8F0;
}

.sidebar-logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #475569;
}

.sidebar[data-collapsed="true"] .sidebar-logo-text {
  opacity: 0;
  pointer-events: none;
}

/* Nav Items */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #94A3B8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-12px);
  animation: sidebarSlideIn 0.35s ease forwards;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: #E2E8F0;
}

.sidebar-item.active {
  background: rgba(8,145,178,0.12);
  color: var(--cyan-bright);
}

.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cyan-bright);
}

.sidebar-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.sidebar-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.sidebar-label {
  transition: opacity 0.25s ease;
}

.sidebar[data-collapsed="true"] .sidebar-label {
  opacity: 0;
  pointer-events: none;
}

/* Toggle button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  background: transparent;
  color: #64748B;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: #E2E8F0;
}

.sidebar-toggle svg {
  transition: transform 0.3s ease;
}

.sidebar[data-collapsed="true"] .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

/* Mobile hamburger trigger */
.sidebar-mobile-trigger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 180;
  width: 40px;
  height: 40px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

/* Slide-in animation */
@keyframes sidebarSlideIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


/* ============================================================================
   6. SECTIONS
   ============================================================================ */

.dash-section {
  margin-bottom: 20px;
}

.dash-section-header {
  margin-bottom: 10px;
}

.dash-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}


/* ============================================================================
   7. KPI HERO
   ============================================================================ */

.kpi-hero {
  padding: 8px 0 4px;
}

.kpi-hero-value {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.kpi-hero-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.kpi-hero-supporting {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.kpi-hero-supporting a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.kpi-hero-supporting a:hover {
  color: var(--text);
  text-decoration: underline;
}


/* ============================================================================
   8. STATUS BANNER
   ============================================================================ */

.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  margin-bottom: 20px;
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
}

.status-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

.status-dot-warn {
  background: var(--warn);
  animation: dotPulse 2s ease-in-out infinite;
}

.status-dot-critical {
  background: var(--fail);
  animation: dotPulse 1s ease-in-out infinite;
}

.status-count {
  font-weight: 700;
  color: var(--text);
}

.status-label {
  color: var(--text-muted);
}

.status-banner-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 3px;
  background: var(--bg-float);
  color: var(--text-secondary);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.status-pill:hover {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.status-pill-warn {
  background: var(--warn-dim);
  color: var(--warn);
}

.status-pill-warn:hover {
  background: rgba(217,119,6,0.14);
}

.status-pill-critical {
  background: var(--fail-dim);
  color: var(--fail);
}

.status-pill-critical:hover {
  background: rgba(220,38,38,0.12);
}

.status-pill-days {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}

.status-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition);
}

.status-more:hover {
  color: var(--cyan);
}


/* ============================================================================
   9. GENERIC CARDS
   ============================================================================ */

.card {
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 20px 24px 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 16px 24px;
}

.card-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-1);
}


/* ============================================================================
   10. CHARTS
   ============================================================================ */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  border-top: 1px solid var(--surface-border);
  padding-top: 16px;
}

.chart-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chart-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
}

.chart-wrap-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: default;
}

.chart-legend-item:hover {
  background: var(--bg-float);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-label {
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}

.chart-legend-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.chart-legend-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* SVG chart center text (for donut charts) */
.chart-center-text {
  text-anchor: middle;
  dominant-baseline: central;
}

.chart-center-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  fill: var(--text);
}

.chart-center-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  fill: var(--text-muted);
}


/* ============================================================================
   11. COVERAGE HEATMAP
   ============================================================================ */

.heatmap-grid {
  display: grid;
  gap: 2px;
}

.heatmap-cell {
  padding: 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  user-select: none;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
  z-index: 1;
  position: relative;
}

.heatmap-header {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  text-align: center;
}

.heatmap-row-label {
  position: sticky;
  left: 0;
  background: var(--bg-subtle);
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px 8px 0;
  white-space: nowrap;
}

/* Heatmap color levels: 0 = worst, 4 = best */
.heat-0 { background: #FEE2E2; color: #991B1B; }
.heat-1 { background: #FEF3C7; color: #92400E; }
.heat-2 { background: #FEF9C3; color: #854D0E; }
.heat-3 { background: #D1FAE5; color: #065F46; }
.heat-4 { background: #A7F3D0; color: #047857; }


/* ============================================================================
   12. INSIGHT CARDS
   ============================================================================ */

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.insight-card {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 20px 23px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.insight-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--surface-border-hover);
}

.insight-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--insight-color, var(--cyan));
}

.insight-severity {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* Severity variants — class on .insight-card */
.insight-card.critical { --insight-color: var(--fail); }
.insight-card.critical .insight-severity { background: var(--fail-dim); color: var(--fail); }

.insight-card.high { --insight-color: var(--warn); }
.insight-card.high .insight-severity { background: var(--warn-dim); color: var(--warn); }

.insight-card.medium { --insight-color: var(--cyan); }
.insight-card.medium .insight-severity { background: var(--cyan-dim); color: var(--cyan); }

.insight-card.low { --insight-color: var(--pass); }
.insight-card.low .insight-severity { background: var(--pass-dim); color: var(--pass); }

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.insight-body {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.insight-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  margin-top: 10px;
  transition: color var(--transition), gap var(--transition);
}

.insight-link:hover {
  color: var(--cyan-bright);
  gap: 6px;
}


/* ============================================================================
   13. DATA TABLE
   ============================================================================ */

.table-wrap {
  overflow-x: auto;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.catalog-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-float);
  z-index: 10;
}

.catalog-table th {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--surface-border);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}

.catalog-table th.sortable {
  cursor: pointer;
  transition: color var(--transition);
}

.catalog-table th.sortable:hover {
  color: var(--text-secondary);
}

.catalog-table th.sort-active {
  color: var(--cyan);
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  transition: opacity var(--transition);
  font-size: 10px;
}

.catalog-table th.sort-active .sort-icon,
.catalog-table th.sortable:hover .sort-icon {
  opacity: 1;
}

.catalog-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
  color: var(--text);
}

.catalog-table tbody tr {
  transition: background var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}

.catalog-table tbody tr:hover {
  background: var(--bg-float);
  border-left: 3px solid var(--cyan);
}

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

.catalog-table tbody tr.expanded {
  background: var(--cyan-dim);
  border-left: 3px solid var(--cyan);
}

/* Table cell variants */
.td-title {
  font-weight: 600;
  color: var(--text);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.td-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.td-brand {
  font-weight: 500;
  color: var(--text-secondary);
}

.td-clickable {
  color: var(--cyan);
  cursor: pointer;
  transition: color var(--transition);
}

.td-clickable:hover {
  color: var(--cyan-bright);
  text-decoration: underline;
}


/* ============================================================================
   14. ROW DETAIL (Expandable)
   ============================================================================ */

.row-detail-tr {
  background: var(--bg-float);
}

.row-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
  opacity: 0;
}

.row-detail.open {
  max-height: 800px;
  opacity: 1;
  transition: max-height 0.6s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}

.row-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px;
}

.row-detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row-detail-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
}

.row-detail-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.row-detail-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.row-detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

/* Score bars inside row detail */
.score-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 100px;
  flex-shrink: 0;
}

.score-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.score-bar-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  min-width: 32px;
  text-align: right;
}

/* Strength/weakness lists */
.strength-list,
.weakness-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strength-list li,
.weakness-list li {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ============================================================================
   15. DRILL-DOWN PANEL
   ============================================================================ */

.drill-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideDown 0.35s ease-out forwards;
  margin-bottom: 20px;
}

.drill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface-1);
}

.drill-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.drill-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.drill-close:hover {
  color: var(--text);
  background: var(--bg-float);
  border-color: var(--surface-border-hover);
}

.drill-body {
  padding: 24px;
}

.drill-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.drill-kpi {
  background: var(--bg-float);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: background var(--transition);
}

.drill-kpi:hover {
  background: var(--surface-2);
}

.drill-kpi-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.drill-kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}

.drill-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

.drill-table th {
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--surface-border);
  text-align: left;
}

.drill-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text);
}

.drill-table tbody tr {
  transition: background var(--transition);
}

.drill-table tbody tr:hover {
  background: var(--bg-float);
}

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

.drill-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.drill-breadcrumb a {
  color: var(--cyan);
  font-weight: 500;
  transition: color var(--transition);
}

.drill-breadcrumb a:hover {
  color: var(--cyan-bright);
}

.drill-breadcrumb span {
  color: var(--text-muted);
}


/* ============================================================================
   16. FILTER BAR
   ============================================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.filter-select {
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-subtle);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.filter-search {
  flex: 1;
  max-width: 280px;
  padding: 7px 12px 7px 36px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-subtle);
  box-shadow: var(--shadow);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-search:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.filter-search::placeholder {
  color: var(--text-muted);
}

.filter-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 10px;
  border-radius: 4px;
  background: var(--cyan-dim);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition);
}

.filter-chip:hover {
  background: var(--cyan-glow);
}

.filter-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  color: var(--cyan);
  cursor: pointer;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  transition: background var(--transition);
  padding: 0;
}

.filter-chip-remove:hover {
  background: var(--cyan-glow);
}

.filter-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.filter-clear:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.filter-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}


/* ============================================================================
   17. BADGES
   ============================================================================ */

/* Base badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.4;
  font-family: var(--font-mono);
}

/* Tier badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.tier-S {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #92400E;
  box-shadow: 0 1px 4px rgba(217,119,6,0.12);
}

.tier-A {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.tier-B {
  background: var(--pass-dim);
  color: var(--pass);
}

.tier-C {
  background: var(--warn-dim);
  color: var(--warn);
}

.tier-D {
  background: var(--fail-dim);
  color: var(--fail);
}

/* Category badges */
.cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.cat-phishing {
  background: var(--violet-dim);
  color: var(--violet);
}

.cat-smishing {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.cat-whatsapp {
  background: #DCFCE7;
  color: #16A34A;
}

/* Difficulty badges */
.diff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.diff-high {
  background: var(--fail-dim);
  color: var(--fail);
}

.diff-medium {
  background: var(--warn-dim);
  color: var(--warn);
}

.diff-low {
  background: var(--pass-dim);
  color: var(--pass);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.status-active {
  background: var(--pass-dim);
  color: var(--pass);
}

.status-inactive {
  background: var(--skip-dim);
  color: var(--skip);
}

/* Region badge */
.region-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--violet-dim);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Event badge */
.event-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}


/* ============================================================================
   18. MONTHLY TIMELINE
   ============================================================================ */

.timeline-container {
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.timeline-bar {
  display: flex;
  gap: 4px;
  height: 160px;
  align-items: flex-end;
  padding: 20px;
}

.timeline-month {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.timeline-bar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: height 0.6s cubic-bezier(0.4,0,0.2,1), background var(--transition);
  min-height: 4px;
  background: #334155;
  position: relative;
}

.timeline-bar-fill:hover {
  background: #475569;
}

.timeline-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 10;
}

.timeline-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
}

.timeline-month:hover .timeline-tooltip {
  opacity: 1;
}

.timeline-month-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transition: opacity var(--transition);
}

.timeline-month:hover .timeline-count {
  opacity: 1;
}

.timeline-today {
  width: 8px;
  height: 8px;
  background: #F59E0B;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  animation: dotPulse 2s ease-in-out infinite;
  position: absolute;
  bottom: -14px;
}


/* ============================================================================
   19. PAGINATION
   ============================================================================ */

.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  align-items: center;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  padding: 0 8px;
}

.page-btn:hover {
  background: var(--bg-float);
  border-color: var(--surface-border-hover);
  color: var(--text);
}

.page-btn.active {
  background: var(--cyan);
  color: #FFFFFF;
  border-color: var(--cyan);
  box-shadow: var(--shadow-cyan);
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.page-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 2px;
  user-select: none;
}


/* ============================================================================
   20. RECOMMENDATION CARDS
   ============================================================================ */

.rec-card {
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rec-card:hover {
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-lg);
}

.rec-priority {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.rec-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.rec-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.rec-rationale {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ============================================================================
   21. FOOTER
   ============================================================================ */

.dash-footer {
  text-align: center;
  padding: 28px;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  border-top: 1px solid var(--surface-border);
  margin-top: 16px;
}

body.sidebar-collapsed .dash-footer {
  margin-left: var(--sidebar-collapsed-width);
}

.dash-footer a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}

.dash-footer a:hover {
  color: var(--cyan-bright);
}


/* ============================================================================
   22. ANIMATIONS & KEYFRAMES
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes barGrow {
  from {
    width: 0;
  }
  to {
    width: var(--bar-width, 100%);
  }
}

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

.animate-in {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.30s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.40s; }


/* ============================================================================
   23. SKELETON LOADING
   ============================================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-1) 25%,
    var(--surface-2) 50%,
    var(--surface-1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton * {
  visibility: hidden;
}


/* ============================================================================
   24. UTILITY CLASSES
   ============================================================================ */

/* Text Colors */
.text-cyan   { color: var(--cyan); }
.text-violet { color: var(--violet); }
.text-pass   { color: var(--pass); }
.text-fail   { color: var(--fail); }
.text-warn   { color: var(--warn); }
.text-muted  { color: var(--text-muted); }

/* Font */
.font-mono { font-family: var(--font-mono); }

/* Flexbox */
.flex            { display: flex; }
.flex-col        { display: flex; flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }

/* Gaps */
.gap-sm { gap: 4px; }
.gap-md { gap: 8px; }
.gap-lg { gap: 16px; }

/* Margins */
.mt-sm { margin-top: 4px; }
.mt-md { margin-top: 8px; }
.mt-lg { margin-top: 16px; }
.mb-sm { margin-bottom: 4px; }
.mb-md { margin-bottom: 8px; }
.mb-lg { margin-bottom: 16px; }

/* Visibility */
.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
}


/* ============================================================================
   25. RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Tablet — 1024px */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .drill-charts {
    grid-template-columns: 1fr;
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .row-detail-grid {
    grid-template-columns: 1fr;
  }

  .kpi-strip {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }

  .dash-app {
    padding: 0 20px;
  }
}

/* Small Tablet — 768px */
@media (max-width: 768px) {
  /* Sidebar hidden on mobile — slides in as overlay */
  .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-mobile-trigger {
    display: flex;
  }

  .dash-app {
    margin-left: 0 !important;
    padding-top: 56px;
  }

  body.sidebar-collapsed .dash-app {
    margin-left: 0;
  }

  .dash-footer {
    margin-left: 0 !important;
  }

  .chart-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-select {
    width: 100%;
  }

  .filter-search {
    max-width: 100%;
  }

  .filter-count {
    margin-left: 0;
    text-align: right;
  }

  .kpi-value {
    font-size: 26px;
  }

  .kpi-card {
    padding: 16px;
  }

  .timeline-bar {
    height: 120px;
    padding: 16px;
  }

  .drill-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .drill-body {
    padding: 16px;
  }

  .drill-header {
    padding: 12px 16px;
  }

  .alert-chip {
    max-width: 260px;
  }
}

/* Mobile — 480px */
@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .dash-app {
    padding: 0 12px;
  }

  .dash-nav-inner {
    padding: 10px 12px;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .kpi-card {
    padding: 14px;
  }

  .chart-container {
    padding: 16px;
  }

  .chart-title {
    font-size: 13px;
  }

  .insight-card {
    padding: 16px 16px 16px 19px;
  }

  .catalog-table th,
  .catalog-table td {
    padding: 8px 10px;
  }

  .catalog-table {
    font-size: 12px;
  }

  .timeline-bar {
    height: 100px;
    padding: 12px;
    gap: 2px;
  }

  .timeline-month-label {
    font-size: 8px;
  }

  .pagination {
    padding: 12px 0;
  }

  .page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .dash-footer {
    padding: 20px 12px;
    font-size: 10px;
  }

  .filter-bar {
    gap: 6px;
  }

  .alert-zone {
    padding: 8px 12px;
    gap: 6px;
  }

  .alert-chip {
    max-width: 220px;
    font-size: 11px;
    padding: 3px 8px;
  }

  .dash-section {
    margin-bottom: 20px;
  }

  .empty-state {
    padding: 32px 16px;
  }

  .drill-kpis {
    grid-template-columns: 1fr;
  }

  .drill-kpi-value {
    font-size: 20px;
  }

  .row-detail-grid {
    padding: 14px;
    gap: 14px;
  }

  .dash-section-title {
    font-size: 16px;
  }

  .rec-card {
    padding: 16px;
  }
}
