:root {
  --bg:       #0d0d0d;
  --surface:  #1a1a1a;
  --border:   #2a2a2a;
  --text:     #e0e0e0;
  --muted:    #6b7280;
  --gold:     #d4a017;
  --orange:   #e85d04;
  --success:  #22c55e;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --radius:   6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

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

nav {
  background: #111;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
}

.nav-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: auto;
}

nav a {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.15s;
}
nav a:hover, nav a.active { color: var(--text); text-decoration: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary  { background: var(--gold);    color: #000; }
.btn-orange   { background: var(--orange);  color: #fff; }
.btn-success  { background: var(--success); color: #000; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-ghost    { background: transparent; border: 1px solid var(--border); color: var(--text); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-ready           { background: #1e3a5f; color: #60a5fa; }
.badge-contacted       { background: #1a3a1a; color: #86efac; }
.badge-responded       { background: #3a2a00; color: #fbbf24; }
.badge-due_diligence   { background: #2a1a3a; color: #c084fc; }
.badge-dealership_review { background: #3a1a1a; color: #f87171; }
.badge-won             { background: #163516; color: #4ade80; }
.badge-lost            { background: #3a1616; color: #f87171; }
.badge-no_response     { background: #2a2a2a; color: #9ca3af; }
.badge-scheduled       { background: #1a2a3a; color: #7dd3fc; }

input[type="text"], input[type="password"], textarea, select {
  background: #222;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 360px;
}
.login-title { font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 24px; }

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}

.cap-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cap-bar .cap-count { color: var(--gold); font-weight: 700; }
.cap-bar .cap-label { color: var(--muted); font-size: 12px; }

.timeline { list-style: none; position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}
.timeline-time { font-size: 11px; color: var(--muted); }
.timeline-label { font-weight: 600; font-size: 13px; }
.timeline-note  { font-size: 12px; color: var(--muted); }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }

.message-preview-box {
  background: #222;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 8px;
}
.message-preview-box textarea {
  min-height: 120px;
  resize: vertical;
  margin-bottom: 10px;
}

h1 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--muted); }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.saved-indicator { color: var(--success); font-size: 12px; }
.error { color: var(--danger); font-size: 13px; }
