/* ===== RoofingGPT design system ===== */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --border: #e3e7ef;
  --text: #10131a;
  --text-2: #4b5568;
  --muted: #8a93a6;
  --brand: #ff5722;
  --brand-600: #e64a1a;
  --brand-tint: #fff1ec;
  --accent: #1a2b4a;
  --good: #12a150;
  --warn: #d9822b;
  --danger: #e5484d;
  --shadow: 0 1px 3px rgba(16,19,26,.06), 0 8px 24px rgba(16,19,26,.06);
  --shadow-lg: 0 12px 40px rgba(16,19,26,.14);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017;
    --surface: #161b25;
    --surface-2: #1f2633;
    --border: #2a3242;
    --text: #eef1f6;
    --text-2: #b3bccb;
    --muted: #7c8698;
    --brand-tint: #2a1712;
    --accent: #cdd8ee;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  }
}
[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #161b25;
  --surface-2: #1f2633;
  --border: #2a3242;
  --text: #eef1f6;
  --text-2: #b3bccb;
  --muted: #7c8698;
  --brand-tint: #2a1712;
  --accent: #cdd8ee;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 750; }
p { margin: 0 0 1em; color: var(--text-2); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; font-weight: 650; font-size: 1rem;
  cursor: pointer; border: 1px solid transparent; transition: .18s ease;
  font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 1em 1.8em; font-size: 1.08rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- header ---- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: .55em; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 1rem;
}
.brand .gpt { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { color: var(--text-2); font-weight: 550; font-size: .96rem; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: .8rem; }
.theme-toggle {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1.05rem;
  display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.menu-btn { display: none; }

/* ---- hero ---- */
.hero { padding: 72px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.18rem; max-width: 34ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.trust { display: flex; gap: 1.6rem; margin-top: 2.2rem; flex-wrap: wrap; }
.trust .stat b { display: block; font-size: 1.5rem; font-weight: 800; }
.trust .stat span { font-size: .84rem; color: var(--muted); }

.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px;
}
.chat-line { display: flex; gap: .6rem; margin-bottom: .8rem; align-items: flex-start; }
.chat-line .av { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: .85rem; }
.chat-line.bot .av { background: var(--brand); color: #fff; }
.chat-line.user .av { background: var(--surface-2); color: var(--text-2); }
.bubble { background: var(--surface-2); padding: .6em .85em; border-radius: 12px; font-size: .93rem; color: var(--text); }
.chat-line.user { flex-direction: row-reverse; }
.chat-line.user .bubble { background: var(--brand-tint); color: var(--text); }
.estimate-pill {
  margin-top: .4rem; background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff; padding: 14px 16px; border-radius: 12px;
}
.estimate-pill b { font-size: 1.5rem; }

/* ---- sections ---- */
section { padding: 56px 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 40px; }
.section-head p { font-size: 1.06rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 14px; }
.card h3 { font-size: 1.14rem; }
.card p { font-size: .95rem; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding-left: 8px; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }
[data-theme="dark"] .step .num, :root:not([data-theme="light"]) .step .num { color: var(--bg); }

.band { background: var(--accent); color: #fff; border-radius: 24px; padding: 48px; text-align: center; }
.band h2 { color: #fff; }
.band p { color: rgba(255,255,255,.82); max-width: 50ch; margin: 0 auto 1.4rem; }

/* ---- footer ---- */
footer.site { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-grid a { color: var(--text-2); font-size: .92rem; display: block; margin-bottom: .5rem; }
.foot-grid a:hover { color: var(--brand); }
.foot-col b { display: block; margin-bottom: .8rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.foot-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---- utility ---- */
.disclaimer { font-size: .82rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 650; padding: .28em .7em; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.badge.verified { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }

/* ===== estimator page ===== */
.est-wrap { max-width: 640px; margin: 0 auto; }
.est-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.est-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .6rem; }
.est-head .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color:#fff; display: grid; place-items: center; }
.est-head b { font-size: 1.02rem; }
.est-head .live { margin-left: auto; font-size: .78rem; color: var(--good); display: flex; align-items: center; gap: .3em; }
.est-head .live::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
#chat { padding: 20px 22px; min-height: 340px; max-height: 52vh; overflow-y: auto; }
#options { padding: 0 22px 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.opt-chip { padding: .7em 1.1em; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: .94rem; font-weight: 550; font-family: inherit; transition: .15s; }
.opt-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.opt-field { width: 100%; }
.opt-field label { font-weight: 650; font-size: .92rem; display:block; margin-bottom: .5rem; }
.sqrow { display: flex; gap: 8px; margin-bottom: 8px; }
.sqrow input, .sqrow select, #options input[type=number] { padding: .7em .8em; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; font-family: inherit; }
.sqrow input { flex: 1; }
.addon-list { width: 100%; display: grid; gap: 8px; margin-bottom: 12px; }
.addon { display: flex; align-items: center; gap: .6em; padding: .7em .9em; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; background: var(--surface); }
.addon:hover { border-color: var(--brand); }
.addon input { width: 18px; height: 18px; accent-color: var(--brand); }
.addon span { flex: 1; font-size: .93rem; }
.addon em { color: var(--muted); font-size: .85rem; font-style: normal; }

.result-card { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.result-price { font-size: 1.9rem; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.result-badge { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 14px; font-weight: 750; }
.result-badge span { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.result-sub { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.result-sub b { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: block; margin-bottom: 4px; }
.result-sub .line { display: flex; justify-content: space-between; font-size: .9rem; padding: 2px 0; }
.result-actions { margin-top: 14px; display: grid; gap: 8px; }

/* ===== directory page ===== */
.dir-head { padding: 40px 0 20px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0 6px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); position: sticky; top: 78px; z-index: 10; }
.filters input, .filters select { padding: .65em .8em; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: .93rem; font-family: inherit; }
.filters input { flex: 1; min-width: 180px; }
#ccount { color: var(--muted); font-size: .9rem; margin: 4px 0 18px; }
.c-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.c-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.c-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.c-logo { width: 46px; height: 46px; border-radius: 11px; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-weight: 800; flex: none; }
[data-theme="dark"] .c-logo, :root:not([data-theme="light"]) .c-logo { color: var(--bg); }
.c-head h3 { font-size: 1.08rem; margin: 0; display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.c-loc { font-size: .85rem; color: var(--muted); }
.c-rating { margin-bottom: 8px; font-size: .95rem; }
.rstars { color: #f5a623; letter-spacing: 1px; }
.c-card p { font-size: .92rem; margin: 0 0 12px; }
.c-svc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.c-foot { margin-top: auto; display: flex; gap: 8px; }
.c-foot .btn { flex: 1; justify-content: center; font-size: .9rem; padding: .7em 1em; }
.empty { grid-column: 1/-1; text-align: center; padding: 50px; color: var(--muted); }

/* ===== forms ===== */
.form-wrap { max-width: 560px; margin: 0 auto; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: 6px; }
.field .req { color: var(--brand); }
.field input, .field select, .field textarea {
  width: 100%; padding: .75em .9em; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 1rem; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-grid label { display: flex; align-items: center; gap: .5em; font-weight: 500; font-size: .92rem; padding: .6em .7em; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--bg); }
.check-grid input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 14px; }
.form-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: .7em .9em; border-radius: 10px; font-size: .9rem; margin-bottom: 14px; }
.form-success { text-align: center; padding: 20px; }
.form-success .big { width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); display: grid; place-items: center; font-size: 2rem; margin: 0 auto 16px; }

/* ===== modal ===== */
.modal-back { position: fixed; inset: 0; background: rgba(8,10,15,.55); backdrop-filter: blur(3px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-x { background: var(--surface-2); border: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 1.1rem; }
.modal-body { padding: 22px; }

/* ===== auth tabs ===== */
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; padding: .6em; border: none; background: transparent; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--text-2); font-family: inherit; font-size: .95rem; }
.auth-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.role-pick { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px; }
.role-pick label { text-align: center; padding: .8em .4em; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; font-size: .85rem; font-weight: 600; }
.role-pick input { display: none; }
.role-pick input:checked + span { color: var(--brand); }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.demo-creds { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: .85rem; margin-top: 18px; }
.demo-creds b { color: var(--text); }
.demo-creds button { background: none; border: none; color: var(--brand); cursor: pointer; font-weight: 600; font-family: inherit; font-size: .85rem; padding: 0; }

/* ===== dashboard ===== */
.dash { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 66px); }
.dash-side { border-right: 1px solid var(--border); padding: 24px 16px; background: var(--surface); }
.dash-side .who { padding: 0 8px 18px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.dash-side .who b { display: block; }
.dash-side .who span { font-size: .82rem; color: var(--muted); }
.dash-nav a { display: flex; align-items: center; gap: .6em; padding: .7em .8em; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: .95rem; cursor: pointer; }
.dash-nav a:hover, .dash-nav a.active { background: var(--brand-tint); color: var(--brand); }
.dash-main { padding: 30px; overflow-x: hidden; }
.dash-main h1 { font-size: 1.7rem; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0 28px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.stat-tile .k { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat-tile .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat-tile .d { font-size: .8rem; color: var(--good); margin-top: 2px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.panel-body { padding: 4px 0; }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; padding: 12px 20px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
table.data td { padding: 13px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
.lead-name b { display: block; }
.lead-name span { font-size: .82rem; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 650; padding: .3em .7em; border-radius: 999px; }
.pill.new { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.pill.contacted { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.won { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.lost { background: var(--surface-2); color: var(--muted); }
.status-sel { padding: .4em .6em; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: .85rem; font-family: inherit; }

/* mini bar chart (pure CSS/SVG, no lib) */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 20px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bar .fill { width: 100%; max-width: 46px; background: linear-gradient(to top, var(--brand), var(--brand-600)); border-radius: 8px 8px 0 0; min-height: 4px; transition: height .5s; }
.chart .bar .lab { font-size: .78rem; color: var(--muted); }
.chart .bar .val { font-size: .78rem; font-weight: 700; }

.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); }
.dash-hamb { display: none; }

/* ===== CRM app ===== */
.crm-topbar { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; }
.crm-topbar .brand { font-size: 1.05rem; }
.crm-search { margin-left: auto; position: relative; }
.crm-search input { width: 240px; max-width: 40vw; padding: .5em .8em .5em 2em; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; font-size: .9rem; }
.crm-search::before { content: "🔍"; position: absolute; left: .7em; top: 50%; transform: translateY(-50%); font-size: .8rem; opacity: .6; }
.crm-shell { display: grid; grid-template-columns: 208px 1fr; min-height: calc(100vh - 56px); }
.crm-side { border-right: 1px solid var(--border); background: var(--surface); padding: 14px 10px; }
.crm-side .grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; font-weight: 700; }
.crm-side a { display: flex; align-items: center; gap: .6em; padding: .6em .7em; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .93rem; cursor: pointer; }
.crm-side a .ic { width: 18px; text-align: center; }
.crm-side a:hover { background: var(--surface-2); color: var(--text); }
.crm-side a.active { background: var(--brand-tint); color: var(--brand); }
.crm-side a .count { margin-left: auto; font-size: .72rem; background: var(--surface-2); color: var(--text-2); padding: .1em .5em; border-radius: 999px; }
.crm-main { padding: 24px; overflow-x: hidden; max-width: 100%; }
.crm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.crm-head h1 { font-size: 1.5rem; margin: 0; }
.crm-head .sub { color: var(--muted); font-size: .92rem; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 260px; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kcol { background: var(--surface-2); border-radius: 12px; padding: 10px; min-height: 120px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 700; font-size: .9rem; }
.kcol-head .n { font-size: .75rem; color: var(--muted); font-weight: 600; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--brand); }
.kcard b { font-size: .92rem; display: block; margin-bottom: 4px; }
.kcard .meta { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.kcard .val { color: var(--good); font-weight: 700; }
.kcard .src { display: inline-block; margin-top: 8px; font-size: .72rem; }
.kcard.dragging { opacity: .4; }
.kcol.dragover { outline: 2px dashed var(--brand); outline-offset: -4px; }

/* timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 16px 14px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.tl-item .when { font-size: .78rem; color: var(--muted); }
.tl-item .what { font-size: .92rem; }

/* detail two-col */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* estimate / invoice doc */
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--border); padding-bottom: 16px; margin-bottom: 16px; }
.doc-head .co { font-size: 1.2rem; font-weight: 800; }
.doc-total { display: flex; justify-content: flex-end; }
.doc-total table { font-size: .95rem; }
.doc-total td { padding: 4px 0 4px 40px; text-align: right; }
.doc-total .grand td { font-size: 1.2rem; font-weight: 800; color: var(--brand); border-top: 2px solid var(--border); padding-top: 10px; }
.li-row td input { width: 100%; border: 1px solid transparent; background: transparent; padding: .4em; border-radius: 6px; color: var(--text); font-family: inherit; font-size: .9rem; }
.li-row td input:focus { border-color: var(--border); background: var(--bg); outline: none; }

/* progress bar */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-600)); }

/* task rows */
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-row input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--brand); flex: none; }
.task-row.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-title { flex: 1; font-size: .93rem; }
.t-due { font-size: .82rem; color: var(--muted); }
.t-due.overdue { color: var(--danger); font-weight: 600; }

/* automation cards */
.auto-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.auto-card:last-child { border-bottom: none; }
.auto-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.auto-card .body { flex: 1; }
.auto-card .body b { display: block; }
.auto-card .body span { font-size: .85rem; color: var(--muted); }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; cursor: pointer; flex: none; }
.switch.on { background: var(--brand); border-color: var(--brand); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .18s; }
.switch.on::after { left: 20px; }

/* segmented toggle */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; padding: .45em .9em; border-radius: 7px; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--text-2); font-family: inherit; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.crm-menu-btn { display: none; }
@media (max-width: 900px) {
  .crm-shell { grid-template-columns: 1fr; }
  .crm-side { display: none; position: fixed; top: 56px; bottom: 0; left: 0; width: 220px; z-index: 40; overflow-y: auto; }
  .crm-side.open { display: block; }
  .crm-menu-btn { display: inline-grid; }
  .detail-grid { grid-template-columns: 1fr; }
  .crm-search input { width: 140px; }
}

@media (max-width: 860px) {
  .hero-grid, .cards, .steps { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 20px; }
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .c-grid { grid-template-columns: 1fr; }
  .filters { position: static; }
  .band { padding: 32px 20px; }
  .field-row, .check-grid, .role-pick { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: 1fr; }
  .dash-side { display: none; }
  .dash-side.open { display: block; position: fixed; top: 66px; bottom: 0; left: 0; width: 240px; z-index: 40; }
  .dash-hamb { display: inline-flex; }
  .dash-main { padding: 20px; }
  table.data { font-size: .84rem; }
  table.data th:nth-child(3), table.data td:nth-child(3) { display: none; }
}
