*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #0e0e0f; color: #e8e6e0; height: 100vh; overflow: hidden; }

.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }

/* SIDEBAR */
.sidebar { background: #161618; border-right: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; overflow-y: auto; }
.logo { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo h1 { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #e8541a; }
.logo p { font-size: 10px; color: #888580; margin-top: 2px; }
.sec-label { padding: 12px 16px 6px; font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #888580; }
.vitem { display: flex; align-items: center; gap: 8px; padding: 8px 16px; cursor: pointer; border-left: 2px solid transparent; transition: background 0.12s; }
.vitem:hover { background: #1e1e21; }
.vitem.active { background: #1e1e21; border-left-color: #e8541a; }
.vdot { width: 5px; height: 5px; border-radius: 50%; background: #888580; flex-shrink: 0; }
.vitem.active .vdot { background: #e8541a; }
.vname { font-size: 12px; font-weight: 500; flex: 1; }
.vcount { font-size: 10px; color: #888580; background: #26262a; padding: 1px 5px; border-radius: 8px; font-family: monospace; }
.add-v { padding: 10px 16px; }
.add-v input { width: 100%; background: #1e1e21; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 6px 9px; font-size: 11px; color: #e8e6e0; outline: none; font-family: inherit; }
.add-v input:focus { border-color: #e8541a; }
.add-v button { width: 100%; margin-top: 5px; background: #e8541a; color: white; border: none; border-radius: 6px; padding: 6px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; }
.add-v button:hover { opacity: 0.85; }
.sidebar-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.srow { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; color: #888580; }
.srow a { color: #3b82f6; text-decoration: none; font-size: 11px; }

/* MAIN */
.main { display: flex; flex-direction: column; overflow: hidden; }
.mhead { padding: 18px 24px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: flex-start; justify-content: space-between; flex-shrink: 0; }
.mhead h2 { font-size: 18px; font-weight: 500; }
.mhead p { font-size: 12px; color: #888580; margin-top: 3px; }
.mbody { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* BADGES */
.badge { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; }
.b-new { background: rgba(59,130,246,0.15); color: #3b82f6; }
.b-researching { background: rgba(245,158,11,0.15); color: #f59e0b; }
.b-terms { background: rgba(245,158,11,0.15); color: #f59e0b; }
.b-ready { background: rgba(34,197,94,0.15); color: #22c55e; }
.b-complete { background: rgba(136,133,128,0.15); color: #888580; }
.b-running { background: rgba(232,84,26,0.15); color: #f97316; }
.b-error { background: rgba(239,68,68,0.15); color: #ef4444; }
.b-done { background: rgba(34,197,94,0.15); color: #22c55e; }

/* PANELS */
.panel { background: #161618; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.ptitle { font-size: 12px; font-weight: 600; margin-bottom: 12px; color: #e8e6e0; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.metric { background: #1e1e21; border-radius: 7px; padding: 12px 14px; }
.mlabel { font-size: 10px; color: #888580; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.mval { font-size: 22px; font-weight: 500; font-family: monospace; }
.mval.green { color: #22c55e; }
.mval.blue { color: #3b82f6; }
.mval.orange { color: #f97316; }

/* TERMS */
.term-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: #1e1e21; border-radius: 7px; margin-bottom: 7px; border: 1px solid rgba(255,255,255,0.08); }
.term-row.approved { border-color: rgba(34,197,94,0.35); }
.term-row.rejected { opacity: 0.4; }
.term-text { font-family: monospace; font-size: 11px; flex: 1; }
.term-rationale { font-size: 10px; color: #888580; flex: 2; }
.term-est { font-size: 10px; color: #888580; min-width: 50px; text-align: right; }
.bsm { padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 600; cursor: pointer; border: 1px solid; font-family: inherit; }
.bsm.approve { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #22c55e; }
.bsm.approve.on { background: rgba(34,197,94,0.2); border-color: #22c55e; }
.bsm.reject { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #ef4444; }
.bsm.reject.on { background: rgba(239,68,68,0.2); border-color: #ef4444; }

/* BUTTONS */
.btn { padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: #e8541a; border-color: #e8541a; color: white; }
.btn.primary:hover { opacity: 0.85; }
.btn.secondary { background: transparent; border-color: rgba(255,255,255,0.14); color: #e8e6e0; }
.btn.secondary:hover { background: #1e1e21; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* GET PROSPECTS */
.prospects-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prospects-row input { background: #1e1e21; border: 1px solid rgba(255,255,255,0.14); border-radius: 7px; padding: 7px 10px; font-size: 13px; color: #e8e6e0; width: 90px; font-family: monospace; outline: none; }
.prospects-row input:focus { border-color: #e8541a; }
.prospects-note { font-size: 11px; color: #888580; }

/* RUN HISTORY */
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 11px; }
.rrow:last-child { border-bottom: none; }

/* RESEARCHING STATE */
.researching-panel { text-align: center; padding: 32px; }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(232,84,26,0.2); border-top-color: #e8541a; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.researching-panel p { font-size: 13px; color: #888580; margin-top: 8px; }

/* MODAL */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-inner { background: #161618; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; width: 600px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; }
.modal-head button { background: none; border: none; color: #888580; font-size: 16px; cursor: pointer; }
.log-body { flex: 1; overflow-y: auto; padding: 16px 20px; font-family: monospace; font-size: 11px; line-height: 1.8; color: #888580; max-height: 50vh; }
.log-body .log-line.success { color: #22c55e; }
.log-body .log-line.error { color: #ef4444; }
.modal-foot { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 48px; color: #888580; font-size: 13px; }

/* INSTR */
.instr { background: #1e1e21; border-left: 2px solid #e8541a; padding: 10px 12px; border-radius: 0 7px 7px 0; font-size: 11px; line-height: 1.7; color: #888580; margin-bottom: 12px; }
.instr strong { color: #e8e6e0; }

#new-term-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: #ccc !important;
}

#new-term-input {
  background: #1e1e21 !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  border-radius: 6px !important;
  color: #e8e6e0 !important;
  font-size: 12px !important;
  padding: 7px 10px !important;
  flex: 1 !important;
}
#new-term-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border-color: rgba(255,255,255,0.3) !important;
}
.add-term-btn {
  background: #e8541a !important;
  border-color: #e8541a !important;
  color: white !important;
  font-size: 12px !important;
  padding: 7px 14px !important;
  white-space: nowrap !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  border: none !important;
}

#new-term-input,
#new-term-input:focus,
#new-term-input:active {
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  border-color: rgba(255,255,255,0.2) !important;
}
