/* FLUX Control — admin console. Builds on the FLUXBOT theme tokens in style.css (dark + light). */
:root, [data-theme="dark"] {
  --nc-blue: var(--flux-blue, #1e90ff);
  --nc-cyan: var(--flux-cyan, #4fd2ff);
  --nc-deep: var(--flux-deep, #0a3cff);
  --nc-title: 'Exo 2', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nc-display: var(--font-display, 'Orbitron', 'Exo 2', Inter, system-ui, sans-serif);
  --nc-panel-solid: #081226;
  --nc-glow-blue: rgba(30, 144, 255, .55);
  --nc-tint: rgba(30, 144, 255, .16);
  --nc-tint-2: rgba(79, 210, 255, .1);
}
[data-theme="light"] {
  --nc-panel-solid: #ffffff;
  --nc-glow-blue: rgba(31, 123, 255, .35);
  --nc-tint: rgba(31, 123, 255, .12);
  --nc-tint-2: rgba(14, 165, 233, .08);
}

.nc { position: relative; z-index: 1; display: flex; min-height: 100vh; min-height: 100dvh; }
body.nc-booting .nc { visibility: hidden; }
body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; margin: 0; overflow-x: hidden; }
.nc-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nc-muted { color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.nc-center { text-align: center; }
.nc :focus-visible, .nc-modal :focus-visible, .nc-drawer :focus-visible { outline: 2px solid var(--nc-cyan); outline-offset: 2px; }
[data-theme="light"] .nc :focus-visible, [data-theme="light"] .nc-modal :focus-visible, [data-theme="light"] .nc-drawer :focus-visible { outline-color: var(--accent); }

/* ---------- sidebar ---------- */
.nc-side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; width: 252px; flex: none; display: flex; flex-direction: column;
  background: var(--glass, var(--sidebar)); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--border); padding: calc(14px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); box-sizing: border-box; z-index: 30;
  overflow: hidden;
}
/* a cold blue light leaking in from the top-left, like the logo's glow */
.nc-side::before {
  content: ''; position: absolute; left: -90px; top: -110px; width: 300px; height: 260px; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(30, 144, 255, .22), rgba(79, 210, 255, .06) 60%, transparent);
}
[data-theme="light"] .nc-side::before { background: radial-gradient(closest-side, rgba(31, 123, 255, .12), transparent); }
.nc-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; color: var(--text); text-decoration: none; border-radius: 12px; }
.nc-brand:hover .nc-logo { filter: drop-shadow(0 0 10px var(--nc-glow-blue)); }
.nc-logo { width: 44px; height: 44px; flex: none; display: inline-flex; position: relative; transition: filter .25s; }
.nc-logo > * { max-width: 100%; max-height: 100%; }
.nc-logo svg, .nc-logo canvas, .nc-logo img { width: 100%; height: 100%; }
.nc-brand-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.nc-brand-name { display: block; font-family: var(--nc-display); font-weight: 800; font-size: 17px; letter-spacing: .06em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-brand-name .flux-wordmark { font-size: inherit; }
.nc-brand-sub { font-family: var(--nc-display); font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .34em; font-weight: 700; white-space: nowrap; }
.nc-brand-ctl { color: var(--nc-cyan); text-shadow: 0 0 12px rgba(79, 210, 255, .45); }
[data-theme="light"] .nc-brand-ctl { color: var(--accent); }
.nc-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.nc-nav-group { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 14px 10px 6px; font-family: var(--nc-title); }
.nc-nav-group:first-child { padding-top: 2px; }
.nc-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nc-nav a:hover { background: var(--hover); color: var(--text); }
.nc-nav a.on { color: var(--text); background: linear-gradient(90deg, var(--nc-tint), var(--nc-tint-2) 70%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nc-blue) 22%, transparent); }
.nc-nav a.on::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--nc-cyan), var(--nc-blue)); box-shadow: 0 0 12px var(--nc-glow-blue); }
.nc-nav a.on .nc-nav-icon { color: var(--nc-cyan); }
[data-theme="light"] .nc-nav a.on .nc-nav-icon { color: var(--accent); }
.nc-nav-icon { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.nc-nav-icon svg { width: 18px; height: 18px; }
.nc-nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; box-shadow: 0 0 0 2px color-mix(in srgb, #dc2626 25%, transparent); }
.nc-nav-badge[hidden] { display: none; }
.nc-side-foot { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.nc-back { display: flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.nc-back:hover { background: var(--hover); color: var(--text); }
.nc-back svg { width: 18px; height: 18px; flex: none; }
.nc-me { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-size: 13px; }
.nc-me b { display: block; font-weight: 600; }
.nc-me small { color: var(--dim); }
.nc-scrim { display: none; }

/* ---------- main ---------- */
.nc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nc-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 28px 14px;
  background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 70%, transparent)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* a thin light-beam under the top bar */
.nc-top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--nc-cyan) 55%, transparent) 30%, color-mix(in srgb, var(--nc-blue) 45%, transparent) 60%, transparent);
  opacity: .7;
}
.nc-titles { min-width: 0; flex: 1; }
.nc-titles h1 { margin: 0; font-family: var(--nc-display); font-size: 20px; font-weight: 700; letter-spacing: .04em; line-height: 1.25; }
.nc-titles p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-titles p:empty { display: none; }
.nc-top-right { display: flex; align-items: center; gap: 8px; }
.nc-menu { display: none; }
.nc-view { padding: 24px 28px 60px; max-width: 1280px; width: 100%; box-sizing: border-box; margin: 0 auto; }
.nc-section { display: flex; flex-direction: column; gap: 18px; animation: ncIn .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ncIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- building blocks ---------- */
.nc-icon {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--glass, var(--surface)); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: color .15s, border-color .15s, background .15s, box-shadow .15s;
}
.nc-icon:hover { color: var(--text); border-color: color-mix(in srgb, var(--nc-blue) 45%, var(--border-strong)); box-shadow: 0 0 16px -6px var(--nc-glow-blue); }
.nc-icon svg { width: 18px; height: 18px; }
.nc-card {
  border-radius: 16px; padding: 18px; min-width: 0; box-sizing: border-box; border: 1px solid transparent;
  background: linear-gradient(var(--glass-strong, var(--surface)), var(--glass-strong, var(--surface))) padding-box, var(--neon-soft, var(--border)) border-box;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 18px 50px -30px rgba(0, 6, 24, .8);
}
[data-theme="light"] .nc-card { box-shadow: 0 14px 40px -28px rgba(10, 40, 110, .35); }
.nc-card, .ncs-zone, .ncp-sintro { scroll-margin-top: 96px; }
.nc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.nc-card-head h3 { margin: 0; font-family: var(--nc-title); font-size: 16px; font-weight: 700; letter-spacing: .005em; }
.nc-card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.nc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.nc-grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.nc-grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.nc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nc-row.between { justify-content: space-between; }
.nc-spacer { flex: 1; }
.nc-hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

.nc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s, background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.nc-btn:hover { border-color: var(--accent); }
.nc-btn:active { transform: translateY(1px); }
.nc-btn:disabled { opacity: .55; cursor: not-allowed; }
.nc-btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); text-shadow: 0 1px 1px rgba(0, 20, 60, .35); }
.nc-btn.primary:hover { filter: brightness(1.1); box-shadow: var(--glow), 0 0 22px -4px var(--nc-glow-blue); }
.nc-btn.danger { background: #dc2626; border-color: transparent; color: #fff; } /* white text stays readable (4.8:1) */
.nc-btn.danger:hover { filter: brightness(1.1); }
.nc-btn.ghost { background: transparent; }
.nc-btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.nc-btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.nc-btn svg { width: 16px; height: 16px; }
.nc-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.nc-input {
  width: 100%; box-sizing: border-box; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
textarea.nc-input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 80px; }
select.nc-input { cursor: pointer; }
.nc-input:disabled { opacity: .6; cursor: not-allowed; }
.nc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px -8px var(--nc-glow-blue); }
.nc-form { display: flex; flex-direction: column; gap: 14px; }
.nc-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.nc-field small { font-weight: 400; color: var(--dim); line-height: 1.4; }
.nc-field.inline { flex-direction: row; align-items: center; gap: 12px; cursor: pointer; }
.nc-field.inline b { display: block; color: var(--text); font-size: 14px; }
.nc-field.inline span { display: flex; flex-direction: column; gap: 2px; }
.nc-err { color: var(--danger); font-size: 13px; margin: 0; min-height: 1em; }
.nc-err:empty { display: none; }
.nc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

.nc-switch { position: relative; width: 46px; height: 27px; border-radius: 999px; border: 0; background: var(--surface-2); cursor: pointer; flex: none; padding: 0; transition: background .2s, box-shadow .2s; box-shadow: inset 0 0 0 1px var(--border); }
.nc-switch span { position: absolute; left: 3px; top: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .22s cubic-bezier(.3, 1.4, .6, 1); }
.nc-switch[aria-checked="true"] { background: var(--grad); box-shadow: var(--glow); }
.nc-switch[aria-checked="true"] span { transform: translateX(19px); }
.nc-switch.danger[aria-checked="true"] { background: var(--danger); box-shadow: 0 6px 22px -6px rgba(248, 113, 113, .6); }
.nc-switch:disabled { opacity: .6; cursor: wait; }

.nc-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.nc-chip.ok { background: rgba(74, 222, 128, .14); color: var(--ok); }
.nc-chip.warn { background: rgba(251, 191, 36, .16); color: #f59e0b; }
.nc-chip.danger { background: var(--danger-soft); color: var(--danger); }
.nc-chip.accent { background: var(--accent-soft); color: var(--accent); }
.nc-chip.grad { background: var(--grad); color: #fff; }
.nc-chip.pulse { animation: ncPulse 1.6s ease-in-out infinite; }
@keyframes ncPulse { 50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); opacity: .75; } 0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .45); } }
.nc-chip[hidden] { display: none; }
.nc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.nc-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); }

.nc-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 13.5px; }
.nc-avatar.lg { width: 48px; height: 48px; font-size: 19px; }

/* stats */
.nc-stat {
  border-radius: 16px; padding: 16px 18px; position: relative; overflow: hidden; border: 1px solid transparent;
  background: linear-gradient(var(--glass-strong, var(--surface)), var(--glass-strong, var(--surface))) padding-box, var(--neon-soft, var(--border)) border-box;
}
.nc-stat::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(30, 144, 255, .24), transparent 70%); pointer-events: none; }
.nc-stat-top { display: flex; align-items: center; justify-content: space-between; }
.nc-stat-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.nc-stat-icon { font-size: 18px; }
.nc-stat-value { font-family: var(--nc-title); font-size: 31px; font-weight: 700; letter-spacing: -0.01em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.nc-stat-sub { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.nc-stat.hot .nc-stat-value { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nc-stat.bad .nc-stat-value { color: var(--danger); }
.nc-stat.good .nc-stat-value { color: var(--ok); }

/* charts */
.nc-bars-wrap { display: flex; flex-direction: column; gap: 6px; }
.nc-bars { width: 100%; height: 160px; display: block; }
.nc-bars rect { transform-origin: bottom; transform-box: fill-box; animation: ncGrow .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 25ms); }
.nc-bars rect:hover { filter: brightness(1.25); }
@keyframes ncGrow { from { transform: scaleY(0); } }
.nc-bars-x { display: flex; font-size: 11px; color: var(--dim); }
.nc-bars-x span { text-align: center; white-space: nowrap; overflow: visible; }
.nc-meters { display: flex; flex-direction: column; gap: 12px; }
.nc-meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.nc-meter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-meter-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.nc-meter-track { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.nc-meter-fill { height: 100%; border-radius: 4px; background: var(--grad); animation: ncFill .7s cubic-bezier(.2, .8, .2, 1) both; box-shadow: 0 0 10px -2px var(--nc-glow-blue); }
@keyframes ncFill { from { width: 0; } }
.nc-meter small { color: var(--dim); font-size: 12px; }

/* tables / lists */
.nc-table-wrap { overflow-x: auto; margin: 0 -4px; -webkit-overflow-scrolling: touch; }
.nc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nc-table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.nc-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.nc-table tr:last-child td { border-bottom: 0; }
.nc-table tbody tr { transition: background .12s; }
.nc-table tbody tr.click { cursor: pointer; }
.nc-table tbody tr.click:hover { background: var(--hover); }
.nc-list { display: flex; flex-direction: column; }
.nc-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.nc-item:last-child { border-bottom: 0; }
.nc-item-main { flex: 1; min-width: 0; }
.nc-item-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-item-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.nc-item.click { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.nc-item.click:hover { background: var(--hover); }
.nc-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; }
.nc-search { position: relative; flex: 1; min-width: 200px; }
.nc-search .nc-input { padding-left: 36px; }
.nc-search svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }

.nc-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.nc-tab { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.nc-tab:hover { color: var(--text); }
.nc-tab.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }

.nc-empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.nc-empty-icon { font-size: 34px; margin-bottom: 8px; }
.nc-empty p { margin: 0; }
.nc-loading { display: flex; justify-content: center; gap: 7px; padding: 40px 0; }
.nc-loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--grad); animation: ncBounce 1s infinite ease-in-out; box-shadow: 0 0 10px var(--nc-glow-blue); }
.nc-loading span:nth-child(2) { animation-delay: .15s; }
.nc-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes ncBounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* modal + drawer */
.nc-modal-back, .nc-drawer-back { position: fixed; inset: 0; z-index: 100; background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.nc-modal-back { display: flex; align-items: center; justify-content: center; padding: 16px; }
.nc-modal-back.in, .nc-drawer-back.in { opacity: 1; }
.nc-modal {
  width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 18px; border: 1px solid transparent;
  background: linear-gradient(var(--glass-strong, var(--surface)), var(--glass-strong, var(--surface))) padding-box, var(--neon, var(--border)) border-box;
  box-shadow: var(--shadow); transform: translateY(10px) scale(.98); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
[data-theme="dark"] .nc-modal, [data-theme="dark"] .nc-drawer { background: linear-gradient(var(--nc-panel-solid), var(--nc-panel-solid)) padding-box, var(--neon, var(--border)) border-box; }
[data-theme="dark"] .nc-modal { box-shadow: var(--shadow), 0 0 60px -24px var(--nc-glow-blue); }
.nc-modal.wide { max-width: 860px; }
.nc-modal-back.in .nc-modal { transform: none; }
.nc-modal-head, .nc-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.nc-modal-head h2, .nc-drawer-head h2 { margin: 0; font-family: var(--nc-title); font-size: 19px; font-weight: 700; letter-spacing: .005em; }
.nc-modal-head p, .nc-drawer-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.nc-modal-body { padding: 4px 20px 20px; overflow-y: auto; }
.nc-drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100vw); display: flex; flex-direction: column; border-left: 1px solid transparent;
  background: linear-gradient(var(--glass-strong, var(--surface)), var(--glass-strong, var(--surface))) padding-box, var(--neon, var(--border)) border-box;
  box-shadow: var(--shadow); transform: translateX(30px); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box;
}
.nc-drawer-back.in .nc-drawer { transform: none; }
.nc-drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.nc-drawer-section h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }

/* toasts */
.nc-toasts { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.nc-toast { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 12px; background: var(--invert); color: var(--invert-text); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; max-width: 100%; box-sizing: border-box; }
.nc-toast-text { min-width: 0; overflow-wrap: anywhere; }
.nc-toast.in { opacity: 1; transform: none; }
.nc-toast.error { background: #dc2626; color: #fff; }
.nc-toast.ok { background: #15803d; color: #fff; }
.nc-toast.info {
  color: #fff; border: 1px solid transparent;
  background: linear-gradient(135deg, #0b1c3d, #0a1428) padding-box, linear-gradient(135deg, var(--nc-cyan), var(--nc-blue), var(--nc-deep)) border-box;
  box-shadow: var(--shadow), 0 0 34px -10px var(--nc-glow-blue);
}
.nc-toast.has-action { pointer-events: auto; padding-right: 8px; }
.nc-toast-btn {
  flex: none; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12); color: inherit;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.nc-toast-btn:hover { background: rgba(255, 255, 255, .22); }
.nc-toast-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* chat viewer bubbles (read-only) */
.nc-thread { display: flex; flex-direction: column; gap: 12px; }
.nc-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.nc-msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(30, 144, 255, .22), rgba(79, 210, 255, .1)), var(--surface); border: 1px solid rgba(79, 170, 255, .28); }
.nc-msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.nc-msg-meta { font-size: 11.5px; color: var(--dim); margin-top: 6px; white-space: normal; }
.nc-msg img { max-width: 220px; border-radius: 10px; display: block; margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nc-side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow); background: var(--glass-strong, var(--sidebar)); max-width: 86vw; }
  body.nc-menu-open .nc-side { transform: none; }
  body.nc-menu-open .nc-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: var(--overlay); }
  .nc-menu { display: inline-flex; }
  .nc-top { padding-left: 16px; padding-right: 16px; }
  .nc-view { padding: 16px 16px 48px; }
  .nc-titles h1 { font-size: 17px; }
}
@media (max-width: 560px) {
  .nc-grid, .nc-grid.two { grid-template-columns: 1fr; }
  .nc-grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .nc-stat { padding: 13px 14px; }
  .nc-stat-value { font-size: 24px; }
  .nc-card { padding: 15px; border-radius: 14px; }
  .nc-top-right .nc-chip { display: none; }
  .nc-top-right .nc-chip.pulse:not([hidden]) { display: inline-flex; }
  .nc-hide-sm { display: none !important; }
  .nc-modal-back { align-items: flex-end; padding: 0; }
  .nc-modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  .nc-titles p { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .nc-section, .nc-bars rect, .nc-meter-fill, .nc-chip.pulse, .nc-loading span { animation: none !important; }
  .nc-side, .nc-drawer, .nc-modal, .nc-toast { transition: none !important; }
}
body.fx-off .nc-section, body.fx-off .nc-bars rect, body.fx-off .nc-meter-fill, body.fx-off .nc-chip.pulse { animation: none !important; }

[data-theme="light"] .nc-chip.warn { color: #b45309; background: rgba(245, 158, 11, .16); }
[data-theme="light"] .nc-toast.info { background: linear-gradient(135deg, #0b2a66, #0a1f4d) padding-box, linear-gradient(135deg, #0ea5e9, #1f7bff) border-box; }
