body {
    background: #f4f7fb;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: #1f2937;
}

.login-page {
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}

.login-card {
    border-radius: 22px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}

.page-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #111827;
    color: #e5e7eb;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    padding: 0.5rem 0.75rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
}

.brand-box .brand-icon {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    border-radius: 10px;
    margin-bottom: 0.35rem;
    padding: 0.8rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(99, 102, 241, 0.18);
    color: #fff;
}

.main-content {
    flex: 1;
    min-width: 0;
    background: #f4f7fb;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: #eef2ff;
    padding: 0.5rem 0.8rem;
    color: #3730a3;
    font-weight: 600;
}

.card {
    border-radius: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.stat-card.primary { border-left: 5px solid #334155; }
.stat-card.success { border-left: 5px solid #475569; }
.stat-card.warning { border-left: 5px solid #64748b; }
.stat-card.info { border-left: 5px solid #94a3b8; }
.stat-card.danger { border-left: 5px solid #64748b; }
.stat-card.secondary { border-left: 5px solid #475569; }
.stat-card.dark { border-left: 5px solid #111827; }

.stat-card small {
    color: #64748b;
    display: block;
    margin-bottom: 0.2rem;
}

.stat-card h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-card i {
    color: #64748b;
    font-size: 2rem;
    opacity: 0.65;
}

.chart-badge,
.status-badge {
    background: #e2e8f0;
    color: #334155;
}

.chart-badge {
    font-weight: 600;
}

.table thead th {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.report-chart {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.report-chart-axis {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, 2fr) auto;
    gap: 1rem;
    color: #64748b;
    font-size: 0.75rem;
}

.report-chart-axis-content {
    grid-column: 2;
}

.report-chart-axis-content strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.report-chart-axis-ticks {
    display: flex;
    justify-content: space-between;
}

.report-chart-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(120px, 2fr) auto;
    align-items: center;
    gap: 1rem;
}

.report-chart-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.report-chart-label span {
    color: #64748b;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.report-chart-track {
    position: relative;
    height: 1rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e9ecef;
    background-image:
        linear-gradient(to right, transparent calc(25% - 1px), #fff calc(25% - 1px), #fff calc(25% + 1px), transparent calc(25% + 1px)),
        linear-gradient(to right, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to right, transparent calc(75% - 1px), #fff calc(75% - 1px), #fff calc(75% + 1px), transparent calc(75% + 1px));
}

.report-chart-bar {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: inherit;
}

.report-chart-bar.critical {
    background: #dc3545;
}

.report-chart-bar.noncritical {
    background: #0d6efd;
}

.report-chart-value {
    min-width: 4.5rem;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
}

.report-details-summary {
    cursor: pointer;
    font-weight: 600;
}

.network-diagram-viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.network-diagram {
    width: 100%;
    min-width: 100%;
    height: 520px;
    border: 1px solid #e7eaf3;
    border-radius: 8px;
    background: #fff;
}

.network-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem 0.85rem;
    color: #334155;
    font-size: 0.875rem;
}

.network-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.network-legend-swatch {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 0.85rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.network-legend-start {
    background: #2563eb;
    border-color: #1d4ed8;
    border-radius: 50%;
}

.network-legend-critical {
    background: #6d28d9;
    border-color: #5b21b6;
}

.network-legend-noncritical {
    background: #f5f3ff;
    border-color: #c4b5fd;
}

.network-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.network-details {
    border: 1px solid #e7eaf3;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: #f8fafc;
}

.network-details-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.85rem;
    color: #1e293b;
}

.network-details-heading h5 {
    font-size: 1.05rem;
    font-weight: 700;
}

.network-details-heading p {
    flex: 1 1 100%;
    font-size: 0.9rem;
}

.network-status-critical {
    background: #6d28d9;
    color: #fff;
}

.network-status-noncritical {
    background: #e2e8f0;
    color: #334155;
}

.network-details-empty {
    color: #64748b;
}

.network-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}

.network-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.network-detail-item span {
    color: #475569;
    font-size: 0.82rem;
}

.network-detail-item strong {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 991px) {
    .page-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .network-diagram {
        height: 340px;
    }
}

@media (max-width: 575px) {
    .network-diagram {
        height: 300px;
    }

    .report-chart-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.35rem 0.75rem;
    }

    .report-chart-axis {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.35rem 0.75rem;
    }

    .report-chart-axis-content {
        grid-column: 1 / -1;
    }

    .report-chart-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}
