:root {
  --sb-bg: #0f172a; --sb-hover: #1e293b; --sb-text: #cbd5e1; --sb-muted: #64748b; --accent: #38bdf8;
  --brand: #2563eb; --page-bg: #f1f5f9;
}
body { background: var(--page-bg); font-size: .9rem; }
.app-sidebar { width: 252px; background: var(--sb-bg); color: var(--sb-text); min-height: 100vh; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 1040; }
.app-sidebar .brand { padding: 1rem 1.1rem; border-bottom: 1px solid #1e293b; }
.app-sidebar .brand .logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #38bdf8); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.15rem; }
.app-sidebar .brand .name { font-weight: 700; color: #fff; line-height: 1.1; }
.app-sidebar .brand .company { font-size: .75rem; color: var(--sb-muted); }
.app-sidebar .nav-section { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-muted); padding: 1rem 1.2rem .35rem; }
.app-sidebar .nav-link { color: var(--sb-text); padding: .45rem 1.2rem; display: flex; align-items: center; gap: .65rem; border-left: 3px solid transparent; font-size: .87rem; }
.app-sidebar .nav-link i { font-size: 1rem; width: 1.2rem; text-align: center; opacity: .85; }
.app-sidebar .nav-link:hover { background: var(--sb-hover); color: #fff; }
.app-sidebar .nav-link.active { background: var(--sb-hover); color: #fff; border-left-color: var(--accent); }
.app-sidebar .nav-link .badge { margin-left: auto; }
.app-main { margin-left: 252px; min-height: 100vh; }
.app-topbar { background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 1030; }
.app-content { padding: 1.25rem 1.5rem 3rem; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .app-sidebar.show { transform: none; }
  .app-main { margin-left: 0; }
  .app-content { padding: 1rem .75rem 3rem; }
}
.card { border: 1px solid #e2e8f0; border-radius: .8rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef2f7; font-weight: 600; border-radius: .8rem .8rem 0 0 !important; }
.stat-card .card-body { padding: .9rem 1rem; }
.stat-card .icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.stat-card .value { font-size: 1.35rem; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .15rem; }
.stat-card .label { color: #64748b; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; line-height: 1.25; padding-top: .1rem; }
.stat-card a.stretched-link:hover ~ * { opacity: .9; }
.table > :not(caption) > * > * { padding: .55rem .65rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; background: #f8fafc; white-space: nowrap; }
.table-card .table { margin-bottom: 0; }
.page-header h1 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.page-header .sub { color: #64748b; font-size: .85rem; }
.form-label { font-weight: 500; font-size: .83rem; margin-bottom: .25rem; }
.badge { font-weight: 600; }
.dl-grid { display: grid; grid-template-columns: 150px 1fr; gap: .35rem .75rem; margin: 0; }
.dl-grid dt { color: #64748b; font-weight: 500; }
.dl-grid dd { margin: 0; }
.signal-good { color: #198754 !important; } .signal-warning { color: #d97706 !important; } .signal-critical { color: #dc3545 !important; } .signal-high { color: #6f42c1 !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.att-btn input { display: none; }
.att-btn label { min-width: 2.3rem; }
.min-w-0 { min-width: 0; }
.login-wrap { min-height: 100vh; background: radial-gradient(circle at 20% 20%, #1e3a8a 0, #0f172a 55%); }
.print-only { display: none; }
@media print {
  .no-print, .app-sidebar, .app-topbar { display: none !important; }
  .app-main { margin: 0 !important; } .app-content { padding: 0 !important; }
  .print-only { display: block; } body { background: #fff; } .card { border: 0; box-shadow: none; }
}
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .list-group-item-action:hover { text-decoration: none; }

/* ===== Dashboard (db-*) — colour tiles with small charts, dark network band, work lists ===== */
.db-hero { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1.1rem 1.35rem; border-radius: 1rem; color: #fff;
  background: radial-gradient(circle at 92% -40%, rgba(56,189,248,.55) 0, transparent 55%), radial-gradient(circle at 60% 160%, rgba(124,58,237,.45) 0, transparent 50%), linear-gradient(120deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  box-shadow: 0 10px 30px -14px rgba(30,58,138,.6); }
.db-hello { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.db-hero-sub { color: rgba(255,255,255,.7); font-size: .84rem; }
.db-hero-line { margin-top: .45rem; font-size: .86rem; color: rgba(255,255,255,.9); }
.db-hero-line i { color: #facc15; }
.db-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-glass { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); color: #fff; backdrop-filter: blur(4px); }
.btn-glass:hover { background: rgba(255,255,255,.24); color: #fff; }

.db-tiles { display: grid; gap: .85rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1399.98px) { .db-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .db-tiles { grid-template-columns: 1fr; } }
.db-tile { position: relative; display: flex; flex-direction: column; min-height: 168px; padding: .95rem 1.05rem .85rem; border-radius: 1rem; color: #fff; overflow: hidden;
  box-shadow: 0 10px 24px -14px var(--glow, rgba(15,23,42,.5)); transition: transform .15s, box-shadow .15s; }
.db-tile::after { content: ""; position: absolute; right: -38px; top: -38px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.12); pointer-events: none; }
.db-tile:hover { color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: 0 16px 30px -14px var(--glow, rgba(15,23,42,.6)); }
.db-blue { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); --glow: rgba(29,78,216,.75); }
.db-green { background: linear-gradient(135deg, #047857, #10b981); --glow: rgba(4,120,87,.75); }
.db-amber { background: linear-gradient(135deg, #b45309, #f59e0b); --glow: rgba(180,83,9,.75); }
.db-rose { background: linear-gradient(135deg, #be123c, #f43f5e); --glow: rgba(190,18,60,.75); }
.db-violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); --glow: rgba(109,40,217,.75); }
.db-tile-top { display: flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: rgba(255,255,255,.88); }
.db-tile-top i { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.2); font-size: 1rem; color: #fff; position: relative; z-index: 1; }
.db-tile-value { font-size: 1.85rem; font-weight: 800; line-height: 1.1; margin-top: .2rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-tile-sub { font-size: .8rem; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-stack { display: flex; gap: 3px; height: 9px; margin-top: auto; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.15); }
.db-stack span { display: block; height: 100%; background: #fff; }
.db-stack-active { opacity: .95; } .db-stack-expired { opacity: .6; } .db-stack-suspended { opacity: .38; } .db-stack-disconnected { opacity: .2; }
.db-legend { display: flex; flex-wrap: wrap; gap: .15rem .7rem; margin-top: .4rem; font-size: .7rem; color: rgba(255,255,255,.85); }
.db-legend span { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.db-legend i { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: inline-block; }
.db-bars { display: flex; align-items: flex-end; gap: 3px; height: 40px; margin-top: auto; padding-top: .5rem; }
.db-bars span { flex: 1; min-width: 0; border-radius: 4px 4px 2px 2px; background: rgba(255,255,255,.42); position: relative; }
.db-bars span.is-now { background: #fff; }
.db-bars-week { gap: 6px; }
.db-bars-week b { position: absolute; top: -1.05rem; left: 0; right: 0; text-align: center; font-size: .66rem; font-weight: 700; }
.db-week-labels span { flex: 1; justify-content: center; }
.db-week-labels { gap: 6px; flex-wrap: nowrap; }

/* network band */
.db-noc { border-radius: 1rem; padding: 1rem 1.1rem; color: #e2e8f0; display: flex; flex-direction: column; gap: .9rem;
  background: radial-gradient(circle at 100% 0, rgba(56,189,248,.16) 0, transparent 45%), linear-gradient(160deg, #0f172a, #111c35); box-shadow: 0 10px 28px -16px rgba(15,23,42,.9); }
.db-noc-head { display: flex; align-items: center; gap: .55rem; }
.db-noc-head h2 { font-size: 1rem; font-weight: 700; margin: 0; color: #fff; }
.db-noc-head a { color: #7dd3fc; font-size: .8rem; }
.db-noc-state { font-size: .78rem; color: #94a3b8; }
.db-pulse { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: db-pulse 1.8s infinite; }
.db-pulse.is-bad { background: #f43f5e; box-shadow: 0 0 0 0 rgba(244,63,94,.6); animation-name: db-pulse-bad; }
@keyframes db-pulse { 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes db-pulse-bad { 70% { box-shadow: 0 0 0 9px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }
.db-gauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 767.98px) { .db-gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.db-gauge { display: flex; align-items: center; gap: .65rem; padding: .6rem .65rem; border-radius: .8rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); color: inherit; min-width: 0; }
.db-gauge:hover { background: rgba(255,255,255,.09); color: inherit; text-decoration: none; }
.db-gauge > div:last-child { min-width: 0; }
.db-gauge b { display: block; color: #fff; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-gauge span { display: block; font-size: .74rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-ring { position: relative; width: 58px; height: 58px; flex: 0 0 58px; }
.db-ring svg { width: 100%; height: 100%; display: block; }
.db-ring-in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; line-height: 1; }
.db-ring-in b { font-size: 1rem; font-weight: 800; display: inline !important; color: inherit; }
.db-ring-in small { font-size: .66rem; opacity: .7; margin-left: 1px; }
.db-noc .db-ring-in { color: #fff; }
.db-alarms { display: flex; flex-direction: column; gap: .35rem; margin-top: auto; }
.db-alarm { display: flex; align-items: center; gap: .6rem; padding: .45rem .65rem; border-radius: .6rem; background: rgba(255,255,255,.04); color: #e2e8f0; font-size: .82rem; min-width: 0; }
a.db-alarm:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.db-alarm small { color: #94a3b8; white-space: nowrap; }
.db-alarm-ok { color: #86efac; }
.db-sev { flex: 0 0 auto; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .15rem .45rem; border-radius: 99px; color: var(--sev); background: color-mix(in srgb, var(--sev) 18%, transparent); border: 1px solid color-mix(in srgb, var(--sev) 40%, transparent); }

/* white cards */
.db-card { border-radius: 1rem; overflow: hidden; }
.db-card-head { display: flex; align-items: center; gap: .55rem; padding: .85rem 1rem .6rem; }
.db-card-head h2 { font-size: .98rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-head-num { font-size: 1.2rem; font-weight: 800; line-height: 1.1; }
.db-count { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: #f1f5f9; color: #334155; }
.db-foot { font-size: .74rem; color: #94a3b8; padding: 0 1rem .75rem; margin-top: -.4rem; }
.db-trend { display: inline-flex; align-items: center; font-weight: 700; font-size: .74rem; padding: 0 .35rem 0 .1rem; border-radius: 99px; margin-left: .25rem; }
.db-trend.is-up { color: #047857; background: #d1fae5; } .db-trend.is-down { color: #be123c; background: #ffe4e6; }
.db-av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 700; color: #fff; }
.db-card-head .db-av { border-radius: 10px; width: 32px; height: 32px; flex-basis: 32px; font-size: .95rem; }
.db-av-blue { background: linear-gradient(135deg, #2563eb, #38bdf8); } .db-av-green { background: linear-gradient(135deg, #059669, #34d399); }
.db-av-amber { background: linear-gradient(135deg, #d97706, #fbbf24); } .db-av-rose { background: linear-gradient(135deg, #e11d48, #fb7185); }
.db-av-violet { background: linear-gradient(135deg, #7c3aed, #a78bfa); } .db-av-cyan { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.db-av-slate { background: linear-gradient(135deg, #64748b, #94a3b8); }
.db-staff-sum { display: flex; align-items: center; gap: .8rem; padding: .15rem 1rem .75rem; border-bottom: 1px solid #eef2f7; }
.db-staff-sum .db-ring { color: #4c1d95; }
.db-staff-sum b { display: block; font-size: .95rem; } .db-staff-sum span { font-size: .78rem; color: #64748b; }
.db-list { display: flex; flex-direction: column; }
.db-row { display: flex; align-items: center; gap: .65rem; padding: .55rem 1rem; border-top: 1px solid #f1f5f9; min-width: 0; }
.db-list .db-row:first-child { border-top: 0; }
.db-who { display: flex; flex-direction: column; min-width: 0; margin-right: auto; color: inherit; line-height: 1.25; }
.db-who:hover { text-decoration: none; color: inherit; }
.db-who:hover b { color: var(--brand); }
.db-who b { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-who span { font-size: .75rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-who em { font-style: normal; font-weight: 600; color: #b45309; }
.db-who em.is-hot { color: #e11d48; } .db-who em.is-warm { color: #d97706; }
.db-amt { font-size: .88rem; white-space: nowrap; color: #be123c; }
.db-act { display: flex; align-items: center; gap: .35rem; flex: 0 0 auto; }
.db-btn { font-size: .74rem; font-weight: 700; padding: .3rem .7rem; border-radius: 99px; color: #fff; white-space: nowrap; }
.db-btn:hover { color: #fff; text-decoration: none; filter: brightness(1.08); }
.db-btn.is-amber { background: linear-gradient(135deg, #d97706, #f59e0b); } .db-btn.is-green { background: linear-gradient(135deg, #059669, #10b981); }
.db-wa { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #16a34a; background: #dcfce7; font-size: .9rem; }
.db-wa:hover { background: #bbf7d0; color: #15803d; text-decoration: none; }
.db-pill { font-size: .7rem; font-weight: 700; padding: .18rem .55rem; border-radius: 99px; white-space: nowrap; flex: 0 0 auto; }
.db-pill.is-green { background: #dcfce7; color: #15803d; } .db-pill.is-rose { background: #ffe4e6; color: #be123c; }
.db-pill.is-amber { background: #fef3c7; color: #b45309; } .db-pill.is-blue { background: #dbeafe; color: #1d4ed8; } .db-pill.is-slate { background: #f1f5f9; color: #475569; }
.db-empty { margin: 0; padding: 1rem; color: #64748b; font-size: .85rem; }
.db-todo { border-top: 4px solid transparent; }
.db-todo.is-amber { border-top-color: #f59e0b; } .db-todo.is-rose { border-top-color: #f43f5e; } .db-todo.is-blue { border-top-color: #3b82f6; }

/* providers */
.db-donut { position: relative; height: 170px; margin: .25rem 0 .5rem; }
.db-donut-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.db-donut-in b { font-size: 1.5rem; font-weight: 800; line-height: 1; } .db-donut-in span { font-size: .74rem; color: #64748b; }
.db-prov { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.db-meter { height: 7px; border-radius: 99px; background: #f1f5f9; overflow: hidden; margin-top: .35rem; }
.db-meter span { display: block; height: 100%; border-radius: 99px; }

/* money */
.db-money-body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 1rem; padding: .25rem 1rem 1rem; align-items: stretch; }
@media (max-width: 1199.98px) { .db-money-body { grid-template-columns: 1fr; } }
.db-net { border-radius: .9rem; padding: .85rem 1rem; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.db-net.is-profit { background: linear-gradient(135deg, #047857, #10b981); } .db-net.is-loss { background: linear-gradient(135deg, #be123c, #f43f5e); }
.db-net span { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; opacity: .9; }
.db-net b { font-size: 1.7rem; font-weight: 800; line-height: 1.15; }
.db-net small { font-size: .72rem; opacity: .85; }
.db-flow { display: flex; flex-direction: column; justify-content: center; gap: .65rem; min-width: 0; }
.db-flow-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 96px; align-items: center; gap: .6rem; }
.db-flow-row > b { text-align: right; font-size: .9rem; white-space: nowrap; }
.db-flow-label { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.db-flow-bar { display: flex; gap: 2px; height: 14px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.db-flow-bar span { display: block; height: 100%; }
.db-flow-keys { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .74rem; color: #475569; padding-left: calc(70px + .6rem); }
.db-flow-keys span { display: inline-flex; align-items: center; gap: .3rem; }
.db-flow-keys i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
@media (max-width: 575.98px) { .db-flow-keys { padding-left: 0; } .db-flow-row { grid-template-columns: 56px minmax(0, 1fr) 84px; } }
.db-payout { display: grid; gap: .6rem; }
.db-payout-box { display: flex; flex-direction: column; padding: .6rem .85rem; border-radius: .8rem; background: #f8fafc; border: 1px solid #eef2f7; color: inherit; }
.db-payout-box:hover { background: #f1f5f9; color: inherit; text-decoration: none; }
.db-payout-box span { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 600; }
.db-payout-box b { font-size: 1.15rem; font-weight: 800; }
.db-payout-box small { font-size: .74rem; color: #64748b; }
.db-devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (max-width: 767.98px) { .db-devices { grid-template-columns: 1fr; } }
.db-device { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: .7rem; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); color: #e2e8f0; min-width: 0; }
.db-device:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.db-device b { display: block; font-size: .82rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-device b small { color: #94a3b8; font-weight: 500; }
.db-device span { display: block; font-size: .72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-device-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.db-device.is-up .db-device-dot { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.8); }
.db-device.is-down { border-color: rgba(244,63,94,.35); background: rgba(244,63,94,.08); }
.db-device.is-down .db-device-dot { background: #f43f5e; box-shadow: 0 0 8px rgba(244,63,94,.8); }
.db-device.is-down .text-end span { color: #fda4af; }
@media (max-width: 575.98px) {
  .db-gauge { flex-direction: column; text-align: center; gap: .4rem; }
  .db-alarm { flex-wrap: wrap; }
  .db-alarm small { width: 100%; padding-left: 0; }
  .db-hero { padding: 1rem; }
  .db-hello { font-size: 1.2rem; }
}
.db-bars-week { height: 56px; padding-top: 1.15rem; }
@media (min-width: 992px) {
  .db-prov-wide { display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .db-prov-wide .db-card-head { grid-column: 1 / -1; }
  .db-prov-wide .db-donut { margin: 0 0 1rem; }
  .db-prov-wide .db-prov { justify-content: center; padding-left: 0; padding-right: 1.5rem; }
  .db-list-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
  .db-list-cols .db-row:nth-child(2) { border-top: 0; }
}
