* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: #EFF0F6; 
    color: #211F54;
    min-height: 100vh;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #211F54, #0B6CD9, #11845B, #211F54);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}
.login-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out;
}
.login-box h1 { color: #211F54; margin-bottom: 0.5rem; font-size: 1.75rem; }
.login-box p { color: #666; margin-bottom: 2rem; }
.login-box .logo { 
    font-size: 3.5rem; 
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}
.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

/* Dashboard (hidden by default) */
.dashboard { display: none; }
.dashboard.visible { display: block; animation: fadeIn 0.4s ease-out; }

.header {
    background: linear-gradient(135deg, #211F54 0%, #1a1840 50%, #211F54 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(33, 31, 84, 0.3);
}
.header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.header .subtitle { opacity: 0.8; font-size: 0.85rem; font-weight: 400; }
.header .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.header .user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    transition: transform 0.2s, border-color 0.2s;
}
.header .user-info img:hover { transform: scale(1.1); border-color: rgba(255,255,255,0.6); }
.header .logout-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.header .logout-btn:hover { 
    background: rgba(255,255,255,0.25); 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Date Filter */
.date-filter-bar {
    background: white;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.date-filter-bar label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #211F54;
}
.date-preset {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-weight: 500;
}
.date-preset:hover { background: #f3f4f6; transform: translateY(-1px); }
.date-preset.active { 
    background: linear-gradient(135deg, #0B6CD9, #0958b3);
    color: white; 
    border-color: #0B6CD9;
    box-shadow: 0 2px 8px rgba(11, 108, 217, 0.3);
}
.date-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
}
.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.apply-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #11845B, #0d6b4a);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.apply-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(17, 132, 91, 0.3); }
.current-period {
    margin-left: auto;
    font-size: 0.85rem;
    color: #211F54;
    background: linear-gradient(135deg, #EFF0F6, #e8e9f3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem 2rem;
}

/* Responsive padding */
@media (max-width: 768px) {
    .container { padding: 1rem; }
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-grid.hidden { display: none; }
.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out backwards;
    border: 1px solid rgba(0,0,0,0.04);
}
.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.15s; }
.kpi-card:nth-child(3) { animation-delay: 0.2s; }
.kpi-card:nth-child(4) { animation-delay: 0.25s; }
.kpi-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.kpi-card .label { font-size: 0.85rem; color: #666; margin-bottom: 0.5rem; font-weight: 500; }
.kpi-card .value { font-size: 1.75rem; font-weight: 700; }
.kpi-card .value.green { color: #11845B; }
.kpi-card .value.blue { color: #0B6CD9; }
.kpi-card .value.purple { color: #211F54; }
.kpi-card .value.orange { color: #D5691B; }
.kpi-card .value.red { color: #dc2626; }

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.tab {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: none;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tab:hover { 
    background: #f0f1f8; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.tab.active { 
    background: linear-gradient(135deg, #0B6CD9, #0958b3);
    color: white;
    box-shadow: 0 4px 16px rgba(11, 108, 217, 0.35);
}
.tab.hidden { display: none; }

/* Content panels */
.panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    display: none;
    border: 1px solid rgba(0,0,0,0.04);
}
.panel.active { display: block; animation: fadeIn 0.3s ease-out; }
.panel h2 { font-size: 1.25rem; margin-bottom: 1rem; color: #211F54; font-weight: 700; }
.panel h3 { font-size: 1rem; margin: 1.5rem 0 1rem; color: #666; font-weight: 600; }

/* Toggle Switch - Modern Design */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}
.filter-toggle:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}
.filter-toggle.active {
    background: linear-gradient(135deg, #211F54, #1a1840);
    border-color: #211F54;
}
.filter-toggle.active .filter-toggle-label { color: white; }
.filter-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}
.filter-toggle.active .filter-toggle-switch {
    background: #0B6CD9;
}
.filter-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.filter-toggle.active .filter-toggle-switch::after {
    left: 22px;
}
.filter-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #211F54;
    user-select: none;
}
.filter-toggle-icon {
    font-size: 1rem;
}

/* Hide default checkbox */
.filter-toggle input[type="checkbox"] {
    display: none;
}

/* Legacy filter controls (for planning tab) */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9fc, #f3f4f6);
    border-radius: 12px;
}
.filter-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}
.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-controls select:hover { border-color: #0B6CD9; }
.filter-controls select:focus { outline: none; border-color: #0B6CD9; box-shadow: 0 0 0 3px rgba(11,108,217,0.1); }

/* Client selector */
.client-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fc, #f3f4f6);
    border-radius: 12px;
}
.client-selector label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #211F54;
}
.client-selector select {
    flex: 1;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}
.client-selector select:hover { border-color: #0B6CD9; }
.client-selector select:focus {
    outline: none;
    border-color: #0B6CD9;
    box-shadow: 0 0 0 3px rgba(11,108,217,0.1);
}
.client-total-hours {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0B6CD9;
    margin-left: auto;
    background: rgba(11,108,217,0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Charts grid for client detail */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}
.charts-grid .chart-box {
    background: linear-gradient(135deg, #fafafa, #f5f5f7);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(0,0,0,0.04);
}
.charts-grid .chart-box h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { 
    text-align: left; 
    padding: 0.85rem; 
    background: linear-gradient(135deg, #EFF0F6, #e8e9f3);
    font-weight: 600;
    color: #211F54;
}
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 0.85rem; border-bottom: 1px solid #f0f0f0; }
tr { transition: all 0.2s; }
tr:hover { background: #f9fafc; }
tr.total-row { 
    background: linear-gradient(135deg, #211F54, #1a1840) !important; 
    color: white; 
    font-weight: 600; 
}
tr.total-row td { border-bottom: none; }
tr.total-row td:first-child { border-radius: 8px 0 0 8px; }
tr.total-row td:last-child { border-radius: 0 8px 8px 0; }
.text-right { text-align: right; }
.text-green { color: #11845B; font-weight: 600; }
.text-red { color: #dc2626; }
.text-blue { color: #0B6CD9; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.high { background: linear-gradient(135deg, #dcfce7, #d1fae5); color: #166534; }
.badge.medium { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.badge.low { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }

/* Status badges for planning */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.ok { background: linear-gradient(135deg, #dcfce7, #d1fae5); color: #166534; }
.status-badge.warning { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.status-badge.exceeded { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }

/* Progress bar */
.progress-bar-container {
    width: 100%;
    height: 26px;
    background: #e5e7eb;
    border-radius: 13px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
.progress-bar {
    height: 100%;
    border-radius: 13px;
    transition: width 0.5s ease;
}
.progress-bar.ok { background: linear-gradient(90deg, #11845B, #22c55e); }
.progress-bar.warning { background: linear-gradient(90deg, #D5691B, #f59e0b); }
.progress-bar.exceeded { background: linear-gradient(90deg, #dc2626, #ef4444); }
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #211F54;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}
.pace-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #211F54;
    opacity: 0.8;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* Planning card */
.planning-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-left: 5px solid #0B6CD9;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out backwards;
}
.planning-card:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.planning-card.warning { border-left-color: #D5691B; }
.planning-card.exceeded { border-left-color: #dc2626; }
.planning-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.planning-card-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #211F54;
}
.planning-card-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.planning-card-employees {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.employee-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: linear-gradient(135deg, #f3f4f6, #e9eaef);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}
.employee-chip:hover { transform: scale(1.05); }
.employee-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Planning summary */
.planning-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.planning-summary-card {
    background: white;
    border-radius: 14px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.04);
}
.planning-summary-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.planning-summary-card .label { font-size: 0.8rem; color: #666; margin-bottom: 0.35rem; font-weight: 500; }
.planning-summary-card .value { font-size: 1.6rem; font-weight: 700; }

/* Charts */
.chart-container { position: relative; height: 400px; margin-bottom: 1.5rem; }
.chart-container.tall { height: 500px; }
.chart-container.medium { height: 350px; }

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #666;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #EFF0F6;
    border-top-color: #0B6CD9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
    .planning-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .date-filter-bar { padding: 0.75rem 1rem; }
    .planning-summary { grid-template-columns: 1fr 1fr; }
}


/* ============================================================================
   Toast Notifications (Phase 3.2)
   ============================================================================ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  min-width: 300px;
  max-width: 500px;
}

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

.toast-error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toast-warning {
  background: linear-gradient(135deg, #D5691B, #f59e0b);
}

.toast-success {
  background: linear-gradient(135deg, #11845B, #22c55e);
}

/* Export buttons (Phase 3.1) */
.export-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.export-btn {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #0B6CD9, #0958b3);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 108, 217, 0.3);
}

.export-btn:active {
  transform: translateY(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}


/* Comparison Cards (Evolution tab) */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.comparison-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}

.comparison-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: #211F54;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #EFF0F6;
}

.comparison-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #211F54;
}

.stat-trend {
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-trend.positive {
  color: #11845B;
}

.stat-trend.negative {
  color: #dc2626;
}

.stat-trend.neutral {
  color: #666;
}

/* Charts Grid for Performance tab */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-box {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}

.chart-box h4 {
  margin-bottom: 1rem;
  color: #211F54;
  font-size: 0.95rem;
  font-weight: 600;
}

.chart-container.medium {
  height: 300px;
}

/* Data Health Panel Styles */
.health-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

#healthTable .status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

#healthTable .status-ok {
    background: #d4edda;
    color: #11845B;
}

#healthTable .status-warning {
    background: #fff3cd;
    color: #D5691B;
}

#healthTable .status-critical {
    background: #f8d7da;
    color: #dc2626;
}

#healthTable .text-center {
    text-align: center;
}

#healthTable .text-right {
    text-align: right;
}

#healthTable .issue-text {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

/* ============================================================================
   ANALYTICS MODULE
   ============================================================================ */

.analytics-subtitle {
    color: #64748b;
    font-size: 0.9375rem;
    margin-top: -10px;
    margin-bottom: 25px;
}

/* Analytics Filters */
.analytics-filters {
    display: grid;
    grid-template-columns: minmax(200px, 300px) minmax(200px, 300px) minmax(250px, 350px) auto;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    max-width: fit-content;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.analytics-select {
    padding: 10px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
    transition: border 0.2s;
}

.analytics-select:hover {
    border-color: #0B6CD9;
}

.analytics-select:focus {
    outline: none;
    border-color: #0B6CD9;
    box-shadow: 0 0 0 3px rgba(11, 108, 217, 0.1);
}

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

.analytics-daterange input[type="date"] {
    padding: 10px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    flex: 1;
    transition: border 0.2s;
}

.analytics-daterange input[type="date"]:hover {
    border-color: #0B6CD9;
}

.analytics-daterange input[type="date"]:focus {
    outline: none;
    border-color: #0B6CD9;
    box-shadow: 0 0 0 3px rgba(11, 108, 217, 0.1);
}

.daterange-separator {
    color: #64748b;
    font-weight: 600;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0B6CD9, #094fa0);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-self: flex-end;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 108, 217, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Analytics Report Container */
.analytics-report-container {
    min-height: 400px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #1A1A2E;
    margin-bottom: 10px;
}

.empty-state p {
    color: #64748b;
    font-size: 1rem;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.25rem;
    color: #64748b;
}

.coming-soon {
    text-align: center;
    padding: 100px 20px;
    font-size: 1.5rem;
    color: #64748b;
    background: linear-gradient(135deg, #F8FAFC, #E0F2FE);
    border-radius: 12px;
}

.error {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.25rem;
    color: #DC2626;
    background: #FEF2F2;
    border-radius: 12px;
    border: 1px solid #FCA5A5;
}

.error small {
    display: block;
    margin-top: 10px;
    font-size: 0.875rem;
    color: #991B1B;
}

/* Analytics KPIs */
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-kpi-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #0B6CD9;
    transition: transform 0.2s, box-shadow 0.2s;
}

.analytics-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.kpi-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1A1A2E;
    margin-bottom: 8px;
}

.kpi-change {
    font-size: 0.875rem;
    font-weight: 600;
}

.kpi-change.positive {
    color: #11845B;
}

.kpi-change.negative {
    color: #DC2626;
}

/* Analytics Section */
.analytics-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.analytics-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 4px solid #0B6CD9;
}

/* Analytics Table */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Limit first column width for campaign names */
.analytics-table td:first-child,
.analytics-table th:first-child {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure sections with tables are scrollable */
.analytics-section > div[style*="overflow-x: auto"],
.analytics-section .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.analytics-table thead {
    background: #F8FAFC;
}

.analytics-table th {
    padding: 14px;
    text-align: left;
    font-weight: 700;
    color: #1A1A2E;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0B6CD9;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.analytics-table th:hover {
    background: #E0F2FE;
}

.analytics-table th.sortable::after {
    content: ' ↕';
    opacity: 0.4;
    font-size: 0.75rem;
}

.analytics-table th.sorted-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #0B6CD9;
}

.analytics-table th.sorted-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #0B6CD9;
}

.analytics-table tbody tr {
    border-bottom: 1px solid #E5E7EB;
    transition: background 0.2s;
}

.analytics-table tbody tr:hover {
    background: #F8FAFC;
}

.analytics-table td {
    padding: 14px;
    font-size: 0.9375rem;
}

.analytics-table td.number {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Responsive Analytics */
@media (max-width: 1200px) {
    .analytics-filters {
        grid-template-columns: 1fr 1fr;
    }

    .filter-group:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .analytics-filters {
        grid-template-columns: 1fr;
    }

    .analytics-kpi-grid {
        grid-template-columns: 1fr;
    }

    .analytics-section {
        padding: 20px;
    }
}

/* Account Selection Modal */
.account-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 31, 84, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.account-selection-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.account-selection-content h3 {
    color: #211F54;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.account-selection-subtitle {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.account-checkbox-list {
    margin-bottom: 24px;
}

.account-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 8px;
}

.account-checkbox-item:hover {
    background: #f8fafc;
}

.account-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #11845B;
}

.account-checkbox-label {
    flex: 1;
    color: #211F54;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-checkbox-count {
    color: #94a3b8;
    font-size: 13px;
}

.account-checkbox-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0;
}

.account-selection-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #11845B, #16a34a);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 132, 91, 0.3);
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Analytics Account Selection Panel (Fixed) */
.analytics-account-panel {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.account-panel-header {
    font-size: 0.95rem;
    color: #211F54;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.analytics-account-panel .account-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.analytics-account-panel .account-checkbox-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.analytics-account-panel .account-checkbox-item:hover {
    border-color: #11845B;
    background: #f0fdf4;
}

.analytics-account-panel .account-checkbox-item input[type="checkbox"]:checked ~ .account-checkbox-label {
    color: #11845B;
    font-weight: 500;
}

/* ============================================================================
   MODERN ANALYTICS COMPONENTS (Coupler.io Style)
   ============================================================================ */

/* Modern Scorecard Grid */
.scorecard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* Modern Scorecard Card */
.scorecard {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scorecard:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

/* Colored accent on left */
.scorecard::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--scorecard-color, #0B6CD9);
}

/* Scorecard with background color */
.scorecard.bg-colored {
    color: white;
}

.scorecard.bg-colored::before {
    display: none;
}

.scorecard.bg-blue { background: linear-gradient(135deg, #0B6CD9, #0958b3); }
.scorecard.bg-green { background: linear-gradient(135deg, #11845B, #0d6b4a); }
.scorecard.bg-orange { background: linear-gradient(135deg, #D5691B, #b85516); }
.scorecard.bg-purple { background: linear-gradient(135deg, #7C3AED, #6d28d9); }
.scorecard.bg-red { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.scorecard.bg-teal { background: linear-gradient(135deg, #0891B2, #0e7490); }

.scorecard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.scorecard-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.scorecard.bg-colored .scorecard-label {
    color: rgba(255,255,255,0.8);
}

.scorecard-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(11, 108, 217, 0.1);
    color: #0B6CD9;
}

.scorecard.bg-colored .scorecard-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.scorecard-icon.blue { background: rgba(11, 108, 217, 0.1); color: #0B6CD9; }
.scorecard-icon.green { background: rgba(17, 132, 91, 0.1); color: #11845B; }
.scorecard-icon.orange { background: rgba(213, 105, 27, 0.1); color: #D5691B; }
.scorecard-icon.purple { background: rgba(124, 58, 237, 0.1); color: #7C3AED; }
.scorecard-icon.red { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.scorecard-icon.teal { background: rgba(8, 145, 178, 0.1); color: #0891B2; }

/* Scorecard Content Layout (icon + content side by side) */
.scorecard {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.scorecard-content {
    flex: 1;
    min-width: 0;
}

.scorecard-secondary {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.scorecard.bg-colored .scorecard-secondary,
.scorecard.bg-blue .scorecard-secondary,
.scorecard.bg-green .scorecard-secondary,
.scorecard.bg-orange .scorecard-secondary,
.scorecard.bg-purple .scorecard-secondary,
.scorecard.bg-red .scorecard-secondary,
.scorecard.bg-teal .scorecard-secondary,
.scorecard[style*="gradient"] .scorecard-secondary {
    color: rgba(255,255,255,0.85);
}

.scorecard.bg-blue .scorecard-label,
.scorecard.bg-green .scorecard-label,
.scorecard.bg-orange .scorecard-label,
.scorecard.bg-purple .scorecard-label,
.scorecard.bg-red .scorecard-label,
.scorecard.bg-teal .scorecard-label,
.scorecard[style*="gradient"] .scorecard-label {
    color: rgba(255,255,255,0.8);
}

.scorecard.bg-blue .scorecard-value,
.scorecard.bg-green .scorecard-value,
.scorecard.bg-orange .scorecard-value,
.scorecard.bg-purple .scorecard-value,
.scorecard.bg-red .scorecard-value,
.scorecard.bg-teal .scorecard-value,
.scorecard[style*="gradient"] .scorecard-value {
    color: white;
}

.scorecard.bg-blue .scorecard-icon,
.scorecard.bg-green .scorecard-icon,
.scorecard.bg-orange .scorecard-icon,
.scorecard.bg-purple .scorecard-icon,
.scorecard.bg-red .scorecard-icon,
.scorecard.bg-teal .scorecard-icon,
.scorecard[style*="gradient"] .scorecard-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.scorecard-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1A1A2E;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.scorecard.bg-colored .scorecard-value {
    color: white;
}

.scorecard-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.scorecard-delta.positive {
    color: #11845B;
    background: rgba(17, 132, 91, 0.1);
}

.scorecard-delta.negative {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.scorecard.bg-colored .scorecard-delta {
    background: rgba(255,255,255,0.2);
}

.scorecard.bg-colored .scorecard-delta.positive,
.scorecard.bg-colored .scorecard-delta.negative {
    color: white;
}

.scorecard-sparkline {
    height: 40px;
    margin-top: 0.75rem;
}

.scorecard-sparkline canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Secondary KPIs Row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-mini {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

.kpi-mini-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.kpi-mini-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1A1A2E;
}

.kpi-mini-delta {
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.kpi-mini-delta.positive { color: #11845B; }
.kpi-mini-delta.negative { color: #dc2626; }

/* Device Cards */
.device-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.device-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.device-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.device-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.device-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1A2E;
}

.device-delta {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.device-delta.positive { color: #11845B; }
.device-delta.negative { color: #dc2626; }

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.lead {
    background: rgba(213, 105, 27, 0.15);
    color: #D5691B;
}

.category-badge.conversion {
    background: rgba(17, 132, 91, 0.15);
    color: #11845B;
}

.category-badge.engagement {
    background: rgba(11, 108, 217, 0.15);
    color: #0B6CD9;
}

/* Inline Bar in Tables */
.inline-bar-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100px;
}

.inline-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.inline-bar-fill.blue { background: linear-gradient(90deg, #0B6CD9, #3b82f6); }
.inline-bar-fill.green { background: linear-gradient(90deg, #11845B, #22c55e); }
.inline-bar-fill.orange { background: linear-gradient(90deg, #D5691B, #f59e0b); }
.inline-bar-fill.purple { background: linear-gradient(90deg, #7C3AED, #a855f7); }
.inline-bar-fill.teal { background: linear-gradient(90deg, #0891B2, #06b6d4); }

/* Modern Section Card */
.analytics-section-card {
    background: white;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.04);
}

.analytics-section-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-section-card h3 .section-icon {
    font-size: 1.25rem;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

/* Metric Toggle Buttons */
.metric-toggles {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.metric-toggle {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.metric-toggle:hover {
    border-color: #0B6CD9;
    color: #0B6CD9;
}

.metric-toggle.active {
    background: #0B6CD9;
    color: white;
    border-color: #0B6CD9;
}

/* Progress Bar with Label */
.progress-metric {
    margin-bottom: 1rem;
}

.progress-metric-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-metric-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.progress-metric-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1A1A2E;
}

.progress-metric-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-metric-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-metric-fill.blue { background: linear-gradient(90deg, #0B6CD9, #3b82f6); }
.progress-metric-fill.green { background: linear-gradient(90deg, #11845B, #22c55e); }
.progress-metric-fill.orange { background: linear-gradient(90deg, #D5691B, #f59e0b); }
.progress-metric-fill.red { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* Search Box */
.table-search {
    margin-bottom: 1rem;
}

.table-search input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.table-search input:focus {
    outline: none;
    border-color: #0B6CD9;
    box-shadow: 0 0 0 3px rgba(11, 108, 217, 0.1);
}

.table-search input::placeholder {
    color: #94a3b8;
}

/* Pagination */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 0.85rem;
    color: #64748b;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #0B6CD9;
    color: #0B6CD9;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #0B6CD9;
    color: white;
    border-color: #0B6CD9;
}

/* Timeline Metric Selector */
.timeline-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Donut Chart Legend */
.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.donut-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.donut-legend-label {
    flex: 1;
    color: #64748b;
}

.donut-legend-value {
    font-weight: 600;
    color: #1A1A2E;
}

/* ==================== GA4 Modern Report Styles ==================== */

/* GA4 Modern Report Container */
.ga4-modern-report {
    padding: 0;
}

/* Section Header with Toggle */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h3 {
    margin-bottom: 0;
}

/* Metric Toggle Group (horizontal) */
.metric-toggle-group {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.25rem;
}

.metric-toggle-group .metric-toggle {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 0.8rem;
}

.metric-toggle-group .metric-toggle.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #1A1A2E;
}

/* Channels Layout - Side by side donut and table */
.channels-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .channels-layout {
        grid-template-columns: 1fr;
    }
}

.channels-table-wrapper {
    max-height: 250px;
    overflow-y: auto;
}

/* Channel color indicator */
.channel-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 0.5rem;
}

/* Compact table variant */
.analytics-table.compact {
    font-size: 0.85rem;
}

.analytics-table.compact th,
.analytics-table.compact td {
    padding: 0.6rem 0.75rem;
}

/* Device Cards Grid (for GA4 Audience) */
.device-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.device-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.875rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.device-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.device-card .device-icon {
    color: #64748b;
    flex-shrink: 0;
}

.device-card .device-icon svg {
    width: 24px;
    height: 24px;
}

.device-card .device-info {
    flex: 1;
    min-width: 0;
}

.device-card .device-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1A1A2E;
    text-transform: capitalize;
}

.device-card .device-stats {
    font-size: 0.75rem;
    color: #64748b;
}

.device-card .device-percentage {
    font-weight: 700;
    font-size: 1rem;
    color: #0B6CD9;
}

/* Countries List (inline bars) */
.countries-list {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem;
}

.country-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.country-rank {
    width: 1.5rem;
    height: 1.5rem;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
}

.country-name {
    flex: 0 0 80px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1A1A2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-bar-container {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.inline-bar-container .inline-bar {
    height: 100%;
    background: #0B6CD9;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.country-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1A1A2E;
    min-width: 50px;
    text-align: right;
}

/* Events Categories Grid */
.events-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .events-categories-grid {
        grid-template-columns: 1fr;
    }
}

/* Event Category Card */
.event-category-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.event-category-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.event-category-card.lead {
    border-left: 4px solid #11845B;
}

.event-category-card.conversion {
    border-left: 4px solid #0B6CD9;
}

.event-category-card.engagement {
    border-left: 4px solid #D5691B;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.category-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1A2E;
}

/* Category badges - override colors for GA4 events */
.event-category-card .category-badge.lead {
    background: rgba(17, 132, 91, 0.15);
    color: #11845B;
}

.event-category-card .category-badge.conversion {
    background: rgba(11, 108, 217, 0.15);
    color: #0B6CD9;
}

.event-category-card .category-badge.engagement {
    background: rgba(213, 105, 27, 0.15);
    color: #D5691B;
}

/* Events List inside Category Card */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #f1f5f9;
}

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

.event-name {
    font-size: 0.85rem;
    color: #64748b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 0.5rem;
}

.event-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1A1A2E;
}

.no-events {
    font-size: 0.85rem;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Page Cell in Tables */
.page-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.page-path {
    font-weight: 500;
    color: #1A1A2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

.page-title {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

/* Search Input */
.search-input {
    width: 100%;
    max-width: 250px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #0B6CD9;
    box-shadow: 0 0 0 3px rgba(11, 108, 217, 0.1);
}

/* KPI Mini Grid */
.kpi-mini-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.kpi-mini-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    min-width: 150px;
}

.kpi-mini-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-mini-content {
    display: flex;
    flex-direction: column;
}

.kpi-mini-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1A1A2E;
    line-height: 1.2;
}

.kpi-mini-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Text utilities */
.text-light {
    opacity: 0.85;
}

/* ==================== Ads Reports Additional Styles ==================== */

/* Conversions List */
.conversions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversion-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.conversion-type {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    flex: 0 0 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversion-type.lead {
    color: #11845B;
}

.conversion-type.conversion {
    color: #0B6CD9;
}

.conversion-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1A1A2E;
    min-width: 50px;
    text-align: right;
}

/* Campaign Cards */
.campaign-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.campaign-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.campaign-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.campaign-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1A1A2E;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.campaign-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.campaign-stats .stat {
    font-size: 0.8rem;
    color: #64748b;
}

.campaign-stats .stat strong {
    color: #1A1A2E;
}

/* Platform Cards (Paid Media) */
.platform-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.platform-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.platform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.platform-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1A1A2E;
}

.platform-spend {
    font-weight: 700;
    font-size: 1rem;
    color: #1A1A2E;
}

.platform-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.platform-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.platform-metrics {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.platform-metrics strong {
    color: #1A1A2E;
}

/* Keywords Preview */
.keywords-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keyword-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.keyword-rank {
    width: 1.5rem;
    height: 1.5rem;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.keyword-text {
    flex: 1;
    font-size: 0.85rem;
    color: #1A1A2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.keyword-clicks {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1A1A2E;
    min-width: 50px;
    text-align: right;
}

/* Query Row (Search Console) */
.queries-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.query-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.query-rank {
    width: 1.5rem;
    height: 1.5rem;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.query-text {
    flex: 1;
    font-size: 0.85rem;
    color: #1A1A2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.query-clicks {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1A1A2E;
    min-width: 50px;
    text-align: right;
}

/* Modern Report Container */
.modern-report {
    padding: 0;
}
