/* ============================================
   META ADS KPI DASHBOARD - EVIVA MEDIA
   Flashy Dark Theme with Glassmorphism
   ============================================ */

:root {
    /* Dark Theme Colors (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.8);
    --bg-card-hover: rgba(30, 30, 45, 0.9);

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a855f7;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    /* Neon Glow Colors */
    --glow-primary: rgba(99, 102, 241, 0.5);
    --glow-secondary: rgba(139, 92, 246, 0.5);
    --glow-success: rgba(16, 185, 129, 0.5);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    /* Shadows */
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px var(--glow-primary);

    /* Animation */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Light Theme */
body.theme-light {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(255, 255, 255, 1);

    /* Keep accent colors vibrant */
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #9333ea;
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-danger: #dc2626;
    --accent-info: #0891b2;

    /* Softer glow for light mode */
    --glow-primary: rgba(79, 70, 229, 0.2);
    --glow-secondary: rgba(124, 58, 237, 0.2);
    --glow-success: rgba(5, 150, 105, 0.2);

    /* Dark text for light background */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Borders for light mode */
    --border-color: rgba(0, 0, 0, 0.1);
    --border-glow: rgba(79, 70, 229, 0.3);

    /* Gradients adjusted for light mode */
    --gradient-card: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(124, 58, 237, 0.02) 100%);

    /* Lighter shadows */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px var(--glow-primary);
}

/* Light theme specific overrides */
body.theme-light {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

body.theme-light .bg-animation {
    opacity: 0.3;
}

body.theme-light .bg-gradient {
    background: radial-gradient(ellipse at top left, rgba(79, 70, 229, 0.1), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(124, 58, 237, 0.08), transparent 50%);
}

body.theme-light .floating-orb {
    opacity: 0.15;
}

body.theme-light .header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .month-tabs {
    background: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .month-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

body.theme-light .stat-card,
body.theme-light .chart-card,
body.theme-light .client-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: var(--shadow-card);
}

body.theme-light .modal-content {
    background: white;
}

body.theme-light .settings-panel {
    background: white;
}

body.theme-light .search-box input {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.theme-light .search-box input::placeholder {
    color: var(--text-muted);
}

body.theme-light .btn-outline {
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.theme-light .date-picker-dropdown {
    background: white;
    border-color: var(--border-color);
}

body.theme-light .preset-btn {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

body.theme-light .preset-btn:hover,
body.theme-light .preset-btn.active {
    background: var(--accent-primary);
    color: white;
}

body.theme-light .export-dropdown {
    background: white;
}

body.theme-light .pin-overlay {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

body.theme-light .pin-container {
    background: white;
    border-color: var(--border-color);
}

body.theme-light .pin-title {
    color: var(--text-primary);
}

body.theme-light .pin-input input {
    background: #f1f5f9;
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.theme-light .toast {
    background: white;
    color: var(--text-primary);
}

body.theme-light .cpr-summary-card {
    background: var(--bg-card);
}

/* Theme Mode Toggle */
.theme-mode-toggle {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 10px;
}

.theme-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.theme-mode-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.theme-mode-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--glow-primary);
}

.theme-mode-btn i {
    font-size: 1rem;
}

body.theme-light .theme-mode-toggle {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-light .theme-mode-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
}

.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: float 15s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.2);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: rgba(168, 85, 247, 0.25);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    75% {
        transform: translate(20px, 10px) scale(1.05);
    }
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--glow-primary);
    }

    50% {
        box-shadow: 0 0 40px var(--glow-secondary);
    }
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.date-display i {
    color: var(--accent-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    font-family: inherit;
}

.btn-glow {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--glow-primary);
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-secondary);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    overflow: visible;
    transition: all var(--transition-normal);
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-glow);
}

.stat-card-primary::before {
    background: var(--gradient-primary);
}

.stat-card-success::before {
    background: var(--gradient-success);
}

.stat-card-warning::before {
    background: var(--gradient-warning);
}

.stat-card-info::before {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.stat-card-success .stat-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.stat-card-warning .stat-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.stat-card-info .stat-icon {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-info);
}

.stat-content {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-trend {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.trend-up {
    color: var(--accent-success);
}

.stat-trend.trend-down {
    color: var(--accent-danger);
}

/* ============================================
   CHARTS
   ============================================ */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-row:has(.chart-card-full) {
    grid-template-columns: 1fr;
}

.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.chart-card:hover {
    border-color: var(--border-glow);
}

.chart-card-large {
    grid-column: span 1;
}

.chart-card-full {
    grid-column: span 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--accent-primary);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-container {
    padding: 1.5rem;
    height: 300px;
}

.chart-container-wide {
    height: 350px;
}

/* ============================================
   TABLE
   ============================================ */
.table-section {
    margin-bottom: 2rem;
}

.table-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.search-box input {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 200px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--glow-primary);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.data-table th:hover {
    color: var(--accent-primary);
}

.data-table th i {
    margin-left: 0.5rem;
    opacity: 0.5;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

.data-table td {
    font-size: 0.875rem;
}

.client-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.money-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.percentage {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.percentage.good {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.percentage.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.percentage.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.status-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.unsettled {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.status-badge.paused {
    background: rgba(113, 113, 122, 0.2);
    color: var(--text-muted);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

/* ============================================
   SELECT
   ============================================ */
.select-styled {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.select-styled:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.modal-header h2 {
    font-size: 1.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-stat {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.modal-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
}

.modal-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.modal-chart {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    height: 200px;
}

.modal-history h4 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.history-item {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.history-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-success);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1001;
}

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

.toast i {
    color: var(--accent-success);
    font-size: 1.25rem;
}

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

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

.loader {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary);
    animation: spin 1.5s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    border-top-color: var(--accent-secondary);
    animation-duration: 1.2s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    border-top-color: var(--accent-tertiary);
    animation-duration: 0.9s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   STATS GRID - 6 COLUMNS (responsive)
   ============================================ */
.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card-tertiary::before {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
}

.stat-card-tertiary .stat-icon {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.stat-card-secondary::before {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.stat-card-secondary .stat-icon {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

/* ============================================
   CHARTS ROW - 3 COLUMNS
   ============================================ */
.charts-row {
    grid-template-columns: 1fr 1fr 1fr;
}

.chart-card-small .chart-container {
    height: 250px;
}

/* ============================================
   CLIENT CARDS GRID
   ============================================ */
.clients-section {
    margin-top: 2rem;
}

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

.section-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: var(--accent-primary);
}

.client-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.client-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.client-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card);
}

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

.client-card.unsettled {
    opacity: 0.7;
}

.client-card.unsettled::before {
    background: var(--gradient-warning);
}

.client-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.client-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.client-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.client-kpi {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-dot.active {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.unsettled {
    background: var(--accent-warning);
}

.client-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.metric-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

.metric-value.cpr.excellent {
    color: var(--accent-success);
}

.metric-value.cpr.good {
    color: var(--accent-success);
}

.metric-value.cpr.warning {
    color: var(--accent-warning);
}

.metric-value.cpr.danger {
    color: var(--accent-danger);
}

.metric-value.results {
    color: var(--accent-info);
}

.budget-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.progress-fill.good {
    background: var(--accent-success);
}

.progress-fill.warning {
    background: var(--accent-warning);
}

.progress-fill.low {
    background: var(--accent-danger);
}

.progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
}

.kpi-target {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.25rem;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.875rem;
}

.kpi-value.excellent,
.kpi-value.good {
    color: var(--accent-success);
}

.kpi-value.warning {
    color: var(--accent-warning);
}

.kpi-value.danger {
    color: var(--accent-danger);
}

.btn-edit-kpi {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.btn-edit-kpi:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ============================================
   MODAL ENHANCEMENTS
   ============================================ */
.modal-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.modal-section h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section h4 i {
    color: var(--accent-primary);
}

.modal-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.modal-stat {
    text-align: center;
}

.modal-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.modal-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-stat-value.good {
    color: var(--accent-success);
}

.modal-stat-value.warning {
    color: var(--accent-warning);
}

.modal-stat-value.low {
    color: var(--accent-danger);
}

.modal-stat-value.results {
    color: var(--accent-info);
}

.kpi-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
}

.kpi-target-edit {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kpi-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-type-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.kpi-type-value {
    font-weight: 600;
    color: var(--accent-primary);
}

.kpi-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kpi-input-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kpi-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-currency {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.kpi-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    max-width: 150px;
}

.kpi-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--glow-primary);
}

.btn-save {
    padding: 0.75rem 1.25rem;
    background: var(--accent-success);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
}

.cpr-status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

.cpr-status.excellent {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cpr-status.good {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cpr-status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cpr-status.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.cpr-status.neutral {
    background: rgba(113, 113, 122, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(113, 113, 122, 0.3);
}

/* ============================================
   DATE PICKER
   ============================================ */
.date-picker-wrapper {
    position: relative;
}

.date-picker-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.date-picker-trigger:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.date-picker-trigger i:first-child {
    color: var(--accent-primary);
}

.date-picker-trigger i:last-child {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.date-picker-wrapper.open .date-picker-trigger i:last-child {
    transform: rotate(180deg);
}

.date-picker-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date-picker-wrapper.open .date-picker-dropdown {
    display: block;
}

.date-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.preset-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.preset-btn i {
    font-size: 0.875rem;
}

.date-custom {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.date-custom label,
.date-schedule label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-inputs input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.date-inputs input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.date-inputs span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.date-schedule {
    margin-bottom: 1.25rem;
}

.date-schedule label i {
    margin-right: 0.25rem;
    color: var(--accent-warning);
}

.schedule-options {
    display: flex;
    gap: 0.5rem;
}

.schedule-options select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.date-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* ============================================
   YEAR SELECTOR
   ============================================ */
.year-selector select {
    padding: 0.625rem 2rem 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.year-selector select:hover {
    border-color: var(--accent-primary);
}

.year-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--glow-primary);
}

/* ============================================
   EXPORT DROPDOWN
   ============================================ */
.export-wrapper {
    position: relative;
}

.export-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.export-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.export-option:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.export-option i {
    width: 16px;
    color: var(--accent-primary);
}

.export-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.export-option.export-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.export-option.export-primary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: var(--accent-primary);
}

.export-option.export-primary i {
    color: var(--accent-success);
}

/* ============================================
   MONTHLY TABS
   ============================================ */
.month-tabs {
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    position: sticky;
    top: 73px;
    z-index: 99;
}

.month-tabs-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.month-tabs-container::-webkit-scrollbar {
    display: none;
}

.month-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.month-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
    transition: width var(--transition-fast);
}

.month-tab:hover {
    color: var(--text-primary);
}

.month-tab:hover::after {
    width: 50%;
}

.month-tab.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.month-tab.active::after {
    width: 100%;
}

.month-tab.has-data {
    color: var(--text-secondary);
}

.month-tab.future {
    color: var(--text-muted);
    opacity: 0.5;
}

/* ============================================
   CPR COLOR CODING (Updated)
   Green = within target
   Red = over target
   Yellow = zero leads
   Gray = campaign off
   ============================================ */
.cpr-green,
.metric-value.cpr.excellent,
.metric-value.cpr.good {
    color: #10b981 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.cpr-red,
.metric-value.cpr.danger {
    color: #ef4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.cpr-yellow,
.metric-value.cpr.warning {
    color: #f59e0b !important;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.cpr-gray,
.metric-value.cpr.neutral,
.metric-value.cpr.off {
    color: #71717a !important;
}

/* CPR Badge styles for table/list view */
.cpr-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

.cpr-badge.green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cpr-badge.red {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.cpr-badge.yellow {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cpr-badge.gray {
    background: rgba(113, 113, 122, 0.15);
    color: #71717a;
    border: 1px solid rgba(113, 113, 122, 0.3);
}

/* Flatpickr custom styles */
.flatpickr-calendar {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
    border-radius: 8px !important;
}

.flatpickr-day:hover {
    background: var(--bg-card-hover) !important;
    border-color: var(--accent-primary) !important;
}

.flatpickr-day.selected {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
}

.flatpickr-day.inRange {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: transparent !important;
}

/* ============================================
   FULL WIDTH CHARTS ROW
   ============================================ */
.charts-row-full {
    grid-template-columns: 1fr;
}

.chart-card-full {
    width: 100%;
}

.chart-container-wide {
    height: 400px;
}

/* ============================================
   INDUSTRY FILTER CHECKBOXES
   ============================================ */
.industry-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.industry-checkbox {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    user-select: none;
}

.industry-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--industry-color, var(--accent-primary));
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--industry-color, var(--accent-primary));
    transition: all var(--transition-fast);
}

.industry-checkbox:hover .checkbox-label {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.industry-checkbox input:checked+.checkbox-label {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

/* ============================================
   CLIENT CARD INDUSTRY BADGE
   ============================================ */
.client-industry {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

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

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   CUSTOM TOOLTIP SYSTEM
   Glassmorphism tooltips with smooth animations
   ============================================ */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
    --tooltip-bg: rgba(15, 15, 25, 0.95);
    --tooltip-arrow: 6px;
    position: absolute;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip text box */
[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 0.625rem 0.875rem;
    background: var(--tooltip-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 280px;
    text-align: center;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(99, 102, 241, 0.15);
}

/* Tooltip arrow */
[data-tooltip]::after {
    content: '';
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border: var(--tooltip-arrow) solid transparent;
    border-top-color: var(--tooltip-bg);
}

/* Hover state */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::before,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Bottom positioned tooltip */
[data-tooltip-position="bottom"]::before {
    bottom: auto;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(-8px);
}

[data-tooltip-position="bottom"]::after {
    bottom: auto;
    top: calc(100% + 4px);
    border-top-color: transparent;
    border-bottom-color: var(--tooltip-bg);
    transform: translateX(-50%) translateY(-8px);
}

[data-tooltip-position="bottom"]:hover::before,
[data-tooltip-position="bottom"]:hover::after {
    transform: translateX(-50%) translateY(0);
}

/* Multi-line tooltip support */
[data-tooltip-wrap]::before {
    white-space: normal;
    text-align: left;
}

/* Buttons should have pointer cursor, not help */
button[data-tooltip],
.btn[data-tooltip] {
    cursor: pointer;
}

/* ============================================
   ENHANCED HOVER EFFECTS
   3D transforms, ripples, and glow effects
   ============================================ */

/* Enhanced Card Hover with 3D perspective */
.stat-card,
.client-card,
.chart-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, box-shadow;
}

.stat-card:hover {
    transform: translateY(-6px) rotateX(2deg);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.35),
        0 0 30px rgba(99, 102, 241, 0.15);
}

.client-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(99, 102, 241, 0.2);
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(99, 102, 241, 0.1);
}

/* Button Ripple Effect */
.btn {
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Focus visible states for keyboard accessibility */
.btn:focus-visible,
.month-tab:focus-visible,
.preset-btn:focus-visible,
.client-card:focus-visible,
.stat-card:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

/* Enhanced glow on focus */
.btn-glow:focus-visible {
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.3),
        0 8px 25px var(--glow-secondary);
}

/* Interactive element hover glow */
.btn-outline:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.month-tab:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Status dot enhanced pulse */
.status-dot.active {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        box-shadow: 0 0 8px var(--accent-success);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 16px var(--accent-success), 0 0 24px rgba(16, 185, 129, 0.4);
        transform: scale(1.1);
    }
}

/* ============================================
   MOTION & ANIMATIONS
   Entrance animations and smooth transitions
   ============================================ */

/* Staggered entrance for cards */
.stat-card,
.client-card,
.chart-card {
    animation: cardEntrance 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.25s;
}

.stat-card:nth-child(6) {
    animation-delay: 0.3s;
}

.chart-card:nth-child(1) {
    animation-delay: 0.35s;
}

.chart-card:nth-child(2) {
    animation-delay: 0.4s;
}

.chart-card:nth-child(3) {
    animation-delay: 0.45s;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Client cards with CSS variable for stagger */
.client-card {
    animation-delay: calc(var(--card-index, 0) * 0.04s + 0.5s);
}

/* Fade in for sections */
.clients-section {
    animation: fadeInUp 0.6s ease 0.4s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton loading shimmer */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-card) 25%,
            rgba(99, 102, 241, 0.1) 50%,
            var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* Value counting animation pulse */
.stat-value.counting {
    animation: valuePulse 0.3s ease;
}

@keyframes valuePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Chart canvas fade in */
.chart-container canvas {
    animation: chartFadeIn 0.8s ease 0.5s backwards;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .floating-orb,
    .bg-grid {
        animation: none !important;
    }
}

/* ============================================
   SETTINGS PANEL
   Slide-out customization drawer
   ============================================ */
.settings-toggle {
    position: fixed;
    right: 1.5rem;
    bottom: 5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--glow-primary);
    transition: all 0.3s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 30px var(--glow-secondary);
}

.settings-toggle:active {
    transform: scale(0.95);
}

.settings-panel {
    position: fixed;
    right: -380px;
    top: 0;
    width: 360px;
    height: 100vh;
    background: rgba(12, 12, 20, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.settings-panel.open {
    right: 0;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-overlay.show {
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(99, 102, 241, 0.05);
}

.settings-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-header h3 i {
    font-size: 1.25rem;
    color: var(--accent-primary);
    -webkit-text-fill-color: initial;
}

.settings-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 2rem;
}

.setting-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* Color Theme Palettes */
.color-palettes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.palette-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.palette-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.palette-option.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
}

.palette-colors {
    display: flex;
    gap: 3px;
}

.palette-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.palette-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toggle-input {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
}

.toggle-input::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-input:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-input:checked::before {
    left: 24px;
    background: white;
}

/* Animation Speed Slider */
.speed-slider {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--glow-primary);
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Settings footer */
.settings-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

.settings-footer .btn {
    flex: 1;
    justify-content: center;
}

/* ============================================
   ENHANCED MOBILE RESPONSIVENESS
   Touch-friendly, stack layouts, swipe gestures
   ============================================ */

/* Tablet adjustments */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .charts-row:nth-of-type(1) {
        grid-template-columns: 1fr 1fr;
    }

    .chart-card-small {
        grid-column: span 2;
    }

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

    .header-actions {
        gap: 0.75rem;
    }

    .settings-panel {
        width: 320px;
        right: -340px;
    }
}

/* Mobile styles - comprehensive */
@media (max-width: 768px) {

    /* Base adjustments */
    .main-content {
        padding: 1rem;
    }

    /* Header - stack on mobile */
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        width: 100%;
        justify-content: center;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .search-box {
        order: 1;
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .date-picker-wrapper,
    .year-selector,
    .export-wrapper {
        order: 2;
    }

    /* Touch-friendly targets (min 44px) */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .month-tab {
        min-height: 44px;
        min-width: 44px;
        padding: 0.875rem 1rem;
    }

    .preset-btn {
        min-height: 44px;
        padding: 0.75rem;
    }

    .btn-icon,
    .btn-close,
    .btn-edit-kpi {
        min-width: 44px;
        min-height: 44px;
    }

    /* Month tabs with horizontal scroll snap */
    .month-tabs {
        padding: 0 1rem;
        top: auto;
        position: relative;
    }

    .month-tabs-container {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0;
        gap: 0.5rem;
    }

    .month-tab {
        scroll-snap-align: center;
        flex-shrink: 0;
    }

    /* Stats grid - 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Charts - single column */
    .charts-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-container {
        height: 250px;
        padding: 1rem;
    }

    .chart-container-wide {
        height: 280px;
    }

    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem;
    }

    .card-header h3 {
        font-size: 0.9rem;
    }

    .card-actions {
        width: 100%;
    }

    .card-actions .select-styled {
        width: 100%;
    }

    /* Client cards - single column */
    .client-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .client-card {
        padding: 1rem;
    }

    /* Date picker dropdown - full width on mobile */
    .date-picker-dropdown {
        position: fixed;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-height: 80vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        bottom: 0;
        top: auto;
    }

    .date-presets {
        grid-template-columns: 1fr 1fr;
    }

    /* Modal - bottom sheet style */
    .modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        margin: 0;
        border-radius: 20px 20px 0 0;
        animation: modalSlideUp 0.3s ease;
    }

    @keyframes modalSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .modal-body {
        max-height: calc(90vh - 120px);
    }

    .modal-stats-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .kpi-input-wrapper {
        flex-wrap: wrap;
    }

    .kpi-input-wrapper input {
        max-width: 100%;
        flex: 1 1 100%;
    }

    .kpi-input-wrapper .btn-save {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    /* Settings panel - full width on mobile */
    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .settings-toggle {
        right: 1rem;
        bottom: 4rem;
        width: 48px;
        height: 48px;
    }

    /* Touch-friendly tooltips - tap to show */
    [data-tooltip]:active::before,
    [data-tooltip]:active::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* Tooltips position at bottom on mobile to avoid thumb obscuring */
    [data-tooltip]::before {
        bottom: auto;
        top: calc(100% + 10px);
    }

    [data-tooltip]::after {
        bottom: auto;
        top: calc(100% + 4px);
        border-top-color: transparent;
        border-bottom-color: var(--tooltip-bg);
    }

    /* Toast position on mobile */
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        justify-content: center;
    }

    /* Export dropdown - full width */
    .export-dropdown {
        position: fixed;
        left: 1rem;
        right: 1rem;
        width: auto;
        bottom: 0;
        top: auto;
        border-radius: 16px 16px 0 0;
    }

    /* Industry filters - scrollable on mobile */
    .industry-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .industry-checkbox {
        flex-shrink: 0;
    }

    /* Reduced animations on mobile for performance */
    .floating-orb {
        display: none;
    }

    .bg-grid {
        animation: none;
    }
}

/* Small mobile (phones) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .date-presets {
        grid-template-columns: 1fr;
    }

    .color-palettes {
        grid-template-columns: 1fr;
    }

    .header-actions .btn span {
        display: none;
    }

    .logo-text {
        display: none;
    }
}

/* Landscape phone orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    [data-tooltip]::before {
        border-width: 2px;
    }

    .btn:focus-visible,
    .client-card:focus-visible {
        outline-width: 3px;
    }
}

/* ============================================
   USER-CONTROLLED SETTINGS CLASSES
   Applied via JavaScript toggles
   ============================================ */

/* Reduced motion class (via settings toggle) */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

body.reduce-motion .floating-orb,
body.reduce-motion .bg-grid {
    animation: none !important;
}

/* Disable hover effects class */
body.no-hover-effects .stat-card:hover,
body.no-hover-effects .client-card:hover,
body.no-hover-effects .chart-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-card) !important;
}

body.no-hover-effects .btn::before {
    display: none;
}

body.no-hover-effects .month-tab:hover {
    background: transparent;
}

/* Hide tooltips class */
body.no-tooltips [data-tooltip]::before,
body.no-tooltips [data-tooltip]::after {
    display: none !important;
}

/* ============================================
   CPR PERFORMANCE SUMMARY - Catherine's KPI
   ============================================ */

.cpr-summary-section {
    margin-bottom: 2rem;
}

.cpr-summary-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.cpr-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cpr-summary-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.cpr-summary-header h3 i {
    color: var(--accent-primary);
}

.cpr-period {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cpr-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.cpr-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    transition: all var(--transition-normal);
}

.cpr-stat:hover {
    transform: translateY(-2px);
}

.cpr-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.cpr-stat-content {
    display: flex;
    flex-direction: column;
}

.cpr-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.cpr-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Green - Within Target */
.cpr-stat.cpr-green {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.cpr-stat.cpr-green .cpr-stat-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.cpr-stat.cpr-green .cpr-stat-value {
    color: #10b981;
}

/* Red - Over Target */
.cpr-stat.cpr-red {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.cpr-stat.cpr-red .cpr-stat-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.cpr-stat.cpr-red .cpr-stat-value {
    color: #ef4444;
}

/* Yellow - Zero Leads */
.cpr-stat.cpr-yellow {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
}

.cpr-stat.cpr-yellow .cpr-stat-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.cpr-stat.cpr-yellow .cpr-stat-value {
    color: #f59e0b;
}

/* Percentage - Main KPI */
.cpr-stat.cpr-percentage {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    position: relative;
    overflow: hidden;
}

.cpr-stat.cpr-percentage::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent,
            rgba(99, 102, 241, 0.1),
            transparent 30%);
    animation: rotateBg 10s linear infinite;
}

@keyframes rotateBg {
    100% {
        transform: rotate(360deg);
    }
}

.cpr-stat.cpr-percentage .cpr-stat-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    position: relative;
    z-index: 1;
}

.cpr-stat.cpr-percentage .cpr-stat-value {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.cpr-stat.cpr-percentage .cpr-stat-content {
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 1200px) {
    .cpr-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cpr-summary-grid {
        grid-template-columns: 1fr;
    }

    .cpr-stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   DEBUG LOG
   ============================================ */
.debug-toggle {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.debug-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--bg-card-hover);
    border-color: var(--accent-info);
    color: var(--accent-info);
}

.debug-panel {
    position: fixed;
    bottom: 90px;
    right: 80px;
    width: 400px;
    height: 300px;
    background: #0f172a;
    /* Dark terminal bg */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'JetBrains Mono', monospace;
}

.debug-panel.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

.debug-header {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.debug-header h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--accent-danger);
}

.debug-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-entry {
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.log-entry.info {
    border-left-color: var(--accent-info);
}

.log-entry.success {
    border-left-color: var(--accent-success);
}

.log-entry.error {
    border-left-color: var(--accent-danger);
}

.log-time {
    display: inline-block;
    color: var(--text-muted);
    margin-right: 0.5rem;
    font-size: 0.7rem;
}

.log-msg {
    color: var(--text-primary);
    font-weight: 600;
}

.log-details {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
}

/* Scrollbar for debug panel */
.debug-content::-webkit-scrollbar {
    width: 6px;
}

.debug-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.debug-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}