/* ── Dashboard shell ──────────────────────────────────── */
.dashboard-main { min-height: calc(100vh - 81px); }
.dash-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.dash-header h1 { font-size: 32px; margin-top: 6px; }
.dash-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 8px; border: none; cursor: pointer;
  font-family: 'Figtree', sans-serif;
  font-size: 14px; font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }
.btn-sm {
  padding: 5px 12px; font-size: 12px;
  border-radius: 6px; cursor: pointer; border: none;
  font-family: 'Figtree', sans-serif; font-weight: 600;
  transition: background 0.15s;
}
.btn-edit { background: var(--bg); color: var(--fg-muted); }
.btn-edit:hover { background: var(--border); }
.btn-delete { background: #FEF2F2; color: #B91C1C; }
.btn-delete:hover { background: #FEE2E2; }

/* ── Stats strip ─────────────────────────────────────── */
.stats-strip {
  display: flex; gap: 16px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 24px;
  flex: 1; min-width: 120px;
}
.stat-val {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--fg); line-height: 1;
}
.stat-lbl {
  display: block;
  font-size: 12px; color: var(--fg-muted);
  font-weight: 500; margin-top: 4px;
}

/* ── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 20px;
  background: none; border: none; cursor: pointer;
  font-family: 'Figtree', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); }

/* ── Panels & toolbar ─────────────────────────────────── */
.tab-panel { display: flex; flex-direction: column; gap: 16px; }
.panel-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.search-input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }

/* ── Table ────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg); }
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td {
  padding: 14px 16px; font-size: 14px; color: var(--fg);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .col-name { font-weight: 600; }
.data-table .col-actions { text-align: right; white-space: nowrap; }
.data-table .col-actions .btn-sm { margin-left: 4px; }

.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.status-lead     { background: #FEF9C3; color: #854D0E; }
.status-active   { background: #DCFCE7; color: #166534; }
.status-completed{ background: #E0DDD8; color: var(--fg-muted); }
.status-discovery  { background: #EFF6FF; color: #1E40AF; }
.status-in_progress { background: #FEF9C3; color: #854D0E; }
.status-review     { background: #F3E8FF; color: #6B21A8; }
.status-delivered  { background: #DCFCE7; color: #166534; }

/* Progress bar in table */
.progress-cell { min-width: 120px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.progress-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-fill.p0-29   { background: #94A3B8; }
.progress-fill.p30-59  { background: var(--accent); }
.progress-fill.p60-89  { background: #D97706; }
.progress-fill.p90-100{ background: #16A34A; }
.progress-label { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

/* Row timestamps */
.row-date { font-size: 12px; color: var(--fg-muted); white-space: nowrap; }

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  padding: 48px; text-align: center;
  font-size: 15px; color: var(--fg-muted);
}

/* ── Modals ───────────────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0;
  z-index: 100; align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(27,58,47,0.4);
  backdrop-filter: blur(2px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 100%; max-width: 460px;
  box-shadow: 0 16px 48px rgba(27,58,47,0.15);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h2 { font-size: 20px; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--fg-muted);
  padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--fg); }

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--fg); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
  font-family: 'Figtree', sans-serif; font-size: 14px; color: var(--fg);
  outline: none; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-group input::placeholder { color: #B0A89C; }

.range-input {
  width: 100%; height: 6px; accent-color: var(--accent); cursor: pointer;
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .dash-inner { padding: 24px 16px; }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .stats-strip { gap: 8px; }
  .stat-card { padding: 12px 16px; min-width: 90px; }
  .stat-val { font-size: 22px; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .table-wrap { overflow-x: auto; }
  .data-table { min-width: 600px; }
}
@media (max-width: 480px) {
  .panel-toolbar { flex-direction: column; align-items: stretch; }
  .search-input { width: 100%; }
  .btn { width: 100%; justify-content: center; }
}