/* Vee's NICHED Command Center — dark theme matching Hermes dashboard */

:root {
  --bg:         #0a0a0a;
  --card:       #1a1a1a;
  --card-2:     #141414;
  --border:     #2a2a2a;
  --border-2:   #333;
  --text:       #e5e5e5;
  --text-dim:   #9a9a9a;
  --text-faint: #6a6a6a;
  --accent:     #006B6B;   /* Vee brand teal */
  --accent-2:   #008b8b;
  --gold:       #C9A961;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --radius:     10px;
  --shadow:     0 1px 0 rgba(255,255,255,0.02) inset, 0 4px 20px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(180deg, #0e0e0e 0%, #0a0a0a 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,107,107,0.18);
}
.brand-name { font-weight: 700; letter-spacing: 0.2px; }
.brand-sub  { color: var(--text-dim); font-size: 12px; }
.topbar-center { color: var(--text-dim); font-size: 13px; }
.topbar-right  { display: flex; align-items: center; gap: 12px; }
.updated { color: var(--text-faint); font-size: 12px; }
.btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 120ms, border-color 120ms;
}
.btn:hover { background: #1f1f1f; border-color: var(--border-2); }
.btn.ghost { background: transparent; }

/* ---- grid ---- */
.grid {
  display: grid;
  gap: 16px;
  padding: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .grid { grid-template-columns: 1fr; } }

/* ---- card ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card > header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.card h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin: 0;
  font-weight: 600;
}
.badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.badge.muted { background: #2a2a2a; color: var(--text-dim); }

.empty {
  color: var(--text-faint);
  list-style: none;
  margin: 0;
  padding: 18px 0;
  text-align: center;
  font-style: italic;
  font-size: 13px;
}

/* ---- pipeline bars ---- */
.pipeline-body { display: flex; flex-direction: column; gap: 8px; }
.pipe-row {
  display: grid;
  grid-template-columns: 120px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.pipe-label { color: var(--text-dim); }
.pipe-bar {
  height: 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.pipe-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 350ms ease;
}
.pipe-bar.lead > span         { background: #2a2a2a; }
.pipe-bar.action > span       { background: var(--warning); }
.pipe-bar.hot > span          { background: var(--danger); }
.pipe-bar.warm > span         { background: var(--gold); }
.pipe-bar.under > span        { background: var(--accent-2); }
.pipe-bar.closed > span       { background: var(--success); }
.pipe-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- leads list ---- */
.leads-list, .cal-list, .dl-list, .mail-list, .content-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.leads-list li, .cal-list li, .dl-list li, .mail-list li, .content-list li {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.lead-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lead-name { font-weight: 600; }
.lead-meta { color: var(--text-dim); font-size: 11px; }
.lead-tag {
  display: inline-block;
  font-size: 10px;
  background: #222;
  color: var(--text-dim);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.btn-tiny {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}
.btn-tiny:hover { background: var(--accent-2); text-decoration: none; }

/* ---- calendar list ---- */
.cal-time { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 8px; }
.cal-loc  { color: var(--text-faint); font-size: 11px; display: block; margin-top: 2px; }

/* ---- deadlines ---- */
.dl-row { display: flex; justify-content: space-between; gap: 8px; }
.dl-row.urgent { border-color: var(--danger); }
.dl-row.urgent .dl-when { color: var(--danger); font-weight: 600; }
.dl-when { color: var(--warning); font-size: 12px; }
.dl-addr { font-weight: 500; }
.dl-meta { color: var(--text-dim); font-size: 11px; }

/* ---- market ---- */
.market-body { display: flex; flex-direction: column; gap: 10px; }
.market-row {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
}
.market-area { font-weight: 600; }
.market-stats { color: var(--text-dim); grid-column: 1 / -1; }
.market-stats .pill {
  display: inline-block;
  margin-right: 8px;
  color: var(--text);
}
.market-stats .pill b { color: var(--gold); font-weight: 600; }

/* ---- content ---- */
.content-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.content-meta { color: var(--text-faint); font-size: 11px; }

/* ---- quick actions ---- */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.action {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 16px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 120ms, background 120ms, transform 120ms;
  font: inherit;
}
.action:hover { border-color: var(--accent); background: #181818; }
.action:active { transform: translateY(1px); }
.action-icon { font-size: 22px; line-height: 1; }
.action-label { font-size: 12px; color: var(--text-dim); text-align: center; }

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms, transform 180ms;
  pointer-events: none;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err  { border-color: var(--danger); }

/* Wide cards (advisors, agents) */
.card-wide { grid-column: 1 / -1; }
.advisors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.advisor-tile {
  background: var(--panel-2, #14151a);
  border: 1px solid var(--border, #23252b);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.advisor-tile:hover {
  border-color: var(--accent, #5fa8ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(95,168,255,0.15);
}
.advisor-tile::before {
  content: attr(data-icon);
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 22px;
  opacity: 0.5;
}
.advisor-name { font-weight: 600; font-size: 14px; }
.advisor-spec { color: var(--muted, #888); font-size: 11px; margin-top: 4px; }

.advisor-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.advisor-form select,
.advisor-form input {
  background: var(--panel-2, #14151a);
  color: var(--fg, #e8eaed);
  border: 1px solid var(--border, #23252b);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}
.advisor-form input { flex: 1; min-width: 200px; }
.advisor-response {
  background: var(--panel-2, #14151a);
  border: 1px solid var(--border, #23252b);
  border-radius: 10px;
  padding: 14px;
  min-height: 60px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  display: none;
}
.advisor-response.show { display: block; }
.advisor-response.error { border-color: var(--danger, #f66); }

/* Agent deployment */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.agent-tile {
  background: var(--panel-2, #14151a);
  border: 1px solid var(--border, #23252b);
  border-radius: 10px;
  padding: 12px;
}
.agent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.agent-icon { font-size: 20px; }
.agent-name { font-weight: 600; font-size: 14px; flex: 1; }
.agent-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #2a2d35;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agent-status.running { background: #2a4a2a; color: #8fc88f; }
.agent-status.idle    { background: #4a3a2a; color: #c8af8f; }
.agent-status.error   { background: #4a2a2a; color: #c88f8f; }
.agent-desc { color: var(--muted, #888); font-size: 12px; margin-bottom: 8px; }
.agent-actions { display: flex; gap: 6px; }
.btn.small { padding: 4px 10px; font-size: 11px; }

.agent-output {
  background: var(--panel-2, #14151a);
  border: 1px solid var(--border, #23252b);
  border-radius: 10px;
  padding: 14px;
  min-height: 50px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  font-family: ui-monospace, monospace;
  display: none;
}
.agent-output.show { display: block; }
