/* VixoStream "Royal" colours — the panel's own layout with a modern, premium finish. Loaded after app.css. */
:root, [data-theme="light"] {
  --bg: #ffffff;   /* plain white pages, like the top bar */
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f7fd;
  --surface-3: #efedf8;
  --border: #e9e6f5;
  --border-2: #dcd7ee;
  --text: #17132b;
  --text-2: #4d4868;
  --muted: #827ca0;
  --accent: #7c3aed;
  --accent-2: #6d28d9;
  --pink: #db2777;
  --gold: #f5b82e;
  --gold-2: #d99a0b;
  --accent-glow: rgba(124, 58, 237, 0.28);
  --accent-soft: rgba(124, 58, 237, 0.10);
  --grad: linear-gradient(120deg, #7c3aed 0%, #a21caf 55%, #db2777 100%);
  --gold-grad: linear-gradient(120deg, #fde68a 0%, #f5b82e 45%, #d99a0b 100%);
  --sidebar-bg: linear-gradient(185deg, #140f33 0%, #1d1650 48%, #120e2e 100%);
  --sidebar-text: #b3aed6;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 44px rgba(40, 22, 90, 0.14);
  --shadow-sm: 0 1px 2px rgba(40, 22, 90, 0.05), 0 6px 18px rgba(40, 22, 90, 0.05);
  --hover: rgba(124, 58, 237, 0.05);
  --chart-grid: rgba(40, 22, 90, 0.07);
  --scroll: #d4cfe8;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c0a1d;
  --bg-2: #110e26;
  --surface: #15122c;
  --surface-2: #1a1636;
  --surface-3: #231e44;
  --border: rgba(180, 170, 255, 0.09);
  --border-2: rgba(180, 170, 255, 0.16);
  --text: #eeeaff;
  --text-2: #b8b1dc;
  --muted: #8680ad;
  --accent: #a78bfa;
  --accent-2: #8b5cf6;
  --accent-glow: rgba(167, 139, 250, 0.32);
  --accent-soft: rgba(167, 139, 250, 0.13);
  --grad: linear-gradient(120deg, #8b5cf6 0%, #c026d3 55%, #ec4899 100%);
  --sidebar-bg: linear-gradient(185deg, #0f0b27 0%, #181245 50%, #0d0a22 100%);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-sm: none;
  --hover: rgba(167, 139, 250, 0.07);
  --chart-grid: rgba(255, 255, 255, 0.06);
  --scroll: #2e2858;
  color-scheme: dark;
}

body { background: var(--bg); color: var(--text); }
[data-theme="light"] body, :root:not([data-theme="dark"]) body { background: #ffffff; }
[data-theme="dark"] body { background: radial-gradient(1100px 480px at 100% -10%, rgba(139, 92, 246, 0.14), transparent 60%), radial-gradient(800px 400px at -10% 110%, rgba(236, 72, 153, 0.07), transparent 60%), var(--bg); background-attachment: fixed; }
::selection { background: rgba(124, 58, 237, 0.25); }
a { color: var(--accent); }

/* ---------------- sidebar: royal night with a gold thread */
.sidebar { background: var(--sidebar-bg); box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04), 8px 0 30px rgba(20, 10, 60, 0.18); }
.sidebar::before { content: ''; position: absolute; inset: 0; background: radial-gradient(260px 200px at 20% 0%, rgba(167, 139, 250, 0.22), transparent 70%), radial-gradient(220px 220px at 100% 100%, rgba(236, 72, 153, 0.14), transparent 70%); pointer-events: none; }
.sidebar > * { position: relative; }
.brand .name { color: #fff; }
.brand .name small { color: #d8c27a; letter-spacing: 0.1em; }
.nav a { color: var(--sidebar-text); border-radius: 12px; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(167, 139, 250, 0.26), rgba(236, 72, 153, 0.08)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav a.active svg { color: var(--gold); opacity: 1; }
.sidebar-foot .avatar, .avatar { background: var(--gold-grad); color: #2a1a00; }

/* ---------------- top bar: frosted, the stats as soft chips */
.topbar { background: color-mix(in srgb, var(--bg-2) 78%, transparent) !important; backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-weight: 800; letter-spacing: -0.02em; }
.topbar h1 .title-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statbar { border-color: var(--border-2); background: var(--surface); box-shadow: var(--shadow-sm); }
.statbar .pill { border-left-color: var(--border); }
.statbar .pill b { color: var(--text); }
.pill.accent { background: var(--gold-grad); color: #3a2600; border-color: transparent; font-weight: 700; }
.pill.accent b { color: #3a2600; }
.pill .dot { background: var(--ok); }

/* ---------------- cards, buttons, inputs: rounder, softer */
.card, .stat, .gpu-card, .table-wrap, .scard, .popover { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow-sm); }
[data-theme="light"] .card, .card { box-shadow: var(--shadow-sm); }
.btn { border-radius: 11px; }
.btn.primary { background: var(--grad); border-color: transparent; box-shadow: 0 8px 22px var(--accent-glow); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.solid-accent { background: var(--grad); border-color: transparent; }
.btn.solid-pink { background: linear-gradient(120deg, #db2777, #f43f5e); border-color: transparent; }
.input, select.input, textarea.input { border-radius: 11px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.switch.on, .xo.on .tr { background: var(--grad); }
.check input, .radios input, .sel-col input { accent-color: var(--accent); }
.radio-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg button.active, .mode-seg button.active, .chip.active { background: var(--grad); border-color: transparent; color: #fff; }
.proto-tabs button.active { background: var(--grad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------------- tabs: the same strip, a modern finish (rounded, gradient mark on the open one) */
.tabs { border-bottom: 1px solid var(--border-2); gap: 4px; }
.tabs a, .tabs button:not(.tab-plus) { border-radius: 12px 12px 0 0; background: transparent; border-color: transparent; color: var(--text-2); font-weight: 600; }
.tabs a:hover, .tabs button:not(.tab-plus):hover { background: var(--hover); color: var(--text); }
.tabs a.active, .tabs button:not(.tab-plus).active { background: var(--surface); color: var(--accent); border-color: var(--border-2); border-bottom-color: var(--surface); box-shadow: inset 0 3px 0 var(--accent-2); font-weight: 700; }
.tabs .tab-plus { background: var(--grad); box-shadow: 0 6px 16px var(--accent-glow); }

/* ---------------- tables */
th { background: var(--surface-2); color: var(--muted); letter-spacing: 0.06em; }
[data-theme="dark"] th { background: var(--surface-2); }
tbody tr:hover td { background: var(--hover); }
.slist .name a { color: var(--text); }
.slist .name a:hover { color: var(--accent); }
.info-btn { background: var(--grad); }
.bulk-bar { background: var(--accent-soft); border-color: rgba(124, 58, 237, 0.3); }

/* ---------------- login: the same page, royal */
.login-page { background: radial-gradient(900px 500px at 15% 0%, rgba(124, 58, 237, 0.13), transparent 60%), radial-gradient(800px 500px at 100% 100%, rgba(219, 39, 119, 0.10), transparent 60%), var(--bg); }
.login-hero .brand-name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.login-hero .admin-ui { color: var(--text); }
.login-hero .biglogo { filter: drop-shadow(0 18px 34px rgba(124, 58, 237, 0.35)); }
.u-input { color: var(--text); border-bottom-color: var(--border-2); }
.u-input:focus { border-bottom-color: var(--accent); }
.login-form .btn.sign { background: var(--grad); border: 0; border-radius: 11px; padding: 10px 26px; box-shadow: 0 10px 24px var(--accent-glow); }
.setup-title { color: var(--text); }

/* ---------------- update box in the sidebar */
.upd-box { background: linear-gradient(135deg, rgba(245, 184, 46, 0.18), rgba(167, 139, 250, 0.14)); border: 1px solid rgba(245, 184, 46, 0.4); display: flex; flex-direction: column; align-items: center; }
.upd-box .upd-ico { background: var(--gold-grad); color: #3a2600; }
.upd-box .upd-txt b { display: block; color: #fff; }
.upd-box .upd-txt span { color: rgba(255, 255, 255, 0.72); font-size: 11.5px; }
.upd-box .upd-btn { background: var(--gold-grad) !important; color: #2a1a00 !important; border: 0 !important; font-weight: 800; }

/* ================================================================ pieces added in 1.1 */
/* test result under the source address */
.test-out { margin-top: 8px; }
.test-run, .test-good, .test-bad { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.test-run { background: var(--surface-2); color: var(--text-2); align-items: center; }
.test-good { background: var(--ok-bg); color: var(--ok-fg); }
.test-bad { background: var(--err-bg); color: var(--err-fg); }
.test-good svg, .test-bad svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.test-good b, .test-bad b { display: block; color: var(--text); }
.test-good span, .test-bad span { color: var(--text-2); font-size: 12.5px; }

/* update window + what's new */
.wn-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(245, 184, 46, 0.12)); border: 1px solid var(--border-2); margin-bottom: 16px; }
.wn-badge { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--gold-grad); color: #3a2600; flex: none; }
.wn-badge svg { width: 22px; height: 22px; }
.wn-hero b { display: block; font-size: 16px; }
.wn-hero span { font-size: 12.5px; color: var(--text-2); }
.wn-body { max-height: 46vh; overflow: auto; }
.wn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wn-list li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.wn-list li svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--gold-2); }
.upd-steps { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.upd-step { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.upd-step i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted); flex: none; }
.upd-step i svg { width: 13px; height: 13px; }
.upd-step.now { color: var(--text); font-weight: 600; } .upd-step.now i { background: var(--accent-soft); color: var(--accent); }
.upd-step.done { color: var(--text-2); } .upd-step.done i { background: var(--ok); color: #fff; }

/* Ctrl K palette */
.pal-bg { position: fixed; inset: 0; z-index: 120; background: rgba(12, 8, 30, 0.5); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade 0.12s; }
.pal { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: 0 30px 90px rgba(20, 10, 60, 0.35); overflow: hidden; animation: pop 0.16s ease-out; }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-top svg { width: 18px; height: 18px; }
.pal-input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); font: inherit; }
.pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 14px; }
.pal-item.on { background: var(--accent-soft); }
.pal-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; position: relative; }
.pal-ic svg { width: 16px; height: 16px; }
.pal-ic.online::after, .pal-ic.error::after, .pal-ic.waiting::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ok); }
.pal-ic.error::after { background: var(--err); } .pal-ic.waiting::after { background: var(--warn); }
.pal-l { flex: 1; min-width: 0; }
.pal-l small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-k { font-size: 11px; color: var(--muted); font-weight: 600; }
.pal-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.mp-empty { display: flex; align-items: center; gap: 8px; padding: 14px 10px; color: var(--muted); font-size: 13px; }

/* dashboard */
.dash-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0 0; }
.dash-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.dash-head .right { margin-left: auto; display: flex; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { position: relative; display: block; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.15s; }
a.kpi:hover { transform: translateY(-2px); }
.kpi::before { content: ''; position: absolute; inset: -40% -30% auto auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent 70%); pointer-events: none; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-ic.ok { background: var(--ok-bg); color: var(--ok-fg); } .kpi-ic.cy { background: rgba(219, 39, 119, 0.1); color: var(--pink); } .kpi-ic.in { background: rgba(245, 184, 46, 0.15); color: var(--gold-2); }
.kpi-ic svg { width: 17px; height: 17px; }
.kpi-l { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi-v { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; margin: 12px 0 6px; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-v small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi-s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi-s .err-t { color: var(--err-fg); font-weight: 600; }
.kpi-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.kpi-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #16a34a, #22c55e); }
.spark { display: block; width: 100%; height: 34px; margin-top: 4px; }
.spark .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .fill { opacity: 0.14; }
.spark.v .line { stroke: var(--accent); } .spark.v .fill { fill: var(--accent); }
.spark.o .line { stroke: var(--pink); } .spark.o .fill { fill: var(--pink); }
.spark.i .line { stroke: var(--gold-2); } .spark.i .fill { fill: var(--gold-2); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.dash-main, .dash-side { display: grid; gap: 16px; min-width: 0; }
.dash-main > *, .dash-side > *, .att-list > *, .top-list > * { min-width: 0; }
.dash-main .card + .card, .dash-side .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card-head > :last-child:not(:first-child) { margin-left: auto; }
.dash-traffic .chart { height: 210px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: block; border-radius: 13px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: transform 0.15s, box-shadow 0.15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-img { position: relative; aspect-ratio: 16 / 9; background: #07051a; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-tag { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 6px; background: rgba(225, 29, 72, 0.92); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.live-tag i { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.res-tag { position: absolute; bottom: 8px; right: 8px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 10.5px; font-weight: 700; font-family: var(--mono); }
.tile-b { display: flex; align-items: center; gap: 8px; padding: 9px 11px; font-size: 12.5px; }
.tile-b b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-b span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.tile-b svg { width: 13px; height: 13px; }
.att-list, .top-list, .res-list { display: grid; gap: 4px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; min-width: 0; }
.att:hover { background: var(--hover); }
.att-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--warn); }
.att-dot.err { background: var(--err); }
.att-t { flex: 1; min-width: 0; color: var(--text); text-decoration: none !important; }
.att-t b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-t span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok-note { display: flex; align-items: center; gap: 8px; padding: 6px 2px; color: var(--ok-fg); font-weight: 600; font-size: 13px; }
.ok-note svg { width: 18px; height: 18px; }
.top-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 34px; gap: 10px; align-items: center; padding: 7px 4px; font-size: 13px; color: var(--text); text-decoration: none !important; border-radius: 8px; }
.top-row:hover { background: var(--hover); }
.top-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.top-bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.top-row b { text-align: right; }
.res-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 2px; font-size: 13px; }
.res-row > span { color: var(--muted); }
.res-row > b { font-weight: 600; text-align: right; }
.res-m { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 10px; align-items: center; }
.res-m b { text-align: right; font-weight: 600; }
.bar { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: var(--grad); }
.bar i.warn { background: var(--warn); } .bar i.err { background: var(--err); }
.legend span { display: inline-flex; align-items: center; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .kpis { gap: 10px; } .kpi-v { font-size: 22px; } .dash-head .right { width: 100%; margin-left: 0; } }

/* an icon nobody sized stays text-sized instead of filling its box (zero specificity: every real rule wins) */
:where(svg[viewBox="0 0 24 24"]) { width: 1.15em; height: 1.15em; flex: none; }
