/* 1. THEME VARIABLES */
:root {
    --bg-body: #0f0f0f;
    --bg-card: #1e1e1e;
    --bg-header: #2d2d2d;
    --text-main: #e0e0e0;
    --accent: #0078d4;
    --border: #333;
    --row-hover: #252525;
}

[data-theme="light"] {
    --bg-body: #ffffff;
    --bg-card: #f4f4f4;
    --bg-header: #e0e0e0;
    --text-main: #1a1a1a;
    --accent: #005a9e;
    --border: #ccc;
    --row-hover: #ebebeb;
}

/* 2. BASE STYLES */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    margin: 0; 
    padding: 20px; 
    transition: 0.3s; 
}

.container { max-width: 1200px; margin: auto; }

/* 3. HEADER & CONTROLS */
header { 
    border-bottom: 2px solid var(--accent); 
    padding-bottom: 10px; 
    margin-bottom: 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

h1 { color: var(--accent); margin: 0; font-size: 24px; }

.header-controls { display: flex; gap: 12px; align-items: center; }

/* 4. BUTTONS & ACTIONS */
.btn-reload { 
    display: inline-block; 
    padding: 8px 12px; 
    background: rgba(142, 254, 161, 0.1); 
    color: #8efea1; 
    border: 1px solid #8efea1; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 11px; 
    font-weight: bold;
    text-transform: uppercase; 
    line-height: 1;
}

.theme-toggle { 
    background: var(--accent); 
    color: white; 
    border: none; 
    padding: 8px 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 11px; 
    text-transform: uppercase; 
}

.btn-delete { color: #fe8e8e; text-decoration: none; font-weight: bold; }

/* 5. DATA TABLES & CARDS */
.stats-card { 
    background: var(--bg-card); 
    border-radius: 8px; 
    padding: 15px; 
    margin-bottom: 20px; 
    border-left: 5px solid #8efea1; 
    border-top: 1px solid var(--border); 
}

.stats-offline { border-left-color: #fe8e8e !important; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    background: var(--bg-card); 
    border-radius: 8px; 
    overflow: hidden; 
    border: 1px solid var(--border); 
}

th { background: var(--bg-header); color: var(--accent); padding: 15px; text-align: left; border-bottom: 2px solid var(--border); }
td { padding: 12px 15px; border-bottom: 1px solid var(--border); font-size: 14px; }
tr:hover { background: var(--row-hover); }

/* 6. STATUS PILLS & BADGES */
.status-pill { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; text-transform: uppercase; }

.online { background: #1b4332; color: #8efea1; border: 1px solid #8efea1; box-shadow: 0 0 8px #2d6a4f; }

.alert { background: #431b1b; color: #fe8e8e; border: 1px solid #fe8e8e; box-shadow: 0 0 8px #6a2d2d; }

.badge { 
    background: var(--bg-header); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: monospace; 
    color: var(--text-main); 
    border: 1px solid var(--border); 
}

/* 7. LIGHT MODE OVERRIDES */
[data-theme="light"] .btn-reload {
    background: rgba(0, 90, 158, 0.1);
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

[data-theme="light"] .btn-reload:hover {
    background: var(--accent);
    color: #ffffff;
}

[data-theme="light"] .btn-delete {
    color: #c42b1c; 
}

/* 8. FOOTER & ANIMATIONS */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: #888;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand { font-weight: bold; letter-spacing: 1px; text-transform: uppercase; }

.system-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #8efea1;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 5px #8efea1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* 9. RESPONSIVENESS */
@media (max-width: 600px) {
    header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-controls { width: 100%; justify-content: space-between; }
}