/* ================================================================
   RideLink WebGen2 — 통계 대시보드 전용 스타일
   ================================================================ */

/* ================================================================ KPI Cards */
.kpi-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem; margin-top: 3rem;
}
.kpi-card {
    padding: 2rem; border-radius: 20px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    text-align: center; position: relative; overflow: hidden;
    transition: all 0.4s var(--ease-out-expo);
}
.kpi-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at top, rgba(0, 242, 255, 0.04), transparent 70%);
    opacity: 0; transition: opacity 0.4s;
}
.kpi-card:hover { border-color: rgba(0, 242, 255, 0.2); transform: translateY(-4px); box-shadow: 0 20px 50px rgba(0,0,0,0.4); }
.kpi-card:hover::before { opacity: 1; }
.kpi-card .kpi-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.kpi-card .kpi-value {
    font-family: 'Outfit', sans-serif; font-size: 2.5rem; font-weight: 800;
    background: var(--gradient-brand); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
    line-height: 1.1; margin-bottom: 0.25rem;
}
.kpi-card .kpi-unit { font-size: 1rem; font-weight: 600; opacity: 0.7; }
.kpi-card .kpi-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 0.5rem; }

/* ================================================================ Period Filter */
.filter-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin: 3rem 0 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.filter-bar h3 { font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 700; }
.period-tabs {
    display: flex; gap: 0.4rem; padding: 0.3rem;
    background: var(--glass-bg); border-radius: 10px;
    border: 1px solid var(--glass-border);
}
.period-btn {
    padding: 0.5rem 1.2rem; border-radius: 7px; border: none;
    background: transparent; color: var(--text-muted); font-size: 0.85rem;
    font-weight: 600; cursor: pointer; transition: all 0.3s; font-family: inherit;
}
.period-btn:hover { color: var(--text-secondary); }
.period-btn.active {
    background: rgba(0, 242, 255, 0.1); color: var(--primary);
    border: 1px solid rgba(0, 242, 255, 0.2);
}

/* ================================================================ Chart Container */
.chart-section { margin-bottom: 3rem; }
.chart-container {
    padding: 2rem; border-radius: 20px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    position: relative; min-height: 300px;
}
.chart-container canvas { width: 100% !important; max-height: 350px; }

/* ================================================================ Data Table */
.stats-table-section { margin-top: 3rem; }
.stats-table-section h3 { font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; }
.stats-table-wrapper {
    border-radius: 16px; overflow: hidden;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.stats-table {
    width: 100%; border-collapse: collapse;
}
.stats-table thead th {
    padding: 1rem 1.25rem; text-align: left;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--primary);
    background: rgba(0, 242, 255, 0.03); border-bottom: 1px solid var(--glass-border);
}
.stats-table tbody td {
    padding: 0.9rem 1.25rem; font-size: 0.9rem;
    color: var(--text-secondary); border-bottom: 1px solid rgba(255,255,255,0.03);
}
.stats-table tbody tr:hover td { color: var(--text-primary); background: rgba(255,255,255,0.02); }
.stats-table tbody tr:last-child td { border-bottom: none; }
.rank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px; font-weight: 700; font-size: 0.8rem;
    background: rgba(0, 242, 255, 0.08); color: var(--primary);
    border: 1px solid rgba(0, 242, 255, 0.15);
}
.rank-badge.gold { background: rgba(255, 215, 0, 0.1); color: #FFD700; border-color: rgba(255, 215, 0, 0.2); }
.rank-badge.silver { background: rgba(192, 192, 192, 0.1); color: #C0C0C0; border-color: rgba(192, 192, 192, 0.2); }
.rank-badge.bronze { background: rgba(205, 127, 50, 0.1); color: #CD7F32; border-color: rgba(205, 127, 50, 0.2); }

/* ================================================================ Loading */
.loading-spinner {
    display: flex; align-items: center; justify-content: center; padding: 3rem;
    color: var(--text-muted); font-size: 0.9rem; gap: 0.75rem;
}
.loading-spinner .spinner {
    width: 24px; height: 24px; border: 3px solid var(--glass-border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ Empty State */
.empty-state {
    text-align: center; padding: 3rem; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.95rem; }

/* ================================================================ Stats Grid (2 col) */
.stats-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ================================================================ Responsive */
@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-card .kpi-value { font-size: 2rem; }
    .filter-bar { flex-direction: column; align-items: flex-start; }
    .stats-table-wrapper { overflow-x: auto; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
}
