/* ============================================
   SKELLIA DENTAL - ULTRA-MODERN STATISTICS
   Premium Dashboard with Glassmorphism
   ============================================ */

/* ============================================
   CSS VARIABLES - Premium Color Palette
   ============================================ */
.statistics-page {
    --stat-glass-bg: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
    --stat-glass-border: rgba(255, 255, 255, 0.08);
    --stat-glass-highlight: rgba(255, 255, 255, 0.05);
    --stat-glow-blue: rgba(79, 143, 186, 0.4);
    --stat-glow-gold: rgba(201, 169, 98, 0.4);
    --stat-gradient-primary: linear-gradient(135deg, #4f8fba 0%, #6ba3c7 100%);
    --stat-gradient-success: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    --stat-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --stat-gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --stat-gradient-info: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --stat-gradient-gold: linear-gradient(135deg, #c9a962 0%, #e0c285 100%);
    --stat-gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    max-width: 1500px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ============================================
   PAGE HEADER - Enhanced
   ============================================ */
.statistics-page .page-header {
    margin-bottom: var(--spacing-xl);
}

.statistics-page .page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a0aec0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   FILTERS - Premium Floating Style
   ============================================ */
.stats-filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 4px;
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--stat-glass-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--stat-gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn:hover::before {
    opacity: 0.1;
}

.filter-btn.active {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.filter-btn.active::before {
    opacity: 1;
}

.filter-btn span {
    position: relative;
    z-index: 1;
}

.custom-dates {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: fadeSlideIn 0.3s ease;
}

.custom-dates input {
    padding: 10px 14px;
    border: 1px solid var(--stat-glass-border);
    border-radius: 12px;
    background: var(--stat-glass-bg);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.3s ease;
}

.custom-dates input:focus {
    border-color: rgba(79, 143, 186, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 143, 186, 0.1);
    outline: none;
}

.custom-dates span {
    color: var(--text-tertiary);
    font-size: 18px;
}

/* ============================================
   TABS - Modern Pill Navigation
   ============================================ */
.stats-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-xl);
    padding: 6px;
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--stat-glass-border);
    width: fit-content;
}

.stats-tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.stats-tab .tab-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.stats-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.stats-tab:hover .tab-icon {
    transform: scale(1.1);
}

.stats-tab.active {
    background: linear-gradient(135deg, rgba(79, 143, 186, 0.2) 0%, rgba(201, 169, 98, 0.15) 100%);
    color: #4f8fba;
    box-shadow:
        0 2px 12px rgba(79, 143, 186, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================
   KPI CARDS - Glassmorphism Premium
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.kpi-card {
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--stat-glass-border);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 var(--stat-glass-highlight);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.5s ease backwards;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.25),
        0 0 60px rgba(79, 143, 186, 0.1),
        inset 0 1px 0 var(--stat-glass-highlight);
    border-color: rgba(79, 143, 186, 0.3);
}

.kpi-card:hover::before {
    opacity: 1;
}

/* Card animation delays */
.kpi-card:nth-child(1) {
    animation-delay: 0.05s;
}

.kpi-card:nth-child(2) {
    animation-delay: 0.1s;
}

.kpi-card:nth-child(3) {
    animation-delay: 0.15s;
}

.kpi-card:nth-child(4) {
    animation-delay: 0.2s;
}

.kpi-card:nth-child(5) {
    animation-delay: 0.25s;
}

.kpi-card:nth-child(6) {
    animation-delay: 0.3s;
}

.kpi-card:nth-child(7) {
    animation-delay: 0.35s;
}

.kpi-card:nth-child(8) {
    animation-delay: 0.4s;
}

/* KPI Icon - Gradient Circle */
.kpi-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 24px;
    position: relative;
    flex-shrink: 0;
}

.kpi-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    opacity: 0.15;
}

.kpi-content {
    flex: 1;
    min-width: 0;
}

.kpi-value {
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
    overflow-wrap: anywhere;
}

.kpi-card:hover .kpi-value {
    transform: scale(1.02);
}

.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* KPI Trend Indicator */
.kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.kpi-trend.up {
    color: #22c55e;
}

.kpi-trend.down {
    color: #ef4444;
}

.kpi-trend-arrow {
    font-size: 14px;
}

/* KPI Variants with Gradients */
.kpi-card.primary .kpi-icon::before {
    background: var(--stat-gradient-primary);
}

.kpi-card.primary .kpi-value {
    color: #6ba3c7;
}

.kpi-card.primary::before {
    background: var(--stat-gradient-primary);
}

.kpi-card.success .kpi-icon::before {
    background: var(--stat-gradient-success);
}

.kpi-card.success .kpi-value {
    color: #4ade80;
}

.kpi-card.success::before {
    background: var(--stat-gradient-success);
}

.kpi-card.warning .kpi-icon::before {
    background: var(--stat-gradient-warning);
}

.kpi-card.warning .kpi-value {
    color: #fbbf24;
}

.kpi-card.warning::before {
    background: var(--stat-gradient-warning);
}

.kpi-card.danger .kpi-icon::before {
    background: var(--stat-gradient-danger);
}

.kpi-card.danger .kpi-value {
    color: #f87171;
}

.kpi-card.danger::before {
    background: var(--stat-gradient-danger);
}

.kpi-card.info .kpi-icon::before {
    background: var(--stat-gradient-info);
}

.kpi-card.info .kpi-value {
    color: #60a5fa;
}

.kpi-card.info::before {
    background: var(--stat-gradient-info);
}

.kpi-card.gold .kpi-icon::before {
    background: var(--stat-gradient-gold);
}

.kpi-card.gold .kpi-value {
    color: #e0c285;
}

.kpi-card.gold::before {
    background: var(--stat-gradient-gold);
}

/* ============================================
   CHARTS - Premium Glass Containers
   ============================================ */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    width: 100%;
    min-width: 0;
}

.statistics-page .chart-container {
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid var(--stat-glass-border);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 var(--stat-glass-highlight);
    transition: all 0.4s ease;
    animation: chartFadeIn 0.6s ease backwards;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}

.statistics-page .chart-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 143, 186, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.statistics-page .chart-container:hover {
    border-color: rgba(79, 143, 186, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 80px rgba(79, 143, 186, 0.05);
}

.statistics-page .chart-container.full-width {
    grid-column: 1 / -1;
}

.statistics-page .chart-container h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.statistics-page .chart-container h3 .chart-icon {
    font-size: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 18px;
    min-width: 0;
}

.chart-header h3 {
    margin-bottom: 4px;
}

.chart-header > div:first-child {
    min-width: 0;
}

.chart-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.chart-legend-inline {
    display: flex;
    gap: 16px;
    font-size: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.chart-legend-rdv {
    background: rgba(79, 143, 186, 0.85);
}

.chart-legend-cash {
    background: rgba(34, 197, 94, 1);
}

.chart-canvas-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-canvas-wrapper.chart-canvas-doughnut {
    height: 320px;
}

.chart-canvas-wrapper.chart-canvas-activity {
    height: 340px;
}

.statistics-page .chart-container canvas {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    display: block;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Donut Center Text */
.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.donut-center-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.donut-center-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* No Data State */
.chart-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    color: var(--text-tertiary);
    gap: 12px;
}

.chart-no-data-icon {
    font-size: 48px;
    opacity: 0.5;
}

.chart-no-data-text {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.chart-canvas-doughnut .donut-center {
    top: 43%;
}

.chart-no-data-hint {
    max-width: 360px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.chart-error-state {
    color: #f59e0b;
}

.stats-inline-empty {
    width: 100%;
    padding: 20px;
    border: 1px dashed var(--stat-glass-border);
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

/* ============================================
   DATA QUALITY SECTION - Premium Progress
   ============================================ */
.data-quality-section {
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid var(--stat-glass-border);
    margin-bottom: var(--spacing-xl);
    animation: cardFadeIn 0.5s ease backwards;
}

.data-quality-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quality-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quality-bar-item {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 16px;
}

.quality-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.quality-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.quality-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quality-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 10px 10px 0 0;
}

.quality-fill.success {
    background: var(--stat-gradient-success);
}

.quality-fill.warning {
    background: var(--stat-gradient-warning);
}

.quality-fill.danger {
    background: var(--stat-gradient-danger);
}

.quality-percent {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    color: var(--text-primary);
}

/* ============================================
   PEAK HOURS - Visual Time Blocks
   ============================================ */
.peak-hours-section {
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 28px;
    border: 1px solid var(--stat-glass-border);
    margin-bottom: var(--spacing-xl);
}

.peak-hours-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.peak-hours {
    display: flex;
    gap: 16px;
}

.peak-hour-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--stat-glass-border);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.peak-hour-item:first-child {
    background: linear-gradient(135deg, rgba(201, 169, 98, 0.15) 0%, rgba(201, 169, 98, 0.05) 100%);
    border-color: rgba(201, 169, 98, 0.3);
}

.peak-hour-item:first-child .peak-rank {
    background: var(--stat-gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.peak-hour-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.peak-rank {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
}

.peak-time {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.peak-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
}

/* ============================================
   TOP ACTS LIST - Premium Ranking
   ============================================ */
.top-acts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-act-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border: 1px solid var(--stat-glass-border);
    border-radius: 14px;
    transition: all 0.3s ease;
    animation: listItemSlide 0.4s ease backwards;
}

.top-act-item:nth-child(1) {
    animation-delay: 0.1s;
}

.top-act-item:nth-child(2) {
    animation-delay: 0.15s;
}

.top-act-item:nth-child(3) {
    animation-delay: 0.2s;
}

.top-act-item:nth-child(4) {
    animation-delay: 0.25s;
}

.top-act-item:nth-child(5) {
    animation-delay: 0.3s;
}

.top-act-item:hover {
    background: linear-gradient(135deg, rgba(79, 143, 186, 0.08) 0%, rgba(201, 169, 98, 0.04) 100%);
    border-color: rgba(79, 143, 186, 0.3);
    transform: translateX(8px);
}

.act-rank {
    font-size: 14px;
    font-weight: 800;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(79, 143, 186, 0.15) 0%, rgba(201, 169, 98, 0.1) 100%);
    color: #c9a962;
}

.top-act-item:first-child .act-rank {
    background: var(--stat-gradient-gold);
    color: #1a1a2e;
}

.act-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.act-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.act-revenue {
    font-size: 14px;
    font-weight: 700;
    color: #4ade80;
}

/* ============================================
   PROGRESS RING GAUGE
   ============================================ */
.gauge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.gauge-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.gauge-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-ring circle {
    fill: none;
    stroke-width: 10;
}

.gauge-ring .gauge-bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.gauge-ring .gauge-fill {
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-ring .gauge-fill.primary {
    stroke: url(#gradientPrimary);
}

.gauge-ring .gauge-fill.success {
    stroke: url(#gradientSuccess);
}

.gauge-ring .gauge-fill.warning {
    stroke: url(#gradientWarning);
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.gauge-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   STATS SUMMARY BAR
   ============================================ */
.stats-summary-bar {
    display: flex;
    gap: 24px;
    padding: 20px 28px;
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--stat-glass-border);
    margin-bottom: var(--spacing-xl);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 18px;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes listItemSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated counter class */
.animate-count {
    animation: countUp 0.5s ease;
}

/* ============================================
   COMPARISON CARDS
   ============================================ */
.comparison-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.comparison-card {
    background: var(--stat-glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--stat-glass-border);
    text-align: center;
}

.comparison-card h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.comparison-current {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

.comparison-vs {
    font-size: 12px;
    color: var(--text-tertiary);
}

.comparison-previous {
    font-size: 18px;
    color: var(--text-secondary);
}

.comparison-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
}

.comparison-change.positive {
    color: #22c55e;
}

.comparison-change.negative {
    color: #ef4444;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .comparison-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .stats-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stats-tab {
        white-space: nowrap;
    }

    .peak-hours {
        flex-wrap: wrap;
    }

    .peak-hour-item {
        flex: 1;
        min-width: 100px;
    }

    .comparison-row {
        grid-template-columns: 1fr;
    }

    .quality-bar-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .quality-percent {
        text-align: left;
    }

    .chart-header-responsive {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-header-responsive .chart-legend-inline {
        justify-content: flex-start;
    }

    .chart-canvas-wrapper {
        height: 260px;
    }

    .chart-canvas-wrapper.chart-canvas-doughnut,
    .chart-canvas-wrapper.chart-canvas-activity {
        height: 310px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        padding: 20px;
    }

    .kpi-value {
        font-size: 24px;
    }

    .statistics-page .chart-container {
        padding: 20px;
    }

    .chart-legend-inline {
        gap: 10px;
    }

    .chart-canvas-wrapper.chart-canvas-activity {
        height: 300px;
    }

    .top-act-item {
        grid-template-columns: 32px 1fr auto;
    }

    .act-revenue {
        display: none;
    }
}

/* ============================================
   CHART TOOLTIP CUSTOMIZATION
   ============================================ */
.chartjs-tooltip {
    background: var(--stat-glass-bg) !important;
    backdrop-filter: blur(12px);
    border: 1px solid var(--stat-glass-border) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}
