/* ProGrowth Sales UI — minimal, offline, no external assets. */
:root {
  --bg: #f4f6f8; --card: #ffffff; --ink: #1c2733; --muted: #68788a;
  --line: #dde4ea; --accent: #175cd3; --accent-ink: #ffffff;
  --warn-bg: #fff7e0; --warn-ink: #8a6100;
  --err-bg: #fdecec; --err-ink: #a12622;
  --ok: #067647;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
header {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 10px 20px; position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 17px; }
.header-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
nav .tab {
  background: none; border: none; padding: 8px 12px; font: inherit;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
}
nav .tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.banner {
  background: var(--warn-bg); color: var(--warn-ink);
  border-bottom: 1px solid #f0dfa8; padding: 8px 20px; font-weight: 600;
}
.view { max-width: 1180px; margin: 18px auto; padding: 0 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 16px;
}
h2 { margin: 0 0 12px; font-size: 17px; }
h3 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase;
     letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }

label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 6px; font: inherit; font-weight: 400;
  background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd3f5; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }

.btn {
  display: inline-block; padding: 8px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }

.table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.table th, .table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table.small { font-size: 13px; }
#sales-table tbody tr { cursor: pointer; }
#sales-table tbody tr:hover { background: #f0f5fc; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; vertical-align: middle; margin-left: 6px;
  background: #e7ecf2; color: var(--muted);
}
.badge.DRAFT            { background: #e7ecf2; color: #47586b; }
.badge.PROPOSAL_SENT    { background: #e2ecfc; color: #1c4fa0; }
.badge.SIGNED           { background: #e5e0fa; color: #4d3fa3; }
.badge.PAYMENT_PENDING  { background: #fff2d6; color: #8a6100; }
.badge.PAID             { background: #dcf5e7; color: var(--ok); }
.badge.PROVISIONED      { background: #d7f0f4; color: #0e6773; }
.badge.DONE             { background: #d9f2dc; color: #22662a; }
.badge.NEEDS_REVIEW     { background: var(--err-bg); color: var(--err-ink); }

.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #f0dfa8;
        border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-weight: 600; }
.error { background: var(--err-bg); color: var(--err-ink); border: 1px solid #efc4c2;
         border-radius: 6px; padding: 8px 12px; margin: 8px 0; white-space: pre-wrap; }
.totals { font-weight: 700; margin-top: 8px; }

/* [hidden] must win even over explicit display rules (typeahead, badges) */
[hidden] { display: none !important; }

/* intro + field help */
.intro { color: var(--muted); font-weight: 400; font-size: 13px; margin: -6px 0 14px; }
.structure-help { margin: -4px 0 10px; min-height: 1em; }
input[readonly] { background: var(--bg); color: var(--muted); }

/* GHL contact typeahead */
.typeahead-wrap { display: block; position: relative; margin-top: 4px; }
.typeahead-wrap input { margin-top: 0; }
.typeahead {
  display: block; position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(28, 39, 51, .15);
  max-height: 280px; overflow-y: auto; margin-top: 2px;
}
.ta-item { display: block; padding: 7px 10px; cursor: pointer; }
.ta-item:hover, .ta-item.active { background: #f0f5fc; }
.ta-name { display: block; font-weight: 600; font-size: 13px; }
.ta-sub { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.ta-note { display: block; padding: 7px 10px; color: var(--muted);
           font-weight: 400; font-size: 12px; cursor: default; }
.ghl-linked { display: inline-block; margin-top: 3px; color: var(--ok);
              font-size: 12px; font-weight: 600; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
              padding: 28px 30px; width: 340px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card .btn { width: 100%; margin-top: 8px; }
