/* ==========================================================================
   SEO Log Analyzer & URL Request Frequency Analyzer - Comprehensive Styles
   Theme: Light Mode (Default SaaS) + Seamless Dark Mode Support
   ========================================================================== */

:root {
  /* Light Theme Palette (Default) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: #eef2ff;
  --primary-border: #c7d2fe;

  --accent-cyan: #0284c7;
  --accent-cyan-subtle: #f0f9ff;
  
  --success: #10b981;
  --success-subtle: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-subtle: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --info: #3b82f6;
  --info-subtle: #eff6ff;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-page: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-subtle: #131c31;
  --bg-hover: #1e293b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus: #818cf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-subtle: rgba(99, 102, 241, 0.15);
  --primary-border: rgba(99, 102, 241, 0.4);

  --accent-cyan: #38bdf8;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.15);

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.15);
  --success-border: rgba(16, 185, 129, 0.4);
  --success-text: #34d399;

  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.15);
  --warning-border: rgba(245, 158, 11, 0.4);
  --warning-text: #fbbf24;

  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.4);
  --danger-text: #f87171;

  --info: #60a5fa;
  --info-subtle: rgba(96, 165, 250, 0.15);

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
}

/* Header & Global Nav */
.analyzer-header {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

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

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
  transform: translateY(-0.5px);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--primary);
}

.btn-sample {
  background: var(--accent-cyan-subtle);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-sample:hover {
  background: var(--accent-cyan);
  color: #ffffff;
}

.btn-icon-only {
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-icon-only:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}
.nav-link-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}
.nav-link-pill.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Secondary Subheader / Omnibar */
.analyzer-subheader {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dataset-meta-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.80rem;
  color: var(--text-secondary);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-subtle);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Navigation Tabs */
.tabs-navigation {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.tabs-navigation::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}
.tab-btn.active {
  color: var(--primary);
  background: var(--primary-subtle);
  font-weight: 700;
}
.tab-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #ffffff;
}

/* Main Container Layout */
.analyzer-main {
  flex: 1;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 24px;
}
.tab-pane.active {
  display: flex;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.kpi-subtext {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  min-height: 320px;
}

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

.chart-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-body {
  flex: 1;
  position: relative;
  min-height: 240px;
}

/* ==========================================================================
   Section 30: URL Request Frequency Analyzer Module Styles
   ========================================================================== */

.frequency-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}

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

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  height: 36px;
  padding: 0 12px 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  min-width: 260px;
  transition: border-color 0.15s ease;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-subtle);
}

.filter-select {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.80rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.filter-select:focus {
  border-color: var(--primary);
}

.mode-toggle-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* URL Request Summary Table */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition: background 0.1s ease;
}
.data-table th:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.data-table th.no-sort {
  cursor: default;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}
.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

.url-cell {
  font-family: var(--font-mono);
  font-size: 0.80rem;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-link-btn {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
.url-link-btn:hover {
  text-decoration: underline;
}

.res-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.res-tag-html { background: var(--primary-subtle); color: var(--primary); }
.res-tag-image { background: var(--success-subtle); color: var(--success); }
.res-tag-css { background: var(--warning-subtle); color: var(--warning-text); }
.res-tag-javascript { background: #fdf4ff; color: #a855f7; }
.res-tag-api { background: #f0fdf4; color: #16a34a; }
.res-tag-other { background: var(--bg-subtle); color: var(--text-muted); }

/* Badges for status codes */
.badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-2xx { background: var(--success-subtle); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-3xx { background: var(--warning-subtle); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-4xx { background: var(--danger-subtle); color: var(--danger-text); border: 1px solid var(--danger-border); }
.badge-5xx { background: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }

/* Pagination Footer */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Heatmap Calendar */
.heatmap-container {
  display: grid;
  grid-template-columns: 40px repeat(24, 1fr);
  gap: 3px;
  padding: 10px 0;
  font-size: 0.70rem;
}
.heatmap-cell {
  height: 22px;
  border-radius: 2px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.heatmap-cell:hover {
  transform: scale(1.15);
  z-index: 5;
}

/* Issues Cards */
.issue-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}
.issue-card.severity-Critical { border-left-color: var(--danger); }
.issue-card.severity-High { border-left-color: #f97316; }
.issue-card.severity-Medium { border-left-color: var(--warning); }
.issue-card.severity-Low { border-left-color: var(--info); }

.issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.issue-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.severity-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}
.severity-Critical { background: var(--danger-subtle); color: var(--danger-text); }
.severity-High { background: #ffedd5; color: #9a3412; }
.severity-Medium { background: var(--warning-subtle); color: var(--warning-text); }
.severity-Low { background: var(--info-subtle); color: #1e40af; }

.issue-remedy-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.80rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary);
}

/* Modal / Drawer for URL Request Details (Section 30.B) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  max-width: 1050px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-subtle);
}

/* File Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .analyzer-header {
    padding: 0 14px;
  }
  .analyzer-main {
    padding: 14px;
  }
}

/* ==========================================================================
   Initial CSV Upload Screen / Landing Gate
   ========================================================================== */
.upload-hero-wrapper {
  max-width: 860px;
  margin: 40px auto 60px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.upload-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.upload-hero-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-primary);
  line-height: 1.25;
}

.upload-hero-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.upload-dropzone-hero {
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 44px 28px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.upload-dropzone-hero:hover,
.upload-dropzone-hero.dragover {
  border-color: var(--accent-cyan);
  background: var(--primary-subtle);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.dropzone-hero-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.8rem;
}

.upload-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.format-pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.format-pill {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* ==========================================================================
   Clickable Numbers & Hint Badges
   ========================================================================== */
.clickable-number,
.kpi-card.clickable-kpi {
  cursor: pointer !important;
  user-select: none;
  position: relative;
}

.kpi-card.clickable-kpi:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25) !important;
  transform: translateY(-2px) !important;
}

.kpi-card.clickable-kpi .kpi-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.click-hint-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  letter-spacing: 0.02em;
  opacity: 0.75;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.kpi-card.clickable-kpi:hover .click-hint-badge {
  opacity: 1;
  background: var(--primary);
  color: #ffffff;
}

.clickable-stat-pill {
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.clickable-stat-pill:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
  text-decoration: underline;
}

/* ==========================================================================
   Number URLs Details Popup Modal
   ========================================================================== */
.modal-dialog-lg {
  max-width: 1040px !important;
  width: 95% !important;
  max-height: 85vh !important;
}

.popup-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.popup-filter-badge {
  font-size: 0.70rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  text-transform: uppercase;
}

.popup-count-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.popup-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.popup-search-box input {
  width: 320px;
  max-width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.popup-search-box input:focus {
  border-color: var(--primary);
}

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

.popup-table-container {
  max-height: 480px;
  overflow-y: auto;
}

.btn-url-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-url-action:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .popup-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .popup-search-box input {
    width: 100%;
  }
  .popup-actions {
    display: flex;
    width: 100%;
    gap: 8px;
  }
  .popup-actions button {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 8px 10px;
  }
  .modal-dialog-lg {
    max-width: 95vw !important;
    padding: 16px;
  }
}
