:root {
    /* Premium Dark Theme Colors */
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    /* Status Colors */
    --status-online: #10b981;
    --status-offline: #ef4444;
    --status-warning: #f59e0b;
    
    /* Glassmorphism */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Layout */
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.8s ease-out;
}

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

.logo-icon {
    background: var(--accent-gradient);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.dashboard-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.date-display {
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Cards Base */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.15);
}

/* Overview Section */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
}

.stat-card:hover .card-icon {
    background: var(--accent-gradient);
    color: white;
    transform: scale(1.1);
}

.card-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.text-success { color: var(--status-online); }
.text-danger { color: var(--status-offline); }
.text-muted { color: var(--text-secondary); }

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.chart-card {
    display: flex;
    flex-direction: column;
}

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

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

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

/* Table Section */
.table-section {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

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

.search-container {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: var(--transition);
}

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

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-online);
}
.status-online::before { background: var(--status-online); }

.status-offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-offline);
}
.status-offline::before { background: var(--status-offline); }

.os-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.table-footer {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: right;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .search-container {
        width: 100%;
    }
}

/* Header Actions & Select */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.history-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
}

.history-select:focus {
    border-color: var(--accent-primary);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-main);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.3s ease-out;
}

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

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-modal {
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.file-input {
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 1rem;
}

.upload-status {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.upload-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-online);
}

.upload-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-offline);
}

.upload-status.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
