/* Voltek CRM + intake. Same family as the fleet app: near-black, one blue, system type. */

:root {
  color-scheme: dark;
  --bg: #0a0a0c; --card: #15161a; --card2: #1c1d22; --line: #26272e; --line2: #33343c;
  --txt: #f2f2f4; --dim: #8e8e96; --faint: #5c5d66;
  --accent: #3b82f6; --accent2: #1d4ed8; --accent-soft: rgba(59,130,246,.14);
  --good: #22c55e; --warn: #f59e0b; --bad: #f87171; --violet: #a78bfa;
  --r: 12px; --r-sm: 8px;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg); color: var(--txt); min-height: 100vh; line-height: 1.45;
  font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; color: var(--txt); }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.wordmark { font-weight: 700; letter-spacing: .38em; font-size: 14px; color: var(--txt); }
.wordmark span { color: var(--dim); font-weight: 500; letter-spacing: .04em; font-size: 12px; margin-left: 8px; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field > label, .field .lbl { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding: 11px 12px; outline: none; transition: border-color .12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.err { border-color: var(--bad); }
textarea.input { min-height: 84px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.error { color: var(--bad); font-size: 13px; margin-top: 5px; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 5px; line-height: 1.4; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--card2); border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding: 10px 16px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: #24252c; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2f74e8; }
.btn.danger { color: var(--bad); border-color: rgba(248,113,113,.35); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--txt); background: var(--card2); }
.btn.sm { padding: 6px 11px; font-size: 13px; font-weight: 500; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--dim); background: var(--card2); line-height: 1.4; }
.pill.new { color: #93c5fd; border-color: rgba(59,130,246,.45); background: rgba(59,130,246,.12); }
.pill.contacted { color: #fcd34d; border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.1); }
.pill.qualified { color: #86efac; border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.1); }
.pill.converted { color: #c4b5fd; border-color: rgba(167,139,250,.45); background: rgba(167,139,250,.1); }
.pill.lost { color: var(--faint); }
.pill.warn { color: #fcd34d; border-color: rgba(245,158,11,.45); }
.pill.bad { color: var(--bad); border-color: rgba(248,113,113,.4); }

/* ---------- flash ---------- */
.flash { background: var(--card2); border: 1px solid var(--accent); border-radius: var(--r-sm);
  padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* ====================================================================
   CRM shell: sidebar on desktop, top bar + bottom tabs on phones
   ==================================================================== */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; }
.side .wordmark { padding: 4px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--dim); font-weight: 500; }
.nav a:hover { background: var(--card); color: var(--txt); text-decoration: none; }
.nav a.on { background: var(--card2); color: var(--txt); }
.nav a .n { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 600; }
.nav a.soon { color: var(--faint); cursor: default; }
.nav a.soon:hover { background: none; color: var(--faint); }
.nav a.soon .tag { margin-left: auto; font-size: 10.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.side .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.side .me b { display: block; color: var(--txt); font-weight: 600; }
.side .me form { margin-top: 8px; }
.main { padding: 26px 32px 60px; max-width: 1120px; width: 100%; }
.topbar, .tabbar { display: none; }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
    border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
  .main { padding: 18px 16px 90px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); z-index: 5; }
  .tabbar a { text-align: center; color: var(--dim); font-size: 11px; font-weight: 600; padding: 6px 2px; }
  .tabbar a .ico { display: block; font-size: 20px; line-height: 1.1; margin-bottom: 2px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a.soon { color: var(--faint); }
  .row2 { grid-template-columns: 1fr; }
}

/* ---------- page header ---------- */
.ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ph .actions { display: flex; gap: 8px; }

/* ---------- filter bar ---------- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: flex; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--dim); font-weight: 500; }
.seg a:hover { text-decoration: none; color: var(--txt); }
.seg a.on { background: var(--card2); color: var(--txt); }
.seg a .n { margin-left: 5px; color: var(--faint); font-size: 12px; }
.search { flex: 1; min-width: 180px; max-width: 320px; }
.search .input { padding: 8px 12px; }

/* ---------- lead list ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lead { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 13px 16px; border-bottom: 1px solid var(--line);
  color: inherit; align-items: center; }
.lead:last-child { border-bottom: none; }
.lead:hover { background: var(--card2); text-decoration: none; }
.lead .who { font-weight: 600; font-size: 15px; }
.lead .who .ret { font-size: 11px; color: var(--violet); font-weight: 600; margin-left: 8px; }
.lead .meta { color: var(--dim); font-size: 13px; margin-top: 2px; }
.lead .meta b { color: var(--txt); font-weight: 500; }
.lead .right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.lead .when { font-size: 12px; color: var(--faint); }
.empty { padding: 44px 20px; text-align: center; color: var(--dim); }
.empty b { display: block; color: var(--txt); font-size: 16px; margin-bottom: 6px; }

/* ---------- detail ---------- */
.cols { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
@media (max-width: 880px) { .cols { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h2 { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--dim); }
.kv dd { color: var(--txt); }
.statusbar { display: flex; gap: 6px; flex-wrap: wrap; }
.statusbar .btn { padding: 8px 13px; font-size: 13.5px; }
.statusbar .btn.cur { border-color: var(--accent); color: #fff; background: var(--accent-soft); cursor: default; }
.license { display: block; border-radius: var(--r-sm); border: 1px solid var(--line2); overflow: hidden; background: #000; }
.license img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: none; }
.note .by { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.note p { white-space: pre-wrap; font-size: 14.5px; }
.act { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.act:last-child { border-bottom: none; }
.act time { color: var(--faint); min-width: 64px; }
.act b { color: var(--txt); font-weight: 500; }
details.edit summary { cursor: pointer; color: var(--accent); font-size: 13.5px; list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] summary { margin-bottom: 12px; }
.blocked { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.4); border-radius: var(--r-sm);
  padding: 10px 14px; margin-bottom: 14px; color: #fecaca; font-size: 14px; }

/* ---------- settings tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--dim); font-weight: 500; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td form { display: inline; }

/* ====================================================================
   Login
   ==================================================================== */
.login { max-width: 380px; margin: 0 auto; padding: 22vh 20px 40px; }
.login .wordmark { display: block; text-align: center; font-size: 22px; letter-spacing: .5em; margin-bottom: 6px; }
.login .sub { text-align: center; color: var(--dim); font-size: 13px; margin-bottom: 30px; }

/* ====================================================================
   Intake (public)
   ==================================================================== */
.intake { max-width: 540px; margin: 0 auto; padding: 28px 18px 60px; }
.intake header { margin-bottom: 26px; }
.intake header .wordmark { font-size: 15px; }
.intake h1 { font-size: 26px; margin: 14px 0 6px; line-height: 1.2; }
.intake .lead-in { color: var(--dim); font-size: 15px; }
.intake .input { font-size: 17px; padding: 13px 14px; }
.intake .field > label, .intake .field .lbl { font-size: 15px; color: var(--txt); font-weight: 600; margin-bottom: 8px; }
.intake .field > label .opt, .intake .lbl .opt { color: var(--faint); font-weight: 400; font-size: 13px; margin-left: 6px; }
.intake .field { margin-bottom: 22px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile span { display: block; padding: 13px 12px; border: 1px solid var(--line2); border-radius: var(--r-sm);
  background: var(--card); font-size: 15px; font-weight: 500; text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.tile input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.tile input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile.wide { grid-column: span 2; }
.tiles.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 380px) { .tiles.three { grid-template-columns: 1fr; } }
.upload { position: relative; display: block; border: 1.5px dashed var(--line2); border-radius: var(--r); padding: 22px 16px;
  text-align: center; background: var(--card); cursor: pointer; transition: border-color .12s; }
.upload:hover, .upload.has { border-color: var(--accent); }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.upload .big { font-size: 28px; margin-bottom: 6px; }
.upload .t { font-weight: 600; font-size: 15px; }
.upload .s { color: var(--dim); font-size: 13px; margin-top: 3px; }
.upload img { display: none; max-width: 100%; max-height: 220px; border-radius: var(--r-sm); margin: 0 auto 10px; }
.upload.has img { display: block; }
.upload.has .big { display: none; }
.privacy { font-size: 12.5px; color: var(--faint); line-height: 1.5; margin-top: 8px; }
.hp { position: absolute; left: -5000px; }
.thanks { text-align: center; padding-top: 18vh; }
.thanks .check { width: 64px; height: 64px; border-radius: 50%; background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.45);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 30px; color: var(--good); }
.thanks h1 { font-size: 24px; margin-bottom: 10px; }
.thanks p { color: var(--dim); max-width: 380px; margin: 0 auto; font-size: 15.5px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
