body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #f4f6f9;
    color: #333;
    transition: background 0.3s, color 0.3s;
}
body.dark {
    background: #1e1e2f;
    color: #ddd;
}
header {
    background: #2c3e50;
    color: white;
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
}
body.dark header {
    background: #0f172a;
}
header h1 { margin-right: 2rem; font-size: 1.5rem; }
nav button {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 0.3rem 1rem;
    margin-right: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}
nav button.active { background: white; color: #2c3e50; }
body.dark nav button.active { background: #334155; color: white; }
nav button:disabled { opacity: 0.5; cursor: not-allowed; }
#loginStatus { margin-left: auto; }
main { max-width: 1200px; margin: 1rem auto; padding: 0 1rem; }
.view { display: none; }
.view.active { display: block; }
.controls { margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.status { padding: 0.2rem 0.75rem; border-radius: 4px; font-weight: bold; }
.status.connected { background: #d4edda; color: #155724; }
.status.disconnected { background: #f8d7da; color: #721c24; }
.box { border: 1px solid #ccc; height: 300px; overflow-y: auto; padding: 0.75rem; background: #fff; border-radius: 4px; font-family: monospace; white-space: pre-wrap; word-break: break-word; }
body.dark .box { background: #2d2d3f; border-color: #444; color: #eee; }
textarea { width: 100%; font-family: monospace; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; }
body.dark textarea { background: #2d2d3f; color: #eee; border-color: #555; }
button { padding: 0.5rem 1rem; cursor: pointer; border: 1px solid #aaa; border-radius: 4px; background: #f0f0f0; }
button:hover { background: #e0e0e0; }
body.dark button { background: #334155; color: white; border-color: #1e293b; }
.card { background: white; border-radius: 6px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 1rem; }
body.dark .card { background: #2d2d3f; }
.metrics { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.metric { flex: 1; min-width: 120px; background: #ecf0f1; padding: 0.75rem; border-radius: 4px; text-align: center; }
body.dark .metric { background: #1e293b; }
.metric span { font-size: 1.5rem; font-weight: bold; color: #2980b9; display: block; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { padding: 0.5rem; text-align: left; border-bottom: 1px solid #ddd; }
body.dark th, body.dark td { border-bottom-color: #444; }
.admin-tabs { margin-bottom: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-tabs button { border: 1px solid #ccc; background: #f9f9f9; padding: 0.4rem 1rem; cursor: pointer; }
.admin-tabs button.active { background: #2980b9; color: white; border-color: #2980b9; }
.adm-panel { display: none; }
.adm-panel.active { display: block; }
#loginPanel input { display: block; margin: 0.5rem 0; padding: 0.4rem; width: 200px; }
.notification {
    position: relative;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
#clientChart { max-width: 100%; height: 200px; }