:root {
    /* Colors - Light Blue Premium Theme */
    --bg-dark: #eff6ff; /* Very Light Blue */
    --bg-card: #ffffff;
    --bg-sidebar: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --accent-primary: #3b82f6; /* Blue */
    --accent-primary-hover: #2563eb;
    --accent-success: #10b981; /* Emerald */
    --accent-danger: #ef4444;  /* Red */
    --accent-warning: #f59e0b; /* Amber */
    
    --border-color: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --glass-blur: blur(4px);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Sidebar Elements */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(59, 130, 246, 0.05);
    color: var(--accent-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent);
    border-left: 3px solid var(--accent-primary);
}

.sidebar-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-success);
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.badge-light-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    font-size: 0.75rem;
}

/* Summary Stats */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

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

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

.total-icon { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.success-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.danger-icon { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.rate-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

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

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    width: 100%;
}

/* Table */
.table-wrapper {
    overflow: hidden;
    padding: 1.5rem 0; /* no horizontal padding */
}
.table-wrapper .card-title {
    padding: 0 1.5rem;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    max-height: 400px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: #000;
    font-weight: 700;
}

th, td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

th {
    color: #000;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

td {
    font-size: 0.95rem;
    color: #000;
    font-weight: 700;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}
.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .charts-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1rem; }
}
