:root {
    --bg-main: #0B0E14;
    --bg-card: rgba(18, 24, 38, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f2f5;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --glass-blur: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    /* Subtle background grid */
    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: 30px 30px;
}

/* Typography & Effects */
.glow-text {
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px var(--accent-glow);
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

/* Layouts */
.page-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
}

.hidden {
    display: none !important;
}

/* Glassmorphism */
.glassmorphism {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Login Box */
.login-box {
    padding: 3rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 { margin-bottom: 0.5rem; font-size: 2rem; }
.login-box p { color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.9rem; }

form { display: flex; flex-direction: column; gap: 1rem; }

input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
}
.btn-primary:hover { background: var(--accent-hover); }

.error-msg {
    margin-top: 1rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dashboard Sidebar */
.sidebar {
    width: 260px;
    background: rgba(11, 14, 20, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
}

.sidebar h2 {
    padding: 0 2rem;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.sidebar ul {
    list-style: none;
    flex-grow: 1;
}

.sidebar li {
    padding: 1rem 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar li:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.02); }
.sidebar li.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent);
}

.sidebar-footer { padding: 1rem 2rem; }
.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.05); color: white; }

/* Main Content */
.content {
    flex-grow: 1;
    margin-left: 260px; /* offset sidebar */
    padding: 2rem 3rem;
}

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

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.uptime-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.uptime-badge span { color: var(--text-primary); font-weight: 500;}

/* Overview Tab */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: 12px;
}

.metric-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.metric-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.progress-bar-container {
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1.5rem;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.5s ease-out;
}

/* Tables */
.card {
    padding: 1.5rem;
    border-radius: 12px;
}
.card h2 { margin-bottom: 1.5rem; font-size: 1.25rem; }

.table-responsive { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    text-left: left;
}
th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:hover { background: rgba(255, 255, 255, 0.02); }
td { font-size: 0.95rem; }

/* Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge.success { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge.warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge.danger { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge.info { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
