/* BITS VPN admin panel - Created by Juan Guzman - Brooklyn Tech Support LLC */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --panel-2: #f8fafc; --line: #e5e9f0; --line-2: #eef1f5;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --green: #15a34a; --green-d: #0e8a3b; --green-l: #e8f7ee; --green-t: #157a3c;
  --red: #e5383b; --red-l: #fdecec; --red-t: #c0262d;
  --amber: #f59e0b; --amber-l: #fef4e2; --amber-t: #b45309;
  --blue: #2f6fed; --blue-l: #e8f0fe; --blue-t: #1d4ed8;
  --purple: #8b5cf6; --purple-l: #f1ecfe; --purple-t: #6d28d9;
  --teal: #0ea5a4; --teal-l: #e0f6f5;
  --gray-l: #f1f4f8; --gray-t: #475569;
  --side: #08180f; --side-2: #0d2418; --side-text: #c9d6cf; --side-muted: #7f978a; --side-active: #16a34a;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .18);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1210; --panel: #111a17; --panel-2: #15201c; --line: #22302b; --line-2: #1b2723;
  --text: #e8efeb; --text-2: #c7d3cd; --muted: #8fa39a; --faint: #6b7f76;
  --green-l: #0f2e1d; --red-l: #3a1517; --amber-l: #3a2a0d; --blue-l: #12213d; --purple-l: #23173d; --gray-l: #1b2622; --teal-l: #0d2b2a;
  --green-t: #4ade80; --red-t: #f87171; --amber-t: #fbbf24; --blue-t: #93b4ff; --purple-t: #c4b5fd; --gray-t: #a6b6ae;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--green-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.center { text-align: center; }
.red { color: var(--red-t); } .green { color: var(--green-t); } .amber { color: var(--amber-t); } .blue { color: var(--blue-t); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.nowrap { white-space: nowrap; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
svg.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }
svg.ic.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--panel-2); border-color: #d3d9e2; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.danger { color: var(--red-t); border-color: #f3c4c5; }
.btn.danger:hover { background: var(--red-l); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.soft { background: var(--green-l); border-color: transparent; color: var(--green-t); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--gray-l); }
.btn.dark { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); color: var(--side-text); }
.btn.dark:hover { background: rgba(255, 255, 255, .08); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.wide { width: 100%; }
.btn.xl { height: 52px; font-size: 16px; border-radius: 10px; }
.btn .end { margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--gray-l); }
.link { background: none; border: 0; color: var(--green-d); cursor: pointer; font: inherit; padding: 6px 0; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; height: 36px; width: 100%; outline: none; }
textarea { padding: 8px 11px; height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--green); padding: 0; margin: 0; vertical-align: -3px; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
label.checks, .checks label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; border-radius: 22px; background: #cbd5e1; transition: .15s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(16px); }
.error { background: var(--red-l); color: var(--red-t); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.note { background: var(--amber-l); color: var(--amber-t); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.note.info { background: var(--blue-l); color: var(--blue-t); }
.note.ok { background: var(--green-l); color: var(--green-t); }
kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--panel); }

/* ------------------------------------------------------------------ badges / pills */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--gray-l); color: var(--gray-t); }
.badge.green { background: var(--green-l); color: var(--green-t); }
.badge.red { background: var(--red-l); color: var(--red-t); }
.badge.amber { background: var(--amber-l); color: var(--amber-t); }
.badge.blue { background: var(--blue-l); color: var(--blue-t); }
.badge.purple { background: var(--purple-l); color: var(--purple-t); }
.badge.teal { background: var(--teal-l); color: var(--teal); }
.badge.outline { background: transparent; border: 1px solid var(--line); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--green); color: #fff; text-transform: capitalize; }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--gray-l); color: var(--gray-t); font-size: 12px; font-weight: 600; }
.count-pill.green { background: var(--green-l); color: var(--green-t); }
.count-pill.red { background: var(--red-l); color: var(--red-t); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.status-dot.bad { background: var(--red); }
.status-dot.warn { background: var(--amber); }
.flag { display: inline-block; width: 20px; height: 15px; border-radius: 2px; background: url(lib/flags.png) no-repeat; background-size: 320px auto; flex: none; vertical-align: -3px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.flag.none { background: var(--gray-l); }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #0f3d2a; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }
.ico-tile { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--green-l); color: var(--green); }
.ico-tile.sq { border-radius: 12px; }
.ico-tile.sm { width: 34px; height: 34px; }
.ico-tile.sm svg.ic { width: 17px; height: 17px; }
.ico-tile svg.ic { width: 22px; height: 22px; }
.ico-tile.red { background: var(--red-l); color: var(--red); }
.ico-tile.amber { background: var(--amber-l); color: var(--amber); }
.ico-tile.blue { background: var(--blue-l); color: var(--blue); }
.ico-tile.purple { background: var(--purple-l); color: var(--purple); }
.ico-tile.gray { background: var(--gray-l); color: var(--gray-t); }
.ico-tile.teal { background: var(--teal-l); color: var(--teal); }

/* ------------------------------------------------------------------ login */
/* Every size scales with the window (height first), so the sign-in fits a 1366x768 laptop, Windows display
   scaling (125-150%), tablets and phones without scrolling; the original design sizes are the maximums. */
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.login-hero { position: relative; overflow: hidden; padding: clamp(28px, 7vh, 64px) clamp(32px, 5vw, 72px) clamp(18px, 4vh, 36px); display: flex; flex-direction: column; color: #fff;
  background: radial-gradient(120% 90% at 85% 100%, #0f5a33 0%, rgba(15, 90, 51, 0) 55%), radial-gradient(80% 70% at 100% 0%, #0b3a23 0%, rgba(11,58,35,0) 60%), linear-gradient(160deg, #04110a 0%, #072014 55%, #0a2c1a 100%); }
.hero-glow { position: absolute; right: -180px; top: -120px; width: 620px; height: 620px; border-radius: 50%; border: 70px solid rgba(34, 197, 94, .06); pointer-events: none; }
.login-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; pointer-events: none; opacity: .55;
  background-image: radial-gradient(circle, rgba(74, 222, 128, .55) 1.1px, transparent 1.6px); background-size: 11px 11px;
  -webkit-mask-image: radial-gradient(70% 80% at 55% 85%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 80% at 55% 85%, #000 30%, transparent 75%); }
.hero-brand { --wm: clamp(170px, min(20vw, 30vh), 280px); position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.hero-brand .wordmark { width: var(--wm); }
.hero-brand small { color: #c7d7cf; font-size: clamp(13px, 1.9vh, 17px); padding-left: calc(var(--wm) * .28); margin-top: -6px; }
.hero-copy { position: relative; z-index: 1; margin-top: clamp(24px, 9vh, 90px); }
.hero-copy h1 { font-size: clamp(28px, min(5.6vh, 3.7vw), 52px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.hero-copy h1 em { font-style: normal; color: #6ee79a; }
.hero-points { list-style: none; padding: 0; margin: clamp(18px, 4.5vh, 44px) 0 0; display: flex; flex-direction: column; gap: clamp(10px, 2.6vh, 26px); max-width: 520px; }
.hero-points li { display: flex; align-items: center; gap: clamp(12px, 2.2vh, 22px); font-size: clamp(13.5px, 1.9vh, 18px); color: #e5efe9; }
.hero-points li > span { display: grid; place-items: center; width: clamp(36px, 6.2vh, 60px); height: clamp(36px, 6.2vh, 60px); border-radius: 12px; flex: none; background: rgba(34, 197, 94, .1); border: 1px solid rgba(74, 222, 128, .25); color: #4ade80; }
.hero-points li > span svg.ic { width: clamp(18px, 2.7vh, 26px); height: clamp(18px, 2.7vh, 26px); }
.hero-foot { position: relative; z-index: 1; margin: auto 0 0; color: #a9bcb2; font-size: clamp(12px, 1.6vh, 14px); padding-top: clamp(16px, 4vh, 40px); }
.login-side { display: grid; place-items: center; padding: clamp(16px, 4vh, 40px) clamp(16px, 3vw, 40px); background: linear-gradient(180deg, #f6f8f7, #eef2f0); }
.login-card { width: 100%; max-width: clamp(380px, 36vw, 560px); background: #fff; border-radius: clamp(14px, 2vh, 20px); padding: clamp(24px, 7vh, 76px) clamp(22px, 4.2vw, 62px) clamp(20px, 4vh, 44px); box-shadow: 0 30px 80px rgba(15, 35, 25, .08), 0 2px 8px rgba(15,35,25,.04); color: #0f172a; }
.login-card h2 { font-size: clamp(25px, 4.6vh, 40px); font-weight: 800; letter-spacing: -.02em; }
.login-card .lead { color: #64748b; font-size: clamp(14px, 2.1vh, 18px); margin: clamp(4px, 1vh, 10px) 0 clamp(14px, 2.8vh, 26px); line-height: 1.5; }
.login-card .field { font-size: clamp(13.5px, 1.75vh, 15px); color: #334155; margin-bottom: clamp(10px, 2vh, 18px); gap: clamp(5px, 1vh, 9px); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i { position: absolute; left: clamp(13px, 2vh, 18px); color: #64748b; display: flex; }
.input-wrap > i svg.ic { width: clamp(18px, 2.5vh, 22px); height: clamp(18px, 2.5vh, 22px); }
.input-wrap input { height: clamp(44px, 6.8vh, 60px); padding-left: clamp(44px, 6.4vh, 58px); font-size: clamp(16px, 2vh, 17px); border-radius: 10px; border-color: #dbe1e8; background: #fff; color: #0f172a; }
.reveal { position: absolute; right: clamp(13px, 2vh, 18px); border: 0; background: none; color: var(--green-d); font: 700 clamp(13.5px, 1.75vh, 15px) var(--font); cursor: pointer; }
.net-badge { display: flex; align-items: center; gap: 12px; background: #e9f8ef; color: #1f2937; padding: clamp(10px, 2vh, 18px) clamp(12px, 2.2vh, 20px); border-radius: 10px; margin: 0 0 clamp(14px, 3.2vh, 30px); font-size: clamp(13.5px, 1.85vh, 16px); line-height: 1.4; }
.net-badge svg.ic { color: #16a34a; width: clamp(20px, 2.9vh, 26px); height: clamp(20px, 2.9vh, 26px); flex: none; }
.net-badge b { color: #15803d; }
.net-badge.remote { background: #fff6e5; }
.net-badge.remote svg.ic, .net-badge.remote b { color: #b45309; }
.caps { color: #b45309; font-size: 12.5px; margin: -8px 0 12px; }
.login-card .btn.xl { margin-top: clamp(4px, 1.2vh, 12px); background: linear-gradient(180deg, #17a34d, #0f8a3c); border: 0; font-size: clamp(16px, 2.15vh, 19px); height: clamp(46px, 7.2vh, 64px); box-shadow: 0 10px 22px rgba(22, 163, 74, .28); }
.login-card .btn.xl svg.ic { width: clamp(18px, 2.5vh, 22px); height: clamp(18px, 2.5vh, 22px); }
.login-card .btn.xl .lbl { flex: 1; text-align: center; }
.or { display: flex; align-items: center; gap: 16px; color: #64748b; margin: clamp(10px, 2.4vh, 22px) 0 clamp(8px, 2vh, 18px); font-size: clamp(12.5px, 1.6vh, 14px); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.login-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px clamp(14px, 2.6vh, 28px); font-size: clamp(13.5px, 1.75vh, 15px); font-weight: 600; text-align: center; }
.login-links a { color: #157a3c; white-space: nowrap; }
.login-links span { width: 1px; height: 22px; background: #d6dde5; }
.login-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; margin: clamp(12px, 3.4vh, 34px) 0 0; color: #64748b; font-size: clamp(12px, 1.6vh, 14px); text-align: center; }
.login-meta .sep { color: #cbd5e1; }
.otp { height: clamp(48px, 6.8vh, 60px); font: 600 28px var(--mono); letter-spacing: .5em; text-align: center; margin-bottom: 16px; }
.steps { padding-left: 20px; color: #475569; margin: 12px 0; }
.qr { display: flex; justify-content: center; margin: 10px 0; }
.qr img { border-radius: 8px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-mobile { display: none; }

/* ------------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, #071510 240px, transparent 240px); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--side) 0%, #071510 100%); color: var(--side-text); padding: 18px 12px 14px; overflow-y: auto; z-index: 40; scrollbar-width: thin; scrollbar-color: #1e3a2c transparent; }
.brand { display: flex; flex-direction: column; padding: 2px 8px 18px; text-decoration: none !important; }
.brand .wordmark { width: 146px; }
.brand small { color: #78c79a; font-size: 12.5px; margin-top: 2px; }
/* client / VPN server picker (portal) */
.scope { margin: 0 2px 8px; padding: 3px; display: flex; flex-direction: column; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.scope-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: 0; background: none; border-radius: 9px; color: #e6efe9; font: inherit; text-align: left; cursor: pointer; }
.scope-row + .scope-row { position: relative; }
.scope-row + .scope-row::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; border-top: 1px solid rgba(255,255,255,.07); }
.scope-row:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.scope-row:hover:not(:disabled)::before, .scope-row:hover + .scope-row::before { border-color: transparent; }
.scope-row:disabled { cursor: default; opacity: 1; }
.scope-row .t { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.scope-row small { color: var(--side-muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.scope-row small .st { text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 4px; }
.scope-row small .st.online { color: #4ade80; }
.scope-row small .st.offline { color: #fca5a5; }
.scope-row b { color: #fff; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-row em { font-style: normal; color: var(--side-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-row > svg.ic { flex: none; width: 15px; height: 15px; color: var(--side-muted); }
.scope-av { position: relative; flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #1fb257, #0d7433); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.scope-av.srv { background: rgba(255,255,255,.07); color: #c3d4ca; }
.scope-av.srv svg.ic { width: 17px; height: 17px; }
.scope-av i, .sp-av i { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; background: #64748b; border: 2px solid #0a1f15; }
.scope-av.online i, .sp-av.online i { background: #22c55e; }
.scope-av.offline i, .sp-av.offline i { background: var(--red); }
.scope-av:not(.srv) i { display: none; }
.scope-pop { position: fixed; z-index: 70; width: 300px; max-height: min(460px, 75vh); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop-in .12s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.scope-pop header { display: flex; justify-content: space-between; padding: 12px 14px 8px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.sp-search { position: relative; margin: 0 10px 8px; }
.sp-search svg.ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.sp-search input { width: 100%; height: 34px; padding-left: 32px; }
.sp-list { overflow-y: auto; padding: 0 6px 6px; }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sp-item:hover { background: var(--gray-l); }
.sp-item.on { background: var(--green-l); }
.sp-item .t { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.sp-item b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item .chk { flex: none; color: var(--green); }
.sp-av { position: relative; flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--green-l); color: var(--green-t); font-size: 12px; font-weight: 700; }
.sp-item.on .sp-av:not(.srv) { background: var(--green); color: #fff; }
.sp-av.srv { background: var(--gray-l); color: var(--gray-t); }
.sp-av.srv i { border-color: var(--panel); }
.sp-pill { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--gray-l); color: var(--gray-t); }
.sp-pill.ok { background: var(--green-l); color: var(--green-t); }
.scope-pop footer { border-top: 1px solid var(--line); padding: 6px; }
.scope-pop footer a { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; color: var(--text); font-size: 13px; text-decoration: none !important; }
.scope-pop footer a:hover { background: var(--gray-l); }
/* collapsible menu sections */
#nav { display: flex; flex-direction: column; gap: 1px; }
#nav .sec { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--side-muted); padding: 12px 10px 5px; border-radius: 6px; text-align: left; }
#nav .sec:hover { color: #d7e4dc; }
#nav .sec > svg.ic { margin-left: auto; width: 14px; height: 14px; transition: transform .18s; }
#nav .sec .nav-badge { min-width: 18px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; letter-spacing: 0; }
#nav .nav-group:not(.collapsed) .sec .nav-badge { display: none; }
#nav .nav-group.collapsed .sec > svg.ic { transform: rotate(-90deg); }
#nav .nav-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease; }
#nav .nav-items > div { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 0 12px 10px; margin: 0 -12px -10px; }
#nav .nav-items > div { transition: visibility .2s, padding .2s, margin .2s; }
#nav .nav-group.collapsed .nav-items { grid-template-rows: 0fr; }
#nav .nav-group.collapsed .nav-items > div { visibility: hidden; padding-bottom: 0; margin-bottom: 0; }
#nav .nav-all { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 6px 10px; border: 0; background: none; color: var(--side-muted); font: inherit; font-size: 12px; cursor: pointer; border-radius: 6px; }
#nav .nav-all:hover { color: #fff; background: rgba(255,255,255,.04); }
#nav a { display: flex; align-items: center; gap: 11px; height: 31px; flex: none; padding: 0 10px; border-radius: 8px; color: var(--side-text); font-size: 13.5px; text-decoration: none; }
#nav a svg.ic { width: 17px; height: 17px; color: #9fb4a8; }
#nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
#nav a.active { background: linear-gradient(180deg, #19a650, #12913f); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(22, 163, 74, .25); }
#nav a.active svg.ic { color: #fff; }
#nav a .nav-badge { margin-left: auto; min-width: 20px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.sidebar-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.health { display: flex; align-items: center; gap: 8px; color: #6fd69a; font-size: 12.5px; padding: 0 8px 10px; border-bottom: 1px solid rgba(255,255,255,.07); text-decoration: none !important; }
.health .dot { width: 14px; height: 14px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.health.bad { color: #fca5a5; }
.health.bad .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(229,56,59,.2); }
.who { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: #fff; font-size: 14px; }
.who .avatar { display: none; }
.who .pill { margin-left: auto; }
.credit { color: var(--side-muted); font-size: 11.5px; margin: 4px 8px 0; line-height: 1.5; }
.scrim { display: none; }
main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px 0 16px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.crumbs b { color: var(--text); font-size: 16px; font-weight: 650; white-space: nowrap; }
.crumbs svg.ic { width: 15px; height: 15px; }
.crumbs .sub { font-size: 12.5px; }
.search { display: flex; align-items: center; gap: 10px; width: 300px; height: 40px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--faint); cursor: text; font: inherit; }
.search span { flex: 1; text-align: left; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell .count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--panel); }
.usermenu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 10px; color: var(--text); font: inherit; }
.user-btn:hover { background: var(--gray-l); }
.user-btn .avatar { background: #12304a; }
.user-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.user-txt b { font-size: 13.5px; }
.user-txt small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 7px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none !important; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--gray-l); }
.menu button.danger { color: var(--red-t); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.view { padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ------------------------------------------------------------------ page head, cards, grids */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; font-weight: 750; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.flush { padding: 0; }
.card.pad-sm { padding: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; flex-wrap: wrap; }
.card-head h2, .card > h2 { font-size: 15.5px; font-weight: 650; }
.card > h2 { margin-bottom: 12px; }
.card-head .sub, .card-title .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; display: block; margin-top: 1px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-title h2 { font-size: 15.5px; }
.card-title .right { margin-left: auto; }
.grid { display: grid; gap: 16px; min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-7-5 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.g-8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.with-drawer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.with-drawer.closed { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1201px) { .with-drawer:not(.closed) .opt { display: none; } }
.with-drawer.closed > .drawer { display: none; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty svg.ic { width: 30px; height: 30px; color: var(--faint); display: block; margin: 0 auto 8px; }
.empty b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 3px; }

/* KPI cards */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 14px; display: flex; gap: 16px; min-width: 0; position: relative; overflow: hidden; }
.kpi .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kpi .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi .value { font-size: 27px; font-weight: 750; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .foot { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; min-height: 30px; }
.kpi .spark { flex: 1; height: 34px; min-width: 60px; }
.kpi .trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--green-l); color: var(--green-t); white-space: nowrap; }
.kpi .trend.down { background: var(--red-l); color: var(--red-t); }
.kpi .trend.flat { background: var(--gray-l); color: var(--gray-t); }
.kpi .trend.plain { background: none; padding: 0; }
.kpi .bar { height: 7px; border-radius: 4px; background: var(--gray-l); overflow: hidden; margin-top: 10px; }
.kpi .bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.kpi .bar.red span { background: var(--red); }
.kpi .bar.gray span { background: #94a3b8; }
.kpi .bar.amber span { background: var(--amber); }
.kpi.compact { padding: 14px 16px; gap: 12px; align-items: center; }
.kpi.compact { padding: 14px 12px; gap: 10px; }
.kpi.compact .ico-tile { width: 36px; height: 36px; }
.kpi.compact .ico-tile svg.ic { width: 18px; height: 18px; }
.kpi.compact .value { font-size: 19px; text-overflow: clip; }
.kpi.compact .label { font-size: 11px; letter-spacing: .03em; }
.kpi.compact .foot { position: absolute; right: 10px; bottom: 12px; margin: 0; min-height: 0; }
.kpi.compact .bars { height: 22px; gap: 2px; }
.kpi.compact .bars i { width: 3px; }
.kpi.compact .body { padding-right: 22px; }
.btn.xs.icon { width: 28px; }
.kpi .side-ico { position: absolute; right: 16px; bottom: 14px; }
.kpi.mini { flex-direction: column; gap: 6px; }
.kpi.mini .head { display: flex; gap: 10px; align-items: center; }
.kpi .bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.kpi .bars i { width: 5px; border-radius: 2px; background: currentColor; opacity: .85; }

/* tabs & filters */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 12px; border: 0; background: none; color: var(--text-2); font: 500 14px var(--font); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .on { color: var(--green-t); border-bottom-color: var(--green); font-weight: 650; }
.tabs .on .count-pill { background: var(--green-l); color: var(--green-t); }
.tabs.page { padding: 0 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tabs.page button { height: 46px; }
.tabs.sub { padding: 0; }
.tabs.sub button { height: 40px; font-size: 13px; padding: 0 8px; }
.tabs .tab-search { margin-left: auto; display: flex; align-items: center; }
.filters { display: flex; gap: 10px; padding: 14px 16px; flex-wrap: wrap; align-items: center; }
.filters .search-in { position: relative; flex: 1 1 230px; max-width: 320px; }
.filters .search-in svg.ic { position: absolute; left: 11px; top: 9px; color: var(--faint); }
.filters .search-in input { padding-left: 36px; }
.filters select { width: auto; min-width: 130px; flex: 0 1 160px; }
.search-in { position: relative; }
.search-in svg.ic { position: absolute; left: 11px; top: 9px; color: var(--faint); }
.search-in input { padding-left: 36px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font: 500 12.5px var(--font); cursor: pointer; }
.chip span { color: var(--muted); }
.chip.on { background: var(--green-l); border-color: transparent; color: var(--green-t); }
.chip.on span { color: var(--green-t); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12.5px; padding: 11px 12px; background: var(--panel-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .sort { color: var(--faint); font-size: 10px; margin-left: 3px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 180px; }
th.num, td.num { text-align: right; }
th.chk, td.chk { width: 34px; padding-right: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.clickable { cursor: pointer; }
tbody tr.sel { background: var(--green-l) !important; }
tbody tr:last-child td { border-bottom: 0; }
.cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cell .t b { font-weight: 600; color: var(--text); }
.cell .t small { color: var(--muted); font-size: 11.5px; }
.cell.u .t b { font-weight: 500; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; }
.more-btn { width: 30px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; }
.more-btn:hover { background: var(--gray-l); }
.rate { line-height: 1.35; font-size: 12.5px; }
.rate .down { color: var(--green-t); }
.rate .up { color: var(--amber-t); }
.mini-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-bar .bar { flex: 1; height: 7px; border-radius: 4px; background: var(--gray-l); overflow: hidden; min-width: 50px; }
.mini-bar .bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.mini-bar.stack .bar { display: flex; }
.mini-bar.stack .bar span:nth-child(2) { background: #22c55e; border-radius: 0; }
.mini-bar.stack .bar span:first-child { background: var(--blue); border-radius: 0; }
.pct-col { display: flex; flex-direction: column; gap: 4px; min-width: 60px; font-size: 12.5px; }
.pct-col .bar { height: 5px; width: 50px; border-radius: 3px; background: var(--gray-l); overflow: hidden; }
.pct-col .bar span { display: block; height: 100%; background: var(--green); }
.sev-bar { width: 3px; height: 26px; border-radius: 2px; background: var(--blue); display: inline-block; }
.sev-bar.red { background: var(--red); } .sev-bar.amber { background: var(--amber); } .sev-bar.green { background: var(--green); }
.pager { display: flex; align-items: center; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .info { color: var(--muted); font-size: 13px; margin-right: auto; }
.pager button { min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; font: 500 13px var(--font); display: inline-grid; place-items: center; }
.pager button.on { background: var(--green); border-color: var(--green); color: #fff; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.pager .per { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-left: 10px; }
.pager .per select { width: 70px; height: 34px; }

/* detail drawer */
.drawer { position: sticky; top: 80px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin; }
.drawer-head { display: flex; gap: 14px; padding: 18px 18px 6px; align-items: flex-start; }
.drawer-head .t { flex: 1; min-width: 0; }
.drawer-head h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; word-break: break-word; }
.drawer-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; word-break: break-word; }
.drawer .tabs { padding: 0 18px; }
.drawer .tabs button { height: 42px; font-size: 13px; padding: 0 6px; }
.drawer-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 18px; }
.drawer-sec h4 { margin: 0 0 10px; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.drawer-sec h4 .right { margin-left: auto; }
.drawer-sec.boxed { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 13px; align-items: center; }
.kv dt { color: var(--muted); display: flex; align-items: center; gap: 9px; }
.kv dt svg.ic { width: 15px; height: 15px; color: var(--faint); }
.kv dd { margin: 0; color: var(--text); min-width: 0; word-break: break-word; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick .btn { justify-content: flex-start; height: 40px; min-width: 0; overflow: hidden; }
.quick .btn span { overflow: hidden; text-overflow: ellipsis; }
.kpi .value.long { font-size: 21px; padding-top: 4px; }
.quick .btn.full { grid-column: 1 / -1; }
.quick.three { grid-template-columns: 1fr 1fr 1fr; }
.traffic-now { display: flex; gap: 28px; }
.traffic-now div { display: flex; gap: 8px; align-items: center; }
.traffic-now b { font-size: 19px; display: block; }
.traffic-now small { color: var(--muted); }
.code-block { background: #0d1a14; color: #c8f2d6; border-radius: 8px; padding: 12px 14px; font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; margin: 0; max-height: 320px; overflow: auto; }
.path { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 0; }
.path .node { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; text-align: center; min-width: 0; }
.path .node small { color: var(--muted); font-size: 11px; }
.path .link { flex: 1; height: 0; border-top: 2px dashed var(--green); position: relative; margin: 0 4px 22px; }
.path .link.off { border-color: var(--red); }
.path .link i { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; }
.path .link.off i { background: var(--red); }
.path .link i svg.ic { width: 13px; height: 13px; }

/* charts, maps */
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 150px; }
.chart-box.lg { height: 300px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.sq { border-radius: 2px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; align-items: start; }
.map { height: 240px; border-radius: 10px; background: #eef2f6; overflow: hidden; z-index: 0; }
:root[data-theme="dark"] .map { background: #0f1916; }
.leaflet-container { background: transparent; font: inherit; }
.top-list { display: flex; flex-direction: column; gap: 11px; font-size: 12.5px; }
.top-list .h { color: var(--muted); font-size: 12px; }
.top-list div.r { display: flex; align-items: center; gap: 9px; }
.top-list div.r span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list div.r b { font-weight: 600; }
.bars-list { display: flex; flex-direction: column; gap: 12px; }
.bars-list .r { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.bars-list .r > :first-child, .bars-list .r > :last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars-list .bar { height: 8px; border-radius: 4px; background: var(--gray-l); overflow: hidden; }
.bars-list .bar span { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.gauge-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; }
.gauge b { font-size: 13px; }
.gauge small { color: var(--muted); }
.gauge svg { width: 76px; height: 76px; }
.ok-strip { display: flex; align-items: center; gap: 10px; background: var(--green-l); border-radius: 10px; padding: 12px 14px; margin-top: 16px; font-size: 13px; }
.ok-strip.bad { background: var(--red-l); }
.ok-strip .right { margin-left: auto; color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap .chart-box { width: 170px; height: 170px; flex: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 26px; display: block; }
.donut-center small { color: var(--muted); }

/* integrations / settings */
.int-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 16px 16px; }
.with-drawer:not(.closed) .int-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.int-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.int-card:hover { border-color: #cfe9d9; }
.int-card.sel { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.int-card .top { display: flex; gap: 12px; align-items: flex-start; }
.int-card .top .t { flex: 1; min-width: 0; }
.int-card .top b { font-size: 14.5px; }
.int-card .top p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.int-card .foot { display: flex; gap: 8px; margin-top: auto; }
.int-card .foot .btn:first-child { flex: 1; }
.int-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: 15px; }
.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.set-card .card-title .ico-tile { width: 42px; height: 42px; }
.set-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.set-row > span:first-child { color: var(--text-2); }
.set-row .hint { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.set-row .inline { display: flex; align-items: center; gap: 10px; }
.set-row .inline .hint { margin: 0; }
.act-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act-tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px 8px; text-align: center; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; color: var(--text); }
.act-tile b { font-size: 13px; }
.act-tile small { color: var(--muted); font-size: 11px; }
.act-tile:hover { background: var(--panel-2); }
.act-tile.danger { background: var(--red-l); border-color: #f6c7c8; color: var(--red-t); }

/* modals, toasts, palette */
.modal-back { position: fixed; inset: 0; background: rgba(8, 20, 14, .45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal.wide { max-width: 780px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16.5px; }
.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #0f1f17; color: #e6f2ea; border-radius: 10px; padding: 11px 14px; min-width: 260px; max-width: 420px; box-shadow: var(--shadow-lg); font-size: 13px; border-left: 4px solid #64748b; animation: fade .15s; }
.toast.ok { border-left-color: #22c55e; }
.toast.error, .toast.critical { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }
.palette { position: fixed; inset: 0; background: rgba(8, 20, 14, .4); z-index: 120; display: flex; justify-content: center; padding-top: 12vh; }
.palette-box { width: 100%; max-width: 620px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; align-self: flex-start; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.palette-input input { border: 0; box-shadow: none !important; height: 54px; font-size: 15px; padding: 0; }
.palette-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-list .grp { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px 4px; }
.palette-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none !important; font-size: 13.5px; }
.palette-list a small { color: var(--muted); margin-left: auto; }
.palette-list a.on, .palette-list a:hover { background: var(--green-l); }

/* misc blocks reused from 1.2 */
.asset-health { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.asset-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.asset-facts div { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.asset-facts span { color: var(--muted); font-size: 12px; }
.asset-facts b { font-size: 17px; }
.asset-facts small { color: var(--muted); font-size: 11.5px; }
.asset-issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.status-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.status-row:last-child { border-bottom: 0; }
.fleet-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fleet-stats div { display: flex; flex-direction: column; }
.fleet-stats b { font-size: 18px; }
.fleet-stats span { color: var(--muted); font-size: 12px; }
.storage-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--gray-l); margin: 6px 0 12px; }
.storage-bar span { display: block; height: 100%; }
.legend-list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend-list div { display: flex; align-items: center; gap: 8px; }
.legend-list div b { margin-left: auto; font-weight: 500; font-family: var(--mono); font-size: 12px; }
.sel-strip { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--green-l); color: var(--green-t); font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1500px) {
  .with-drawer { grid-template-columns: minmax(0, 1fr) 340px; }
  .int-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .with-drawer { grid-template-columns: minmax(0, 1fr); }
  .drawer { position: static; max-height: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-7-5, .g-8-4, .g3 { grid-template-columns: minmax(0, 1fr); }
  .search { width: 220px; }
}
@media (max-width: 1000px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .brand-mobile { display: block; margin-bottom: clamp(14px, 3vh, 26px); }
  .brand-mobile img { width: clamp(150px, 24vh, 200px); }
  .login-card { max-width: 480px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .sidebar.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .search span, .search kbd, .user-txt { display: none; }
  .search { width: 40px; padding: 0; justify-content: center; border: 0; }
  .g2, .g6, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-row { grid-template-columns: 1fr; }
  .int-grid, .set-grid { grid-template-columns: minmax(0, 1fr); }
  .asset-health { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .view { padding: 16px 16px 32px; }
  .topbar { padding: 0 12px 0 8px; gap: 6px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .g4, .g6, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; gap: 10px; flex-direction: column; }
  .kpi .ico-tile { width: 36px; height: 36px; }
  .kpi .value { font-size: 22px; }
  .kpi .side-ico { display: none; }
  .filters select { flex: 1 1 100%; max-width: none; }
  .filters .search-in { max-width: none; flex-basis: 100%; }
  .page-head .actions { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .login-side { padding: 12px; align-items: start; }
  .login-card { padding: clamp(22px, 4.5vh, 36px) 20px clamp(18px, 3.5vh, 28px); }
  .login-card h2 { font-size: clamp(24px, 4vh, 30px); }
  .login-links { flex-direction: column; gap: 10px; }
  .login-links span { display: none; }
  .crumbs .sub, .crumbs > span:not(:last-child), .crumbs > svg { display: none; }
  .gauge-row { grid-template-columns: repeat(2, 1fr); }
  .quick.three { grid-template-columns: 1fr 1fr; }
  .bars-list .r { grid-template-columns: 100px minmax(0, 1fr) 34px; }
}
@media print {
  .sidebar, .topbar, .no-print, .drawer, .pager { display: none !important; }
  .app { display: block; }
  .card, .kpi { break-inside: avoid; box-shadow: none; }
}
