/* ===================================================================
   장마트(JANG MART) 경영 실적 대시보드 - Modern Executive Design System
   =================================================================== */

:root {
  /* Color Palette - Dark Mode Default */
  --bg-base: #0B0F19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1F2937;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-subtle: #6B7280;

  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --secondary: #06B6D4;
  --secondary-glow: rgba(6, 182, 212, 0.25);

  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 25px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  --primary: #4F46E5;
  --primary-light: #6366F1;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --secondary: #0284C7;
  --secondary-glow: rgba(2, 132, 199, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.12);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

.dashboard-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-glow);
}

.title-wrap h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-wrap p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.action-btn.primary:hover {
  background: var(--primary-light);
}

/* Key Metrics Cards Grid (5 KPIs) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  background: var(--bg-card-hover);
}

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

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

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 8px;
  font-feature-settings: "tnum";
}

.kpi-value.text-primary {
  color: var(--primary-light);
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.trend-badge.up {
  color: var(--success);
  background: var(--success-bg);
}

.trend-badge.neutral {
  color: var(--secondary);
  background: var(--secondary-glow);
}

/* Main Visuals Grid */
.charts-grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease;
}

.chart-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-heading h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-heading p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tab Pills */
.tab-group {
  display: flex;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.tab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.chart-container-box {
  position: relative;
  width: 100%;
  height: 310px;
}

/* Secondary Grid: Category Bar Chart & Store Table */
.charts-grid-sub {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-bottom: 32px;
}

/* Channel stats sub-box */
.channel-legend-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.channel-stat-item {
  text-align: center;
}

.channel-stat-item .label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.channel-stat-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.channel-stat-item .val {
  font-size: 17px;
  font-weight: 700;
  margin-top: 4px;
}

.channel-stat-item .sub {
  font-size: 11px;
  color: var(--text-subtle);
}

/* Table styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.custom-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

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

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
}

.rank-1 { background: rgba(245, 158, 11, 0.2); color: #F59E0B; }
.rank-2 { background: rgba(156, 163, 175, 0.2); color: #D1D5DB; }
.rank-3 { background: rgba(180, 83, 9, 0.2); color: #D97706; }

.channel-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.channel-tag.online {
  background: var(--secondary-glow);
  color: var(--secondary);
}

.channel-tag.offline {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* GitHub Deploy Banner & Instructions Modal */
.deploy-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.deploy-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.deploy-icon {
  font-size: 32px;
}

.deploy-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.deploy-info p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 28px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.step-card {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  border-left: 4px solid var(--primary);
}

.step-card h5 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-card p, .step-card li {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-card ul {
  padding-left: 20px;
  margin-top: 6px;
}

.step-card code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--secondary);
  font-size: 12px;
}

/* Footer */
.dashboard-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
}

/* Responsive Breakpoints */
@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid-main,
  .charts-grid-sub {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dashboard-container {
    padding: 16px 16px 40px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-value {
    font-size: 22px;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Utility & Dedicated Classes (Eliminating all inline styles)
   ========================================================================== */
.sr-only {
  display: none;
}

.channel-chart-box {
  height: 230px;
}

.dot-offline {
  background: var(--primary);
}

.dot-online {
  background: var(--secondary);
}

.col-rank {
  width: 45px;
}

.footer-subtitle {
  margin-top: 4px;
}

/* ==========================================================================
   Sub Navigation Tabs & Global Filter Bar (STEP 1)
   ========================================================================== */

/* Sub Navigation Tabs */
.subnav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav-tabs::-webkit-scrollbar {
  display: none;
}

.subnav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.subnav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.subnav-tab-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.subnav-tab-btn.active {
  color: var(--text-main);
  font-weight: 700;
}

.subnav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Global Filter Toolbar */
.filter-toolbar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.filter-toolbar:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-group-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

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

.filter-segment-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.filter-pills {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.filter-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.filter-pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.filter-pill-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.filter-pill-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.filter-badge-summary {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

.filter-badge-summary strong {
  color: var(--primary-light);
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: tabFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Micro-Pulse for KPI Values on Filter Change */
.kpi-pulse {
  animation: valuePulse 0.4s ease-out;
}

@keyframes valuePulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.3); color: var(--primary-light); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Customer Segment / RFM Styles (Prep for Tab 2) */
.rfm-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.rfm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.rfm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.rfm-card.grade-a::before { background: #6366F1; }
.rfm-card.grade-b::before { background: #06B6D4; }
.rfm-card.grade-c::before { background: #10B981; }
.rfm-card.grade-d::before { background: #F59E0B; }

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

.rfm-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.rfm-card.grade-a .rfm-badge { background: rgba(99, 102, 241, 0.2); color: #818CF8; }
.rfm-card.grade-b .rfm-badge { background: rgba(6, 182, 212, 0.2); color: #22D3EE; }
.rfm-card.grade-c .rfm-badge { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.rfm-card.grade-d .rfm-badge { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }

.rfm-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.rfm-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.rfm-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.metric-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.metric-tag.recency {
  color: var(--secondary);
  background: var(--secondary-glow);
  border-color: rgba(6, 182, 212, 0.2);
}

.metric-tag.recency.alert {
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Bestseller Products Section (STEP 2 Extended)
   ========================================================================== */
.bestseller-section {
  margin-top: 32px;
}

.highlight-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.highlight-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.highlight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-xl);
}

.highlight-card.revenue-highlight {
  border-left: 4px solid #F59E0B;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, var(--bg-card) 60%);
}

.highlight-card.quantity-highlight {
  border-left: 4px solid var(--secondary);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.06) 0%, var(--bg-card) 60%);
}

.highlight-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.highlight-badge-pill.gold {
  background: rgba(245, 158, 11, 0.18);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.highlight-badge-pill.cyan {
  background: var(--secondary-glow);
  color: var(--secondary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.highlight-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.highlight-prod-info {
  flex: 1;
  min-width: 220px;
}

.highlight-prod-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.highlight-prod-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.highlight-prod-meta .meta-brand {
  font-weight: 600;
  color: var(--text-main);
}

.highlight-prod-meta .meta-code {
  font-family: monospace;
  background: var(--bg-surface-elevated);
  padding: 1px 6px;
  border-radius: 4px;
}

.highlight-stat-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-surface-elevated);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.stat-unit {
  text-align: right;
}

.stat-lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

.text-cyan {
  color: var(--secondary) !important;
}

.bestseller-table-card {
  margin-top: 10px;
}

.badge-highlight-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-highlight-item.rev-top {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-highlight-item.qty-top {
  background: var(--secondary-glow);
  color: var(--secondary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-highlight-item.hit {
  background: var(--primary-glow);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Category Badge inside table */
.cat-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 992px) {
  .rfm-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .highlight-cards-grid {
    grid-template-columns: 1fr;
  }
  .filter-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .rfm-summary-grid {
    grid-template-columns: 1fr;
  }
  .highlight-card-body {
    flex-direction: column;
    align-items: flex-start;
  }
  .highlight-stat-box {
    width: 100%;
    justify-content: space-around;
  }
}


