/* Cuevanomics Command Console — onyx & gold design system.
   Dark, refined, premium. Tokens up top; components below. */

:root {
  --ink:      #ece7da;   /* primary text — warm ivory */
  --ink-2:    #cfc9ba;
  --muted:    #9a9385;
  --muted-2:  #6f6a5e;
  --line:     #2b2c30;
  --line-2:   #232428;
  --bg:       #0d0d0f;   /* page onyx */
  --surface:  #16161a;   /* cards */
  --surface-2:#1d1d22;   /* inputs / hover */

  --brand:     #c8a253;  /* antique gold */
  --brand-600: #b08b3c;
  --brand-700: #8f6f2e;
  --brand-50:  rgba(200,162,83,.13);   /* gold tint */

  --green:   #3aa564;  --green-50: rgba(58,165,100,.14);
  --amber:   #d2a141;  --amber-50: rgba(210,161,65,.14);
  --red:     #df5d5d;  --red-50:   rgba(223,93,93,.14);
  --blue:    #5aa7d8;
  --violet:  #9d86d8;

  --radius:   14px;
  --radius-sm:10px;
  --shadow:   0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.40);
  --shadow-sm:0 1px 2px rgba(0,0,0,.40);
  --ring:     0 0 0 3px rgba(200,162,83,.22);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif:"Cormorant Garamond", Didot, "Bodoni MT", Georgia, serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  height: 62px; padding: 0 24px;
  background: linear-gradient(180deg, #161616, #0c0c0e);
  color: var(--ink);
  border-bottom: 1px solid rgba(200,162,83,.28);
  box-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .02em; font-size: 17px; }
.brand .emblem { width: 34px; height: 34px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(200,162,83,.35); }
.brand .name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .06em; color: #e9dcbf; }
.brand .sub { color: var(--brand); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 4px; margin-left: 10px; }
.topbar nav a {
  color: var(--muted); font-weight: 600; font-size: 14px; padding: 7px 13px; border-radius: 8px;
}
.topbar nav a:hover { color: var(--ink); background: rgba(255,255,255,.05); text-decoration: none; }
.topbar nav a.active { color: #1a1407; background: var(--brand); }
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 14px; }
.userchip .av {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #1a1407; font-size: 12px; font-weight: 800;
}
.userchip form { margin: 0; }
.btn-ghost-light {
  background: rgba(255,255,255,.06); color: var(--ink); border: 1px solid var(--line); padding: 7px 12px;
  border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.12); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 24px 80px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: linear-gradient(180deg, #d2ad5e, #bd9542); color: #1c1407; border: 0; cursor: pointer;
  padding: 11px 18px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 14px;
  transition: transform .04s ease, filter .15s ease; box-shadow: var(--shadow-sm); text-decoration: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #3a3a3e; color: #8a8678; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.secondary:hover { background: #26262c; filter: none; }
.btn.success { background: linear-gradient(180deg, #3fb06b, #2f9257); color: #07120b; }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }

.btn-call {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, #2faa5e, #1f8a49); color: #fff;
  padding: 13px 20px; border-radius: 11px; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 18px rgba(31,138,73,.30); text-decoration: none;
}
.btn-call:hover { filter: brightness(1.06); text-decoration: none; }
.btn-call .ph { font-size: 18px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); margin-bottom: 12px; font-weight: 700; }
.card .h-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card .h-row h3 { margin: 0; }

/* ---------- Pills / tags / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; line-height: 1.6; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 2px 8px; margin: 2px 4px 2px 0;
}
.tag.warn { color: var(--amber); background: var(--amber-50); border-color: rgba(210,161,65,.4); }

.score {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 9px; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
  background: var(--brand-50); color: var(--brand);
}
.score.hot { background: rgba(200,162,83,.22); color: #e3c074; box-shadow: inset 0 0 0 1px rgba(200,162,83,.5); }
.score.cold { background: var(--surface-2); color: var(--muted); }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .n { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.kpi .n.accent { color: var(--brand); }
.kpi .n.green { color: var(--green); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 0 12px;
  box-shadow: var(--shadow-sm);
}
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 11px 0; width: 100%; }
.search .ic { color: var(--muted-2); }
select.filter, input.filter, button.filter {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px; font: inherit; color: var(--ink); box-shadow: var(--shadow-sm); cursor: pointer;
}
label.toggle { display: inline-flex; align-items: center; gap: 6px; user-select: none; }
label.toggle.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--brand); }
th.sorted { color: var(--brand); }
th .sarrow { font-size: 10px; margin-left: 4px; }
button.btn-search { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; padding: 10px 18px; }
button.btn-search:hover { filter: brightness(1.06); }
.search-clear { color: var(--muted-2); font-size: 20px; line-height: 1; text-decoration: none; padding: 0 2px; }
.search-clear:hover { color: var(--ink); }

/* ---------- Table ---------- */
.tablecard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.leads { border-collapse: collapse; width: 100%; }
table.leads th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; padding: 13px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
table.leads td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.leads tr:last-child td { border-bottom: 0; }
table.leads tbody tr { transition: background .1s ease; cursor: pointer; }
table.leads tbody tr:hover { background: var(--surface-2); }
.owner-cell { font-weight: 700; color: var(--ink); }
.addr-cell { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ---------- Lead detail ---------- */
.lead-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.lead-head .who h1 { font-size: 24px; }
.lead-head .who .addr { color: var(--muted); margin-top: 3px; }
.lead-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.col { min-width: 0; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); }

.phone-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0; }
.phone-blocked { color: var(--muted-2); text-decoration: line-through; font-family: var(--mono); font-size: 13px; }

label.fld { display: block; margin: 12px 0 5px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
input.in, select.in, textarea.in {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: var(--surface-2); outline: 0; transition: border .12s, box-shadow .12s;
}
input.in::placeholder, textarea.in::placeholder { color: var(--muted-2); }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--brand); box-shadow: var(--ring); }
textarea.in { resize: vertical; min-height: 70px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Offer panel ---------- */
.offer-panel { background: linear-gradient(180deg, #1b1a16, #161512); border: 1px solid rgba(200,162,83,.28); }
.offer-big { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; color: #e9dcbf; font-variant-numeric: tabular-nums; }
.offer-break { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; margin: 14px 0; font-size: 14px; }
.offer-break .lab { color: var(--muted); }
.offer-break .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.offer-break .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 800; color: var(--ink); }
.gate-ok { color: var(--green); background: var(--green-50); border: 1px solid rgba(58,165,100,.4); padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.gate-warn { color: var(--amber); background: var(--amber-50); border: 1px solid rgba(210,161,65,.4); padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.timeline li.sys::before { background: var(--muted-2); box-shadow: 0 0 0 3px var(--line-2); }
.timeline .when { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.timeline .what { font-size: 14px; color: var(--ink); margin-top: 1px; }
.timeline .who { font-weight: 700; color: var(--ink-2); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, #1a1813, var(--bg)); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.6); padding: 30px 32px 34px; text-align: center; }
.login-card .logo { width: 188px; max-width: 78%; margin: 4px auto 14px; display: block; }
.login-card .tag { display: block; color: var(--muted); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 18px; }
.login-card label.fld { margin-top: 14px; text-align: left; }
.login-err { background: var(--red-50); color: var(--red); border: 1px solid rgba(223,93,93,.4); padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }

/* ---------- Brand band (deal package header) ---------- */
.brandband { display: flex; align-items: center; gap: 14px; background: linear-gradient(180deg, #161616, #0c0c0e);
  border: 1px solid rgba(200,162,83,.3); border-radius: 12px; padding: 14px 20px; margin-bottom: 16px; }
.brandband img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(200,162,83,.35); }
.brandband .bn { font-family: var(--serif); font-size: 22px; letter-spacing: .06em; color: #e9dcbf; font-weight: 700; }
.brandband .bt { color: var(--brand); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }

/* ---------- Misc ---------- */
.flash { padding: 11px 15px; border-radius: 11px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.flash.ok { background: var(--green-50); color: var(--green); border: 1px solid rgba(58,165,100,.4); }
.section-title { font-size: 20px; margin-bottom: 4px; }
.back { color: var(--muted); font-weight: 600; font-size: 13px; }
.lead-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.lead-nav .stepper { display: flex; align-items: center; gap: 10px; }
.btn.disabled { opacity: .4; pointer-events: none; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.inline-form { display: inline; }
.hint { font-size: 12.5px; color: var(--muted-2); margin-top: 6px; }

@media (max-width: 880px) {
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .topbar nav { display: none; }
}

/* The deal package prints clean on white (keeps ink off paper), brand band stays dark. */
@media print {
  .topbar, .noprint, .back { display: none !important; }
  :root { --ink: #1a1a1a; --muted: #555; --line: #ddd; --surface: #fff; --surface-2: #faf8f3; }
  body { background: #fff; color: #1a1a1a; }
  .wrap { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #e3ddcf; background: #fff; break-inside: avoid; }
  .offer-panel { background: #faf8f3; }
  .offer-big { color: #1a1a1a; }
  .grid2 { grid-template-columns: 1fr 1fr; }
}
