/* app-components.css — the ONLY source of visual styling: variables, components, typography, motion. */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #070b12;
  --bg-glow: radial-gradient(1200px 600px at 20% -10%, rgba(34,211,238,0.10), transparent 60%),
             radial-gradient(900px 500px at 90% 0%, rgba(59,130,246,0.08), transparent 60%);
  --panel-bg: #0f1622;
  --panel-bg-2: #16202f;
  --panel-edge: rgba(255,255,255,0.06);
  --border: #223045;
  --text: #e8eef6;
  --muted: #7f8ea3;
  --accent: #22d3ee;
  --accent-soft: rgba(34,211,238,0.14);
  --green: #34d399;
  --green-soft: rgba(52,211,153,0.14);
  --red: #f43f5e;
  --red-soft: rgba(244,63,94,0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251,191,36,0.14);
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 0 var(--panel-edge) inset, 0 10px 30px -12px rgba(0,0,0,0.7);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.09) inset, 0 24px 48px -16px rgba(0,0,0,0.8);
  --ease: cubic-bezier(.2,.8,.2,1);
}

body { background: var(--bg); background-image: var(--bg-glow); background-attachment: fixed; color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* halted state tints the whole page: an unmistakable amber cast at the top */
body.is-halted { background-image: radial-gradient(1200px 500px at 50% -10%, rgba(251,191,36,0.16), transparent 60%); }

/* typography */
.nc-brand { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--text); }
.nc-h2 { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--text); margin: 0 0 12px; }
.nc-muted { color: var(--muted); }
.nc-mono { font-family: var(--mono); font-size: 12.5px; }
.nc-num { text-align: right; font-variant-numeric: tabular-nums; }
.nc-nowrap { white-space: nowrap; }
.nc-caption { font-size: 12px; color: var(--muted); }

/* topbar surface (skeleton lives in base-layout.css) */
.topbar { background: rgba(7,11,18,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }

/* panels: two-layer surface with a light edge, lift on hover */
.nc-panel { background: linear-gradient(180deg, var(--panel-bg-2), var(--panel-bg)); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.nc-panel:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #2c3d57; }

/* hero: heartbeat */
.nc-hero { background: linear-gradient(135deg, #111a29, #0b1220 60%); border: 1px solid var(--border); border-radius: 18px; padding: 22px 26px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.nc-hero::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 60%; height: 200%; background: radial-gradient(closest-side, var(--accent-soft), transparent); opacity: .6; pointer-events: none; }
.nc-hero.is-off::after { background: radial-gradient(closest-side, var(--red-soft), transparent); }
.nc-hero.is-halted::after { background: radial-gradient(closest-side, var(--amber-soft), transparent); }
.nc-pulse { width: 64px; height: 64px; border-radius: 50%; position: relative; display: grid; place-items: center; background: var(--panel-bg); border: 1px solid var(--border); box-shadow: 0 0 0 6px var(--accent-soft), 0 0 40px var(--accent-soft); }
.nc-pulse::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.nc-pulse::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: nc-ring 2.2s var(--ease) infinite; }
.nc-pulse.is-off { box-shadow: 0 0 0 6px var(--red-soft); }
.nc-pulse.is-off::before { background: var(--red); box-shadow: 0 0 14px var(--red); }
.nc-pulse.is-off::after { animation: none; }
.nc-hero-title { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.nc-hero-sub { color: var(--muted); margin: 4px 0 0; }
.nc-kv { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.nc-kv-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.nc-kv.is-pos { color: var(--green); text-shadow: 0 0 22px var(--green-soft); }
.nc-kv.is-neg { color: var(--red); text-shadow: 0 0 22px var(--red-soft); }
@keyframes nc-ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }

/* stat tiles */
.nc-stat { background: linear-gradient(180deg, var(--panel-bg-2), var(--panel-bg)); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.nc-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.nc-stat-label { font-size: 12px; color: var(--muted); }
.nc-stat-value { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nc-stat-sub { font-size: 12px; color: var(--muted); }
.nc-stat-neg .nc-stat-value { color: var(--red); }

/* glow */
.nc-glow-green { border-color: rgba(52,211,153,0.45); box-shadow: 0 0 0 1px rgba(52,211,153,0.25), 0 0 32px rgba(52,211,153,0.16), var(--shadow-1); }
.nc-glow-blue { border-color: rgba(34,211,238,0.45); box-shadow: 0 0 0 1px rgba(34,211,238,0.25), 0 0 32px rgba(34,211,238,0.16), var(--shadow-1); }
.nc-glow-red { border-color: rgba(244,63,94,0.5); box-shadow: 0 0 0 1px rgba(244,63,94,0.3), 0 0 32px rgba(244,63,94,0.18), var(--shadow-1); }
.nc-glow-amber { border-color: rgba(251,191,36,0.5); box-shadow: 0 0 0 1px rgba(251,191,36,0.3), 0 0 32px rgba(251,191,36,0.18), var(--shadow-1); }

/* badges */
.nc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,0.02); }
.nc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nc-badge-paper { color: var(--accent); border-color: rgba(34,211,238,0.4); background: var(--accent-soft); }
.nc-badge-live { color: #fff; background: var(--red); border-color: var(--red); }
.nc-badge-halt { color: #1a1200; background: var(--amber); border-color: var(--amber); }
.nc-badge-ok { color: var(--green); border-color: rgba(52,211,153,0.4); background: var(--green-soft); }
.nc-badge-bad { color: var(--red); border-color: rgba(244,63,94,0.4); background: var(--red-soft); }
.nc-badge-filled { color: var(--green); border-color: rgba(52,211,153,0.4); }
.nc-badge-submitted, .nc-badge-pending { color: var(--accent); border-color: rgba(34,211,238,0.4); }
.nc-badge-cancelled, .nc-badge-unknown { color: var(--amber); border-color: rgba(251,191,36,0.4); }
.nc-badge-rejected, .nc-badge-error { color: var(--red); border-color: rgba(244,63,94,0.4); }

/* buttons */
.nc-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: linear-gradient(180deg, var(--panel-bg-2), var(--panel-bg)); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), filter .2s var(--ease); }
.nc-btn:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 0 0 1px rgba(34,211,238,0.25), 0 0 24px var(--accent-soft), var(--shadow-1); }
.nc-btn:active { transform: translateY(1px); box-shadow: none; }
.nc-btn-red { background: linear-gradient(180deg, #ff5c78, #d92a49); border-color: #ff7a90; color: #fff; box-shadow: 0 0 0 1px rgba(244,63,94,0.3), 0 0 28px rgba(244,63,94,0.28), var(--shadow-1); }
.nc-btn-red:hover { border-color: #ffa3b3; box-shadow: 0 0 0 1px rgba(244,63,94,0.4), 0 0 40px rgba(244,63,94,0.4), var(--shadow-1); filter: brightness(1.05); }
.nc-btn-green { background: linear-gradient(180deg, #4ade80, #16a34a); border-color: #6ee7a0; color: #05130a; box-shadow: 0 0 0 1px rgba(52,211,153,0.3), 0 0 28px rgba(52,211,153,0.3), var(--shadow-1); }
.nc-btn-green:hover { border-color: #a7f3d0; box-shadow: 0 0 0 1px rgba(52,211,153,0.4), 0 0 40px rgba(52,211,153,0.45), var(--shadow-1); }
.nc-btn-big { padding: 14px 26px; font-size: 15px; border-radius: 12px; }

/* inputs */
.nc-input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-bg); color: var(--text); font: inherit; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.nc-input:hover { border-color: #2c3d57; }
.nc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

/* nav links */
.nc-link { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; transition: color .2s var(--ease), background .2s var(--ease); }
.nc-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nc-link-active { color: var(--text); background: var(--accent-soft); box-shadow: 0 0 0 1px rgba(34,211,238,0.25) inset; }

/* tables: rows lift and light up on hover */
.nc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.nc-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.nc-table td { padding: 9px 10px; border-bottom: 1px solid rgba(34,48,69,0.6); vertical-align: top; transition: background .15s var(--ease); }
.nc-table tbody tr:hover td { background: rgba(255,255,255,0.035); }
.nc-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.nc-table tr:last-child td { border-bottom: 0; }
.nc-row-warning td:nth-child(2) { color: var(--amber); }
.nc-row-error td:nth-child(2) { color: var(--red); }
.nc-row-warning:hover td:first-child { box-shadow: inset 3px 0 0 var(--amber) !important; }
.nc-row-error:hover td:first-child { box-shadow: inset 3px 0 0 var(--red) !important; }

/* misc */
.nc-flash { background: var(--accent-soft); border: 1px solid rgba(34,211,238,0.4); border-radius: 10px; padding: 12px 16px; box-shadow: 0 0 24px var(--accent-soft); }
.nc-pre { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--text); }
.nc-pre-log { max-height: 75vh; overflow: auto; background: #060a10; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.nc-empty { color: var(--muted); padding: 18px 0; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  .nc-pulse::after { animation: none; }
  .nc-panel, .nc-stat, .nc-btn, .nc-table td { transition: none; }
}

/* watchlist quotes */
.nc-quote { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--panel-bg); border: 1px solid var(--border); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
.nc-quote:hover { transform: translateY(-2px); }
.nc-quote-sym { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.nc-quote-price { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nc-quote-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.nc-quote.is-up { border-color: rgba(52,211,153,0.35); }
.nc-quote.is-up .nc-quote-chg { color: var(--green); }
.nc-quote.is-up:hover { box-shadow: 0 0 0 1px rgba(52,211,153,0.3), 0 0 28px rgba(52,211,153,0.18); }
.nc-quote.is-down { border-color: rgba(244,63,94,0.35); }
.nc-quote.is-down .nc-quote-chg { color: var(--red); }
.nc-quote.is-down:hover { box-shadow: 0 0 0 1px rgba(244,63,94,0.3), 0 0 28px rgba(244,63,94,0.18); }

/* quote cards are buttons */
.nc-quote-btn { font: inherit; color: var(--text); text-align: left; cursor: pointer; width: 100%; }
.nc-quote-btn:hover { border-color: var(--accent); }

/* chips (range selector) */
.nc-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; transition: all .15s var(--ease); }
.nc-chip:hover { color: var(--text); border-color: var(--accent); }
.nc-chip.is-active { color: var(--text); background: var(--accent-soft); border-color: rgba(34,211,238,0.5); box-shadow: 0 0 16px var(--accent-soft); }
.nc-btn-icon { padding: 8px 12px; }

/* modal */
.nc-modal-backdrop { background: rgba(3,6,12,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.nc-modal-card { background: linear-gradient(180deg, #131c2b, #0c1320); border: 1px solid #2c3d57; border-radius: 18px; box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 40px 80px -20px rgba(0,0,0,0.9), 0 0 60px rgba(34,211,238,0.08); animation: nc-pop .22s var(--ease); }
.nc-hero-sub.is-up { color: var(--green); }
.nc-hero-sub.is-down { color: var(--red); }
@keyframes nc-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* chart marks */
.nc-chart { width: 100%; height: 100%; display: block; }
.nc-grid { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.nc-baseline { stroke: rgba(255,255,255,0.18); stroke-width: 1; stroke-dasharray: 4 4; }
.nc-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.nc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nc-crosshair { stroke: rgba(255,255,255,0.35); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.nc-dot { stroke: var(--bg); stroke-width: 2; pointer-events: none; }
.nc-tooltip { background: rgba(12,19,32,0.95); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow-2); pointer-events: none; font-size: 12px; color: var(--muted); min-width: 150px; }
.nc-tip-time { color: var(--muted); }
.nc-tip-price { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.nc-tip-row { display: flex; gap: 10px; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .nc-modal-card { animation: none; } }

/* admin extras */
.nc-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.nc-input-sm { padding: 5px 8px; width: 120px; }
.nc-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.nc-label-inline { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.nc-link-btn { background: none; border: 0; cursor: pointer; font: inherit; }
a.nc-stat { color: inherit; }
textarea.nc-input { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.nc-check { display: inline-flex; gap: 8px; align-items: center; color: var(--text); font-weight: 500; cursor: pointer; }
.nc-check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* backtest */
.bt-bench { stroke: var(--accent); stroke-dasharray: 5 4; stroke-width: 1.5; opacity: .9; }
.bt-dot-bench { fill: var(--accent); }
.bt-key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 10px; }
.bt-key-strat { background: var(--green); box-shadow: 0 0 8px var(--green); }
.bt-key-bench { background: var(--accent); }
.bt-pos { color: var(--green); }
.bt-neg { color: var(--red); }
