:root {
    --bg: #101418;
    --panel: #171e25;
    --panel-2: #202a33;
    --border: rgba(255,255,255,0.12);
    --text: #edf3f7;
    --muted: #98a8b5;
    --blue: #4aa3ff;
    --green: #48c774;
    --amber: #ffb84d;
    --red: #f05a5a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, #101418, #121b24 52%, #0d1014);
}

.network-shell {
    width: min(1220px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.network-topbar,
.panel-header,
.device-row,
.toolbar,
.status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.network-topbar {
    margin-bottom: 22px;
}

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 6px; font-size: 1.8rem; }
p { color: var(--muted); }

.topbar-actions,
.toolbar {
    flex-wrap: wrap;
}

a,
button {
    border: 0;
    border-radius: 9px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-link {
    min-height: 40px;
    padding: 0 14px;
}

.btn-primary { background: var(--blue); }
.btn-secondary { background: #2d3b48; }
.btn-danger { background: var(--red); }
.btn-link { display: inline-flex; align-items: center; background: rgba(255,255,255,0.08); }

.network-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
}

.panel,
.stat-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(23, 30, 37, 0.9);
    box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}

.panel {
    padding: 18px;
}

.panel-header {
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.panel-header h2 { margin: 0; font-size: 1.1rem; }

.settings-stack {
    display: grid;
    gap: 13px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(0,0,0,0.22);
    color: var(--text);
    font: inherit;
}

textarea { min-height: 90px; resize: vertical; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 16px;
}

.stat-value {
    display: block;
    margin-bottom: 5px;
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    font-size: 0.85rem;
}

.status-pill.online { color: #0d2417; background: var(--green); }
.status-pill.warning { color: #2d1b00; background: var(--amber); }
.status-pill.offline { color: #fff; background: var(--red); }

.device-list,
.log-list {
    display: grid;
    gap: 10px;
}

.device-row {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
}

.device-row strong { display: block; margin-bottom: 4px; }
.device-row small { color: var(--muted); }

.log-list {
    max-height: 260px;
    overflow: auto;
}

.log-entry {
    padding: 10px;
    border-left: 3px solid var(--blue);
    border-radius: 8px;
    background: rgba(255,255,255,0.045);
    color: var(--muted);
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .network-grid,
    .two-column {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .network-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
