/* ==========================================================================
   3DSPP NEXUS — design system
   ========================================================================== */
:root {
  --bg: #05070d;
  --bg-2: #0a0e18;
  --panel: rgba(14, 20, 34, 0.72);
  --panel-solid: #0d1322;
  --panel-hi: rgba(22, 31, 52, 0.85);
  --line: rgba(148, 163, 184, 0.12);
  --line-hi: rgba(148, 163, 184, 0.22);
  --text: #e6edf7;
  --text-2: #9aa7bd;
  --text-3: #64748b;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --pink: #f472b6;
  --grad: linear-gradient(135deg, #22d3ee 0%, #818cf8 55%, #a78bfa 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(167, 139, 250, .16));
  --glow: 0 0 0 1px rgba(34, 211, 238, .25), 0 0 24px rgba(34, 211, 238, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(34, 211, 238, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- ambient background ---- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 85%);
  animation: grid-drift 40s linear infinite;
}
@keyframes grid-drift { to { background-position: 44px 44px, 44px 44px; } }
.bg-glow {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(34, 211, 238, .13), transparent 70%),
    radial-gradient(35% 35% at 90% 15%, rgba(167, 139, 250, .14), transparent 70%),
    radial-gradient(40% 40% at 60% 100%, rgba(99, 102, 241, .08), transparent 70%);
  animation: glow-breathe 14s ease-in-out infinite alternate;
}
@keyframes glow-breathe { to { transform: translate3d(2%, 1%, 0) scale(1.05); } }
#app { position: relative; z-index: 1; min-height: 100vh; }

/* ---- boot ---- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot-logo { width: 72px; height: 72px; animation: spin-pulse 2.4s ease-in-out infinite; filter: drop-shadow(0 0 18px rgba(34, 211, 238, .5)); }
.boot-text { font: 600 12px/1 var(--mono); letter-spacing: .35em; color: var(--text-2); }
@keyframes spin-pulse { 0%, 100% { transform: rotate(0) scale(1); opacity: .8 } 50% { transform: rotate(180deg) scale(1.08); opacity: 1 } }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 14, 24, .92), rgba(5, 7, 13, .92));
  backdrop-filter: blur(16px);
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.brand svg { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(34, 211, 238, .45)); }
.brand-name { font: 700 17px/1.1 var(--display); letter-spacing: .02em; }
.brand-name .sub { display: block; font: 600 10px/1.4 var(--mono); letter-spacing: .32em; color: var(--text-3); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font: 600 10px/1 var(--mono); letter-spacing: .22em; color: var(--text-3); padding: 16px 12px 8px; text-transform: uppercase; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(148, 163, 184, .07); color: var(--text); }
.nav a.active { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .18); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); box-shadow: 0 0 12px var(--cyan); }
.nav a .count { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--text-3); background: rgba(148, 163, 184, .08); padding: 3px 7px; border-radius: 20px; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 13px/1 var(--display); background: var(--grad); color: #04121a; flex: none; }
.who { min-width: 0; flex: 1; }
.who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--text-3); font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  border-bottom: 1px solid var(--line); background: rgba(5, 7, 13, .7); backdrop-filter: blur(18px) saturate(1.4);
}
.menu-btn { display: none; }
.crumbs { font: 600 18px/1.2 var(--display); letter-spacing: .01em; }
.crumbs small { display: block; font: 500 11px/1.4 var(--mono); color: var(--text-3); letter-spacing: .14em; text-transform: uppercase; }
.search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 280px; padding: 8px 12px;
  background: rgba(148, 163, 184, .06); border: 1px solid var(--line); border-radius: 10px; color: var(--text-3); cursor: pointer; font: inherit;
}
.search-trigger:hover { border-color: var(--line-hi); color: var(--text-2); }
.search-trigger svg { width: 16px; height: 16px; }
kbd { font: 500 10.5px/1 var(--mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-hi); background: rgba(148, 163, 184, .08); color: var(--text-2); margin-left: auto; }
.live { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .14em; color: var(--text-2); padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: ping 2s infinite; }
.live.off i { background: var(--red); animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55) } 70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0) } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0) } }
.content { padding: 26px 28px 60px; max-width: 1600px; width: 100%; animation: page-in .35s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- typography helpers ---- */
h1, h2, h3, h4 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: .005em; }
h2 { font-size: 15px; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font: 600 10.5px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--text-3); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- layout ---- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

/* ---- panels ---- */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.panel::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(34, 211, 238, .22), transparent 35%, transparent 65%, rgba(167, 139, 250, .18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-head h2 svg { width: 16px; height: 16px; color: var(--cyan); }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }

/* ---- stat tiles ---- */
.stat { padding: 18px 18px 16px; overflow: hidden; }
.stat .eyebrow { display: flex; align-items: center; gap: 8px; }
.stat .eyebrow svg { width: 14px; height: 14px; color: var(--cyan); }
.stat .value { font: 600 34px/1.1 var(--display); margin: 10px 0 4px; letter-spacing: -.01em; }
.stat .sub { color: var(--text-2); font-size: 12.5px; }
.stat .spark { position: absolute; right: 0; bottom: 0; width: 55%; height: 48px; opacity: .55; }
.stat.accent .value { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-hi); background: rgba(148, 163, 184, .07); color: var(--text);
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: rgba(148, 163, 184, .13); border-color: rgba(148, 163, 184, .35); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { border: 0; color: #03141c; font-weight: 600; background: var(--grad); box-shadow: 0 6px 22px rgba(34, 211, 238, .25); }
.btn.primary:hover { box-shadow: 0 8px 30px rgba(34, 211, 238, .4); filter: brightness(1.06); }
.btn.danger { border-color: rgba(248, 113, 113, .4); color: #fecaca; background: rgba(248, 113, 113, .1); }
.btn.danger:hover { background: rgba(248, 113, 113, .2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: rgba(148, 163, 184, .08); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---- forms ---- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
label.field .hint { color: var(--text-3); font-weight: 400; font-size: 12px; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-hi);
  background: rgba(3, 6, 12, .55); color: var(--text); font: 14px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
textarea.input.code { font: 12.5px/1.55 var(--mono); min-height: 260px; }
.input:focus { border-color: rgba(34, 211, 238, .6); box-shadow: 0 0 0 3px rgba(34, 211, 238, .14); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa7bd' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
select.input option { background: var(--panel-solid); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* toggle switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .lbl { display: flex; flex-direction: column; }
.switch .lbl small { color: var(--text-3); font-size: 12px; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: rgba(148, 163, 184, .22); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; transition: transform .2s, background .2s; }
.switch input:checked { background: var(--grad); box-shadow: 0 0 14px rgba(34, 211, 238, .4); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }
.checkbox { appearance: none; width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line-hi); background: rgba(3, 6, 12, .5); cursor: pointer; position: relative; margin: 0; vertical-align: middle; }
.checkbox:checked { background: var(--grad); border-color: transparent; }
.checkbox:checked::after { content: ''; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px; border: solid #03141c; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkbox:indeterminate { background: var(--grad); border-color: transparent; }
.checkbox:indeterminate::after { content: ''; position: absolute; left: 3px; right: 3px; top: 6.5px; height: 2px; background: #03141c; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 600 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(34, 211, 238, .035); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected { background: rgba(34, 211, 238, .07); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .w-check { width: 42px; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main b { font-weight: 600; display: block; }
.cell-main small { color: var(--text-3); font: 11.5px var(--mono); }
.dev-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(148, 163, 184, .07); border: 1px solid var(--line); flex: none; position: relative; }
.dev-ico svg { width: 18px; height: 18px; color: var(--text-2); }
.dev-ico .dot { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel-solid); background: var(--text-3); }
.dev-ico .dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 20px; font: 500 11.5px/1 var(--font); border: 1px solid var(--line-hi); color: var(--text-2); background: rgba(148, 163, 184, .06); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .08); }
.badge.amber { color: var(--amber); border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .08); }
.badge.red { color: var(--red); border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .08); }
.badge.cyan { color: var(--cyan); border-color: rgba(34, 211, 238, .3); background: rgba(34, 211, 238, .08); }
.badge.violet { color: var(--violet); border-color: rgba(167, 139, 250, .3); background: rgba(167, 139, 250, .08); }
.badge.pulse i { animation: ping 2s infinite; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font: 500 11px/1 var(--mono); background: rgba(167, 139, 250, .1); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, .2); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* battery meter */
.batt { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); color: var(--text-2); }
.batt-bar { width: 34px; height: 12px; border-radius: 3px; border: 1.5px solid rgba(148, 163, 184, .4); padding: 1.5px; position: relative; }
.batt-bar::after { content: ''; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: rgba(148, 163, 184, .4); }
.batt-bar span { display: block; height: 100%; border-radius: 1.5px; background: var(--green); }
.batt.low .batt-bar span { background: var(--red); }
.batt.mid .batt-bar span { background: var(--amber); }

/* ---- toolbar / filters ---- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .input-icon { flex: 1; min-width: 220px; max-width: 420px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(3, 6, 12, .55); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); border-radius: 7px; font: 500 12.5px var(--font); cursor: pointer; }
.seg button.on { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .25); }

/* bulk action bar */
.bulkbar {
  position: fixed; left: calc(var(--sidebar) + 50%); transform: translateX(calc(-50% - var(--sidebar) / 2)); bottom: 24px; z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 14px;
  background: rgba(13, 19, 34, .92); border: 1px solid rgba(34, 211, 238, .35); box-shadow: var(--glow), 0 20px 60px rgba(0, 0, 0, .5);
  backdrop-filter: blur(18px); animation: rise .25s ease; flex-wrap: wrap; max-width: calc(100vw - var(--sidebar) - 40px);
}
.bulkbar b { font-family: var(--display); }
@keyframes rise { from { opacity: 0; transform: translate(calc(-50% - var(--sidebar) / 2), 16px); } }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { height: 40px; padding: 0 14px; border: 0; background: none; color: var(--text-2); font: 500 13.5px var(--font); cursor: pointer; position: relative; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--grad); box-shadow: 0 0 10px var(--cyan); border-radius: 2px; }

/* ---- key/value lists ---- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 0; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---- bar lists / charts ---- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgba(148, 163, 184, .1); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 6px; background: var(--grad); box-shadow: 0 0 10px rgba(34, 211, 238, .4); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 150px; height: 150px; flex: none; }
.donut text { font-family: var(--display); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 9px; }
.legend b { margin-left: auto; font-family: var(--mono); font-weight: 500; padding-left: 12px; }
.chart { width: 100%; height: 160px; display: block; }

/* ---- feed ---- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); align-items: start; animation: feed-in .4s ease; }
.feed li:last-child { border-bottom: 0; }
.feed .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(34, 211, 238, .1); color: var(--cyan); }
.feed .ico svg { width: 14px; height: 14px; }
.feed .ico.warn { background: rgba(251, 191, 36, .1); color: var(--amber); }
.feed .ico.error { background: rgba(248, 113, 113, .1); color: var(--red); }
.feed .msg { font-size: 13px; min-width: 0; }
.feed .msg small { display: block; color: var(--text-3); font-size: 12px; }
.feed time { color: var(--text-3); font: 11.5px var(--mono); white-space: nowrap; }
@keyframes feed-in { from { opacity: 0; transform: translateX(-6px); background: rgba(34, 211, 238, .08); } }

/* ---- empty states ---- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty svg { width: 46px; height: 46px; color: var(--text-3); margin-bottom: 12px; opacity: .7; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }

/* ---- modal ---- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(2, 4, 9, .66); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), var(--glow); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.wide { width: min(820px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; display: flex; align-items: center; gap: 9px; min-width: 0; }
.modal-head h3 svg { width: 18px; height: 18px; color: var(--cyan); flex: none; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal .danger-zone { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .07); color: #fecaca; font-size: 13px; margin-bottom: 14px; }

/* ---- toasts ---- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: rgba(13, 19, 34, .96); border: 1px solid var(--line-hi); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.2); font-size: 13px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--green); }
.toast.err { border-color: rgba(248, 113, 113, .4); }
.toast.err svg { color: var(--red); }
.toast.info svg { color: var(--cyan); }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---- command palette ---- */
.palette { width: min(620px, 100%); align-self: start; margin-top: 12vh; background: var(--panel-solid); border: 1px solid rgba(34, 211, 238, .35); border-radius: 16px; box-shadow: var(--glow), 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; animation: pop .2s ease; }
.palette input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: 16px var(--font); padding: 0 20px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; cursor: pointer; color: var(--text-2); }
.palette li svg { width: 16px; height: 16px; }
.palette li small { margin-left: auto; color: var(--text-3); font: 11px var(--mono); }
.palette li.on { background: var(--grad-soft); color: var(--text); }

/* ---- login ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; overflow: hidden; border-right: 1px solid var(--line); }
.auth-hero h1 { font-size: clamp(34px, 4vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -.02em; max-width: 620px; }
.auth-hero p { color: var(--text-2); max-width: 520px; font-size: 16px; }
.hex-orbit { position: absolute; right: -300px; top: 50%; width: 620px; height: 620px; transform: translateY(-50%); opacity: .4; pointer-events: none; z-index: 0; }
.auth-hero > *:not(.hex-orbit) { position: relative; z-index: 1; }
.hex-orbit svg { width: 100%; height: 100%; animation: orbit 60s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.auth-feats { display: flex; gap: 22px; flex-wrap: wrap; color: var(--text-2); font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.auth-feats span { display: flex; align-items: center; gap: 8px; }
.auth-feats svg { width: 15px; height: 15px; color: var(--cyan); }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); padding: 32px; }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth-card .btn.primary { height: 42px; margin-top: 6px; }
.error-msg { color: #fecaca; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .3); padding: 10px 12px; border-radius: 10px; font-size: 13px; }

/* ---- misc components ---- */
.dropzone { border: 1.5px dashed rgba(34, 211, 238, .35); border-radius: var(--radius); padding: 34px 20px; text-align: center; background: rgba(34, 211, 238, .03); transition: background .2s, border-color .2s; cursor: pointer; }
.dropzone.over { background: rgba(34, 211, 238, .09); border-color: var(--cyan); box-shadow: var(--glow); }
.dropzone svg { width: 34px; height: 34px; color: var(--cyan); margin-bottom: 8px; }
.progress { height: 6px; border-radius: 6px; background: rgba(148, 163, 184, .12); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: var(--grad); width: 0; transition: width .2s; box-shadow: 0 0 10px var(--cyan); }
.qr-box { background: #fff; padding: 14px; border-radius: 14px; display: inline-block; box-shadow: 0 0 40px rgba(34, 211, 238, .25); }
.qr-box img, .qr-box svg { display: block; width: 260px; height: 260px; image-rendering: pixelated; }
.code-block { font: 12px/1.6 var(--mono); background: rgba(3, 6, 12, .7); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow: auto; white-space: pre-wrap; word-break: break-all; color: #cbd5e1; max-height: 340px; margin: 0; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 86px; border-radius: 12px; border: 1px solid var(--line); background: rgba(148, 163, 184, .04); color: var(--text-2); cursor: pointer; font: 500 12.5px var(--font); transition: all .15s; }
.action-tile svg { width: 22px; height: 22px; color: var(--cyan); transition: transform .2s; }
.action-tile:hover { border-color: rgba(34, 211, 238, .4); color: var(--text); background: rgba(34, 211, 238, .06); box-shadow: var(--glow); }
.action-tile:hover svg { transform: scale(1.12); }
.action-tile.danger svg { color: var(--red); }
.action-tile.danger:hover { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .07); box-shadow: 0 0 20px rgba(248, 113, 113, .15); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 38px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--line-hi); background: rgba(3, 6, 12, .55); }
.chip-input input { flex: 1; min-width: 120px; border: 0; background: transparent; color: var(--text); outline: none; font: 13px var(--font); height: 26px; }
.chip-input .tag button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 5px; font-size: 13px; line-height: 1; }
.list-editor .item { display: grid; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3, 6, 12, .35); margin-bottom: 10px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.section-title h3 { font-size: 14px; }
.section-title p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.policy-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.policy-nav button { text-align: left; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); font: 500 13.5px var(--font); cursor: pointer; }
.policy-nav button svg { width: 16px; height: 16px; }
.policy-nav button:hover { background: rgba(148, 163, 184, .07); color: var(--text); }
.policy-nav button.on { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .2); }
.policy-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.status-strip { display: flex; gap: 2px; height: 6px; border-radius: 6px; overflow: hidden; margin-top: 12px; background: rgba(148, 163, 184, .1); }
.status-strip span { height: 100%; transition: width .6s; }
.skeleton { background: linear-gradient(90deg, rgba(148, 163, 184, .06), rgba(148, 163, 184, .14), rgba(148, 163, 184, .06)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(34, 211, 238, .25); background: rgba(34, 211, 238, .05); font-size: 13px; color: var(--text-2); }
.callout svg { width: 18px; height: 18px; color: var(--cyan); flex: none; margin-top: 1px; }
.callout.warn { border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .06); }
.callout.warn svg { color: var(--amber); }
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.step-list li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.step-list li::before { content: counter(step); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid rgba(34, 211, 238, .25); color: var(--cyan); font: 600 12px var(--mono); }

/* ---- responsive ---- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); z-index: 60; transform: translateX(-100%); transition: transform .25s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 80px; }
  .search-trigger { min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .live span { display: none; }
  .g-2, .g-3, .form-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .policy-layout { grid-template-columns: 1fr; }
  .policy-nav { position: static; flex-direction: row; overflow-x: auto; }
  .bulkbar { left: 16px; right: 16px; transform: none; max-width: none; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .donut-wrap { flex-direction: column; align-items: stretch; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
