/* ─── Deal Finder Dashboard ─────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --surface: #111;
  --surface2: #1a1a1a;
  --border: #222;
  --text: #fff;
  --text-muted: #888;
  --text-dim: #555;
  --gold: #C9A84C;
  --gold-dark: #a8893e;
  --green: #4caf50;
  --red: #ef5350;
  --blue: #42a5f5;
  --orange: #ff9800;
  --purple: #ab47bc;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

/* ─── Layout ─────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-brand h1 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.sidebar-brand small {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--text);
  background: var(--surface2);
  border-right: 2px solid var(--gold);
}

.main {
  margin-left: 220px;
  flex: 1;
  padding: 32px;
  min-width: 0;
}

/* ─── Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
}

/* ─── Cards ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.stat-card .label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
}

.stat-card .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Filters ────────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filters select,
.filters input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.filters select:focus,
.filters input:focus {
  border-color: var(--gold);
}

/* ─── Table ──────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.data-table th:hover { color: var(--gold); }

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.data-table tr:hover td {
  background: var(--surface2);
  color: var(--text);
}

/* ─── Status Badges ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
}

.badge-new { background: var(--blue); color: #fff; }
.badge-contacted { background: var(--orange); color: #000; }
.badge-negotiating { background: var(--purple); color: #fff; }
.badge-loi { background: var(--gold); color: #000; }
.badge-closed { background: var(--green); color: #fff; }
.badge-dead { background: var(--red); color: #fff; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-gold {
  background: var(--gold);
  color: var(--bg);
}

.btn-gold:hover { background: var(--gold-dark); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--bg);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 10px;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  max-width: 500px;
  width: 90%;
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.modal .form-group {
  margin-bottom: 16px;
}

.modal label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--gold);
}

/* ─── Pipeline / Kanban ──────────────────────────────────── */
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  min-height: 500px;
}

.pipeline-col {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
}

.pipeline-col h3 {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.pipeline-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.pipeline-card:hover {
  border-color: var(--gold);
}

.pipeline-card .card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.pipeline-card .card-location {
  font-size: 12px;
  color: var(--text-muted);
}

.pipeline-card .card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 8px;
}

/* ─── Detail Page ────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
}

.detail-section h3 {
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-row .label { color: var(--text-dim); }
.detail-row .value { color: var(--text); font-weight: 600; }

/* ─── Timeline ───────────────────────────────────────────── */
.timeline { margin-top: 24px; }

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-dot.sent { background: var(--green); }
.timeline-dot.pending { background: var(--border); }
.timeline-dot.opened { background: var(--gold); }

.timeline-content .step-type {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.timeline-content .step-subject {
  font-size: 14px;
  color: var(--text);
  margin-top: 4px;
}

.timeline-content .step-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ─── Login ──────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  width: 360px;
  text-align: center;
}

.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-box small {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 32px;
}

.login-box input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
}

.login-box input:focus { border-color: var(--gold); }

.login-box .btn { width: 100%; justify-content: center; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert-success { background: rgba(76,175,80,0.1); border: 1px solid var(--green); color: var(--green); }
.alert-error { background: rgba(239,83,80,0.1); border: 1px solid var(--red); color: var(--red); }
.alert-info { background: rgba(66,165,245,0.1); border: 1px solid var(--blue); color: var(--blue); }

/* ─── Loading ────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar-brand h1, .sidebar nav a span { display: none; }
  .main { margin-left: 60px; }
  .detail-grid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
}
