:root{
  --navy:#0f2a43; --navy-2:#163a5c; --teal:#14b8a6; --teal-d:#0d9488; --coral:#f97362;
  --bg:#f4f6fa; --card:#fff; --ink:#1b2533; --muted:#6b7686; --line:#e3e8ef;
  --ok:#16a34a; --warn:#d97706; --err:#dc2626; --r:12px;
  --shadow:0 1px 2px rgba(15,42,67,.06),0 4px 16px rgba(15,42,67,.06);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font:14px/1.5 "Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--ink)}
a{color:var(--teal-d);text-decoration:none}
h1,h2,h3{margin:0;line-height:1.25}
h1{font-size:22px} h2{font-size:17px} h3{font-size:15px}
.muted{color:var(--muted)} .small{font-size:12px}
.app{display:grid;grid-template-columns:240px 1fr;min-height:100vh}

/* sidebar */
.side{background:var(--navy);color:#cfdae6;padding:18px 14px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;gap:6px}
.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 18px}
.brand-mark{width:36px;height:36px;border-radius:10px;background:linear-gradient(135deg,var(--teal),var(--coral));display:grid;place-items:center;color:#fff;font-weight:800}
.brand b{color:#fff;display:block;font-size:15px} .brand span{font-size:11px;opacity:.7}
.nav a{display:flex;align-items:center;gap:10px;color:#cfdae6;padding:9px 10px;border-radius:9px;font-weight:500}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.nav a.active{background:rgba(20,184,166,.18);color:#fff}
.nav a svg{width:18px;height:18px;flex:none}
.nav .sec{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;opacity:.5;margin:14px 10px 4px}
.side-foot{margin-top:auto;font-size:11px;opacity:.7;padding:10px}
.demo-pill{display:inline-block;background:var(--coral);color:#fff;border-radius:99px;padding:2px 8px;font-size:10px;font-weight:700;letter-spacing:.05em}

/* main */
.main{min-width:0}
.top{display:flex;align-items:center;gap:12px;padding:14px 28px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.top .menu{display:none}
.top .spacer{flex:1}
.view{padding:24px 28px 60px;max-width:1280px}
.page-head{display:flex;align-items:flex-end;gap:12px;margin-bottom:20px;flex-wrap:wrap}
.page-head .spacer{flex:1}
.page-head p{margin:4px 0 0}

/* elements */
.btn{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);background:#fff;color:var(--ink);padding:8px 14px;border-radius:9px;font:inherit;font-weight:600;cursor:pointer;white-space:nowrap}
.btn:hover{border-color:#c9d2de}
.btn.primary{background:var(--teal);border-color:var(--teal);color:#fff}
.btn.primary:hover{background:var(--teal-d)}
.btn.dark{background:var(--navy);border-color:var(--navy);color:#fff}
.btn.danger{color:var(--err)}
.btn.sm{padding:5px 10px;font-size:12.5px}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn svg{width:16px;height:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow)}
.card-pad{padding:18px}
.card-head{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line)}
.card-head .spacer{flex:1}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{padding:16px 18px}
.stat .v{font-size:26px;font-weight:700;margin-top:4px}
.stat .l{color:var(--muted);font-size:12.5px;font-weight:500}
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:99px;font-size:11.5px;font-weight:600;background:#eef2f7;color:#445}
.badge.sale{background:#e0f2fe;color:#0369a1}
.badge.rent{background:#fef3c7;color:#92400e}
.badge.published{background:#dcfce7;color:#166534}
.badge.draft{background:#eef2f7;color:#475569}
.badge.sold,.badge.rented{background:#fee2e2;color:#991b1b}
.badge.scheduled{background:#ede9fe;color:#5b21b6}
.badge.failed{background:#fee2e2;color:#991b1b}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:99px;padding:3px 10px;font-size:12px;background:#fff}
.pf{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:7px;color:#fff;font-weight:800;font-size:11px;flex:none}
.pf.lg{width:40px;height:40px;border-radius:10px;font-size:14px}
.row{display:flex;align-items:center;gap:10px}
.wrap{flex-wrap:wrap}
.stack{display:flex;flex-direction:column;gap:12px}
.empty{padding:40px;text-align:center;color:var(--muted)}
hr.sep{border:0;border-top:1px solid var(--line);margin:16px 0}

/* forms */
label.f{display:flex;flex-direction:column;gap:5px;font-weight:600;font-size:12.5px;color:#334155}
.inp,select.inp,textarea.inp{font:inherit;font-weight:400;color:var(--ink);border:1px solid #d5dce6;border-radius:9px;padding:9px 11px;background:#fff;width:100%}
.inp:focus{outline:2px solid rgba(20,184,166,.35);border-color:var(--teal)}
textarea.inp{resize:vertical;min-height:110px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:10px;padding:3px;background:#fff}
.seg button{border:0;background:none;padding:6px 14px;border-radius:7px;font:inherit;font-weight:600;color:var(--muted);cursor:pointer}
.seg button.on{background:var(--navy);color:#fff}
.checks{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px}
.checks label{display:flex;gap:8px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:8px 10px;cursor:pointer;font-weight:500;background:#fff}
.checks label:has(input:checked){border-color:var(--teal);background:#f0fdfa}
.form-sec{padding:18px;border-bottom:1px solid var(--line)}
.form-sec:last-child{border-bottom:0}
.form-sec h3{margin-bottom:12px}

/* property cards */
.props{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:16px}
.prop{overflow:hidden;display:flex;flex-direction:column}
.prop .ph{aspect-ratio:16/10;background:linear-gradient(135deg,#1e3a5f,#14b8a6);position:relative;overflow:hidden}
.prop .ph img{width:100%;height:100%;object-fit:cover;display:block}
.prop .ph .tags{position:absolute;left:10px;top:10px;display:flex;gap:6px}
.prop .ph .noimg{position:absolute;inset:0;display:grid;place-items:center;color:rgba(255,255,255,.75);font-weight:600}
.prop .bd{padding:14px;display:flex;flex-direction:column;gap:6px;flex:1}
.prop .price{font-size:18px;font-weight:700;color:var(--navy)}
.prop .specs{display:flex;gap:12px;color:var(--muted);font-size:12.5px;flex-wrap:wrap}
.prop .ft{display:flex;gap:6px;padding:10px 14px;border-top:1px solid var(--line);align-items:center}
.prop .ft .spacer{flex:1}
.posted{display:flex;gap:3px}
.posted .pf{width:18px;height:18px;font-size:8px;border-radius:5px}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.toolbar .inp{width:auto}

/* images */
.imgs{display:flex;gap:10px;flex-wrap:wrap}
.imgs .im{width:120px;height:84px;border-radius:9px;overflow:hidden;position:relative;border:1px solid var(--line);background:#eef2f7}
.imgs .im img{width:100%;height:100%;object-fit:cover}
.imgs .im button{position:absolute;right:4px;top:4px;border:0;background:rgba(0,0,0,.6);color:#fff;border-radius:6px;width:22px;height:22px;cursor:pointer}
.imgs .im .cover{position:absolute;left:4px;bottom:4px;background:var(--teal);color:#fff;font-size:10px;padding:1px 6px;border-radius:5px}
.drop{width:120px;height:84px;border:2px dashed #c9d2de;border-radius:9px;display:grid;place-items:center;color:var(--muted);cursor:pointer;text-align:center;font-size:12px}
.drop:hover{border-color:var(--teal);color:var(--teal-d)}

/* tables */
table.t{width:100%;border-collapse:collapse}
.t th{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);text-align:left;padding:10px 14px;border-bottom:1px solid var(--line);font-weight:600}
.t td{padding:10px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
.t tr:last-child td{border-bottom:0}

/* composer */
.composer{display:grid;grid-template-columns:300px 1fr 360px;gap:16px;align-items:start}
.ch-opt{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;cursor:pointer;background:#fff}
.ch-opt.on{border-color:var(--teal);background:#f0fdfa}
.ch-opt.off{opacity:.55;cursor:default}
.ch-opt .nm{font-weight:600}
.ch-opt .spacer{flex:1}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);padding:0 12px;overflow-x:auto}
.tabs button{border:0;background:none;padding:11px 12px;font:inherit;font-weight:600;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;display:flex;gap:6px;align-items:center;white-space:nowrap}
.tabs button.on{color:var(--ink);border-bottom-color:var(--teal)}
.counter{font-size:12px;color:var(--muted)} .counter.over{color:var(--err);font-weight:700}
.preview{overflow:hidden}
.preview .pv-head{display:flex;gap:10px;align-items:center;padding:12px}
.preview .avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--teal),var(--coral));color:#fff;display:grid;place-items:center;font-weight:800}
.preview .pv-text{padding:0 12px 12px;white-space:pre-wrap;font-size:13px;max-height:260px;overflow:auto}
.preview .pv-img{aspect-ratio:1/1;background:linear-gradient(135deg,#1e3a5f,#14b8a6)}
.preview .pv-img img{width:100%;height:100%;object-fit:cover;display:block}
.preview.portrait .pv-img{aspect-ratio:9/12}
.prog{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.prog:last-child{border-bottom:0}
.spin{width:16px;height:16px;border:2px solid #cbd5e1;border-top-color:var(--teal);border-radius:50%;animation:sp .8s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

/* accounts */
.acc{padding:18px;display:flex;flex-direction:column;gap:12px}
.acc .row .spacer{flex:1}
.dot{width:8px;height:8px;border-radius:50%;background:#cbd5e1;display:inline-block}
.dot.on{background:var(--ok)}

/* whatsapp */
.wa-list{max-height:360px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.wa-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--line);cursor:pointer}
.wa-item:last-child{border-bottom:0}
.wa-item:hover{background:#f8fafc}
.wa-item .spacer{flex:1}
.av{width:30px;height:30px;border-radius:50%;background:#e2e8f0;display:grid;place-items:center;font-weight:700;font-size:12px;color:#475569;flex:none}
.bubble{background:#dcf8c6;border-radius:10px 10px 2px 10px;padding:10px 12px;white-space:pre-wrap;font-size:13px;max-height:280px;overflow:auto;box-shadow:0 1px 1px rgba(0,0,0,.08)}
.wa-bg{background:#efeae2;padding:14px;border-radius:10px}

/* modal + toast */
.modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.5);display:grid;place-items:center;z-index:50;padding:20px}
.modal{background:#fff;border-radius:14px;width:min(560px,100%);max-height:90vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.modal .mh{display:flex;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid var(--line)}
.modal .mh .spacer{flex:1}
.modal .mb{padding:20px;display:flex;flex-direction:column;gap:14px}
.modal .mf{display:flex;gap:8px;justify-content:flex-end;padding:14px 20px;border-top:1px solid var(--line)}
.x{border:0;background:none;font-size:22px;cursor:pointer;color:var(--muted)}
.toasts{position:fixed;right:20px;bottom:20px;display:flex;flex-direction:column;gap:8px;z-index:60}
.toast{background:var(--navy);color:#fff;padding:10px 16px;border-radius:10px;box-shadow:var(--shadow);animation:tin .2s ease}
.toast.err{background:var(--err)}
@keyframes tin{from{transform:translateY(8px);opacity:0}}
.note{background:#f0fdfa;border:1px solid #99f6e4;color:#115e59;border-radius:10px;padding:10px 12px;font-size:12.5px}
.note.warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.oauth{text-align:center;padding:10px 0}
.oauth .perm{text-align:left;background:#f8fafc;border-radius:10px;padding:12px 14px;margin-top:10px}
.oauth .perm div{padding:3px 0}
.list-act{display:flex;flex-direction:column}
.list-act div{display:flex;gap:10px;padding:10px 18px;border-bottom:1px solid var(--line);align-items:flex-start}
.list-act div:last-child{border-bottom:0}

@media (max-width:1150px){.composer{grid-template-columns:1fr 1fr}.composer>.c3{grid-column:1/-1}}
@media (max-width:900px){
  .app{grid-template-columns:1fr}
  .side{position:fixed;left:0;top:0;z-index:40;width:250px;transform:translateX(-100%);transition:transform .2s}
  .side.open{transform:none}
  .top .menu{display:inline-flex}
  .g3,.g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .composer,.g2{grid-template-columns:1fr}
  .view{padding:18px 14px 60px}
}
@media (max-width:520px){.g3,.g4{grid-template-columns:1fr}}

/* auth */
#auth{display:none}
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(135deg,#0f2a43,#14526b)}
.auth{width:min(420px,100%);padding:28px;display:flex;flex-direction:column;gap:14px}
.nav-badge{margin-left:auto;background:var(--coral);color:#fff;border-radius:99px;font-size:10.5px;font-weight:700;padding:0 7px;line-height:18px}
.side-foot{font-size:12px;opacity:.85;line-height:1.4}

/* setup & approvals */
.steps{display:flex;flex-direction:column}
.step{display:flex;gap:12px;padding:14px 18px;border-bottom:1px solid var(--line);align-items:flex-start}
.step:last-child{border-bottom:0}
.st-i{flex:none;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:800;color:#fff;margin-top:1px}
.st-i.ok{background:var(--ok)} .st-i.todo{background:#cbd5e1;color:#334155} .st-i.warn{background:var(--warn)} .st-i.fail{background:var(--err)} .st-i.info{background:#e0f2fe;color:#0369a1}
.copy-row{display:flex;gap:8px;align-items:center;margin-top:6px;flex-wrap:wrap}
.copy-row code{background:#f1f5f9;border:1px solid var(--line);border-radius:7px;padding:4px 8px;font-size:12px;word-break:break-all}
.setup-form{margin-top:10px;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:12px}
details>summary{margin-top:6px}
.badge.sent,.badge.opened{background:#dcfce7;color:#166534}
.badge.queued,.badge.publishing{background:#e0f2fe;color:#0369a1}
