:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1e2a38;
    --sidebar-text: #c9d3df;
    --sidebar-hover: #2d3e52;
    --sidebar-active: #0d6efd;
    --topbar-height: 56px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1030;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.1rem 1.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
}

#sidebar .sidebar-brand .brand-icon {
    font-size: 1.4rem;
}

#sidebar .nav-section {
    padding: .75rem 1rem .25rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #5d7494;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1.2rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    margin: 1px .5rem;
    font-size: .9rem;
    transition: background .15s, color .15s;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

#sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

#sidebar .nav-link .nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: .8;
}

#sidebar .sidebar-footer {
    margin-top: auto;
    padding: .75rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .82rem;
    color: #5d7494;
}

#sidebar .sidebar-footer a {
    color: var(--sidebar-text);
    text-decoration: none;
}

#sidebar .sidebar-footer a:hover {
    color: #fff;
}

/* ── Main content ── */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar .page-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e2a38;
    flex: 1;
}

.topbar .user-info {
    font-size: .85rem;
    color: #6c757d;
}

.page-content {
    padding: 1.75rem;
    flex: 1;
}

/* ── Cards & tables ── */
.card {
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-radius: 10px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.table-hover tbody tr:hover td {
    background: #f8f9ff;
}

.mac-address {
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    letter-spacing: .03em;
    color: #495057;
}

.ip-address {
    font-family: 'Courier New', monospace;
    font-size: .9rem;
    font-weight: 500;
    color: #0d6efd;
}

/* ── Login page ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2a38 0%, #2d4a6e 100%);
}

.login-card {
    width: 380px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.login-logo {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: .5rem;
}

/* ── Stats cards ── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    color: #1e2a38;
}

.stat-card .stat-label {
    font-size: .8rem;
    color: #6c757d;
    margin-top: .15rem;
}

/* ── Badges & status ── */
.sync-ok    { color: #198754; }
.sync-error { color: #dc3545; }

/* ── Responsive (minimal) ── */
@media (max-width: 768px) {
    #sidebar       { transform: translateX(-100%); }
    #main-content  { margin-left: 0; }
}
