/* Advoxa HQ — Dashboard Stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --border:    #2a2d3e;
  --accent:    #6c63ff;
  --accent2:   #00c9a7;
  --danger:    #ff4d6d;
  --warn:      #ffa726;
  --success:   #4caf50;
  --text:      #e8eaf0;
  --muted:     #8892a4;
  --sidebar-w: 240px;
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; }
.sidebar-header { padding: 20px 16px 12px; border-bottom: 1px solid var(--border); }
.sidebar-logo { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
.sidebar-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sidebar-section { padding: 12px 8px 0; }
.sidebar-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 0 8px 6px; }
.stage-link { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13px; transition: all .15s; margin-bottom: 1px; }
.stage-link:hover, .stage-link.active { background: rgba(108,99,255,.15); color: var(--text); }
.stage-link.active { color: var(--accent); }
.stage-count { font-size: 11px; background: var(--border); padding: 1px 6px; border-radius: 10px; min-width: 20px; text-align: center; }
.sidebar-actions { padding: 16px; margin-top: auto; border-top: 1px solid var(--border); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a52e0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e03456; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Main content ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: var(--surface); position: sticky; top: 0; z-index: 50; }
.topbar h1 { font-size: 16px; font-weight: 600; flex: 1; }
.search-input { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 7px 12px; border-radius: 8px; font-size: 13px; width: 260px; outline: none; }
.search-input:focus { border-color: var(--accent); }
.content { padding: 24px; flex: 1; }

/* ── Stats strip ── */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Table ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-header h2 { font-size: 14px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
thead { background: rgba(255,255,255,.02); }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.td-name { font-weight: 500; color: var(--text); }
.td-name a { color: inherit; text-decoration: none; }
.td-name a:hover { color: var(--accent); }

/* ── Score bars ── */
.score-bar { display: flex; align-items: center; gap: 8px; }
.score-num { font-size: 13px; font-weight: 600; min-width: 28px; }
.bar-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; max-width: 80px; }
.bar-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.bar-high { background: var(--success); }
.bar-mid  { background: var(--warn); }
.bar-low  { background: var(--danger); }

/* ── Stage badges ── */
.stage-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.s-researched    { background: #2a2d3e; color: #8892a4; }
.s-audited       { background: #1a2744; color: #6fa3ef; }
.s-contacted     { background: #1e2a1e; color: #6ec66e; }
.s-replied       { background: #2a1e2a; color: #c86ec8; }
.s-loom          { background: #2a2210; color: #ffc24b; }
.s-discovery     { background: #1a2a2a; color: #4dd4c8; }
.s-proposal      { background: #2a1a1e; color: #f07090; }
.s-won           { background: #1a2a1a; color: #4caf50; }
.s-lost          { background: #2a1a1a; color: #ff4d6d; }
.s-followup      { background: #222222; color: #aaaaaa; }
.s-leadbuyer     { background: #1a1a2a; color: #9c9cff; }
.s-serviceclient { background: #1a2210; color: #a4c840; }

/* ── Lead detail ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.detail-card h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.field-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.field-label { color: var(--muted); flex-shrink: 0; min-width: 140px; }
.field-value { text-align: right; font-weight: 500; word-break: break-all; }
.field-value a { color: var(--accent); text-decoration: none; }
.field-value.gap { color: var(--danger); }
.field-value.ok  { color: var(--success); }

/* ── Next action card ── */
.next-action-card { background: linear-gradient(135deg, rgba(108,99,255,.15), rgba(0,201,167,.1)); border: 1px solid var(--accent); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.next-action-card .label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 6px; }
.next-action-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.next-action-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── Audit note ── */
.audit-note { background: #0d1117; border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; line-height: 1.7; color: #a9b1d6; white-space: pre-wrap; overflow-x: auto; }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.form-control { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-size: 13px; outline: none; transition: border-color .15s; }
.form-control:focus { border-color: var(--accent); }
.form-control select, select.form-control { appearance: none; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.form-section h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; padding: 16px 0; }

/* ── Empty state ── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }

/* ── Rating stars ── */
.rating { color: var(--warn); font-size: 13px; }
.bool-yes { color: var(--success); }
.bool-no  { color: var(--danger); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
