/* App colours come from the Kewat brand tokens in /brand/brand.css (light and dark). */
:root {
  --bg: var(--kw-canvas, #f7f9fb);
  --card: var(--kw-paper, #ffffff);
  --text: var(--kw-ink, #1f2328);
  --muted: var(--kw-muted, #6b7280);
  --border: var(--kw-line, #e5e7eb);
  --accent: var(--kw-blue, #115ea6);
  --accent-deep: var(--kw-blue-deep, #0b4a85);
  --brand-green: var(--kw-green, #8bc53f);
  --on: var(--kw-success, #4f9a1f);
  --off: var(--kw-danger, #d64545);
  --mid: var(--kw-warning, #e8a317);
  --grid: #e9eef4;
  --input: #f9fbfd;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --on: #7cc243;
    --off: #f07272;
    --mid: #f2b94b;
    --grid: #232a33;
    --input: #12161b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--kw-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font-family: inherit; }

.auth {
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; font-weight: 700; color: var(--accent); }
/* Section labels in the price-list style: small spaced capitals after a green bar. */
h2 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.card > h2::before, .page-head + .card > h2::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 8px; vertical-align: middle; background: var(--brand-green); border-radius: 2px; }
p { margin: 0; }
.muted { color: var(--muted); }
code { font-size: 0.9em; background: var(--input); padding: 1px 5px; border-radius: 4px; }

.center { min-height: 60vh; display: grid; place-items: center; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

/* ---------- Auth ---------- */

.auth { max-width: 380px; margin: 8vh auto 0; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.auth-logo { height: 56px; }
.brand h1 { font-size: 1.1rem; color: var(--muted); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.auth > .muted { margin-bottom: 16px; }
.auth .card p + p { margin-top: 8px; }

form label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 14px; }

input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
}

input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
#auth-form button { width: 100%; }
button:disabled { opacity: 0.6; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 8px 12px; }
button.link { background: none; color: var(--muted); padding: 4px; font-weight: 500; text-decoration: underline; }

.error { color: var(--off); font-size: 0.9rem; margin-bottom: 12px; }

/* ---------- Dashboard ---------- */

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.top h1 { word-break: break-word; }
.top .muted { font-size: 0.9rem; margin-top: 2px; }

.state { display: flex; align-items: center; gap: 14px; }
.state strong { font-size: 1.15rem; }
.dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.state[data-kind="on"] .dot { background: var(--on); box-shadow: 0 0 0 5px color-mix(in srgb, var(--on) 22%, transparent); }
.state[data-kind="off"] .dot { background: var(--off); box-shadow: 0 0 0 5px color-mix(in srgb, var(--off) 22%, transparent); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid .card { margin-bottom: 14px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; gap: 0; } }

.big { font-size: 2.4rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }

.bar { height: 10px; background: var(--grid); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.bar span { display: block; height: 100%; width: 0; background: var(--on); border-radius: 99px; transition: width 0.4s; }
.bar span[data-level="mid"] { background: var(--mid); }
.bar span[data-level="low"] { background: var(--off); }
.bar span[data-charging="yes"] {
  background-image: linear-gradient(90deg, transparent 0 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60% 100%);
  background-size: 200% 100%;
  animation: charge 1.8s linear infinite;
}
@keyframes charge { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .bar span { animation: none !important; transition: none; } }

.stats { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

#chart { display: block; width: 100%; height: 110px; }
#chart .gridline { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
#chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#chart .ac { fill: var(--on); }
#chart .empty { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.legend { font-size: 0.8rem; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.key-ac { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--on); }

.events { list-style: none; margin: 0; padding: 0; }
.events li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 10px 0 10px 18px;
  border-top: 1px solid var(--border);
  position: relative;
  font-size: 0.95rem;
}
.events li:first-child { border-top: 0; padding-top: 2px; }
.events li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--muted);
}
.events li:first-child::before { margin-top: -2px; }
.events li[data-icon="off"]::before { background: var(--off); }
.events li[data-icon="plug"]::before { background: var(--on); }
.events li[data-icon="unplug"]::before { background: var(--mid); }
.events .muted { font-size: 0.85rem; }

.foot { text-align: center; font-size: 0.85rem; }

/* ---------- App shell ---------- */

.shell { min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.side-brand { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.side-name { display: grid; line-height: 1.1; }
.side-name small { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-green); }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: var(--input); color: var(--text); }
.nav-label { padding: 14px 12px 4px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@media (max-width: 899px) { .nav-label { padding: 8px 4px 8px 12px; border-left: 1px solid var(--border); } }
.nav a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.side-foot { display: flex; align-items: center; gap: 8px; }
.chip {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.chip[data-kind="on"] { color: var(--on); border-color: color-mix(in srgb, var(--on) 40%, transparent); }
.chip[data-kind="off"] { color: var(--off); border-color: color-mix(in srgb, var(--off) 40%, transparent); }

.content { padding: 20px 16px 40px; min-width: 0; }
.page { max-width: 1100px; margin: 0 auto; }
.page.wide { max-width: none; }
.page.narrow { max-width: 760px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .side {
    flex-direction: column;
    align-items: stretch;
    height: 100vh;
    padding: 18px 12px;
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }
  .side-brand { padding: 0 8px 12px; }
  .nav { flex-direction: column; overflow: visible; }
  .side-foot { flex-direction: column; align-items: stretch; margin-top: auto; }
  .chip { text-align: center; }
  .content { padding: 28px 32px 48px; }
}
@media (max-width: 899px) {
  .side { flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
}

/* ---------- Common UI ---------- */

.button {
  display: inline-block;
  font-weight: 600;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
.button.ghost, button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.small, .button.small { padding: 6px 10px; font-size: 0.85rem; }
button.link.danger { color: var(--off); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.grow-right { margin-left: auto; }
h3 { font-size: 0.95rem; margin: 18px 0 8px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .muted { margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--grid);
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
}
.pill[data-stage="contacted"] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pill[data-stage="interested"], .pill[data-stage="meeting"] { background: color-mix(in srgb, var(--mid) 18%, transparent); color: var(--mid); }
.pill[data-stage="proposal"] { background: color-mix(in srgb, #8b5cf6 18%, transparent); color: #8b5cf6; }
.pill[data-stage="won"] { background: color-mix(in srgb, var(--on) 18%, transparent); color: var(--on); }
.pill[data-stage="lost"] { background: color-mix(in srgb, var(--off) 14%, transparent); color: var(--off); }

.score {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--grid);
  color: var(--muted);
}
.score[data-level="high"] { background: color-mix(in srgb, var(--on) 20%, transparent); color: var(--on); }
.score[data-level="mid"] { background: color-mix(in srgb, var(--mid) 20%, transparent); color: var(--mid); }

.due { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.due.overdue { color: var(--off); font-weight: 600; }
.notice {
  background: color-mix(in srgb, var(--mid) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mid) 35%, transparent);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin: 10px 0;
}
.clickable { cursor: pointer; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
}
a.tile:hover { border-color: var(--accent); }
.tile-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.tile strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.tile .muted { font-size: 0.82rem; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; gap: 0; } }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list li.clickable:hover strong { color: var(--accent); }

.stage-bars { display: grid; gap: 8px; }
.stage-row { display: grid; grid-template-columns: 90px 1fr 32px; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.stage-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.track { height: 8px; background: var(--grid); border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; min-width: 2px; background: var(--muted); border-radius: 99px; }
.track span[data-stage="contacted"] { background: var(--accent); }
.track span[data-stage="interested"], .track span[data-stage="meeting"] { background: var(--mid); }
.track span[data-stage="proposal"] { background: #8b5cf6; }
.track span[data-stage="won"] { background: var(--on); }
.track span[data-stage="lost"] { background: var(--off); }

.empty-state ul { margin: 8px 0 0; padding-left: 20px; }
.empty-state li { margin: 6px 0; }

/* Filters & table */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.filters input, .filters select, .inline-form input, .inline-form select { margin-top: 0; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
select {
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.page > .muted { margin-bottom: 8px; font-size: 0.9rem; }
.card.flush { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--input); }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--input); border: 1px solid var(--border); border-radius: 14px; padding: 10px; min-height: 160px; display: grid; gap: 8px; align-content: start; }
.column.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--input)); }
.column-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 4px; }
.deal {
  display: grid;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: grab;
}
.deal:hover { border-color: var(--accent); }
.deal-foot { display: flex; align-items: center; gap: 8px; }

/* Tasks */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; }
.task input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input:not([type="checkbox"]) { flex: 1 1 200px; width: auto; }
.inline-form input[type="date"] { flex: 0 1 160px; }
.inline-form select { flex: 0 1 200px; width: auto; }

/* Templates */
.template-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.template-head h3 { margin: 0; }
.template-body { white-space: pre-wrap; margin-top: 8px; font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.chip-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
}
.preview {
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.9rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 12px;
  max-height: 260px;
  overflow: auto;
}

/* Forms */
.form label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid label.check { align-self: center; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.modal-actions.wrap { flex-wrap: wrap; }
.key-row { display: grid; grid-template-columns: 1fr minmax(260px, 1fr); gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
@media (max-width: 760px) { .key-row { grid-template-columns: 1fr; } }

/* Modal */
.modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
}
.modal.wide { width: min(1040px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(5, 10, 20, 0.55); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.modal-title { font-size: 1.25rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 14px; }
.modal-head .modal-title { margin: 0; color: var(--accent); }
.lead-photo { width: 64px; height: 46px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--border); padding: 2px; }
.lead-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
@media (max-width: 860px) { .lead-layout { grid-template-columns: 1fr; } }
.lead-side h3:first-of-type { margin-top: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick .button, .quick button { padding: 8px 12px; font-size: 0.9rem; }
.log-form textarea { margin-top: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.timeline li { padding: 8px 0 8px 12px; border-left: 2px solid var(--border); margin-left: 4px; }
.timeline li[data-type="call"], .timeline li[data-type="whatsapp"] { border-left-color: var(--on); }
.timeline li[data-type="email"] { border-left-color: var(--accent); }
.timeline li[data-type="stage"] { border-left-color: var(--mid); }
.timeline p { white-space: pre-wrap; font-size: 0.9rem; margin-top: 2px; }

/* Find leads */
.jobs { list-style: none; margin: 0; padding: 0; }
.job { padding: 12px 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.job:first-child { border-top: 0; padding-top: 2px; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job .bar { margin: 2px 0; }
.job .preview { max-height: 200px; font-size: 0.8rem; margin: 0; }
.ai-row { margin: 12px 0 4px; }
.scope-toggle { display: flex; gap: 18px; margin-bottom: 10px; }
.scope-toggle label.check { margin: 0; }
.scope-note { align-self: center; margin: 0; }
.sweep-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 14px; margin: 8px 0 12px; }
.sweep-types label.check { margin: 0; }
.google-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.google-cap input { width: 110px; margin: 0; }
.preset-group { margin-top: 10px; }
.preset-group .chips { margin-top: 4px; }
.ai-row input[type="number"] { flex: 0 1 110px; }
.models { max-height: 340px; overflow: auto; margin-top: 8px; }
.models li { align-items: flex-start; }
.research { background: var(--input); border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 10px; margin-top: 12px; }
.research h3 { margin-top: 8px; }
.research p { margin: 4px 0; overflow-wrap: anywhere; }
.form label.check { display: flex; }
.modal-actions label.check { margin: 0; }

/* Import */
.import-map select { margin: 0; padding: 7px 9px; font-size: 0.88rem; min-width: 190px; }
.import-map td { vertical-align: middle; }
.stats.extra dd { text-align: left; font-weight: 500; overflow-wrap: anywhere; }

/* Quotes */
.tabs { margin-bottom: 14px; }
.quote-head { grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 760px) { .quote-head { grid-template-columns: 1fr 1fr; } }
.quote-items td { vertical-align: top; }
.quote-items td, .quote-items th { padding: 8px 6px; }
.quote-items td:first-child { min-width: 220px; width: 100%; }
.quote-items select, .quote-items input { margin-top: 0; margin-bottom: 6px; }
.quote-items input[type="number"] { width: 72px; padding: 9px 8px; }
.quote-items td:nth-child(3) input[type="number"] { width: 104px; }
.quote-items td.num { white-space: nowrap; padding-top: 18px; }
.quote-items .desc-input { font-size: 0.85rem; padding: 7px 10px; }
.quote-totals { max-width: 360px; margin: 6px 0 10px auto; }
.quote-totals .grand { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.price-table input, .price-table select { margin-top: 0; padding: 7px 9px; font-size: 0.88rem; }
.price-table td:nth-child(3) { min-width: 260px; }
.price-table input[type="number"] { width: 110px; }
.steps { margin: 0 0 12px; padding-left: 20px; }
.steps li { margin: 4px 0; }

/* Campaigns */
.camp-status { display: flex; align-items: center; gap: 14px; }
.camp-status .dot[data-kind="on"] { background: var(--on); box-shadow: 0 0 0 5px color-mix(in srgb, var(--on) 22%, transparent); }
.camp-status .dot[data-kind="off"] { background: var(--mid); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mid) 22%, transparent); }
.section-head { margin: 22px 0 4px; font-size: 1.1rem; }
.camp-designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 12px 0 8px; }
.camp-design { display: flex; flex-direction: column; padding: 0; text-align: left; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; font-weight: 400; }
.camp-design:hover { border-color: var(--accent); }
.camp-design img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: var(--grid); }
.camp-design-text { display: grid; gap: 4px; padding: 12px 14px 14px; }
.camp-back { margin-bottom: 12px; }
.camp-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .camp-editor { grid-template-columns: 1fr; } }
.camp-right { position: sticky; top: 12px; }
@media (max-width: 1100px) { .camp-right { position: static; } }
.camp-preview select { margin: 0 0 10px; flex: 1 1 180px; }
.camp-frame-wrap { background: #e9edf3; border-radius: 10px; padding: 10px; margin-bottom: 12px; display: flex; justify-content: center; }
.camp-frame { width: 100%; height: min(72vh, 900px); border: 0; border-radius: 6px; background: #fff; transition: width 0.2s; }
.camp-frame-wrap.phone .camp-frame { width: 375px; max-width: 100%; }
.camp-step { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.camp-step textarea { margin-top: 6px; }
.camp-step input[type="number"] { width: 72px; margin: 0 0 0 4px; display: inline-block; }
label.inline { display: inline-flex; align-items: center; margin: 0; }
.camp-filters { margin: 8px 0; }
.camp-filters input[type="search"] { flex: 2 1 200px; margin: 0; }
.camp-filters select { flex: 1 1 140px; margin: 0; }
.camp-leads { max-height: 420px; overflow: auto; margin-top: 8px; }
.camp-leads td { vertical-align: top; }
.camp-progress summary { cursor: pointer; font-weight: 600; }
.camp-progress .table-wrap { margin-top: 10px; max-height: 360px; overflow: auto; }

/* Map */
.view-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.view-row .muted { margin: 0; font-size: 0.9rem; }
.map-card { overflow: hidden; }
.map { height: min(70vh, 620px); background: var(--grid); }
.map-note { padding: 16px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; font-size: 0.82rem; border-top: 1px solid var(--border); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.map-tools label.check { margin: 0 0 0 auto; }
.map-ring { width: 12px; height: 12px; border-radius: 50%; border: 2px solid; }
.map-pop { display: grid; gap: 4px; min-width: 170px; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.map-pop button { justify-self: start; margin-top: 4px; }
.leaflet-container .map-pop .muted { color: #5b6475; }

/* Team */
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-bottom: 14px; }
.tm-card { display: grid; gap: 14px; align-content: start; margin: 0; }
.tm-card.inactive { opacity: 0.7; }
.tm-head { display: flex; gap: 12px; align-items: flex-start; }
.tm-head h2 { margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-size: 1.1rem; }
.tm-head .chips { margin-top: 6px; }
.tm-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tm-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 520px) { .tm-meters { grid-template-columns: 1fr; } }
.tm-meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.tm-meter-head .small { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-bar { height: 8px; border-radius: 99px; background: var(--grid); overflow: hidden; margin: 5px 0 3px; }
.tm-bar span { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
.tm-bar span[data-pace="done"], .tm-pace[data-pace="done"] { background: var(--on); color: var(--on); }
.tm-bar span[data-pace="on-track"] { background: var(--accent); }
.tm-bar span[data-pace="behind"] { background: var(--mid); }
.tm-pace { background: none !important; }
.tm-pace[data-pace="on-track"] { color: var(--accent); }
.tm-pace[data-pace="behind"] { color: var(--mid); }
.tm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 520px) { .tm-stats { grid-template-columns: 1fr 1fr; } }
.tm-stat { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.tm-stat strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.tm-stat.warn strong { color: var(--off); }
.tm-actions h3 { margin: 0 0 6px; font-size: 0.9rem; }
.tm-actions ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tm-actions li { display: flex; gap: 8px; font-size: 0.9rem; padding: 6px 8px; border-radius: 8px; background: var(--input); }
.tm-tasks summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.tm-tasks .tasks { margin-top: 6px; }
.tm-buttons { border-top: 1px solid var(--border); padding-top: 12px; }
.tm-sent { margin: -6px 0 0; }
.tm-pool { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tm-lines { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; margin: 4px 0 0; }
.tm-lines legend { font-size: 0.85rem; font-weight: 600; padding: 0 4px; }
.tm-settings { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.tm-settings select { width: auto; margin: 0 4px; }
.tm-preview { max-height: 60vh; white-space: pre-wrap; }
.task-who { margin-left: 6px; font-size: 0.75rem; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.toast[data-kind="error"] { background: var(--off); color: #fff; }

/* Plan page */
.plan-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
.plan-tiles.inner { margin: 4px 0 6px; }
.plan-tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.plan-tiles.inner .plan-tile { background: var(--input); }
.plan-tile-n { font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.plan-tile-l { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.plan-tile[data-kind="good"] .plan-tile-n { color: var(--on); }
.plan-tile[data-kind="bad"] .plan-tile-n { color: var(--off); }
.plan-gap { margin-top: 10px; }
.plan-pad { padding: 16px 16px 4px; }
.plan-list { margin: 0; padding-left: 20px; }
.plan-list li { margin: 6px 0; }
.plan-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.plan-field { display: grid; gap: 4px; font-size: 0.85rem; margin: 0; }
.plan-input { display: flex; align-items: center; gap: 6px; }
.plan-input input { margin: 0; min-width: 0; flex: 1; }
.est { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: 0.7rem; font-weight: 600; color: var(--mid); background: color-mix(in srgb, var(--mid) 16%, transparent); }
.plan-table input[type="number"] { width: 100px; margin: 0; padding: 6px 8px; font-size: 0.88rem; }
.plan-table input.is-est { border-color: var(--mid); background: color-mix(in srgb, var(--mid) 10%, var(--input)); }
.plan-table select { margin: 6px 0 0; padding: 4px 6px; font-size: 0.78rem; max-width: 170px; }
.plan-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-meter { margin-bottom: 8px; }
.plan-meter-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.plan-progress { height: 14px; }
.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 190px) 1fr auto; gap: 10px; align-items: center; font-size: 0.85rem; padding: 2px 0; border-radius: 6px; }
.hbar:hover { background: var(--input); }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar-fill.neg { background: var(--off); }
.hbar-value { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 80px; text-align: right; }
.vcols { display: flex; align-items: stretch; gap: 4px; height: 190px; margin-top: 12px; }
.vcol { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; border-radius: 6px; }
.vcol:hover { background: var(--input); }
.vcol-track { flex: 1; width: 70%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.vcol-fill { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.vcol-value, .vcol-label { font-size: 0.7rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vcol-label { margin-top: 4px; }
.plan-miles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-miles li { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: start; }
.plan-status { justify-self: start; }
.plan-status[data-status="doing"] { color: var(--mid); border-color: var(--mid); }
.plan-status[data-status="done"] { color: var(--on); border-color: var(--on); }
.plan-market { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 12px 0 14px; }
.plan-market .card { margin: 0; display: grid; gap: 6px; align-content: start; }
@media (max-width: 560px) {
  .hbar { grid-template-columns: 1fr auto; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .vcol-value { display: none; }
}

/* Plan pictures (public/features/plan-visuals.js) */
.pv-icon { display: inline-flex; width: 22px; height: 22px; flex: none; color: var(--accent); }
.pv-icon svg { width: 100%; height: 100%; }
.pv-icon.small { width: 16px; height: 16px; }
.pv-icon.xl { width: 56px; height: 56px; }
.pv-icon.fact { width: 28px; height: 28px; }
.pv-tab { display: inline-flex; align-items: center; gap: 6px; }
.pv-tab .pv-icon { color: inherit; }
.pv-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--card)), var(--card)); }
.pv-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; }
.pv-step-box { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.pv-step-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); }
.pv-arrow { display: grid; place-items: center; font-size: 1.4rem; color: var(--brand-green); font-weight: 700; }
.pv-lines, .pv-how { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pv-lines li { display: flex; gap: 8px; align-items: flex-start; }
.pv-lines li > span:last-child { display: grid; }
.pv-how li { padding-left: 16px; position: relative; font-size: 0.92rem; }
.pv-how li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-green); }
.pv-big { font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.pv-mini { font-size: 0.85rem; margin-top: 6px; }
@media (max-width: 900px) {
  .pv-flow { grid-template-columns: 1fr; }
  .pv-arrow { transform: rotate(90deg); height: 18px; }
}
.pv-grid { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; max-width: 290px; }
.pv-more { font-size: 0.8rem; color: var(--muted); align-self: center; margin-left: 4px; }
.pv-even { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; margin-top: 12px; align-items: start; }
.pv-even-n { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.pv-or { align-self: center; color: var(--muted); font-weight: 600; }
@media (max-width: 760px) { .pv-even { grid-template-columns: 1fr; } .pv-or { justify-self: start; } }
.pv-funnel { display: grid; gap: 6px; }
.pv-funnel-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 44px; gap: 10px; align-items: center; }
.pv-funnel-label { display: grid; font-size: 0.9rem; }
.pv-funnel-track { display: flex; justify-content: center; }
.pv-funnel-bar { height: 34px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 0.9rem; transition: width 0.4s; }
.pv-funnel-rate { text-align: right; }
.pv-stack { display: flex; gap: 2px; height: 34px; border-radius: 8px; overflow: hidden; margin: 10px 0; }
.pv-seg { display: grid; place-items: center; color: #fff; font-size: 0.78rem; font-weight: 600; min-width: 2px; }
.pv-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; }
.pv-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.pv-key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: none; }
.pv-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.pv-ring-box { display: grid; justify-items: center; text-align: center; gap: 4px; }
.pv-ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 2px;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 77%), conic-gradient(var(--on) calc(var(--p) * 1%), var(--grid) 0); }
.pv-ring[data-level="high"] { background: radial-gradient(closest-side, var(--card) 76%, transparent 77%), conic-gradient(var(--mid) calc(var(--p) * 1%), var(--grid) 0); }
.pv-ring[data-level="over"] { background: radial-gradient(closest-side, var(--card) 76%, transparent 77%), conic-gradient(var(--off) calc(var(--p) * 1%), var(--grid) 0); }
.pv-ring strong { font-size: 1.3rem; }
.pv-ring-label { font-weight: 600; }
.pv-cycle-box { max-width: 680px; margin: 0 auto 12px; }
.pv-cycle { width: 100%; height: auto; display: block; }
.pv-loop { fill: none; stroke: var(--grid); stroke-width: 10; }
.pv-arc { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.pv-arrowhead { fill: var(--accent); }
.pv-node { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.pv-node-title { font: 700 14px var(--kw-font, system-ui); fill: var(--accent); text-anchor: middle; }
.pv-node-text { font: 11.5px var(--kw-font, system-ui); fill: var(--text); text-anchor: middle; }
.pv-cycle-mid { font: 800 22px var(--kw-font, system-ui); fill: var(--text); text-anchor: middle; }
.pv-cycle-sub { font: 12px var(--kw-font, system-ui); fill: var(--muted); text-anchor: middle; }
.pv-roadmap { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pv-quarter { background: var(--input); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: grid; gap: 6px; align-content: start; }
.pv-quarter-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem; margin-bottom: 2px; }
.pv-step { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 0.72rem; }
.pv-chip { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; text-align: left; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 0.8rem; font-weight: 500; cursor: pointer; }
.pv-chip:hover { border-color: var(--accent); }
.pv-chip[data-status="doing"] { border-color: var(--mid); }
.pv-chip[data-status="done"] { border-color: var(--on); background: color-mix(in srgb, var(--on) 10%, var(--card)); }
.pv-chip[data-status="done"] .pv-chip-text { text-decoration: line-through; color: var(--muted); }
.pv-chip-mark { font-weight: 700; color: var(--muted); }
.pv-chip[data-status="doing"] .pv-chip-mark { color: var(--mid); }
.pv-chip[data-status="done"] .pv-chip-mark { color: var(--on); }
@media (max-width: 900px) { .pv-roadmap { grid-template-columns: 1fr; } }
.pv-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.66rem; font-weight: 700; color: #fff; background: #64748b; flex: none; }
.pv-avatar.big { width: 44px; height: 44px; font-size: 0.95rem; }
.pv-avatar[data-who="nilesh"] { background: #2f6fd0; }
.pv-avatar[data-who="bhavik"] { background: #14a38b; }
.pv-avatar[data-who="kelvin"] { background: #e0a019; color: #1f2328; }
.pv-avatar[data-who="james"] { background: #be3d63; }
.pv-people { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 0.85rem; }
.pv-people > span { display: inline-flex; align-items: center; gap: 6px; }
.pv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pv-person { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); }
.pv-person p { margin-top: 6px; }
.plan-fact .pv-icon { margin-bottom: 2px; }
.pv-map-card { overflow: hidden; margin-bottom: 0; }
.pv-map { background: var(--grid); }
.pv-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; color: var(--on); margin-right: 6px; }
.pv-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on); animation: pv-pulse 1.6s infinite; }
@keyframes pv-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--on) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .pv-live-dot { animation: none; } }
.pv-map-card .map-tools label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 0 0; }
.pv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .pv-two { grid-template-columns: 1fr; } }
.pv-flag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; color: var(--off); background: color-mix(in srgb, var(--off) 12%, transparent); white-space: nowrap; }
.pv-flag.mid { color: var(--mid); background: color-mix(in srgb, var(--mid) 14%, transparent); }
.pv-flag.ok { color: var(--on); background: color-mix(in srgb, var(--on) 14%, transparent); }
.pv-present { position: fixed; inset: 0; z-index: 2000; background: var(--bg); display: flex; flex-direction: column; }
.pv-slide { flex: 1; overflow: auto; padding: clamp(18px, 4vw, 48px); max-width: 1200px; width: 100%; margin: 0 auto; }
.pv-slide-head { margin-bottom: 22px; }
.pv-slide-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); }
.pv-slide-head p { font-size: 1.05rem; margin-top: 4px; }
.pv-slide-body h3 { margin: 0 0 10px; font-size: 1rem; }
.pv-slide-body .pv-hero { margin: 0; }
.pv-present-bar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--card); }
.pv-present-bar .grow { flex: 1; }
.pv-slide-cover { display: grid; gap: 18px; justify-items: start; padding-top: 3vh; }
.pv-cover-icons { display: flex; gap: 18px; }
.pv-slide-lead { font-size: clamp(1.2rem, 2.4vw, 1.8rem); font-weight: 600; max-width: 30ch; }
.pv-slide-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.pv-slide-fact { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; display: grid; gap: 8px; }
.pv-slide-n { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; line-height: 1; }
.pv-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pv-next li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 1.05rem; }
.pv-next li > span:last-child { display: grid; }

/* Plan: go-to-market tab */
.gtm-pitch { margin: 10px 0 0; padding: 10px 12px; border-left: 4px solid var(--brand-green); background: var(--input); border-radius: 8px; }
.gtm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gtm-steps > li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); }
.gtm-step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.gtm-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 30px; }
.gtm-who { display: inline-flex; gap: 4px; margin-left: auto; }
.gtm-steps .plan-list { margin-top: 4px; }
.gtm-done { margin: 6px 0 0; color: var(--accent); }
.gtm-channel { display: inline-flex; align-items: center; gap: 8px; }
.table tfoot td { border-top: 2px solid var(--border); }
.gtm-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.gtm-pay .pv-step-box p { margin: 0; }
.gtm-compare th[scope="row"] { white-space: nowrap; vertical-align: top; }
.gtm-compare .gtm-us { background: color-mix(in srgb, var(--brand-green) 14%, transparent); font-weight: 500; }
.gtm-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gtm-idea { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); display: grid; gap: 6px; align-content: start; }
.gtm-idea-head { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.gtm-idea-n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-green); color: #1f2328; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.gtm-idea p { margin: 0; }
.gtm-first { color: var(--accent); }
.plan-miles.gtm-decisions li { grid-template-columns: 118px 1fr; }

/* Plan: leasing tab */
.lease-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.lease-routes .pv-step-box p { margin: 6px 0 0; }
.rate-bars .hbar { grid-template-columns: minmax(150px, 260px) 1fr auto; }
.rate-bars .hbar-label { display: grid; line-height: 1.25; }
.rate-bars .hbar-fill { background: color-mix(in srgb, var(--accent) 45%, var(--input)); }
.rate-bars .hbar-fill.floor { background: var(--mid); }
.rate-bars .hbar-fill.ours { background: var(--brand-green); }
.rate-bars .hbar-track.over .hbar-fill { border-radius: 0; -webkit-mask: linear-gradient(90deg, #000 92%, transparent); mask: linear-gradient(90deg, #000 92%, transparent); }
.lease-ladder tr.is-chosen td { background: color-mix(in srgb, var(--brand-green) 14%, transparent); }
.lease-ladder tr.is-floor td { background: color-mix(in srgb, var(--mid) 10%, transparent); }
.plan-table td.pos { color: var(--on); font-weight: 600; }
.plan-table td.neg { color: var(--off); font-weight: 600; }
.price-table input[aria-label="Price excl. VAT"] { font-weight: 600; }
.quote-items td .muted.small { margin-top: 2px; }

/* ---------- Quote follow-ups & proformas ---------- */
.followups { border-left: 4px solid var(--accent); }
.followups .list li > span { min-width: 0; }
.quote-proformas { margin-top: 2px; }
.quote-overdue { color: var(--off); }

/* Today (daily call list) */
.today-progress .bar { margin: 8px 0 6px; }
.today-count strong { font-size: 1.15rem; }
.today-keys { margin: 0; }
@media (max-width: 760px) { .today-keys { display: none; } }
.today-section h2 .muted { font-weight: 400; }
.today-list li.today-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 16px; align-items: start; padding: 12px 6px; border-radius: 8px; }
@media (min-width: 1200px) { .today-list li.today-row { grid-template-columns: minmax(0, 1fr) auto; } }
.today-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.today-row:focus-within { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.today-main { display: grid; gap: 3px; min-width: 0; }
.today-who { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.today-who strong { overflow-wrap: anywhere; }
.today-reason { font-size: 0.92rem; }
.today-reason.overdue { color: var(--off); font-weight: 600; }
.today-actions { display: grid; gap: 6px; justify-items: start; }
@media (min-width: 1200px) { .today-actions { justify-items: end; } .today-actions .actions { justify-content: flex-end; } }
.today-wa { background: #25d366; border-color: #25d366; color: #fff; }
button.today-lost { color: var(--off); }
.today-panel { grid-column: 1 / -1; }
@media (max-width: 760px) { .today-list li.today-row { padding: 12px 0; } }

/* ---------- Backups ---------- */
.notice.backup-warn { background: color-mix(in srgb, var(--off) 12%, transparent); border-color: color-mix(in srgb, var(--off) 40%, transparent); }
button.backup-danger:not(:disabled) { background: var(--off); }
button.backup-danger:not(:disabled):hover { background: var(--off); filter: brightness(0.9); }

/* ---------- Orders (public/features/orders.js) ---------- */
.order-paid { display: grid; gap: 2px; min-width: 110px; }
.order-paid .bar { margin: 2px 0; height: 8px; }
.order-totals { max-width: 360px; margin: 10px 0 4px auto; }
.order-totals .grand { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.owing { color: var(--off); }
.order-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.order-detail-head .modal-title { margin-bottom: 2px; }
.order-pay input[type="number"] { flex: 0 1 150px; }
.order-total { font-weight: 700; text-align: right; }
.order-new .inline-form select { flex: 1 1 240px; min-width: 0; max-width: 100%; }
.order-items-edit select { min-width: 170px; }
.order-items-edit input[type="number"] { min-width: 80px; }
.orders-filter { margin-bottom: 12px; }
.orders-filter select { width: auto; flex: 0 1 240px; }
.orders-table tr.clickable:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tile-button { font: inherit; text-align: left; cursor: pointer; }
.tile-button.alert { border-color: color-mix(in srgb, var(--off) 45%, transparent); }
.tile-button.alert strong { color: var(--off); }
.stock-table .group-row th { background: var(--grid); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stock-table tr.short td { background: color-mix(in srgb, var(--off) 8%, transparent); }
.stock-adjust { flex-wrap: nowrap; }
.stock-adjust input[type="number"] { flex: 0 0 90px; width: 90px; }
.stock-adjust input:not([type="number"]) { flex: 1 1 140px; min-width: 120px; }
@media (max-width: 640px) {
  .stock-adjust { flex-wrap: wrap; }
  .order-detail-head { flex-direction: column-reverse; }
  .order-pay > * { flex: 1 1 100%; }
  .order-detail .item-desc { display: none; }
}

/* ---------- Lead quality: towns, duplicates, contacts ---------- */
.phone-flag { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--mid); vertical-align: middle; cursor: help; }
.contact-line { display: grid; gap: 4px; margin: 10px 0; }
.dup-group { display: grid; gap: 10px; }
.dup-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dup-card { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); min-width: 0; overflow-wrap: anywhere; }
.dup-card.keep { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dup-card .stats { margin: 0; }
.dup-card .link { justify-self: start; }

/* ---------- Tenders ---------- */
.tender-due[data-urgency="red"], .tender-due[data-urgency="past"] { background: color-mix(in srgb, var(--off) 16%, transparent); color: var(--off); }
.tender-due[data-urgency="amber"] { background: color-mix(in srgb, var(--mid) 18%, transparent); color: var(--mid); }
.tender-due[data-urgency="ok"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tender-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.tender-docs-meter { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tender-meter { width: 70px; height: 8px; border-radius: 99px; background: var(--grid); overflow: hidden; }
.tender-meter span { display: block; height: 100%; background: var(--accent); }
.tender-meter[data-full="true"] span { background: var(--on); }
.tender-table td:first-child { min-width: 240px; }
.tender-table td:nth-child(2) { min-width: 130px; }
.tender-status-select { width: auto; padding: 4px 8px; font-size: 0.85rem; margin: 0; }
.tender-when { display: flex; gap: 6px; }
.tender-when input[type="date"] { flex: 1 1 60%; }
.tender-when input[type="time"] { flex: 1 1 40%; }
.tender-doclist li { justify-content: flex-start; padding: 6px 0; }
.tender-doc input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--on); }
.tender-doc input:not([type="checkbox"]) { flex: 1; margin: 0; }

/* ---------- Reports ---------- */
.rp-delta { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.rp-delta[data-dir="up"] { color: var(--on); }
.rp-delta[data-dir="down"] { color: var(--off); }
.rp-cols > * { min-width: 0; }
.rp-chart { width: 100%; height: auto; display: block; }
.rp-chart .rp-axis { stroke: var(--border); stroke-width: 1; }
.rp-chart .rp-bar rect { fill: color-mix(in srgb, var(--accent) 55%, transparent); }
.rp-chart .rp-bar.current rect { fill: var(--brand-green); }
.rp-chart .rp-bar:hover rect { fill: var(--accent); }
.rp-chart text { font-size: 9px; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.rp-chart .rp-val { fill: var(--text); font-weight: 600; }
.rp-hbars { display: grid; gap: 8px; margin-bottom: 8px; }
.rp-hbar { display: grid; grid-template-columns: 100px 1fr 44px minmax(120px, auto); gap: 10px; align-items: center; font-size: 0.9rem; }
.rp-hbar strong { text-align: right; font-variant-numeric: tabular-nums; }
.rp-track { display: block; height: 14px; border-radius: 99px; background: var(--grid); overflow: hidden; }
.rp-track.rp-mini { width: 90px; height: 8px; margin-top: 5px; }
.rp-fill { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 99px; }
.rp-table td.num, .rp-table th, .rp-table td:first-child { white-space: nowrap; }
.rp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-table tr.rp-current td { background: color-mix(in srgb, var(--brand-green) 8%, transparent); }
.rp-preview { white-space: pre-wrap; font-size: 0.85rem; background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: 60vh; overflow: auto; }
@media (max-width: 760px) { .rp-hbar { grid-template-columns: 80px 1fr 36px; } .rp-hbar > :last-child { grid-column: 2 / -1; } }

/* Phone access card (PC status page) */
.phone-link { font-size: 1.05rem; font-weight: 600; margin: 8px 0; overflow-wrap: anywhere; }
.phone-settings { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.phone-settings label.check { margin: 0; }

/* Quote accessories, add-ons and margin */
.addons { margin: 10px 0 4px; display: grid; gap: 8px; }
.addon-group p { margin: 0 0 4px; }
.chip-btn.added { background: color-mix(in srgb, var(--on) 14%, transparent); color: var(--on); border-color: color-mix(in srgb, var(--on) 40%, transparent); cursor: default; }
.margin-note { margin: 4px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--input); border: 1px dashed var(--border); }
.margin-note:empty { display: none; }
.addons .notice.misfit { border-color: var(--off); color: var(--off); background: color-mix(in srgb, var(--off) 8%, transparent); }
.margin-note[data-kind="low"] { border-color: var(--mid); }
.margin-note[data-kind="bad"] { border-color: var(--off); color: var(--off); }
.price-table tr.unconfirmed td { background: color-mix(in srgb, var(--mid) 10%, transparent); }
.price-table .fits-select { min-width: 150px; font-size: 0.8rem; padding: 4px; }
.price-table .fits-select:disabled { opacity: 0.35; }
.price-table .center-cell { text-align: center; }

/* Assistant (Hermes on Telegram) */
.agent-approval { border-top: 1px solid var(--line, #e3e8ef); padding: 12px 0; }
.agent-approval:first-of-type { border-top: 0; }
.agent-approval-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.agent-body { white-space: pre-wrap; font: inherit; font-size: 0.9em; background: var(--soft, #f5f7fa); padding: 10px; border-radius: 8px; margin: 6px 0 0; }
.chip.agent-pending { background: #fff4d6; color: #7a5600; }
.chip.agent-sent { background: #e2f5e8; color: #1d6b37; }
.chip.agent-failed, .chip.agent-rejected, .chip.agent-expired { background: #f1f1f1; color: #555; }

