/* Veise Leads Dashboard — app.css */

:root {
  --red:        #c0392b;
  --red-light:  #fde8ea;
  --bg:         #f7f6f3;
  --surface:    #ffffff;
  --border:     #e4e2dc;
  --text:       #1a1a1a;
  --muted:      #888;
  --warn-bg:    #fff8e1;
  --warn-text:  #c07800;
  --green:      #1a7f5a;
  --radius:     6px;
  --shadow:     0 1px 3px rgba(0,0,0,.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.red { color: var(--red); }
.text-muted { color: var(--muted); }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 52px;
}

.topbar-brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.topbar-nav { display: flex; gap: 4px; flex: 1; }

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover    { background: var(--bg); color: var(--text); }
.nav-link.active   { background: var(--red-light); color: var(--red); }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.logout-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.logout-link:hover { color: var(--text); }

/* ── Layout ── */
.main-content { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }

.page-header { margin-bottom: 24px; }
.page-title  { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.breadcrumb  { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

/* ── Stat row ── */
.stat-row {
  display: flex; gap: 20px; margin-top: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  min-width: 100px;
}
.stat-val   { font-size: 24px; font-weight: 600; color: var(--text); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Action bar ── */
.action-bar { display: flex; gap: 8px; margin-bottom: 16px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover        { background: var(--bg); }
.btn-primary      { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover{ background: #a93226; border-color: #a93226; }
.btn-secondary    { background: var(--surface); }
.btn-danger       { background: #fff; border-color: #e0c0be; color: var(--red); }
.btn-danger:hover { background: var(--red-light); }
.btn-sm           { padding: 4px 10px; font-size: 12px; }
.btn-full         { width: 100%; }

/* ── Table ── */
.leads-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.leads-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.leads-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leads-table tr:last-child td { border-bottom: none; }
.lead-row:hover td { background: #fafaf8; }
.row-approved td  { background: #f0faf5; }
.lead-name a      { font-weight: 500; color: var(--text); text-decoration: none; }
.lead-name a:hover{ color: var(--red); }
.actions          { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Score badges ── */
.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.score-high { background: #fde8ea; color: var(--red); }
.score-mid  { background: #fff3cd; color: var(--warn-text); }
.score-low  { background: #e8f5ee; color: var(--green); }

/* ── Status pills ── */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}
.status-pending  { background: #f0f0f0; color: #666; }
.status-approved { background: #e8f5ee; color: var(--green); }
.status-printed  { background: #e8eef8; color: #2255aa; }
.status-posted   { background: #e8eef8; color: #2255aa; }
.status-replied  { background: #fff3cd; color: var(--warn-text); }
.status-converted{ background: #e8f5ee; color: var(--green); }
.status-skipped  { background: #f0f0f0; color: #aaa; }

/* ── Flags ── */
.flag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
}
.flag-warn       { background: var(--warn-bg); color: var(--warn-text); }
.flag-info       { background: #e8eef8; color: #2255aa; }
.flag-block      { display: block; margin: 0 0 12px 0; padding: 8px 12px; border-radius: var(--radius); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.empty-state p { margin-bottom: 8px; }

/* ── Cards (review page) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ── Review grid ── */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* ── Score display ── */
.score-large {
  font-size: 48px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 16px;
}
.score-denom { font-size: 18px; color: var(--muted); font-weight: 400; }

.sub-scores { display: flex; flex-direction: column; gap: 8px; }
.sub-score  { display: flex; align-items: center; gap: 10px; }
.sub-label  { font-size: 12px; color: var(--muted); width: 110px; flex-shrink: 0; }
.sub-bar    { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.sub-fill   { height: 100%; background: var(--red); border-radius: 3px; }
.sub-val    { font-size: 12px; font-weight: 600; width: 28px; text-align: right; }

/* ── Detail table ── */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-table td:first-child {
  width: 120px;
  color: var(--muted);
  font-weight: 500;
}
.detail-table tr:last-child td { border-bottom: none; }
.detail-table th {
  padding: 6px 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* ── Forms ── */
.form-group   { margin-bottom: 14px; }
.form-label   { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-label .hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-input, .form-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.12s;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--red);
  background: var(--surface);
}
.form-textarea { resize: vertical; }

/* ── Login ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 340px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.login-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.login-sub    { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-error  { background: var(--red-light); color: var(--red); padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.login-input  { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: inherit; background: var(--bg); margin-bottom: 12px; }
.login-input:focus { outline: none; border-color: var(--red); background: #fff; }
.login-btn    { width: 100%; padding: 10px; background: var(--red); border: none; border-radius: var(--radius); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-btn:hover { background: #a93226; }
