/* CallCatch app. Same paperwork look as the marketing sites; .theme-in switches to the India notebook palette. */
:root {
  --bg: #E4E7E9; --surface: #FFFFFF; --sheet: #F5F6F6;
  --ink: #1A2330; --muted: #55606B; --line: #C3C9CE;
  --accent: #1F3FAE; --accent-ink: #FFFFFF; --hilite: #F6EA95; --alert: #B8322B; --ok: #1F7A4D;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --headweight: 800;
  --gutter: clamp(14px, 4vw, 32px);
}
.theme-in {
  --bg: #E8EFEC; --sheet: #F4F8F7; --line: #C8DAD5; --ink: #16221F; --muted: #55655F;
  --accent: #0A4F44; --hilite: #F7C65B; --alert: #C23B31;
  --head: "Rozha One", "Hind", Georgia, serif; --body: "Hind", system-ui, sans-serif; --hand: "Kalam", "Segoe Script", cursive;
  --headweight: 400;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.55 var(--body); padding-bottom: 76px; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: var(--headweight); line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
p { margin: 0; max-width: 62ch; }
p + p { margin-top: .8em; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.hand { font-family: var(--hand); }

/* top bar + navigation */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: var(--headweight) 1.55rem var(--head); }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 4px; font: 500 1rem var(--body); background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--sheet); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.nav .count { display: inline-block; min-width: 1.4em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--alert); color: #fff; font-size: .8rem; text-align: center; }
@media (max-width: 720px) {
  .top .nav.main { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 0; }
  .top .nav.main a { flex: 1; text-align: center; padding: 10px 2px; font-size: .9rem; }
}

main.page { padding: 28px 0 56px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 4px; border: 2px solid var(--ink); background: var(--ink); color: #fff; font: 700 1rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.plain { background: transparent; color: var(--ink); }
.btn.plain:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { background: transparent; border-color: var(--alert); color: var(--alert); }
.btn.danger:hover { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .95rem; }
.btn.wide { width: 100%; }
form.inline { display: inline; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: .9rem; margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid #8C959E; border-radius: 4px; padding: 10px 12px; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* messages and banners */
.flash { padding: 12px 16px; margin-bottom: 18px; border-left: 5px solid var(--ok); background: var(--surface); }
.flash.warn, .error { border-left-color: var(--alert); }
.error { padding: 12px 16px; background: #FBEDEC; border-left: 5px solid var(--alert); margin-bottom: 16px; color: #6B1A15; }
.banner { background: var(--hilite); padding: 14px 18px; margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; transform: rotate(-.3deg); }
.banner b { font: var(--headweight) 1.25rem var(--head); }

/* weekly ledger: numbers on one line, no stat cards */
.ledger { display: flex; flex-wrap: wrap; gap: 6px 34px; padding: 14px 0 18px; border-block: 2px solid var(--ink); margin-bottom: 22px; }
.ledger div { min-width: 90px; }
.ledger b { display: block; font: var(--headweight) 2.4rem/1 var(--head); }
.ledger span { color: var(--muted); font-size: .9rem; }

/* inbox */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filters a { padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); font-size: .95rem; }
.filters a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lead-row { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line); padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.lead-row.p1 { border-left-color: var(--alert); background: var(--hilite); }
.lead-row.p2 { border-left-color: var(--accent); }
.lead-row.unseen::after { content: "New"; position: absolute; top: -10px; left: 14px; font: 700 .75rem var(--body); color: #fff; background: var(--alert); padding: 1px 8px; border-radius: 999px; }
.lead-row .what { font: 600 1.6rem/1.1 var(--hand); color: var(--accent); }
.lead-row .meta { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.lead-row.p1 .meta { color: #4A4410; }
.lead-row.unseen { margin-top: 8px; }
.lead-row .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-row a.cover { position: absolute; inset: 0; }
.lead-row .acts, .lead-row .btn { position: relative; z-index: 1; }
@media (max-width: 600px) { .lead-row { grid-template-columns: 1fr; } }
.empty { padding: 36px 0; text-align: left; max-width: 52ch; }
.empty h3 { margin-bottom: 8px; }

/* lead detail */
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.slip { background: var(--hilite); padding: 18px 20px; transform: rotate(-.5deg); box-shadow: 0 16px 28px -20px rgba(26,35,48,.6); }
.slip .hand { font-size: 1.6rem; line-height: 1.2; color: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 20px; }
.panel h2, .panel h3 { margin-bottom: 10px; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.b { max-width: 86%; padding: 8px 12px; border-radius: 14px; font-size: .98rem; line-height: 1.4; }
.b small { display: block; color: inherit; opacity: .7; font-size: .75rem; margin-top: 2px; }
.b.cust { align-self: flex-start; background: #E4E7E9; border-bottom-left-radius: 4px; }
.b.ai { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.b.owner { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.status-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* setup checklist */
.todo { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.todo > li { counter-increment: s; border-top: 1px solid var(--line); padding: 20px 0 20px 52px; position: relative; }
.todo > li::before { content: counter(s); position: absolute; left: 0; top: 18px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font: var(--headweight) 1.15rem var(--head); }
.todo > li.done::before { content: "\2713"; background: var(--ok); border-color: var(--ok); color: #fff; font-family: var(--body); }
.todo h3 { margin-bottom: 4px; }
.todo .acts { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.code { font: 600 1.05rem ui-monospace, Consolas, monospace; background: var(--sheet); border: 1px solid var(--line); padding: 2px 8px; border-radius: 3px; word-break: break-all; }

/* tables (admin) */
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--muted); font-size: .85rem; background: var(--sheet); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--sheet); border: 1px solid var(--line); }
.badge.ok { background: #DDF2E6; border-color: #9BD2B1; color: #145636; }
.badge.warn { background: #FBEDEC; border-color: #E7B0AB; color: #7A241D; }
.scroll-x { overflow-x: auto; }

/* auth pages */
.auth { max-width: 460px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); padding: 28px 26px; box-shadow: 0 20px 36px -26px rgba(26,35,48,.5); }
.auth h1 { font-size: 2.4rem; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin-bottom: 20px; }
.auth .alt { margin-top: 18px; font-size: .95rem; }
.foot { text-align: center; color: var(--muted); font-size: .9rem; padding: 10px 0 0; }
