:root {
    --rb-sidebar: #1f2d3d;
    --rb-sidebar-hover: #2a3b4f;
    --rb-accent: #e8622a;
    --rb-body: #243447;
    --rb-card: #1d2b3a;
    --rb-border: #2f4256;
}

body { background: #f0f2f5; font-size: .92rem; }
body.rb-dark { background: var(--rb-body); }

/* ---------- sidebar ---------- */
.rb-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 230px; z-index: 1030;
    background: var(--rb-sidebar); overflow-y: auto; transition: transform .2s;
}
.rb-brand { height: 56px; display: flex; align-items: center; justify-content: center; background: #fff; }
.rb-brand .logo { font-weight: 800; font-size: 1.45rem; color: var(--rb-accent); letter-spacing: 1px; line-height: 1; }
.rb-brand .logo small { display: block; font-size: .6rem; color: #8b9bb0; letter-spacing: 4px; text-align: center; }
.rb-sidebar .nav-link {
    color: #e6edf5; padding: .68rem 1.2rem; border-bottom: 1px solid #263649;
    display: flex; align-items: center; gap: .7rem;
}
.rb-sidebar .nav-link i { width: 18px; color: #9fb0c4; }
.rb-sidebar .nav-link:hover { background: var(--rb-sidebar-hover); color: #fff; }
.rb-sidebar .nav-link.active { background: #152230; border-left: 4px solid var(--rb-accent); color: #fff; }
.rb-sidebar .nav-link.active i { color: var(--rb-accent); }
.rb-sidebar .submenu .nav-link { padding-left: 2.9rem; font-size: .86rem; background: #1a2735; }
.rb-sidebar .nav-link .chev { margin-left: auto; transition: transform .2s; font-size: .7rem; }
.rb-sidebar .nav-link[aria-expanded="true"] .chev { transform: rotate(-90deg); }

/* ---------- top bar ---------- */
.rb-main { margin-left: 230px; min-height: 100vh; display: flex; flex-direction: column; }
.rb-topbar { height: 56px; background: #fff; border-bottom: 1px solid #e3e7ec; display: flex; align-items: center; padding: 0 1rem; gap: 1rem; }
.rb-breadcrumb { background: #fff; border-bottom: 1px solid #e3e7ec; padding: .45rem 1.2rem; color: #6c7a89; font-size: .85rem; }
.rb-content { padding: 1.2rem; flex: 1; }
.rb-footer { background: #fff; border-top: 1px solid #e3e7ec; padding: .5rem 1rem; font-size: .8rem; color: #6c7a89; }

@media (max-width: 991.98px) {
    .rb-sidebar { transform: translateX(-100%); }
    body.sidebar-open .rb-sidebar { transform: none; }
    .rb-main { margin-left: 0; }
}

/* ---------- dashboard dark panels (SAS style) ---------- */
.rb-dash { background: var(--rb-body); border-radius: .4rem; padding: 1rem; }
.rb-panel { background: var(--rb-card); border: 1px solid var(--rb-border); border-radius: .3rem; color: #dbe6f1; height: 100%; }
.rb-panel .rb-panel-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem .4rem; font-weight: 600; }
.rb-panel .rb-panel-head .ico { width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; font-size: .9rem; }
.rb-panel .rb-panel-head .big { margin-left: auto; font-size: 1.6rem; color: #b9c7d6; }
.rb-stat { display: flex; justify-content: space-between; padding: .42rem 1rem; border-bottom: 1px solid var(--rb-border); margin: 0 .4rem; }
.rb-stat:last-child { border-bottom: 0; }
.rb-stat a, .rb-stat .lbl { color: #67b7ff; text-decoration: none; }
.rb-stat a:hover { text-decoration: underline; }
.rb-stat .val { font-weight: 600; }
.text-ok { color: #3ddc84 !important; }
.text-warn { color: #ffc93c !important; }
.text-bad { color: #ff6b6b !important; }

.rb-meter { height: 8px; border-radius: 4px; background: #30455b; overflow: hidden; }
.rb-meter > div { height: 100%; background: linear-gradient(90deg, #22b07d, #ffc93c 70%, #ff6b6b); }

/* ---------- generic ---------- */
.card { border: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.card-header { background: #fff; font-weight: 600; }
.table > :not(caption) > * > * { padding: .45rem .6rem; }
.table-sm > :not(caption) > * > * { padding: .3rem .45rem; }
.badge-status { min-width: 70px; }
.status-active { background: #198754; }
.status-expired { background: #dc3545; }
.status-disabled { background: #6c757d; }
.status-new, .status-inactive { background: #0d6efd; }
.status-fup { background: #fd7e14; }
.status-quota { background: #6f42c1; }
.online-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #adb5bd; }
.online-dot.on { background: #20c997; box-shadow: 0 0 0 3px rgba(32, 201, 151, .25); }
.filter-bar .form-control, .filter-bar .form-select { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }

/* ---------- login ---------- */
.rb-login-bg {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column;
    background: radial-gradient(circle at 20% 20%, #2aa0dd 0, #1a6ea8 40%, #2c4a66 100%);
}
.rb-login-logo { font-size: 4rem; font-weight: 900; color: var(--rb-accent); line-height: .9; text-align: center; letter-spacing: 3px; }
.rb-login-logo small { display: block; font-size: 1.9rem; color: #e9f1f8; letter-spacing: 10px; font-weight: 600; }
.rb-login-box { background: rgba(230, 238, 245, .88); width: 100%; max-width: 520px; padding: 3rem 3.3rem; margin-top: 1.5rem; }
.rb-login-box .input-group-text { width: 46px; justify-content: center; }
.rb-login-box .btn-login { background: #20a8d8; border-color: #20a8d8; color: #fff; }

/* ---------- print ---------- */
@media print {
    .rb-sidebar, .rb-topbar, .rb-breadcrumb, .rb-footer, .no-print { display: none !important; }
    .rb-main { margin: 0; }
    .rb-content { padding: 0; }
    body { background: #fff; }
}
