@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Public+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ===== Minimal Luxury Terminal — black/gold, Bloomberg meets Apple, quiet ===== */
:root {
  --bg: #0a0a09;
  --surface: #121210;
  --surface-2: #1a1917;
  --border: rgba(201, 169, 97, 0.16);
  --border-strong: rgba(201, 169, 97, 0.45);
  --text: #f2efe6;
  --text-dim: #9c9686;
  --text-faint: #5c584d;
  --accent: #c9a961;
  --accent-soft: rgba(201, 169, 97, 0.08);
  --good: #7cae8a;
  --bad: #c96b5e;
  --warn: #c9a961;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body.cc-body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Public Sans', system-ui, sans-serif; font-size: 15px; line-height: 1.55;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: 'Manrope', system-ui, sans-serif; }
.accent { color: var(--accent); }
.ok { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

#bgCanvas { display: none; } /* quiet by design - no particle motion in this direction */

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* ---- login ---- */
.login-shell { position: relative; z-index: 2; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { padding: 44px 40px; width: 100%; max-width: 380px; text-align: center; border-color: var(--border-strong); }
.cc-eyebrow { font-size: 10px; letter-spacing: 0.24em; color: var(--text-faint); font-weight: 600; }
.cc-title { font-size: 21px; font-weight: 700; margin: 10px 0 0; letter-spacing: 0.08em; }
.command-row { display: flex; gap: 8px; }
.login-card input {
  flex: 1; padding: 12px 14px; border-radius: 2px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--border-strong); }
#mic { background: transparent; border: 1px solid var(--border); padding: 10px 14px; border-radius: 2px; cursor: pointer; color: var(--text-dim); }
#mic.listening { border-color: var(--bad); color: var(--bad); }
.cc-btn {
  width: 100%; margin-top: 22px; padding: 13px; border-radius: 2px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font-weight: 600; letter-spacing: 0.14em;
  cursor: pointer; font-size: 12px; transition: background 0.2s;
}
.cc-btn:hover { background: var(--accent-soft); }
.login-error { color: var(--bad); font-size: 12px; min-height: 16px; margin-top: 12px; }

/* ---- boot sequence ---- */
.boot-overlay { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: none; align-items: center; justify-content: center; }
.boot-overlay.show { display: flex; }
.boot-lines { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text-dim); text-align: left; letter-spacing: 0.05em; }
.boot-line { opacity: 0; animation: boot-in 0.25s ease forwards; margin: 7px 0; }
.boot-line:last-child { color: var(--accent); }
@keyframes boot-in { from { opacity: 0; } to { opacity: 1; } }

/* ================= MAIN SHELL ================= */
.cc-shell { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; padding: 0; gap: 0; }

.topbar {
  flex: none; height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim);
  border-bottom: 1px solid var(--border); border-radius: 0;
}
.tb-brand { color: var(--text); font-weight: 700; letter-spacing: 0.1em; }
.tb-item b { color: var(--text); font-weight: 600; }
.tb-sep { color: var(--border-strong); }
.tb-spacer { flex: 1; }
.tb-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 14px; border-radius: 2px; font-size: 10.5px; letter-spacing: 0.06em;
  cursor: pointer; text-decoration: none;
}
.tb-btn:hover { color: var(--accent); border-color: var(--border-strong); }
.sync-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--good); animation: sync-blink 2s ease-in-out infinite; }
@keyframes sync-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.tb-ticker { color: var(--accent); letter-spacing: 0.04em; min-width: 220px; text-align: center; }

.cc-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; padding: 24px; }

.cc-command { padding: 30px 34px; text-align: center; border-radius: 3px; margin-bottom: 20px; }
.cc-command-label { font-size: 11px; letter-spacing: 0.16em; color: var(--text-faint); font-weight: 600; margin-bottom: 16px; }
.cc-command .command-row { max-width: 620px; margin: 0 auto; }
.input-wrap { position: relative; flex: 1; }
.cc-command input {
  position: relative; z-index: 2; width: 100%; padding: 13px 18px; border-radius: 2px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: 14px;
}
.cc-command input:focus { outline: none; border-color: var(--border-strong); }
.ghost-text {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center;
  padding: 0 18px; font-size: 14px; font-family: 'Public Sans', system-ui, sans-serif;
  white-space: pre; overflow: hidden; pointer-events: none; text-align: left;
}
.ghost-text span:last-child { color: var(--text-faint); }
.cc-command #send {
  padding: 13px 24px; border-radius: 2px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font-weight: 600; letter-spacing: 0.1em;
  cursor: pointer; font-size: 11.5px; transition: background 0.2s;
}
.cc-command #send:hover { background: var(--accent-soft); }
.command-examples { margin-top: 16px; font-size: 11px; color: var(--text-faint); }
.command-examples span {
  display: inline-block; background: transparent; border: 1px solid var(--border);
  border-radius: 2px; padding: 5px 14px; margin: 3px 4px; cursor: pointer; letter-spacing: 0.02em;
}
.command-examples span:hover { border-color: var(--border-strong); color: var(--text); }
.voice-status { margin-top: 12px; font-size: 11px; color: var(--accent); font-family: 'IBM Plex Mono', monospace; min-height: 14px; letter-spacing: 0.04em; }

.terminal-panel { padding: 18px 22px; border-radius: 3px; margin-bottom: 20px; }
.terminal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.terminal-col { background: var(--surface); padding: 16px 18px; }
.tc-name { font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.tc-sub { font-size: 10px; color: var(--text-faint); font-weight: 400; margin-left: 6px; text-transform: uppercase; }
.tc-stats { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.tc-stats > div { display: flex; justify-content: space-between; font-size: 13px; }
.tc-label { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.tc-spark { width: 100%; height: 56px; display: block; }

.tc-gauge-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); text-align: center; }
.tc-gauge-title { font-size: 9.5px; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 600; margin-bottom: 4px; }
.tc-gauge { width: 100%; height: 64px; display: block; }
.tc-gauge-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; letter-spacing: 0.02em; }

.tc-symbols-title { font-size: 9px; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 600; margin-top: 14px; margin-bottom: 6px; }
.tc-symbols { display: flex; flex-wrap: wrap; gap: 6px; }
.symbol-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 5px 10px; border-radius: 2px;
  border: 1px solid var(--border); cursor: pointer; letter-spacing: 0.02em; background: transparent;
}
.symbol-chip:hover { border-color: var(--border-strong); color: var(--accent); }
.symbol-chip.sc-good { color: var(--good); }
.symbol-chip.sc-bad { color: var(--bad); }
.symbol-chip .sc-count { color: var(--text-faint); }

.symbol-chart-wrap { margin: 6px 0 14px; }
.symbol-chart { width: 100%; height: 90px; display: block; }
.trade-row {
  display: grid; grid-template-columns: 78px 52px 1fr 68px; gap: 8px; align-items: center;
  padding: 7px 0; border-top: 1px solid var(--border); font-size: 11.5px;
}
.trade-row:first-child { border-top: none; }
.trade-row .tr-time { color: var(--text-faint); font-size: 10.5px; }
.trade-row .tr-result { font-weight: 700; font-size: 10px; letter-spacing: 0.04em; }
.trade-row .tr-result.PROFIT { color: var(--good); }
.trade-row .tr-result.LOSS { color: var(--bad); }
.trade-row .tr-reason { color: var(--text-dim); }
.trade-row .tr-pnl { text-align: right; font-weight: 600; }

.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--border); margin-bottom: 20px; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.agent-card { background: var(--surface); border: none; border-radius: 0; padding: 18px; cursor: pointer; transition: background 0.15s; }
.agent-card:hover { background: var(--surface-2); }
.ac-name { font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; }
.ac-dept { font-size: 9.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px; }
.ac-status { font-size: 11.5px; color: var(--text-dim); margin-top: 12px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.status-dot.working { background: var(--accent); }
.status-dot.done { background: var(--good); }
.status-dot.error { background: var(--bad); }

.agent-card.working { animation: card-pulse 1.6s ease-in-out infinite; position: relative; z-index: 1; }
@keyframes card-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px var(--border-strong), 0 0 8px rgba(201,169,97,0.15); }
  50% { box-shadow: inset 0 0 0 1px var(--accent), 0 0 20px rgba(201,169,97,0.45); }
}
.agent-card.done { animation: card-flash 0.9s ease-out; }
@keyframes card-flash {
  0% { box-shadow: inset 0 0 0 1px var(--good), 0 0 18px rgba(124,174,138,0.4); }
  100% { box-shadow: inset 0 0 0 1px transparent, 0 0 0 rgba(124,174,138,0); }
}

.log-panel { padding: 14px 22px; border-radius: 3px; margin-bottom: 20px; }
.log-stream { height: 130px; overflow-y: auto; font-size: 11px; color: var(--text-dim); }
.log-line { padding: 3px 0; border-top: 1px solid var(--border); white-space: nowrap; }
.log-line:first-child { border-top: none; }
.log-line .ll-ok { color: var(--good); }
.log-line .ll-warn { color: var(--warn); }
.log-line .ll-bad { color: var(--bad); }

.approval-center { padding: 18px 22px; border-radius: 3px; margin-bottom: 20px; }
.ac-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); font-weight: 600; margin-bottom: 10px; }
.ac-body { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; }
.approval-example { border: 1px dashed var(--border-strong); border-radius: 3px; padding: 16px 18px; opacity: 0.85; }
.ae-badge { font-size: 9.5px; letter-spacing: 0.1em; color: var(--warn); font-weight: 700; margin-bottom: 8px; }
.ae-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.ae-row { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.ae-row .tc-label { display: block; margin-bottom: 1px; }
.ae-actions { display: flex; gap: 8px; margin-top: 12px; }
.ae-btn { flex: 1; padding: 8px; border-radius: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; cursor: not-allowed; background: transparent; }
.ae-btn.approve { border: 1px solid rgba(124,174,138,0.4); color: var(--good); }
.ae-btn.reject { border: 1px solid rgba(201,107,94,0.4); color: var(--bad); }
.ae-btn.modify { border: 1px solid var(--border-strong); color: var(--text-dim); }

.reports-panel { padding: 18px 22px; border-radius: 3px; flex: 1; min-height: 200px; display: flex; flex-direction: column; }
.reports-search {
  width: 100%; padding: 8px 12px; margin-bottom: 10px; border-radius: 2px;
  border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 12.5px;
}
.reports-search:focus { outline: none; border-color: var(--border-strong); }
.reports-list { flex: 1; overflow-y: auto; }
.report-row { padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.report-row:first-child { border-top: none; }
.report-row:hover .report-title { color: var(--accent); }
.report-row .report-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.report-row .report-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; letter-spacing: 0.02em; }
.report-row .report-meta .pill { display: inline-block; padding: 1px 9px; border-radius: 2px; font-size: 9px; font-weight: 600; text-transform: uppercase; margin-right: 8px; border: 1px solid var(--border); }
.report-row .report-meta .pill.done { color: var(--good); border-color: rgba(124,174,138,0.3); }
.report-row .report-meta .pill.running { color: var(--accent); border-color: var(--border-strong); }

.notif-panel { position: fixed; top: 60px; right: 20px; width: 280px; max-height: 55vh; z-index: 22; display: none; flex-direction: column; overflow: hidden; border-radius: 3px; }
.notif-panel.open { display: flex; }
.np-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 600; }
.np-body { overflow-y: auto; }
.activity-row { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 11.5px; }
.activity-row:first-child { border-top: none; }
.activity-row .ar-icon { color: var(--text-faint); margin-right: 6px; }
.activity-row .ar-time { color: var(--text-faint); font-size: 10px; }
.activity-row .ar-agent { color: var(--accent); font-weight: 600; margin-left: 6px; }

.detail-panel { position: fixed; bottom: 20px; right: 20px; width: 340px; max-height: 45vh; z-index: 22; display: none; flex-direction: column; overflow: hidden; border-radius: 3px; }
.detail-panel.open { display: flex; }
.dp-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 12.5px; letter-spacing: 0.03em; }
.dp-head button { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; }
.dp-body { padding: 14px 18px; overflow-y: auto; font-size: 12.5px; color: var(--text-dim); white-space: pre-wrap; }
.dp-body .sp-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin: 11px 0 3px; font-weight: 600; }
.dp-body .sp-label:first-child { margin-top: 0; }
.dp-body .sp-value { color: var(--text); }
