:root {
  --green-900: #01281d;
  --green-800: #023325;
  --green-700: #044d36;
  --green-600: #067a4f;
  --green-500: #0a9c66;
  --green-100: #e3f2ea;
  --gold: #FED700;
  --gold-dark: #d9b800;
  --ink: #1c2b24;
  --ink-soft: #5b6d63;
  --line: #e2e8e3;
  --bg: #f4f6f4;
  --card: #ffffff;
  --red: #c0392b;
  --blue: #5b8def;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 42, 30, .08), 0 4px 16px rgba(16, 42, 30, .06);
  --shadow-lg: 0 8px 40px rgba(16, 42, 30, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: var(--green-600); }
::selection { background: var(--gold); }

#app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
#sidebar {
  width: 250px; flex-shrink: 0; background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
  color: #dcebe2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo-block { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-mark {
  width: 42px; height: 42px; border-radius: 10px; background: var(--gold); color: var(--green-900);
  font-family: Georgia, serif; font-weight: 700; font-size: 19px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(254, 215, 0, .35);
}
.logo-text strong { display: block; color: #fff; font-size: 14.5px; letter-spacing: .2px; }
.logo-text span { display: block; font-size: 11px; color: #9fbfae; margin-top: 1px; }
#nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; color: #7fa291; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; cursor: pointer;
  color: #cfe3d7; font-size: 13.5px; font-weight: 500; transition: background .15s; text-decoration: none; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--gold); color: var(--green-900); font-weight: 700; }
.nav-item .n-icon { width: 20px; text-align: center; font-size: 15px; }
.nav-item .n-badge { margin-left: auto; background: rgba(255,255,255,.14); border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.nav-item.active .n-badge { background: rgba(1,40,29,.18); }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.compliance-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cc-row { display: flex; gap: 10px; align-items: flex-start; }
.cc-icon { font-size: 16px; }
.cc-row strong { display: block; font-size: 12px; color: #fff; }
.cc-row span { display: block; font-size: 11px; color: #9fbfae; }
.demo-chip { margin-top: 10px; font-size: 11px; color: var(--gold); text-align: center; background: rgba(254,215,0,.08); border: 1px dashed rgba(254,215,0,.35); border-radius: 8px; padding: 5px 8px; }
.demo-chip.connected { color: #7fe3ac; background: rgba(127,227,172,.08); border-color: rgba(127,227,172,.35); }

/* ---------- main ---------- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 26px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40;
}
.page-head h1 { font-size: 19px; font-weight: 750; letter-spacing: -.2px; }
.page-head p { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; }
.search-box input { border: none; background: transparent; outline: none; width: 220px; }
.search-box span { opacity: .5; font-size: 13px; }

#view { flex: 1; padding: 24px 26px 40px; }
#footer { padding: 16px 26px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11.5px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--card); }

/* ---------- buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 600; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-green { background: var(--green-600); color: #fff; }
.btn-green:hover { background: var(--green-700); }
.btn-gold { background: var(--gold); color: var(--green-900); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-500); color: var(--green-600); }
.btn-dark { background: var(--green-800); color: #fff; }
.btn-dark:hover { background: var(--green-900); }
.btn-danger { background: #fff; border-color: #f0c9c4; color: var(--red); }
.btn-danger:hover { background: #fdf1ef; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; gap: 10px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--ink-soft); }
.card-body { padding: 4px 18px 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } #sidebar { display: none; } .search-box input { width: 120px; } }

/* KPI cards */
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-soft); font-weight: 600; }
.kpi .k-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--green-800); }
.kpi .k-sub { font-size: 12px; color: var(--ink-soft); }
.kpi .k-icon { position: absolute; right: 14px; top: 14px; font-size: 22px; opacity: .8; }
.kpi-gold .k-value { color: #a08800; }

/* chips & badges */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2.5px 10px; font-size: 11.5px; font-weight: 600; background: var(--green-100); color: var(--green-700); }
.chip.gold { background: #fff7cc; color: #8a7400; }
.chip.grey { background: #eef1ef; color: var(--ink-soft); }
.chip.red { background: #fdeceb; color: var(--red); }
.chip.blue { background: #e9f0fe; color: #2b5fc7; }
.chip.dark { background: var(--green-800); color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-soft); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl tr.clickable:hover td { background: #f6faf7; cursor: pointer; }
.tbl tr:last-child td { border-bottom: none; }

/* avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green-100); color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-row { display: flex; align-items: center; gap: 10px; }
.avatar-row .meta strong { display: block; font-size: 13.5px; }
.avatar-row .meta span { display: block; font-size: 11.5px; color: var(--ink-soft); }

/* ---------- pipeline board ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col { min-width: 242px; width: 242px; flex-shrink: 0; background: #edf1ee; border-radius: var(--radius); border: 1px solid var(--line); }
.board-col.drag-over { outline: 2px dashed var(--green-500); outline-offset: -2px; background: var(--green-100); }
.col-head { padding: 10px 12px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.col-head .col-name { font-size: 12.5px; font-weight: 700; }
.col-head .col-count { margin-left: auto; font-size: 11px; background: #fff; border-radius: 12px; padding: 1px 8px; color: var(--ink-soft); font-weight: 600; border: 1px solid var(--line); }
.col-sum { font-size: 11px; color: var(--ink-soft); padding: 4px 12px 8px; }
.col-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.deal-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s, transform .1s; }
.deal-card .dc-title { padding-right: 16px; }
.dc-del { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--ink-soft); font-size: 15px; line-height: 1; cursor: pointer; opacity: .38; transition: opacity .12s, background .12s; }
.deal-card:hover .dc-del { opacity: .75; }
.dc-del:hover { opacity: 1; background: #fdeceb; color: var(--red); }
.nf-stage { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nf-stage input { flex: 1; }
.nf-del { width: 26px; height: 26px; flex: none; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; color: var(--ink-soft); font-size: 14px; line-height: 1; }
.nf-del:hover { border-color: #f0c9c4; color: var(--red); background: #fdf1ef; }
.mt { margin-top: 10px; }
.e-icon { font-size: 30px; margin-bottom: 8px; }
.deal-card:hover { box-shadow: var(--shadow); }
.deal-card.dragging { opacity: .45; transform: rotate(1.5deg); }
.deal-card .dc-title { font-size: 13px; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.deal-card .dc-contact { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.deal-card .dc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; }
.deal-card .dc-value { font-size: 12.5px; font-weight: 800; color: var(--green-700); }
.deal-card .dc-days { font-size: 10.5px; color: #9aa8a0; }

.funnel-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.funnel-tab { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.funnel-tab.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.funnel-tab .ft-count { opacity: .7; font-size: 11.5px; margin-left: 4px; }

/* funnel bars (dashboard) */
.fbar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.fbar-label { width: 150px; font-size: 12px; color: var(--ink-soft); flex-shrink: 0; text-align: right; }
.fbar-track { flex: 1; background: #eef1ee; border-radius: 6px; height: 22px; overflow: hidden; position: relative; }
.fbar-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; padding-left: 8px; color: #fff; font-size: 11px; font-weight: 700; min-width: 24px; transition: width .5s ease; }
.fbar-val { width: 110px; font-size: 12px; font-weight: 600; flex-shrink: 0; }

/* ---------- property cards ---------- */
.prop-card { overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.prop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.prop-img { height: 168px; background: linear-gradient(135deg, var(--green-100), #d8e8dd); background-size: cover; background-position: center; position: relative; }
.prop-price { position: absolute; bottom: 10px; left: 10px; background: var(--green-800); color: var(--gold); font-weight: 800; font-size: 13.5px; padding: 4px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.prop-status { position: absolute; top: 10px; right: 10px; }
.prop-body { padding: 13px 15px 15px; }
.prop-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.prop-sub { font-size: 12px; color: var(--ink-soft); margin-bottom: 9px; }
.prop-specs { display: flex; gap: 12px; font-size: 12px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 9px; }
.prop-specs b { color: var(--ink); }

/* ---------- activity feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.fi-whatsapp { background: #e2f7e8; }
.fi-email { background: #e9f0fe; }
.fi-call { background: #fdf3e2; }
.fi-note { background: #eef1ef; }
.fi-viewing { background: #f3e9fd; }
.fi-stage_change { background: var(--green-100); }
.fi-system { background: #fff7cc; }
.fi-ai { background: #e8f7f2; }
.feed-body { flex: 1; min-width: 0; }
.feed-body strong { font-size: 13px; }
.feed-body p { font-size: 12px; color: var(--ink-soft); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { font-size: 11px; color: #9aa8a0; white-space: nowrap; }
.feed-sim { font-size: 10px; color: var(--gold-dark); border: 1px solid #eee0a0; background: #fffae0; border-radius: 6px; padding: 0 5px; margin-left: 5px; }

/* schedule */
.sched-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sched-item:last-child { border-bottom: none; }
.sched-date { width: 54px; text-align: center; background: var(--green-100); border-radius: 9px; padding: 5px 0; flex-shrink: 0; }
.sched-date b { display: block; font-size: 16px; color: var(--green-800); }
.sched-date span { display: block; font-size: 10px; text-transform: uppercase; color: var(--green-700); letter-spacing: .5px; }

/* ---------- drawer ---------- */
#drawer-root { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 26, 18, .45); opacity: 0; transition: opacity .2s; pointer-events: auto; }
.drawer-backdrop.show { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: -560px; width: 560px; max-width: 96vw; height: 100%; background: #fff;
  box-shadow: var(--shadow-lg); transition: right .25s ease; pointer-events: auto; display: flex; flex-direction: column;
}
.drawer.show { right: 0; }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; background: linear-gradient(180deg, #fbfdfb, #fff); }
.drawer-head h2 { font-size: 17px; font-weight: 750; }
.drawer-head .dh-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.drawer-close { background: none; border: none; font-size: 22px; color: var(--ink-soft); line-height: 1; padding: 2px 6px; border-radius: 6px; }
.drawer-close:hover { background: var(--bg); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--line); background: #fbfdfb; }

/* ---------- modal ---------- */
#modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 26, 18, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; opacity: 0; transition: opacity .18s; pointer-events: auto; overflow-y: auto; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform .18s; }
.modal-backdrop.show .modal { transform: translateY(0); }
.modal.wide { width: 760px; }
.modal-head { padding: 18px 22px 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h3 { font-size: 16px; font-weight: 750; }
.modal-head .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.modal-body { padding: 6px 22px 16px; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

/* forms */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 650; color: var(--ink-soft); margin-bottom: 5px; }
.field .help { font-size: 11px; color: #9aa8a0; margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number], .field input[type=password], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none; background: #fff; transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(10, 156, 102, .12); }
.field textarea { resize: vertical; min-height: 90px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; }

/* ---------- toasts ---------- */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--green-800); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 380px; animation: slideIn .25s ease; display: flex; gap: 8px; align-items: center; }
.toast.error { background: #8c2f24; }
.toast.gold { background: #6b5a00; color: var(--gold); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- AI page ---------- */
.ai-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ai-layout { grid-template-columns: 1fr; } }
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 460px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 85%; display: flex; flex-direction: column; gap: 4px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.msg .bubble { border-radius: 14px; padding: 11px 15px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.msg.user .bubble { background: var(--green-700); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: #f1f5f2; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .bubble strong { font-weight: 700; }
.msg-meta { font-size: 10.5px; color: #9aa8a0; }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-input-bar { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; gap: 10px; background: #fbfdfb; border-radius: 0 0 var(--radius) var(--radius); }
.chat-input-bar textarea { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: none; outline: none; height: 64px; }
.chat-input-bar textarea:focus { border-color: var(--green-500); }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 18px 12px; }
.qchip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 12px; color: var(--ink-soft); font-weight: 550; }
.qchip:hover { border-color: var(--green-500); color: var(--green-600); background: var(--green-100); }
.ctx-card { padding: 14px 16px; margin-bottom: 12px; }
.ctx-card label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-soft); font-weight: 700; display: block; margin-bottom: 6px; }
.ctx-card select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-bottom: 10px; background: #fff; }
.typing { display: inline-flex; gap: 4px; padding: 12px 16px; }
.typing span { width: 7px; height: 7px; background: #a8bcb0; border-radius: 50%; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.script-block { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 12px 14px; margin: 8px 0; font-size: 13px; white-space: pre-wrap; }

/* ---------- integrations ---------- */
.int-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.int-head { display: flex; gap: 12px; align-items: flex-start; }
.int-icon { font-size: 24px; width: 44px; height: 44px; border-radius: 11px; background: var(--green-100); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.int-head h3 { font-size: 14.5px; font-weight: 700; }
.int-head .cat { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .6px; }
.int-blurb { font-size: 12.5px; color: var(--ink-soft); flex: 1; }
.int-status { position: absolute; top: 16px; right: 16px; }
.int-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.webhook-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; background: var(--green-900); color: #9fe8c3; padding: 7px 10px; border-radius: 7px; word-break: break-all; }
.cap-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cap-list li { font-size: 12px; color: var(--ink-soft); }
.cap-list li::before { content: '✓ '; color: var(--green-500); font-weight: 700; }

/* login screen */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 70% -10%, rgba(254, 215, 0, .12), transparent), linear-gradient(160deg, var(--green-700), var(--green-800) 45%, var(--green-900)); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 34px 30px 26px; width: 400px; max-width: 100%; box-shadow: var(--shadow-lg); text-align: center; }
.login-card h1 { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.login-card form { margin-top: 18px; text-align: left; }
.login-card .logo-mark { box-shadow: 0 4px 14px rgba(254, 215, 0, .4); }
.tagpick { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 4px 11px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); transition: all .12s; }
.tagpick:hover { border-color: var(--green-500); color: var(--green-600); }
.tagpick.on { background: var(--green-600); border-color: var(--green-600); color: #fff; }

/* automations */
.auto-steps { display: flex; flex-direction: column; }
.auto-step { display: flex; gap: 10px; padding: 8px 0; position: relative; align-items: flex-start; }
.auto-step::before { content: ''; position: absolute; left: 15px; top: 34px; bottom: -6px; width: 2px; background: var(--line); }
.auto-step:last-child::before { display: none; }
.auto-step .as-num { width: 32px; height: 32px; border-radius: 50%; background: var(--green-100); color: var(--green-700); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.auto-step .as-body { flex: 1; min-width: 0; }
.auto-step .as-body strong { font-size: 12.5px; }
.auto-step .as-body .as-prev { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.auto-step .as-meta { font-size: 11px; color: var(--ink-soft); white-space: nowrap; padding-top: 6px; }
.switch { position: relative; width: 42px; height: 23px; background: #ccd6cf; border-radius: 20px; border: none; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch.on { background: var(--green-500); }
.switch.on::after { left: 21px; }
.step-editor { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fbfdfb; }
.step-editor .se-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }

/* marketing */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.tab.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.composer-body textarea { min-height: 150px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* empty state */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-soft); }
.empty .e-icon { font-size: 40px; margin-bottom: 10px; }
.empty h3 { font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 420px; margin: 0 auto 14px; }

/* section headers inside views */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; font-weight: 750; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0; }
.detail-grid .d-item span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); font-weight: 650; }
.detail-grid .d-item b { font-size: 13.5px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.badge-src { font-size: 10.5px; background: #eef1ef; border-radius: 6px; padding: 2px 7px; color: var(--ink-soft); font-weight: 600; }
.stat-mini { display: flex; gap: 18px; flex-wrap: wrap; }
.stat-mini .sm b { font-size: 18px; display: block; color: var(--green-800); }
.stat-mini .sm span { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
.pill-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.pill-toggle button { border: none; background: #fff; padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.pill-toggle button.on { background: var(--green-700); color: #fff; }

/* ---------- help manual & training ---------- */
.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.help-list li { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.help-list li b, .help-list li code { color: var(--ink); }
.help-list code { background: #eef1ef; border-radius: 5px; padding: 1px 5px; font-size: 11.5px; }

/* ---------- calendar & bookings ---------- */
.cal-list { display: flex; flex-direction: column; gap: 10px; }
.appt-card { display: flex; gap: 14px; padding: 14px 16px; align-items: flex-start; }
.appt-date { flex: none; width: 66px; text-align: center; background: var(--green-100); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; gap: 1px; }
.appt-day { font-size: 20px; font-weight: 800; color: var(--green-700); line-height: 1.05; }
.appt-mon { font-size: 10px; text-transform: uppercase; letter-spacing: .9px; color: var(--ink-soft); font-weight: 700; }
.appt-time { font-size: 11.5px; font-weight: 700; margin-top: 3px; }
.appt-dur { font-size: 10px; color: var(--ink-soft); }
.survey-q summary { cursor: pointer; color: var(--green-700); font-weight: 600; font-size: 12.5px; padding: 6px 0; }
.survey-q[open] summary { margin-bottom: 4px; }

/* ---------- Social Poster ---------- */
.sp-wrap { display: grid; grid-template-columns: 420px 1fr; gap: 18px; align-items: start; }
.sp-left { position: sticky; top: 12px; max-height: calc(100vh - 100px); overflow-y: auto; }
@media (max-width: 1100px) { .sp-wrap { grid-template-columns: 1fr; } .sp-left { position: static; max-height: none; } }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sp-head h3 { margin: 0; font-size: 16px; }
.sp-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: 16px 0 7px; }
.sp-all { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.sp-chs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-ch { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 9px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; transition: .15s; }
.sp-ch:hover { border-color: var(--bc); }
.sp-ch.on { border-color: var(--bc); background: color-mix(in srgb, var(--bc) 9%, #fff); box-shadow: 0 0 0 1px var(--bc) inset; }
.sp-ch-ic { grid-row: 1 / 3; font-size: 22px; }
.sp-ch-nm { font-weight: 700; font-size: 13px; }
.sp-dot { font-size: 10.5px; color: #b45309; }
.sp-dot.ok { color: var(--green-600); }
.sp-dot::before { content: '● '; }
#sp-text { width: 100%; min-height: 140px; resize: vertical; }
.sp-count { text-align: right; font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
.sp-count.bad { color: var(--red); font-weight: 700; }
.sp-drop { border: 2px dashed #c5d3ca; border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; background: #fafcfb; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.sp-drop.over, .sp-drop:hover { border-color: var(--green-600); background: var(--green-100); }
.sp-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 10px; }
.sp-thumb { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #e8eeea; border: 1px solid var(--line); }
.sp-thumb img, .sp-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-vtag { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; }
.sp-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; font-size: 14px; }
.sp-bar { position: absolute; left: 6px; right: 6px; bottom: 8px; height: 6px; background: #d4ddd7; border-radius: 4px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: var(--green-600); transition: width .2s; }
.sp-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.sp-quick button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; }
.sp-quick button:hover { background: var(--green-100); }
.sp-warn { margin-top: 14px; background: #fff8e1; border: 1px solid #f3dd8a; border-radius: 10px; padding: 9px 12px; font-size: 12px; color: #6b5a00; display: grid; gap: 4px; }
.sp-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 16px; }
.sp-actions .btn { justify-content: center; padding-left: 6px; padding-right: 6px; }
.sp-post { margin-bottom: 12px; }
.sp-body { display: flex; gap: 12px; align-items: flex-start; }
.sp-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 112px; flex: none; }
.sp-mt { position: relative; aspect-ratio: 1; border-radius: 7px; overflow: hidden; background: #e8eeea; }
.sp-mt img, .sp-mt video { width: 100%; height: 100%; object-fit: cover; }
.sp-mt.more { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-soft); }
.sp-txt { font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; flex: 1; min-width: 0; }
.sp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sp-rc { font-size: 11.5px; padding: 2.5px 9px; border-radius: 14px; background: #eef1ef; color: var(--ink-soft); font-weight: 600; }
.sp-rc.ok { background: var(--green-100); color: var(--green-700); }
.sp-rc.bad { background: #fdeceb; color: var(--red); }
.sp-rc.skip { background: #fff7cc; color: #8a7400; }
.sp-err { margin-top: 8px; font-size: 12px; color: var(--red); background: #fdf3f2; border-radius: 8px; padding: 6px 10px; }
.btn-wa { background: #25D366; color: #fff; text-decoration: none; }
.btn-wa:hover { background: #1fb858; }

/* ---------- Workflows & AI Agents ---------- */
.wf-top { margin-bottom: 12px; }
.wf-editor { display: grid; grid-template-columns: 210px minmax(0, 1fr) 330px; gap: 12px; height: calc(100vh - 235px); min-height: 560px; }
@media (max-width: 1250px) { .wf-editor { grid-template-columns: 180px minmax(0, 1fr) 290px; } }
.wf-palette, .wf-insp { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-y: auto; }
.wf-pal-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 6px; }
.wf-pal-h:first-child { margin-top: 0; }
.wf-pal { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--pb); color: var(--ink); border: 1px solid transparent; border-left: 3px solid var(--pc); border-radius: 8px; padding: 7px 9px; margin-bottom: 5px; font: inherit; font-size: 12.5px; cursor: pointer; transition: .12s; }
.wf-pal:hover { transform: translateX(2px); border-color: var(--pc); }
.wf-pal span { font-size: 15px; }
.wf-canvas { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background-color: #f7faf8; background-image: radial-gradient(#cfdad3 1px, transparent 1px); background-size: 22px 22px; }
#wf-stage { position: relative; width: 2600px; height: 1300px; }
#wf-svg { position: absolute; left: 0; top: 0; pointer-events: none; }
#wf-svg .wf-edge-del { pointer-events: all; cursor: pointer; opacity: 0; transition: .12s; }
#wf-svg .wf-edge-del circle { fill: #fff; stroke: #c0392b; stroke-width: 1.5; }
#wf-svg .wf-edge-del text { fill: #c0392b; font-size: 13px; font-weight: 800; }
#wf-svg:hover .wf-edge-del, .wf-edge-del:hover { opacity: 1; }
.wf-node { position: absolute; width: 214px; background: #fff; border: 2px solid #d6e0da; border-radius: 12px; box-shadow: 0 2px 8px rgba(2,51,37,.08); user-select: none; cursor: grab; z-index: 2; }
.wf-node.sel { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(6,122,79,.18); }
.wf-node.drop { border-color: var(--gold-dark); box-shadow: 0 0 0 4px rgba(254,215,0,.45); }
.wf-node:active { cursor: grabbing; }
.wf-node-h { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px 10px 0 0; font-size: 12.5px; }
.wf-node-b { padding: 8px 10px 9px; font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; word-break: break-word; min-height: 28px; }
.wf-key { margin-top: 5px; font: 10.5px ui-monospace, Menlo, monospace; color: #8aa095; }
.wf-port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #7a8c82; z-index: 3; }
.wf-port.in { left: -8px; top: 50%; margin-top: -7px; }
.wf-port.out { right: -8px; margin-top: -7px; cursor: crosshair; }
.wf-port.out:hover, .wf-port.in:hover { background: var(--gold); border-color: var(--green-700); transform: scale(1.25); }
.wf-port.out.yes { border-color: #0a9c66; } .wf-port.out.no { border-color: #c0392b; }
.wf-port em { position: absolute; right: 18px; top: -2px; font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--ink-soft); }
.wf-port.out.yes em { color: #0a9c66; } .wf-port.out.no em { color: #c0392b; }
.wf-st { width: 9px; height: 9px; border-radius: 50%; margin-left: auto; background: #aaa; }
.wf-st.ok { background: #0a9c66; } .wf-st.failed { background: #c0392b; } .wf-st.skipped { background: #e0a800; }
.wf-insp-h { display: flex; gap: 10px; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; align-items: flex-start; }
.wf-insp .field { margin-bottom: 11px; }
.wf-multi { display: grid; gap: 4px; max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.wf-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.wf-switch input { opacity: 0; width: 0; height: 0; }
.wf-switch span { position: absolute; inset: 0; background: #c9d3cd; border-radius: 22px; cursor: pointer; transition: .15s; }
.wf-switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.wf-switch input:checked + span { background: var(--green-600); }
.wf-switch input:checked + span::before { transform: translateX(18px); }
.wf-run-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.wf-run-row:last-child { border-bottom: 0; }
.wf-run-row:hover { background: #f4f9f6; }
.wf-log { display: grid; gap: 8px; }
.wf-log-row { border: 1px solid var(--line); border-left: 4px solid #0a9c66; border-radius: 8px; padding: 8px 12px; }
.wf-log-row.skipped { border-left-color: #e0a800; } .wf-log-row.failed { border-left-color: #c0392b; background: #fdf6f5; }
.wf-log-h { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.wf-out { white-space: pre-wrap; background: #f4f7f5; border-radius: 6px; padding: 8px 10px; font: 11.5px/1.45 ui-monospace, Menlo, monospace; margin: 6px 0 0; max-height: 160px; overflow: auto; }
