:root {
    --sidebar-width: 250px;
    --surface-muted: #f5f7fb;
}

[data-bs-theme="dark"] {
    --surface-muted: #171b22;
}

body {
    background: var(--surface-muted);
    min-width: 320px;
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background-image: radial-gradient(circle at 20% 10%, rgba(13, 110, 253, .13), transparent 35%);
}

.auth-card {
    max-width: 480px;
    border-radius: 1.25rem;
}

.auth-icon,
.brand-mark {
    display: inline-grid;
    place-items: center;
    background: rgba(13, 110, 253, .12);
    color: var(--bs-primary);
}

.auth-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    font-size: 1.6rem;
}

.sidebar {
    width: var(--sidebar-width) !important;
    flex: 0 0 var(--sidebar-width);
}

.brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .7rem;
    margin-right: .7rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .8rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
}

.sidebar .nav-link.active {
    color: var(--bs-primary);
    background: rgba(13, 110, 253, .1);
}

.sidebar .nav-link-muted {
    opacity: .58;
    cursor: not-allowed;
}

.main-content {
    min-width: 0;
}

.metric-card,
.panel-card {
    border-radius: 1rem;
}

.metric-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .85rem;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.metric-value {
    font-size: 1.7rem;
    line-height: 1.1;
    font-weight: 700;
}

.empty-state {
    min-height: 190px;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--bs-secondary-color);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: .5rem;
}

.empty-state p,
.empty-inline {
    color: var(--bs-secondary-color);
    margin: 0;
}

.resource-dot {
    width: .65rem;
    height: .65rem;
    flex: 0 0 .65rem;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .1);
}

.min-w-0 {
    min-width: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(130px, 40%) minmax(0, 1fr);
    gap: .9rem 1rem;
}

.detail-grid dt {
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.detail-grid dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.text-prewrap {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cascade-node-card { color: inherit; transition: border-color .15s ease, transform .15s ease; }
.cascade-node-card:hover { border-color: var(--bs-primary) !important; transform: translateY(-2px); }
.route-scroll { overflow-x: auto; padding-bottom: .5rem; }
.route-flow { display: flex; gap: 1rem; min-width: max-content; }
.route-segment { display: flex; align-items: center; gap: .75rem; }
.route-endpoint { display: flex; flex-direction: column; color: inherit; text-decoration: none; border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: .75rem 1rem; min-width: 11rem; max-width: 17rem; }
.route-endpoint:hover { border-color: var(--bs-primary); }
.route-arrow { display: flex; flex-direction: column; align-items: center; color: var(--bs-primary); min-width: 8rem; }
.route-arrow i { font-size: 1.5rem; }
.route-arrow small { color: var(--bs-secondary-color); max-width: 12rem; text-align: center; }

.ip-row {
    background: var(--surface-muted);
}

.table > :not(caption) > * > * {
    padding: .9rem 1rem;
}

.table thead th {
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

@media (max-width: 575.98px) {
    .display-6 { font-size: 2rem; }
    .card-body.p-4 { padding: 1.15rem !important; }
}

@media (max-width: 767.98px) {
    .route-flow { min-width: 0; flex-direction: column; }
    .route-segment { flex-direction: column; align-items: stretch; }
    .route-arrow i { transform: rotate(90deg); }
    .route-endpoint { max-width: none; }
}

.finance-nav { scrollbar-width: thin; }
.finance-bar-row { display:grid; grid-template-columns:5.5rem 1fr auto; gap:.75rem; align-items:center; margin:.8rem 0; font-size:.875rem; }
.finance-bar-track { height:.65rem; background:var(--bs-tertiary-bg); border-radius:999px; overflow:hidden; min-width:4rem; }
.finance-bar { height:100%; border-radius:999px; }
@media (max-width:575.98px){.finance-bar-row{grid-template-columns:4.5rem 1fr}.finance-bar-row strong{grid-column:2}}
