:root {
  --bg: #f6f5f2; --surface: #fff; --soft: #f1efeb; --ink: #16152d; --ink-2: #44425c; --muted: #6c6a80;
  --line: #e7e4ec; --brand: #2c2a91; --brand-ink: #1f1d6c; --brand-50: #efeefa; --sun: #e2401f; --wa: #1a9e52;
  --r: 16px; --sh: 0 1px 2px rgba(22,21,45,.05), 0 10px 30px -18px rgba(22,21,45,.25);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --s-new: #1898d6; --s-contacted: #7b61d1; --s-interested: #d99a06; --s-quote_sent: #e2701f; --s-booked: #1a9e52; --s-lost: #9a98a8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-danger { color: var(--sun); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; color: var(--ink); }
.logo img { width: 34px; height: 34px; }
.logo small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); }
.tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.tabs a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.tabs a.on { background: var(--brand-50); color: var(--brand-ink); }
@media (max-width: 640px) { .logo span { display: none; } .tabs a { padding: 8px 9px; font-size: .86rem; } }

main { padding: 22px 0 60px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi { padding: 16px; }
.kpi small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; font-size: 1.7rem; letter-spacing: -.02em; margin-top: 2px; }
.kpi em { font-style: normal; color: var(--muted); font-size: .82rem; }
.kpi.warn strong { color: var(--sun); }
.two { grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 1000px) { .two { grid-template-columns: 1fr 1fr; } }

.range { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.range input[type=date] { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--surface); }

.funnel { display: grid; gap: 8px; }
.funnel a { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.bar { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); width: 0; transition: width .6s; }
.funnel b { text-align: right; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 10px; }
.chart span { flex: 1; min-width: 3px; background: var(--brand-50); border-radius: 4px 4px 0 0; position: relative; height: 0; }
.chart span i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--wa); border-radius: 4px 4px 0 0; }
.chart-legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.chart-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--brand-50); }
.chart-legend span.b::before { background: var(--wa); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
td.n, th.n { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.tbl { overflow-x: auto; }
.tbl table tbody tr { cursor: pointer; }
.tbl table tbody tr:hover { background: var(--soft); }

/* Filters */
.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.frow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 42px; }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
select.f, .field select, .field input, .field textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; min-height: 40px; max-width: 100%; }
select.f { border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: .84rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; white-space: nowrap; }
.dot.s-new, .pill.s-new { background: var(--s-new); } .dot.s-contacted, .pill.s-contacted { background: var(--s-contacted); }
.dot.s-interested, .pill.s-interested { background: var(--s-interested); } .dot.s-quote_sent, .pill.s-quote_sent { background: var(--s-quote_sent); }
.dot.s-booked, .pill.s-booked { background: var(--s-booked); } .dot.s-lost, .pill.s-lost { background: var(--s-lost); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--soft); font-size: .76rem; font-weight: 600; color: var(--ink-2); }
.tag.ok { background: #e3f5ea; color: #137a3f; }
.tag.warn { background: #fdeee9; color: #a8321a; }

/* Lead cards (mobile) */
.cards { display: grid; gap: 10px; }
.lc { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-decoration: none; color: var(--ink); }
.lc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lc strong { display: block; }
.lc p { margin: 4px 0 0; font-size: .86rem; color: var(--ink-2); }
.only-desk { display: none; }
@media (min-width: 900px) { .only-desk { display: block; } .only-mob { display: none; } }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(16,15,40,.4); z-index: 30; }
.drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); overflow-y: auto; box-shadow: -20px 0 60px -30px rgba(0,0,0,.5); animation: slide .3s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer header { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; z-index: 2; }
.drawer header h2 { margin: 0; }
.drawer .body { padding: 16px; display: grid; gap: 14px; }
.x { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: grid; gap: 4px; font-weight: 600; font-size: .85rem; }
.fields { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.fields .full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; font-weight: 500; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .88rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }
.notes { display: grid; gap: 8px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.note small { display: block; color: var(--muted); margin-top: 4px; font-size: .76rem; }
.hist { font-size: .84rem; color: var(--ink-2); display: grid; gap: 4px; }
.status-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pick button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: .84rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.status-pick button.on { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth form { width: min(400px, 100%); display: grid; gap: 14px; }
.auth .logo { justify-content: center; margin-bottom: 6px; }
.auth .logo img { width: 64px; height: 64px; }
.err { color: var(--sun); font-weight: 600; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 50; font-weight: 600; box-shadow: var(--sh); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.section-t { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-t h2 { margin: 0; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: .85em; }
a.kpi { text-decoration: none; color: var(--ink); }

/* Website tab */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subnav a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.subnav a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pubbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; }
.pubbar .tag { margin-left: 4px; }
.steps-list { display: grid; gap: 6px; padding-left: 18px; }
.head h1 small { font-size: .9rem; font-weight: 600; }
.tdimg { width: 56px; }
.tdimg img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; display: block; }
.editor { display: grid; gap: 14px; padding-bottom: 90px; }
.editor h2 { margin-bottom: 4px; }
.slug { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.slug input { flex: 1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 500; }
.checks.scroll { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.rows { display: grid; gap: 10px; margin-bottom: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input, .day-ed input, .day-ed textarea { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 40px; background: var(--surface); }
.r-place input:first-child { flex: 1 1 220px; }
.r-hotel input { flex: 1 1 160px; }
.r-hotel input.w-s, .mini input[type=number] { width: 80px; flex: none; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.mini input { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; min-height: 36px; }
.day-ed { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.day-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-ed .mini input { flex: 1; }
.dates-ed { display: flex; flex-wrap: wrap; gap: 8px; }
.date-ed { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 10px; background: var(--surface); }
.date-ed input { border: 0; background: none; min-height: 34px; }
.date-ed button { border: 0; background: var(--soft); border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.date-ed.past { opacity: .5; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { display: grid; gap: 6px; align-content: start; }
.thumb input { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: .82rem; }
.thumb-img { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--soft); }
.thumb-img img, .thumb-img video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-img .tag { position: absolute; left: 6px; top: 6px; }
.thumb-act { display: flex; gap: 4px; }
.thumb-act .btn { padding: 0 8px; }
.thumb.add { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 12px; background: none; cursor: pointer; font-weight: 700; color: var(--brand); }
.thumb.add:hover { border-color: var(--brand); }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 10px 0; }
.grow { flex: 1; }
.rev-list { display: grid; gap: 10px; }
.rev-row { display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer; width: 100%; font: inherit; }
.rev-row:hover { border-color: var(--ink-2); }
.rev-thumb { position: relative; flex: none; }
.rev-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; display: block; }
.rev-thumb .tag { position: absolute; right: -6px; bottom: -6px; }
.rev-main { flex: 1; min-width: 0; }
.rev-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.stars-sm { color: #e8a317; letter-spacing: 1px; }
.gal-admin { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 14px; }
.gpost p { margin: 0 0 8px; word-break: break-all; }
.gpost .thumbs { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.drawer .thumbs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }
.mt14 { margin-top: 14px; }
.grid.two.mt0 { margin-top: 0; }
.thumb { min-width: 0; }
.thumb input { width: 100%; min-width: 0; }
[hidden] { display: none !important; }
