:root {
  --bg: #f7f8fc; --panel: #ffffff; --text: #1a2240; --muted: #6b7280; --border: #e3e7f1;
  --primary: #1d3fae; --primary-dark: #0f2167; --primary-weak: #eef2ff;
  --gold: #c9a227; --gold-light: #f3d77a; --gold-weak: #fbf5e1;
  --danger: #dc2626; --ok: #16a34a; --warn: #b7791f;
  --soft: #eef1f8; --radius: 10px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
.sidebar { width: 220px; background: linear-gradient(180deg, var(--primary-dark), #13287f); color: #e5e7eb; padding: 18px 12px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; padding: 0 8px 20px; color: #fff; letter-spacing: .01em; }
.brand img { width: 36px; height: 36px; } .brand b { color: var(--gold-light); }
.sidebar nav a { display: block; color: #d1d5db; padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: var(--gold); color: var(--primary-dark); font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; gap: 12px; align-items: center; padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.search { position: relative; flex: 1; max-width: 640px; }
.search input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; background: var(--bg); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.08); max-height: 420px; overflow: auto; }
.search-results a { display: block; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:hover, .search-results a.sel { background: var(--primary-weak); }
.search-results small { color: var(--muted); display: block; }
main#view { padding: 24px; max-width: 1200px; width: 100%; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 16px; margin: 0 0 12px; }
.card { box-shadow: 0 1px 2px rgba(15,33,103,.04); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; } .g4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } .g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.stat .n { font-size: 26px; font-weight: 700; color: var(--primary); } .stat .l { color: var(--muted); }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--primary-weak); }
.btn { border: 1px solid var(--border); background: var(--panel); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.btn:hover { border-color: #cbd5e1; } .btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); } .btn.primary:hover { background: var(--primary-dark); }
.btn.gold { background: var(--gold); color: var(--primary-dark); border-color: var(--gold); font-weight: 600; }
.btn.danger { color: var(--danger); } .btn.sm { padding: 4px 9px; font-size: 12px; } .btn:disabled { opacity: .6; cursor: wait; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .spacer { flex: 1; }
.muted { color: var(--muted); } .right { text-align: right; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--soft); color: var(--text); }
.badge.ok { background: #dcfce7; color: #166534; } .badge.warn { background: #fef3c7; color: #92400e; } .badge.blue { background: var(--primary-weak); color: #1e40af; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
dialog { border: none; border-radius: 14px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(17,24,39,.45); }
dialog form { padding: 22px; } dialog h2 { margin-bottom: 16px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .form .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--panel); }
textarea { min-height: 80px; resize: vertical; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline .k { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--primary); background: var(--primary-weak); }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 300px; max-height: 60vh; overflow: auto; margin-bottom: 12px; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 80%; white-space: pre-wrap; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; } .msg.bot { align-self: flex-start; background: var(--soft); }
#toast { position: fixed; bottom: 96px; right: 22px; background: var(--primary-dark); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 50; max-width: 420px; }
#toast.err { background: var(--danger); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; } .kv div:nth-child(odd) { color: var(--muted); }
@media (max-width: 760px) { body { flex-direction: column; } .sidebar { width: auto; } .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; } .form { grid-template-columns: 1fr; } main#view { padding: 16px; } }

.stat { border-top: 3px solid var(--gold); }
.badge.gold { background: var(--gold-weak); color: #7a5d0b; }
/* Pipeline */
.funnel-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.funnel-tabs button { border: 1px solid var(--border); background: var(--panel); padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.funnel-tabs button .dot { width: 8px; height: 8px; border-radius: 50%; }
.funnel-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.col { background: var(--soft); border-radius: var(--radius); min-width: 210px; flex: 1 1 210px; display: flex; flex-direction: column; max-height: calc(100vh - 290px); }
.col-head { padding: 10px 12px; border-bottom: 2px solid var(--primary); display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.col-head.won { border-color: var(--gold); } .col-head.lost { border-color: #9ca3af; }
.col-head strong { font-size: 13px; } .col-head small { color: var(--muted); white-space: nowrap; }
.col-body { padding: 8px; overflow-y: auto; min-height: 80px; flex: 1; }
.col.over { outline: 2px dashed var(--gold); }
.deal { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; }
.deal:hover { box-shadow: 0 3px 10px rgba(15,33,103,.10); } .deal.dragging { opacity: .5; }
.deal .t { font-weight: 600; font-size: 13px; } .deal .c { font-size: 12px; color: var(--muted); margin-top: 2px; }
.deal .m { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; }
.deal .v { font-weight: 700; color: var(--primary); }
.col-add { margin: 0 8px 8px; border: 1px dashed #c7cee0; background: none; border-radius: 8px; padding: 6px; color: var(--muted); cursor: pointer; font-size: 12px; }
.col-add:hover { border-color: var(--primary); color: var(--primary); }
.client-pick { position: relative; } .client-pick .opts { position: absolute; left: 0; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; z-index: 10; max-height: 200px; overflow: auto; }
.client-pick .opts div { padding: 8px 10px; cursor: pointer; font-weight: 400; color: var(--text); } .client-pick .opts div:hover { background: var(--primary-weak); }
/* Client list: selection + bulk actions */
th.chk, td.chk { width: 34px; } td.chk input, th.chk input { width: 16px; height: 16px; cursor: pointer; }
.bulkbar { display: flex; gap: 8px; align-items: center; background: var(--primary-dark); color: #fff; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.bulkbar .btn { background: var(--panel); } .bulkbar .btn.danger { color: var(--danger); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #2a55e0, #14308c); color: var(--gold-light); font-weight: 700; flex-shrink: 0; text-transform: uppercase; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; } .avatar.lg { width: 64px; height: 64px; font-size: 22px; box-shadow: 0 0 0 3px var(--gold); }
/* Duplicates + merge */
.duprow { display: grid; grid-template-columns: 56px 1fr 1fr 1.1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.dupc small, .simc small, .cmph small, .mini small { display: block; color: var(--muted); font-size: 12px; }
.dupscore { font-weight: 700; color: var(--primary); background: var(--primary-weak); border-radius: 8px; text-align: center; padding: 8px 4px; }
.dupscore.hi { background: var(--gold-weak); color: #7a5d0b; } .dupscore.sm { padding: 4px 8px; font-size: 12px; }
.dupwhy, .simwhy { display: flex; gap: 4px; flex-wrap: wrap; }
dialog.wide { width: min(980px, 96vw); }
.simlist { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.simrow { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 400; color: var(--text); font-size: 14px; cursor: pointer; }
.simrow:hover { background: var(--primary-weak); } .simrow .simc { flex: 1; min-width: 0; } .simrow input { width: 16px; height: 16px; }
.cmpwrap { overflow-x: auto; max-height: 56vh; } .cmp td, .cmp th { min-width: 180px; } .cmp td:first-child, .cmp th:first-child { min-width: 110px; }
.cmp th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); background: var(--bg); position: sticky; top: 0; }
.cmp tr.diff td { background: var(--gold-weak); } .cmp tr.diff td:first-child { color: #7a5d0b; font-weight: 600; }
.cmph { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.keep, .pickv { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; color: var(--text); cursor: pointer; }
.keep { font-weight: 600; color: var(--primary); }
/* Customer card (client profile) */
main#view:has(.cc-grid) { max-width: 1480px; }
.cc-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 4px solid var(--gold); }
.cc-title h1 { margin: 0 0 4px; } .cc-title .row { gap: 6px; }
.cc-actions { display: flex; gap: 6px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 62px; padding: 8px 4px; border: 1px solid var(--border); background: var(--panel); border-radius: 10px; color: var(--primary); cursor: pointer; font-size: 11px; font-weight: 600; }
.qa svg { width: 18px; height: 18px; fill: currentColor; } .qa:hover { background: var(--primary-weak); border-color: var(--primary); }
.qa.off { opacity: .35; cursor: not-allowed; pointer-events: none; }
.cc-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cc-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.cc-grid h3:not(:first-child) { margin-top: 16px; }
.info { list-style: none; padding: 0; margin: 0; } .info li { display: flex; gap: 10px; padding: 7px 0; align-items: flex-start; word-break: break-word; }
.info svg { width: 16px; height: 16px; fill: var(--gold); flex-shrink: 0; margin-top: 2px; } .info small { display: block; color: var(--muted); font-size: 11px; }
.pre { white-space: pre-wrap; }
.cc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .cc-stats b { display: block; font-size: 20px; color: var(--primary); } .cc-stats span { color: var(--muted); font-size: 12px; }
.cc-center .tabs { margin-bottom: 0; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; background: var(--panel); padding: 0 8px; }
.cc-center .card { border-top-left-radius: 0; border-top-right-radius: 0; }
.dealmini { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; padding: 9px 10px; margin-top: 10px; cursor: pointer; }
.dealmini:hover { box-shadow: 0 3px 10px rgba(15,33,103,.10); } .dealmini .v { color: var(--primary); } .dealmini small { display: block; margin-top: 2px; }
.stagebar { display: flex; gap: 3px; margin-top: 8px; } .stagebar i { flex: 1; height: 5px; border-radius: 3px; background: var(--soft); }
.stagebar i.on { background: var(--primary); } .stagebar.won i.on { background: var(--gold); } .stagebar.lost i { background: #9ca3af; }
.mini { padding: 7px 0; border-bottom: 1px solid var(--border); } .mini:last-child { border: none; }
/* Timeline */
.composer { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.composer textarea { min-height: 70px; background: var(--panel); }
.modes { display: flex; gap: 4px; flex-wrap: wrap; }
.modes button, .chips button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 12px; color: var(--text); }
.modes button svg { width: 13px; height: 13px; fill: currentColor; }
.modes button.active, .chips button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.modes button:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.feed { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.feed::before { content: ''; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.feed li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.feed .ic { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 700; border: 2px solid var(--panel); z-index: 1; }
.feed .ic svg { width: 15px; height: 15px; fill: currentColor; }
.feed .bub { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.feed .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; } .feed .meta strong { color: var(--text); }
.feed .k-note .ic { background: var(--gold-weak); color: #7a5d0b; } .feed .k-call .ic { background: #dcfce7; color: #166534; }
.feed .k-sms .ic, .feed .k-email .ic { background: var(--primary-weak); color: var(--primary); }
.feed .k-sms .bub { background: var(--primary-weak); } .feed .k-sales .ic { background: var(--gold); color: var(--primary-dark); }
.feed .k-document .ic { background: var(--panel); } .feed li.empty { justify-content: center; }
@media (max-width: 1200px) { .cc-grid { grid-template-columns: 260px minmax(0, 1fr); } .cc-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; } .cc-right .card { margin: 0; } }
@media (max-width: 860px) { .cc-grid { grid-template-columns: 1fr; } .duprow { grid-template-columns: 1fr; } }
.cc-center .tabs { flex-wrap: nowrap; overflow-x: auto; } .cc-center .tabs button { white-space: nowrap; padding: 10px 11px; }
/* My Day + tasks */
.navbadge { float: right; background: var(--gold-light); color: var(--primary-dark); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.navbadge.late { background: #f87171; color: #fff; } .sidebar nav a.active .navbadge { background: var(--primary-dark); color: var(--gold-light); }
main#view:has(.md-grid) { max-width: 1480px; }
.md-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; } .md-head h1 { margin: 0; } .md-head p { margin: 4px 0 0; }
.md-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.md-kpis div { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 12px 14px; }
.md-kpis b { display: block; font-size: 24px; color: var(--primary); } .md-kpis span { color: var(--muted); font-size: 12px; }
.md-kpis .bad { border-top-color: var(--danger); } .md-kpis .bad b { color: var(--danger); }
.md-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.md-side h3, .tgroup h3, #ccTasks h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
.cnt { display: inline-block; background: var(--primary-weak); color: var(--primary); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.quickadd { display: flex; gap: 6px; margin: 12px 0 6px; flex-wrap: wrap; } .quickadd input[name=title] { flex: 1; min-width: 200px; }
.tgroup { margin-top: 16px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--panel); }
.task:hover { border-color: #c7cee0; } .task.late { border-left: 4px solid var(--danger); } .task.done .tt { text-decoration: line-through; color: var(--muted); }
.tcheck { width: 18px; height: 18px; margin-top: 2px; cursor: pointer; accent-color: var(--gold); }
.tk { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-weak); color: var(--primary); flex-shrink: 0; }
.tk svg { width: 13px; height: 13px; fill: currentColor; } .tk.k-call { background: #dcfce7; color: #166534; } .tk.k-todo { background: var(--gold-weak); color: #7a5d0b; }
.tbody { flex: 1; min-width: 0; } .tt { font-weight: 600; } .tbody small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.latetxt { color: var(--danger); font-weight: 600; }
.tact { display: flex; gap: 4px; opacity: .55; } .task:hover .tact { opacity: 1; } .tact svg { width: 12px; height: 12px; fill: currentColor; }
.sug { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); } .sug:last-child { border: none; }
.sug .sb { flex: 1; min-width: 0; } .sug small { display: block; color: var(--muted); font-size: 12px; } .sug .btn svg { width: 12px; height: 12px; fill: var(--primary); }
.md-side .card .empty { padding: 8px 0; }
#ccTasks .task { padding: 8px; } #ccTasks .tact a.btn { display: none; }
.quickdue { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 1000px) { .md-grid { grid-template-columns: 1fr; } }
/* Quotes */
main#view:has(.q-grid) { max-width: 1400px; }
.q-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin-top: 14px; }
.qh { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.qitems td { vertical-align: top; } .qitems input, .qitems select { width: 100%; } .qdesc { margin-top: 4px; font-size: 12px; }
.qline { padding-top: 16px; font-weight: 600; } .q4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.q-sum { border-top: 4px solid var(--gold); } .ql { display: flex; justify-content: space-between; padding: 6px 0; }
.ql.big { font-size: 20px; font-weight: 700; color: var(--primary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 4px 0; padding: 10px 0; }
.qplan { margin-top: 10px; background: var(--gold-weak); border-left: 4px solid var(--gold); padding: 8px 10px; border-radius: 6px; }
.qbtns { display: flex; flex-wrap: wrap; gap: 6px; } .qbtns .btn svg { width: 12px; height: 12px; fill: currentColor; vertical-align: -1px; }
/* AI agent */
.aiplan { border-top: 4px solid var(--gold); background: linear-gradient(180deg, var(--gold-weak), var(--panel) 120px); }
.aiact { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-top: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.aiact.added { border-color: var(--ok); opacity: .7; } .aiact small { max-width: 55%; text-align: right; }
.aiact .aimsg { min-height: 64px; font-size: 13px; } .aiact .btn svg { width: 12px; height: 12px; fill: currentColor; vertical-align: -1px; }
.aiopps { margin: 0; padding-left: 18px; } .aiopps li { padding: 3px 0; }
@media (max-width: 1000px) { .q-grid { grid-template-columns: 1fr; } }
.qhint { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
/* Companies */
.co { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 12px; display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.co .actions { grid-column: 1 / -1; margin-top: 0; }
.cologo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; } .cologo img { max-width: 190px; max-height: 90px; object-fit: contain; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 6px; }
.colines { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
label.chk { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; color: var(--text); font-size: 13px; }
@media (max-width: 760px) { .co { grid-template-columns: 1fr; } }
.selall { margin: 0 0 8px 12px; font-weight: 600 !important; }
.listtools { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.listtools #listFilter { flex: 1; min-width: 220px; max-width: 520px; } .selall2 { font-weight: 600 !important; font-size: 14px !important; }
.selall2 input { width: 16px; height: 16px; }

/* Dashboard */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font: inherit; color: inherit; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--primary); color: #fff; }
.dk { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.dk .card { margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.dk .card span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.dk .card b { font-size: 24px; color: var(--primary); }
.dk.sm .card b { font-size: 20px; }
.dd { font-size: 12px; font-weight: 600; text-transform: none !important; letter-spacing: 0 !important; }
.dd.up { color: #15803d !important; } .dd.down { color: #b91c1c !important; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbl { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.hbt { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; margin-top: 3px; }
.hbt i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 8px; }
.vb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.vb i { display: block; width: 100%; max-width: 38px; min-height: 2px; background: linear-gradient(var(--gold, #c9a227), #b38b12); border-radius: 4px 4px 0 0; }
.vb span, .vb small { font-size: 11px; color: #6b7280; white-space: nowrap; }
.tk2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.tseg { border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tseg span { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tseg b { font-size: 22px; }
.tseg.hi { background: #fbf6e4; } .tseg.hi .hbt i { background: var(--gold, #c9a227); }
.tseg.lo { background: #eef2fb; }
@media (max-width: 700px) { .tk2 { grid-template-columns: 1fr; } }
.rvbtns { margin: 10px 0 4px; gap: 8px; flex-wrap: wrap; }
.rvbtns .btn { display: inline-flex; align-items: center; gap: 6px; }
.rvbtns .btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* Settings tabs and templates */
.stabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.stabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.stabs a.active { color: var(--primary); border-bottom-color: var(--gold); font-weight: 600; }
.tplbar { gap: 10px; margin-bottom: 12px; flex-wrap: wrap; } .tplbar #tplQ { min-width: 220px; }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tpl { display: flex; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: var(--panel); }
.tpl:hover { border-color: var(--primary); }
.tpl .tb { min-width: 0; flex: 1; } .tpl .row { gap: 8px; } .tpl .pre { font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.star { border: 0; background: none; font-size: 18px; color: #cbd2e0; cursor: pointer; padding: 0; height: 24px; }
.star.on { color: var(--gold); }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--border); background: var(--primary-weak); color: var(--primary); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.tplprev { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 4px; white-space: pre-wrap; min-height: 48px; }
.tplrow { gap: 10px; margin-bottom: 6px; } .tplpick { max-width: 360px; } .small { font-size: 12px; }

/* Automations, pipeline editor, lists */
.rule { display: flex; gap: 14px; align-items: center; } .rule.off { opacity: .65; } .rule .rb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; } .switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--ok); } .switch input:checked + i::after { left: 21px; }
.chkcol { display: flex; flex-direction: column; gap: 8px; }
.hours td { vertical-align: middle; } .hours input[type=time] { width: 120px; }
.funnel-ed .row { gap: 10px; } .funnel-ed .fname { font-weight: 600; font-size: 16px; width: 260px; } .funnel-ed input[type=color] { width: 40px; height: 34px; padding: 2px; }
.stages { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.stage-ed { display: flex; gap: 8px; align-items: center; } .stage-ed input { flex: 1; max-width: 320px; } .stage-ed .ord { display: flex; gap: 2px; }
.addstage { gap: 8px; } .addstage input { max-width: 260px; }
.sidebar .locklink { display: block; margin-top: 18px; padding: 8px 12px; color: #c7cee0; font-size: 13px; } .sidebar .locklink[hidden] { display: none; }
#lock, #setup2fa { position: fixed; inset: 0; z-index: 100; background: linear-gradient(160deg, var(--primary-dark), #13287f); display: flex; align-items: center; justify-content: center; }
.lockbox { background: var(--panel); border-radius: 16px; padding: 32px 36px; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.lockbox img { width: 56px; height: 56px; } .lockbox h2 { margin: 0; font-size: 18px; }
.lockbox input { width: 100%; text-align: center; font-size: 22px; letter-spacing: .3em; } .lockbox .btn { width: 100%; } .lockbox small { color: var(--danger); min-height: 16px; }
.tact .btn svg { width: 12px; height: 12px; fill: currentColor; vertical-align: -1px; }
dialog { background: var(--panel); color: var(--text); }

/* Dark mode */
:root[data-theme="dark"] {
  --bg: #0f1424; --panel: #182036; --text: #e6e9f2; --muted: #9aa3b8; --border: #2a3452; --soft: #222b45;
  --primary: #6d8cff; --primary-dark: #0a1030; --primary-weak: #1f2a4d; --gold-weak: #3a3218; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1424; --panel: #182036; --text: #e6e9f2; --muted: #9aa3b8; --border: #2a3452; --soft: #222b45;
    --primary: #6d8cff; --primary-dark: #0a1030; --primary-weak: #1f2a4d; --gold-weak: #3a3218; color-scheme: dark;
  }
}
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .seg button.active, :root[data-theme="dark"] .modes button.active, :root[data-theme="dark"] .chips button.active { background: #2f54d6; border-color: #2f54d6; }
:root[data-theme="dark"] .tseg.hi, :root[data-theme="dark"] .badge.gold { background: #3a3218; color: #f3d77a; }
:root[data-theme="dark"] .tseg.lo { background: #1f2a4d; }
:root[data-theme="dark"] .badge.ok { background: #14361f; color: #86efac; }
:root[data-theme="dark"] .badge.warn { background: #3d2a0c; color: #fcd34d; }
:root[data-theme="dark"] .badge.blue { background: #1f2a4d; color: #a5b8ff; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .btn.primary, :root[data-theme="auto"] .seg button.active, :root[data-theme="auto"] .modes button.active, :root[data-theme="auto"] .chips button.active { background: #2f54d6; border-color: #2f54d6; }
  :root[data-theme="auto"] .tseg.hi, :root[data-theme="auto"] .badge.gold { background: #3a3218; color: #f3d77a; }
  :root[data-theme="auto"] .tseg.lo { background: #1f2a4d; }
  :root[data-theme="auto"] .badge.ok { background: #14361f; color: #86efac; }
  :root[data-theme="auto"] .badge.warn { background: #3d2a0c; color: #fcd34d; }
  :root[data-theme="auto"] .badge.blue { background: #1f2a4d; color: #a5b8ff; }
}
[hidden] { display: none !important; }
.addcar { gap: 8px; margin-bottom: 12px; } .addcar input[name=name] { min-width: 260px; } .addcar input[name=states] { min-width: 300px; } .carrierhint { display: block; margin-top: 4px; font-weight: 400; }

/* Two-step verification setup */
#setup2fa { overflow: auto; padding: 16px; }
.lockbox.wide2fa { width: min(460px, 100%); align-items: stretch; text-align: left; }
.lockbox.wide2fa h2, .lockbox.wide2fa > img { align-self: center; }
.steps2fa { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps2fa li { line-height: 1.45; }
.qr2fa { background: #fff; width: 190px; margin: 10px 0 6px; border-radius: 8px; }
.qr2fa svg { display: block; width: 100%; height: auto; }
.key2fa { display: block; font-size: 13px; letter-spacing: .08em; word-break: break-all; background: var(--bg, #f3f5fa); padding: 6px 8px; border-radius: 6px; margin-bottom: 4px; }
.lockbox input#lockCode, .steps2fa + label input { letter-spacing: .2em; }
.lockbox input[type="password"] { letter-spacing: .15em; }

/* Client selection bar: stays visible at the bottom of the screen while you scroll */
.bulkbar.floating { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; width: min(760px, calc(100vw - 32px)); margin: 0; box-shadow: 0 10px 30px rgba(10, 20, 60, .35); flex-wrap: wrap; }
.bulkbar .bulkhint { opacity: .75; }
main#view.has-bulkbar { padding-bottom: 96px; }
td.chk { cursor: pointer; width: 44px; }
td.chk input, th.chk input { width: 18px; height: 18px; cursor: pointer; }
@media (max-width: 760px) { .bulkbar .bulkhint { display: none; } .bulkbar.floating { bottom: 12px; } }
tr:has(input[data-sel]:checked) td { background: rgba(201, 162, 39, .14); }

/* Online payments (Stripe) */
.payrow { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border, #e5e7eb); flex-wrap: wrap; }
.payrow:last-of-type { border-bottom: 0; }
.qpay .row { margin-top: 6px; }
.badge.danger { background: #fee2e2; color: #991b1b; }
:root[data-theme="dark"] .badge.danger { background: #3f1515; color: #fca5a5; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .badge.danger { background: #3f1515; color: #fca5a5; } }

/* Inbox */
.inbox { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 14px; align-items: start; }
.ib-list { padding: 6px; max-height: calc(100vh - 190px); display: flex; flex-direction: column; }
.ib-convs { overflow: auto; flex: 1; min-height: 0; }
.ib-tabs, .ib-chs { display: flex; gap: 4px; padding: 4px 4px 8px; flex-wrap: wrap; }
.ib-tabs button, .ib-chs button { border: 1px solid var(--border); background: transparent; color: inherit; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ib-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ib-chs button.active { background: var(--primary-weak); border-color: var(--primary); }
.chip-ch { font-size: 12px; margin-left: 4px; }
.ib-img { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; margin-bottom: 4px; }
.ib-file { display: inline-block; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.08); color: inherit; margin-bottom: 4px; }
.ib-files { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-files:empty { display: none; }
.ib-fchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; background: var(--soft); font-size: 12px; }
.ib-fchip button { border: 0; background: none; cursor: pointer; color: inherit; }
.ib-compose select { max-width: 200px; }
.btn.off { opacity: .5; pointer-events: none; }
.ib-conv { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.ib-conv > div { flex: 1; min-width: 0; }
.ib-conv small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-conv:hover { background: var(--soft); } .ib-conv.sel { background: var(--primary-weak); }
.ib-conv.unread strong { font-weight: 800; }
.ib-thread { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 420px; padding: 0; }
.ib-head { padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.ib-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 72%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.bubble small { display: block; opacity: .7; font-size: 11px; margin-top: 3px; }
.bubble.in { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ib-compose { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.ib-compose textarea { min-height: 70px; }
.ib-compose input { flex: 1; }
@media (max-width: 800px) { .inbox { grid-template-columns: 1fr; } .ib-list { max-height: 260px; } }

/* AI assistant action cards */
.actioncard { margin: 6px 0 12px; border-left: 4px solid var(--primary); }
.actioncard.danger { border-left-color: var(--danger); }
.asample { margin: 8px 0; padding-left: 18px; }
.asample li { margin: 2px 0; }

/* ---------- Crown AI bubble ---------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 80; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #2a55e0, #14308c); color: #fff; font-size: 26px; box-shadow: 0 10px 28px rgba(20, 48, 140, .45), 0 0 0 3px var(--gold);
  display: flex; align-items: center; justify-content: center; transition: transform .18s ease, box-shadow .18s ease; }
.ai-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(20, 48, 140, .55), 0 0 0 3px var(--gold); }
.ai-fab.open { transform: rotate(-12deg) scale(.94); }
.ai-dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.ai-panel { position: fixed; right: 22px; bottom: 94px; z-index: 90; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px));
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 60px rgba(10, 20, 60, .35);
  display: flex; flex-direction: column; overflow: hidden; animation: aiIn .18s ease-out; }
.ai-panel[hidden] { display: none; }
.ai-panel.wide { width: min(760px, calc(100vw - 32px)); height: calc(100vh - 120px); }
@keyframes aiIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; background: linear-gradient(135deg, #1d3fae, #13287f); color: #fff; }
.ai-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 0 0 2px var(--gold); }
.ai-title { display: flex; flex-direction: column; line-height: 1.2; } .ai-title small { opacity: .8; font-size: 12px; }
.ai-ico { background: transparent; border: 0; color: #fff; opacity: .85; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.ai-ico:hover { background: rgba(255,255,255,.14); opacity: 1; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ai-welcome { text-align: center; margin: auto 8px; color: var(--muted); } .ai-welcome h3 { color: var(--text); margin: 6px 0; } .ai-big { font-size: 40px; }
.ai-msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; font-size: 14px; word-wrap: break-word; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin: 0; } .ai-msg ul { margin: 4px 0 6px; padding-left: 18px; } .ai-msg code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.ai-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.ai-msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.ai-msg.typing { display: flex; gap: 4px; padding: 14px; } .ai-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: aiDot 1s infinite ease-in-out; }
.ai-msg.typing i:nth-child(2) { animation-delay: .15s; } .ai-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.ai-card { align-self: stretch; background: var(--panel); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px; padding: 12px 14px; box-shadow: 0 4px 14px rgba(10,20,60,.08); }
.ai-card.danger { border-left-color: var(--danger); } .ai-card.err { border-left-color: var(--warn); } .ai-card.err small { display: block; color: var(--muted); margin-top: 4px; }
.ai-card.settled { opacity: .85; }
.ai-card-head { display: flex; gap: 10px; align-items: flex-start; } .ai-card-head small { display: block; color: var(--muted); margin-top: 2px; font-size: 12px; }
.ai-card-ic { font-size: 20px; line-height: 1.2; }
.ai-sample { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.ai-sample span { background: var(--soft); border-radius: 999px; padding: 3px 10px; font-size: 12px; } .ai-sample .more { background: transparent; color: var(--muted); }
.ai-btns { display: flex; gap: 8px; margin-top: 12px; } .ai-btns .big { flex: 1; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.ai-btns .btn.danger.big { background: var(--danger); color: #fff; border-color: var(--danger); }
.ai-warn { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fee2e2; color: #991b1b; font-size: 13px; }
.ai-status { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--muted); } .ai-status.ok { color: var(--ok); } .ai-status.bad { color: var(--danger); }
.ai-chips { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; background: var(--panel); }
.ai-chip { flex-shrink: 0; border: 1px solid var(--border); background: var(--panel); color: var(--primary); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.ai-chip:hover { background: var(--primary-weak); }
.ai-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: var(--panel); }
.ai-input textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; font: inherit; font-size: 14px; max-height: 140px; background: var(--bg); color: var(--text); }
.ai-input textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.ai-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.ai-send:disabled { opacity: .45; cursor: default; }
.ai-foot { text-align: center; font-size: 11px; color: var(--muted); padding: 0 12px 10px; background: var(--panel); }
.newver { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 95; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(10,20,60,.25); display: flex; gap: 10px; align-items: center; }
:root[data-theme="dark"] .ai-warn { background: #3f1515; color: #fca5a5; } :root[data-theme="dark"] .ai-msg code { background: rgba(255,255,255,.1); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .ai-warn { background: #3f1515; color: #fca5a5; } }
@media (max-width: 640px) {
  .ai-panel, .ai-panel.wide { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .ai-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  #aiWide { display: none; }
  .ai-panel:not([hidden]) ~ .ai-fab, .ai-fab.open { display: none; }
  #toast { bottom: 84px; }
}

/* Phones: wide tables scroll inside their box instead of stretching the page sideways (which also pushed the AI button off-screen). */
@media (max-width: 760px) {
  html, body { overflow-x: clip; }
  main#view table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 640px) { .ai-input { padding-bottom: max(10px, env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .ai-panel, .ai-fab, .ai-msg.typing i { animation: none; transition: none; } }
.newver { background: var(--primary-dark); color: #fff; border: 0; font-size: 14px; }

/* ---------- Calendar ---------- */
.cal { padding: 12px; }
.cal-bar { gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-title { margin: 0 8px; font-size: 18px; }
.cal-dow, .cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow div { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; text-transform: uppercase; }
.cal-cells { border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-cell { min-height: 108px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell.out { background: var(--soft); opacity: .65; }
.cal-num button { border: 0; background: none; color: inherit; font-weight: 600; font-size: 12px; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; }
.cal-num button:hover { background: var(--primary-weak); }
.cal-cell.today .cal-num button { background: var(--primary); color: #fff; }
.cal-ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--primary); background: var(--primary-weak); color: var(--text); border-radius: 5px; padding: 2px 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev.web { border-left-color: var(--gold); background: var(--gold-weak); }
.cal-ev.task { border-left-color: var(--muted); background: var(--soft); }
.cal-ev.block { border-left-color: var(--danger); background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 6px, transparent 6px, transparent 12px); }
.cal-ev.done, .cal-ev.cancelled, .cal-ev.no_show { opacity: .55; text-decoration: line-through; }
.cal-ev.confirmed { border-left-color: var(--ok); }
.cal-more { border: 0; background: none; color: var(--primary); font-size: 12px; text-align: left; cursor: pointer; padding: 0 6px; }
.cal-day { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cal-dhead, .cal-allday, .cal-hours { display: grid; grid-template-columns: 56px repeat(var(--cols, 1), minmax(0, 1fr)); }
.cal-day.week .cal-dhead, .cal-day.week .cal-allday, .cal-day.week .cal-hours { --cols: 7; }
.cal-dhead > div { padding: 6px; text-align: center; border-left: 1px solid var(--border); font-weight: 600; }
.cal-dhead > div:first-child, .cal-allday > div:first-child { border-left: 0; }
.cal-dhead button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.cal-dhead .today button { color: var(--primary); }
.cal-allday { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-allday > div { padding: 4px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-height: 30px; font-size: 11px; }
.cal-hours { max-height: calc(100vh - 330px); min-height: 360px; overflow: auto; }
.cal-times div { height: var(--px); font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; }
.cal-col { position: relative; border-left: 1px solid var(--border); }
.cal-slot { height: var(--px); border-bottom: 1px solid var(--border); cursor: pointer; }
.cal-slot:hover { background: var(--primary-weak); }
.cal-block { position: absolute; left: 3px; right: 3px; }
.cal-block .cal-ev { height: 100%; white-space: normal; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cal-block.short .cal-ev { white-space: nowrap; font-size: 11px; padding-top: 1px; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); pointer-events: none; }
.share-av { display: grid; gap: 12px; }
.share-av .card.soft { background: var(--soft); box-shadow: none; padding: 12px; }
.share-av p { margin: 4px 0 8px; }
.share-av textarea { width: 100%; font-family: inherit; }
.share-av .row input { flex: 1; }
.share-av summary { cursor: pointer; }
@media (max-width: 800px) {
  .cal-cell { min-height: 64px; } .cal-cell .cal-ev { font-size: 0; height: 6px; padding: 0; border-left-width: 0; border-radius: 3px; }
  .cal-cell .cal-ev b { display: none; }
  .cal-day.week .cal-dhead, .cal-day.week .cal-allday, .cal-day.week .cal-hours { min-width: 700px; }
  .cal-day.week { overflow-x: auto; }
}

/* ---------- Phones and tablets ---------- */
.navtoggle, .tabbar { display: none; }
.cc-grid > * { min-width: 0; }
.stabs { overflow-x: auto; scrollbar-width: none; } .stabs::-webkit-scrollbar { display: none; } .stabs a { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 900px) {
  body { flex-direction: column; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  /* Top bar with the logo and a ☰ menu instead of the side menu */
  .sidebar { position: sticky; top: 0; z-index: 30; width: auto; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); }
  .brand { padding: 0; font-size: 17px; flex: 1; } .brand img { width: 30px; height: 30px; }
  .navtoggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 11px; background: rgba(255,255,255,.1); border: 0; border-radius: 10px; cursor: pointer; }
  .navtoggle span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  .sidebar.open .navtoggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .sidebar.open .navtoggle span:nth-child(2) { opacity: 0; }
  .sidebar.open .navtoggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .sidebar nav, .sidebar .locklink { display: none; }
  .sidebar.open nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: absolute; top: 100%; left: 0; right: 0; padding: 12px 14px 16px; background: #13287f; box-shadow: 0 18px 40px rgba(0,0,0,.35); max-height: calc(100dvh - 120px); overflow-y: auto; }
  .sidebar.open nav a { margin: 0; padding: 13px 12px; font-size: 15px; background: rgba(255,255,255,.06); }
  .sidebar.open nav a.active { background: var(--gold); color: var(--primary-dark); }
  .sidebar.open .locklink:not([hidden]) { display: block; position: absolute; top: 8px; right: 66px; padding: 12px 8px; color: #d1d5db; }
  /* Search on its own row, buttons below */
  .topbar { position: static; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .search { flex: 1 1 auto; max-width: none; }
  .topbar > .btn { white-space: nowrap; }
  .funnel-tabs, .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px 2px; }
  .funnel-tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .funnel-tabs button, .chips > * { flex-shrink: 0; white-space: nowrap; }
  .md-head { flex-wrap: wrap; align-items: center; } .md-head > div:first-child { flex: 1 1 100%; } .md-head .spacer { display: none; }
  .md-head > .btn { flex: 1 1 auto; white-space: nowrap; }
  main#view { padding: 14px; }
  h1 { font-size: 20px; }
  .tabs, .cc-center .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } .tabs button { white-space: nowrap; flex-shrink: 0; }
  html, body { overflow-x: clip; }
  main#view table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .board { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .col { min-width: min(78vw, 300px); flex: 0 0 min(78vw, 300px); scroll-snap-align: start; max-height: none; }
  .g2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: minmax(90px, 35%) 1fr; }
  /* Pop-up windows slide up from the bottom and fill the width */
  dialog, dialog.wide { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog form { padding: 18px 16px 0; }
  .form { grid-template-columns: 1fr; }
  dialog .actions { position: sticky; bottom: 0; z-index: 2; background: var(--panel); margin: 18px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  /* Bottom tab bar for the pages used most */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--panel); border-top: 1px solid var(--border); padding: 4px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left)); box-shadow: 0 -4px 16px rgba(15,33,103,.06); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 7px; font-size: 11px; color: var(--muted); position: relative; border-radius: 10px; }
  .tabbar a i { font-style: normal; font-size: 20px; line-height: 1.1; filter: grayscale(1); opacity: .75; }
  .tabbar a.active { color: var(--primary); font-weight: 600; }
  .tabbar a.active i { filter: none; opacity: 1; }
  .tabbar .navbadge { float: none; position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
  .ai-fab { bottom: calc(74px + env(safe-area-inset-bottom)); }
  #toast { left: 14px; right: 14px; max-width: none; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .bulkbar.floating { bottom: calc(70px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .search { flex-basis: 100%; }
  .topbar > .btn { flex: 1 1 0; padding: 7px 10px; font-size: 13px; min-height: 38px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g4 .card, .g4.card { padding: 14px; }
  .stat .n { font-size: 22px; }
}
@media (max-width: 900px) and (pointer: coarse), (max-width: 640px) {
  /* 16px text in fields stops the iPhone from zooming in when you tap one */
  input, select, textarea, .search input { font-size: 16px; }
}
@media (pointer: coarse) {
  .btn { min-height: 40px; } .btn.sm { min-height: 34px; padding: 6px 11px; font-size: 13px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  .tabs button, .stabs a { padding-top: 12px; padding-bottom: 12px; }
}

:root[data-theme="dark"] .tabbar { background: var(--panel); }
@media (max-width: 640px) {
  .ai-head { padding-top: max(14px, env(safe-area-inset-top)); }
  #lock, #setup2fa { padding: max(16px, env(safe-area-inset-top)) 16px 16px; overflow-y: auto; align-items: flex-start; }
  #lock > *, #setup2fa > * { margin-top: 8vh; max-width: 100%; }
}

/* Calls and email in the inbox */
.ib-subj { font-weight: 600; margin-bottom: 4px; }
.ib-via { align-self: flex-start; }
.callrow { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.callrow:last-child { border-bottom: 0; }
.callrow.missed strong { color: var(--danger, #c0392b); }
.callicon { width: 22px; text-align: center; font-weight: 700; color: var(--primary); }
.callrow.missed .callicon { color: var(--danger, #c0392b); }
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rec audio { height: 34px; max-width: 100%; flex: 1 1 220px; }

/* Message composer (texts and emails) */
.composer.msgmode { padding: 8px; }
.mc { display: flex; flex-direction: column; gap: 8px; position: relative; }
.mc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-ch button { padding: 7px 14px; font-weight: 600; }
.mc.sms .mc-ch button.active { background: var(--ok); }
.mc-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mc-from { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.mc-from select { max-width: 280px; min-width: 0; padding: 5px 8px; width: auto; }
.mc-ch button { white-space: nowrap; }
.mc textarea { min-height: 76px; resize: vertical; background: var(--panel); font-size: 15px; line-height: 1.4; }
.mc-warn { background: var(--gold-weak); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.mc-files { display: flex; gap: 6px; flex-wrap: wrap; } .mc-files:empty { display: none; }
.mc-sig { border-left: 3px solid var(--gold); padding: 4px 10px; font-size: 13px; background: var(--panel); border-radius: 0 6px 6px 0; }
.mc-sig.none { border-left-color: var(--border); }
.mc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-tools { display: flex; gap: 2px; align-items: center; }
label.mc-ic, .mc-ic { flex-direction: row; font-weight: 400; border: 1px solid transparent; background: none; font-size: 19px; line-height: 1; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: inherit; display: inline-flex; align-items: center; gap: 4px; min-width: 38px; min-height: 38px; justify-content: center; }
.mc-ic:hover { background: var(--soft); border-color: var(--border); }
.mc-ic.off { opacity: .4; cursor: not-allowed; }
.mc-ic.ai span { font-size: 13px; font-weight: 600; }
.mc-count { flex: 1; text-align: right; }
.mc-send { min-height: 38px; padding: 8px 16px; }
.mc-pop { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 33, 103, .12); padding: 8px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.mc-pop[hidden] { display: none; }
.emo-tabs { display: flex; align-items: center; gap: 4px; }
.emo-tabs button { border: 0; background: none; font-size: 18px; padding: 4px 8px; border-radius: 8px; cursor: pointer; color: inherit; }
.emo-tabs button.active { background: var(--primary-weak); }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.emo-grid button { border: 0; background: none; font-size: 22px; padding: 4px; border-radius: 8px; cursor: pointer; }
.emo-grid button:hover { background: var(--soft); }
.tpl-list { display: flex; flex-direction: column; gap: 4px; }
.tpl-list button { text-align: left; border: 1px solid var(--border); background: var(--bg); border-radius: 8px; padding: 6px 10px; cursor: pointer; color: inherit; font: inherit; }
.tpl-list button:hover { border-color: var(--primary); }
.mc-pop input { width: 100%; }
.letter-prev { white-space: pre-wrap; font-size: 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 220px; overflow: auto; }
.myname { align-items: flex-end; gap: 8px; margin-bottom: 8px; } .myname label { flex: 1; max-width: 360px; }
@media (max-width: 640px) {
  .mc-to { display: none; }
  .mc-from { flex: 1 1 100%; } .mc-from select { flex: 1; max-width: none; width: 100%; }
  .mc-ch { flex: 1; } .mc-ch button { flex: 1; }
  .mc-ic.ai span { display: none; }
  .mc-count { flex: 1 1 100%; order: 3; text-align: left; }
  .mc-send { margin-left: auto; }
  .mc textarea { font-size: 16px; }
}

.cardrow { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); }
.cardrow:first-of-type { border-top: 0; }

/* Invoices */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; } .kpi b { font-size: 22px; } .kpi b.danger { color: var(--danger); }
.inv-items { display: grid; gap: 6px; margin: 6px 0; }
.inv-line { display: grid; grid-template-columns: 1fr 64px 100px auto; gap: 6px; align-items: center; }
.inv-trip { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--soft); }
table.mini { width: 100%; font-size: 13px; } table.mini td { padding: 3px 0; border: 0; }
@media (max-width: 560px) { .inv-line { grid-template-columns: 1fr 52px 84px auto; } }

.costripe { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: grid; gap: 6px; }
.costripe .form { margin: 0; }
.costripe > .btn { justify-self: start; }

/* ===================== HighLevel-style layout (2026-11-29) ===================== */
/* Side menu: icons + labels, grouped, folds to icons on a computer */
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: 232px; padding: 16px 10px 10px; transition: width .18s; }
.sidebar nav { flex: 1; overflow-y: auto; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; font-size: 14px; white-space: nowrap; }
.sidebar nav a svg, .navcollapse svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.sidebar nav a span:not(.navbadge) { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav a .navbadge { float: none; }
.navlbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #93a3d8; padding: 14px 10px 5px; }
.navlbl.navend { border-top: 1px solid rgba(255,255,255,.1); margin-top: 10px; padding: 6px 0 0; }
.navcollapse { align-self: flex-end; background: rgba(255,255,255,.08); border: 0; color: #cbd5e1; border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; margin-top: 6px; }
.navcollapse:hover { background: rgba(255,255,255,.16); color: #fff; }
.sidebar .locklink { color: #cbd5e1; padding: 6px 10px; font-size: 13px; }
body.nav-small .sidebar { width: 68px; }
body.nav-small .sidebar .brand span, body.nav-small .sidebar nav a span:not(.navbadge), body.nav-small .navlbl:not(.navend) { display: none; }
body.nav-small .navlbl:not(.navend) + a { margin-top: 10px; }
body.nav-small .sidebar nav a { justify-content: center; position: relative; padding: 10px 0; }
body.nav-small .sidebar nav a .navbadge { position: absolute; top: 2px; right: 4px; padding: 0 5px; font-size: 10px; }
body.nav-small .brand { justify-content: center; padding: 0 0 18px; }
body.nav-small .navcollapse { align-self: center; } body.nav-small .navcollapse svg { transform: rotate(180deg); }
body.nav-small .sidebar .locklink { font-size: 0; text-align: center; } body.nav-small .sidebar .locklink::first-letter { font-size: 16px; }

/* Section tabs under the top bar (Conversations · Calls · Templates, etc.) */
.subnav { display: flex; gap: 2px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; position: sticky; top: 63px; z-index: 4; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 11px 14px 10px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.subnav a:hover { color: var(--text); }
.subnav a.active { color: var(--primary); border-bottom-color: var(--gold); font-weight: 600; }
main#view { max-width: 1400px; }

/* Top bar: Charge + Create menu */
.topbar #chargeBtn { white-space: nowrap; }
.qadd { position: relative; }
.qadd > .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.qadd > .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.qadd-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(15,33,103,.16); padding: 6px; min-width: 220px; z-index: 40; display: flex; flex-direction: column; }
.qadd-menu[hidden] { display: none; }
.qadd-menu button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; }
.qadd-menu button:hover { background: var(--primary-weak); }

/* KPI tiles used by Payments, Invoices and Reputation */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi > small:first-child { color: var(--muted); font-size: 12px; } .kpi b { font-size: 22px; color: var(--primary); }

/* Conversations: list · chat · contact details (3 panes on a computer) */
.inbox { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) 280px; }
.ib-side { padding: 16px; max-height: calc(100vh - 230px); overflow: auto; }
.ib-side:empty { display: none; }
.ibs-top { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; } .ibs-top .avatar { width: 44px; height: 44px; font-size: 15px; }
.ibs-kv { display: grid; gap: 8px; margin-bottom: 12px; } .ibs-kv > div { display: flex; flex-direction: column; min-width: 0; } .ibs-kv a { overflow-wrap: anywhere; }
.ibs-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.ib-side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0; }
.ibs-deal { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; color: var(--text); }
.ib-back { display: none; }
.ib-hbtn svg { width: 14px; height: 14px; vertical-align: -2px; fill: currentColor; }
.ib-head { flex-wrap: nowrap; } .ib-head > div { min-width: 0; } .ib-head strong { white-space: nowrap; }
@media (max-width: 1280px) { .inbox { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); } .ib-side { display: none; } }
.mc.compact .mc-sig { display: none; }

/* Payments */
.paytx { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); padding: 4px 0; }
.paytx:last-child { border-bottom: 0; }
.paytx-who { display: flex; align-items: center; gap: 8px; width: 210px; flex-shrink: 0; color: var(--text); min-width: 0; }
.paytx-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paytx .payrow { flex: 1; min-width: 0; border: 0; }
.tapinfo h3 { margin: 0 0 6px; }
.payqr-mini { display: flex; gap: 12px; align-items: center; } .payqr-mini svg { width: 120px; height: 120px; flex-shrink: 0; }

/* Charge now (made for the phone) */
.charge { max-width: 560px; margin: 0 auto; }
.charge-card h1 { margin-bottom: 6px; }
.ch-who { display: flex; } .ch-who button { flex: 1; padding: 10px; font-weight: 600; }
.ch-amt-in { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--panel); }
.ch-amt-in i { font-style: normal; font-size: 28px; color: var(--muted); }
.ch-amt-in input { border: 0; font-size: 32px; font-weight: 700; padding: 10px 6px; width: 100%; color: var(--primary); background: transparent; outline: none; }
.ch-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.ch-btns .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; font-size: 16px; font-weight: 700; min-height: 64px; }
.ch-btns .btn small { font-size: 11.5px; font-weight: 400; opacity: .85; }
.qr-card { text-align: center; }
.qr-amt { font-size: 40px; font-weight: 800; color: var(--primary); }
.qr-box { background: #fff; border-radius: 16px; padding: 12px; margin: 16px auto; width: min(78vw, 320px); box-shadow: 0 0 0 3px var(--gold); }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-box.big { width: min(80vw, 360px); }
.qr-done { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin: 20px auto 8px; font-size: 52px; background: #dcfce7; color: #15803d; }
.qr-done.wait { background: var(--gold-weak); } .qr-done.no { background: #fee2e2; color: var(--danger); }
.qr-card.paid { border-color: #86efac; box-shadow: 0 0 0 3px #bbf7d0; }
.qr-acts { justify-content: center; margin: 12px 0; }
.center { text-align: center; }

/* Sites & forms */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 14px 0; }
.site { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-ic { font-size: 26px; } .site-t { flex: 1; min-width: 0; }
.site-url { background: var(--soft); border-radius: 8px; padding: 6px 8px; font-size: 12px; overflow-wrap: anywhere; }
.opp-list .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

:root[data-theme="dark"] .qr-box { background: #fff; }

/* ---------- Phones and tablets ---------- */
@media (max-width: 900px) {
  .sidebar { height: auto; width: auto; flex-direction: row; transition: none; }
  body.nav-small .sidebar { width: auto; } body.nav-small .sidebar .brand span { display: inline; }
  .navcollapse { display: none; }
  .sidebar.open nav { display: grid; }
  .sidebar.open nav .navlbl { grid-column: 1 / -1; padding: 8px 2px 0; }
  .sidebar.open nav .navlbl.navend { border: 0; margin: 0; padding: 4px 0 0; }
  .sidebar.open nav a { display: flex !important; justify-content: flex-start !important; }
  .sidebar.open nav a span:not(.navbadge) { display: inline !important; }
  .subnav { position: static; padding: 0 8px; }
  .subnav a { padding: 11px 12px 10px; }
  .qadd-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); min-width: 0; }
  .qadd-menu button { padding: 14px; font-size: 16px; }
  .inbox { grid-template-columns: 1fr; }
  .ib-side { display: none; }
  /* Conversations on a phone: first the list (full height)… */
  .inbox.ib-listmode .ib-thread { display: none; }
  .inbox.ib-listmode .ib-list { max-height: none; padding: 4px; }
  .ib-conv { padding: 12px 8px; }
  .ib-twilio { padding: 12px 14px; font-size: 13px; }
  .ib-pagehead h1 { margin-bottom: 0; }
  .hide-sm, .ib-autolbl { display: none; }
  /* …then the chat full screen, like Messages or WhatsApp */
  .inbox.ib-chatmode .ib-list { display: none; }
  body.ib-full { padding-bottom: 0; }
  body.ib-full .sidebar, body.ib-full .topbar, body.ib-full .subnav, body.ib-full .tabbar, body.ib-full .ai-fab, body.ib-full .ib-pagehead, body.ib-full .ib-twilio { display: none !important; }
  body.ib-full main#view { padding: 0; }
  body.ib-full .ib-thread { position: fixed; left: 0; right: 0; top: 0; height: 100dvh; min-height: 0; z-index: 30; margin: 0; border: 0; border-radius: 0; }
  .ib-head { padding: max(8px, env(safe-area-inset-top)) 10px 8px 4px; gap: 6px; background: var(--panel); }
  .ib-back { display: grid; place-items: center; width: 40px; height: 40px; font-size: 34px; line-height: 1; color: var(--primary); flex-shrink: 0; }
  .ib-head .avatar { display: none; }
  .ib-head > div { flex: 1; } .ib-head strong { display: block; overflow: hidden; text-overflow: ellipsis; }
  .ib-head .spacer { display: none; }
  .ib-hbtn { padding: 0 !important; width: 40px; min-height: 40px !important; justify-content: center; display: inline-flex; align-items: center; font-size: 16px !important; }
  .ib-hbtn span, .ib-openc { display: none !important; }
  .ib-msgs { padding: 12px 10px; background: var(--bg); }
  .bubble { max-width: 85%; }
  .ib-compose { padding: 8px 10px max(8px, env(safe-area-inset-bottom)); gap: 6px; }
  .mc.compact { gap: 6px; }
  .mc.compact .mc-top { flex-wrap: nowrap; }
  .mc.compact .mc-ch { flex: 0 0 auto; } .mc.compact .mc-ch button { padding: 6px 10px; font-size: 13px; }
  .mc.compact .mc-from { flex: 1 1 auto; } .mc.compact .mc-from > span { display: none; }
  .mc.compact .mc-from select { font-size: 14px; padding: 6px 8px; }
  .mc.compact textarea { min-height: 44px; border-radius: 20px; padding: 10px 14px; resize: none; }
  .mc.compact .mc-bar { flex-wrap: nowrap; } .mc.compact .mc-count { display: none; }
  .mc.compact .mc-ic { padding: 6px; font-size: 18px; }
  .mc.compact .mc-send { border-radius: 20px; padding: 8px 14px; white-space: nowrap; }
  .mc.compact > small.muted { display: none; }
  .paytx { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
  .paytx-who { width: auto; }
  .charge-card { padding: 16px; }
}
@media (max-width: 640px) {
  .topbar > .btn, .qadd { flex: 1 1 0; } .qadd > .btn { width: 100%; justify-content: center; min-height: 38px; padding: 7px 10px; font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi b { font-size: 19px; }
  .ch-btns .btn { font-size: 15px; }
}
.charge .form { grid-template-columns: 1fr 1fr; } .charge .form > * { min-width: 0; } .charge .form select, .charge .form input { width: 100%; min-width: 0; }
.ib-hbtn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
@media (max-width: 900px) {
  .charge .form { grid-template-columns: 1fr; }
  .ib-pagehead { flex-wrap: nowrap; } .ib-pagehead h1 { font-size: 19px; } .ib-pagehead .btn { white-space: nowrap; }
}
.qadd-menu { z-index: 90; }
@media (max-width: 900px) { .ib-pagehead h1 { display: none; } .ib-pagehead .spacer { display: block; } }

/* Phone polish (2026-11-29 b): one compact top row, tables that scroll instead of squeezing, tidy headers */
@media (max-width: 640px) {
  .topbar { flex-wrap: nowrap; gap: 6px; padding: 8px 10px; }
  .search { flex: 1 1 auto; flex-basis: auto; min-width: 0; }
  .search input { padding: 9px 12px; }
  .topbar > #chargeBtn, .qadd { flex: 0 0 auto; }
  .topbar > #chargeBtn span, .qadd > .btn span { display: none; }
  .topbar > #chargeBtn, .qadd > .btn { width: 44px; min-height: 40px; padding: 0; justify-content: center; display: inline-flex; align-items: center; font-size: 18px; }
  .qadd > .btn svg { width: 20px; height: 20px; }
  .search-results { position: fixed; left: 8px; right: 8px; top: auto; }
  main#view { padding: 12px; }
  main#view > .row:first-child { flex-wrap: wrap; row-gap: 8px; }
  main#view > .row:first-child h1 { margin: 0; flex: 1 1 auto; }
  main#view table td, main#view table th { white-space: nowrap; }
  main#view table td small, main#view table td .muted { white-space: nowrap; }
  #period { display: flex; overflow-x: auto; max-width: 100%; scrollbar-width: none; } #period::-webkit-scrollbar { display: none; }
  #period button { white-space: nowrap; flex-shrink: 0; }
  .card { padding: 14px; }
  .ai-fab { width: 48px; height: 48px; right: 12px; }
}
/* Phone fixes from alex's iPhone screenshots (2026-11-29 c) */
@media (max-width: 900px) {
  /* Header below the iPhone clock/battery bar (installed app) */
  .sidebar { padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); }
  /* Single-column grids must never grow wider than the screen because of a long name or message */
  .inbox, .md-grid, .cc-grid, .q-grid, .g2, .tk2, .co, .form, .charge .form { grid-template-columns: minmax(0, 1fr); }
  .inbox > *, .md-grid > *, .cc-grid > *, .q-grid > *, .g2 > *, .card, main#view > * { min-width: 0; max-width: 100%; }
  .main, main#view { min-width: 0; max-width: 100vw; }
  .ib-conv .row { flex-wrap: nowrap; } .ib-conv .row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .ib-conv .row small { flex-shrink: 0; }
  /* Room at the bottom so the ✨ button never hides the last item */
  main#view { padding-bottom: 84px; }
  body.ib-full main#view { padding-bottom: 0; }
}
@media (max-width: 900px) { .cc-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); } .cc-actions > * { min-width: 0; } }

/* Workflows builder */
.wf-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 16px; align-items: start; margin: 12px 0 16px; }
.wf-canvas { display: flex; flex-direction: column; align-items: center; padding: 20px 8px; border-radius: 14px; min-width: 0;
  background: radial-gradient(circle, #1d3fae22 1px, transparent 1px) 0 0 / 18px 18px, var(--card, #fff); border: 1px solid var(--line, #e3e8f2); }
.wf-node { display: flex; gap: 12px; align-items: flex-start; width: min(100%, 380px); background: var(--card, #fff); border: 2px solid var(--line, #dfe5f0);
  border-left: 5px solid #1d3fae; border-radius: 12px; padding: 12px 14px; cursor: pointer; box-shadow: 0 2px 8px #0f216712; overflow-wrap: anywhere; }
.wf-node:hover { border-color: #1d3fae66; }
.wf-node.sel { border-color: #c9a227; box-shadow: 0 0 0 3px #c9a22744; }
.wf-node.trigger { border-left-color: #c9a227; } .wf-node.wait { border-left-color: #8a94a6; } .wf-node.email { border-left-color: #0ea5e9; }
.wf-node.task { border-left-color: #16a34a; } .wf-node.add_tag, .wf-node.remove_tag { border-left-color: #9333ea; }
.wf-node.end { cursor: default; border-left-color: #0f2167; width: auto; padding: 8px 16px; }
.wf-ic { font-size: 20px; line-height: 1.2; }
.wf-link { position: relative; display: flex; justify-content: center; height: 44px; }
.wf-link::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #1d3fae55; }
.wf-add { position: relative; align-self: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #1d3fae; background: #fff; color: #1d3fae; font-weight: 700; cursor: pointer; line-height: 1; }
.wf-add:hover { background: #1d3fae; color: #fff; }
.wf-menu { position: absolute; top: 36px; z-index: 20; background: var(--card, #fff); border: 1px solid var(--line, #dfe5f0); border-radius: 10px; box-shadow: 0 8px 24px #0f216730; padding: 6px; display: grid; min-width: 190px; }
.wf-menu button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.wf-menu button:hover { background: #1d3fae14; }
.wf-edit { position: sticky; top: 12px; }
.wf-name { font-size: 20px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 4px 8px; border-radius: 8px; min-width: 0; flex: 1; max-width: 460px; }
.wf-name:hover, .wf-name:focus { border-color: var(--line, #dfe5f0); background: var(--card, #fff); }
@media (max-width: 900px) { .wf-wrap { grid-template-columns: minmax(0, 1fr); } .wf-edit { position: static; } }

.me-tag { margin-top: auto; padding: 10px 14px; font-size: 13px; color: inherit; opacity: .85; overflow-wrap: anywhere; }
.me-tag small { opacity: .7; text-transform: capitalize; }
body.nav-small .me-tag b, body.nav-small .me-tag small { display: none; }
.wf-head { flex-wrap: wrap; }
@media (max-width: 900px) { .wf-name { order: 9; flex: 1 1 100%; max-width: none; } }

/* Social planner */
.sp-post{margin-bottom:10px}.sp-thumb{width:84px;height:84px;object-fit:cover;border-radius:10px;flex:none}.sp-text{white-space:pre-wrap;margin-top:6px;font-size:14px;max-height:9.5em;overflow:hidden}.sp-ai{background:var(--gold-weak,#fbf5e1);border-radius:10px;padding:10px}.danger-text{color:#b42318}
.sp-acct{padding:8px 0;border-top:1px solid var(--line,#e5e7eb)}.sp-acct select{max-width:180px}.sp-ico{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;color:#fff;font-weight:700;flex:none}.sp-ico.facebook{background:#1877f2}.sp-ico.instagram{background:linear-gradient(45deg,#f09433,#dc2743,#bc1888)}.sp-ico.tiktok{background:#111}.sp-targets{display:flex;flex-wrap:wrap;gap:6px 14px;margin:4px 0}
.ai-draft .ai-lbl{display:flex;flex-direction:row;text-align:left;gap:8px;align-items:center;font-size:12px;color:var(--muted);margin-top:8px}.ai-draft .ai-lbl select,.ai-draft .ai-lbl input{flex:1;min-width:0}.ai-draft-body{width:100%;margin-top:8px;font:inherit;font-size:14px;border:1px solid var(--border);border-radius:10px;padding:8px;background:var(--bg,#fff);color:inherit;resize:vertical}#toast .btn{margin-left:8px}#mcHint{width:100%;font:inherit;font-size:14px;margin:6px 0}

/* Dashboard command center: glass cards on a royal-blue panel with gold accents */
.hero-x{--hx-gold:#e6c158;position:relative;display:grid;grid-template-columns:repeat(12,1fr);gap:14px;padding:16px;margin:4px 0 20px;border-radius:22px;overflow:hidden;color:#eef2ff;
  background:radial-gradient(120% 90% at 0% 0%,#2a47c9 0%,transparent 55%),radial-gradient(90% 80% at 100% 100%,rgba(230,193,88,.35) 0%,transparent 55%),linear-gradient(135deg,#0f1f6b 0%,#13207a 45%,#0a1450 100%);
  box-shadow:0 18px 50px rgba(15,33,103,.35)}
.hero-x::before{content:"";position:absolute;inset:-40% -10% auto auto;width:420px;height:420px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.12),transparent 60%);pointer-events:none}
.hx-card{position:relative;grid-column:span 4;min-width:0;padding:16px;border-radius:18px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);
  backdrop-filter:blur(14px) saturate(140%);-webkit-backdrop-filter:blur(14px) saturate(140%);box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
  transition:transform .25s ease,background .25s ease,box-shadow .25s ease;animation:hxIn .5s ease both}
.hx-card:hover{transform:translateY(-3px);background:rgba(255,255,255,.12);box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 12px 28px rgba(0,0,0,.25)}
.hx-card:nth-child(2){animation-delay:.05s}.hx-card:nth-child(3){animation-delay:.1s}.hx-card:nth-child(4){animation-delay:.15s}.hx-card:nth-child(5){animation-delay:.2s}.hx-card:nth-child(6){animation-delay:.25s}
@keyframes hxIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.hx-head{display:flex;align-items:center;gap:8px;justify-content:space-between;font-size:12px;letter-spacing:.04em;text-transform:uppercase;color:rgba(238,242,255,.72);margin-bottom:10px}
.hx-link{background:none;border:0;color:var(--hx-gold);font-size:12px;cursor:pointer;text-transform:none;letter-spacing:0;padding:0}
.hx-muted{color:rgba(238,242,255,.6);font-size:12px}
.hx-pill{font-size:11px;padding:3px 8px;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;text-transform:none;letter-spacing:0;white-space:nowrap}.hx-pill.ok{background:rgba(52,211,153,.22);color:#a7f3d0}
.hx-foot{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:12px;padding-top:10px;border-top:1px solid rgba(255,255,255,.12);font-size:13px;flex-wrap:wrap}
.hx-up{color:#86efac}.hx-down{color:#fca5a5}
.hx-goal{grid-column:span 4}.hx-gwrap{position:relative;display:grid;place-items:center}
.hx-gauge{width:100%;max-width:230px}.hx-track{fill:none;stroke:rgba(255,255,255,.14);stroke-width:10;stroke-linecap:round}
.hx-arc{fill:none;stroke:var(--hx-gold);stroke-width:10;stroke-linecap:round;transition:stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1);filter:drop-shadow(0 0 6px rgba(230,193,88,.6))}
.hx-gnum{position:absolute;bottom:0;text-align:center;line-height:1}.hx-gnum b{font-size:38px;font-weight:700}.hx-gnum i{font-style:normal;font-size:18px;color:var(--hx-gold)}.hx-gnum small{display:block;margin-top:6px;font-size:12px;color:rgba(238,242,255,.7)}
.hx-dealrow{display:flex;gap:12px;align-items:center;color:inherit;text-decoration:none}.hx-dealrow small{display:block;color:rgba(238,242,255,.7);font-size:12px;margin-top:2px}
.hx-av{width:54px;height:54px;flex:none;border-radius:16px;display:grid;place-items:center;font-weight:700;font-size:18px;color:#0f1f6b;background:linear-gradient(135deg,#f6dc8c,#d4a72c);box-shadow:0 6px 16px rgba(212,167,44,.35)}
.hx-actions{display:flex;gap:8px;align-items:center;margin-top:12px}
.hx-btn{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.14);text-decoration:none;font-size:16px;transition:background .2s,transform .2s}.hx-btn:hover{background:rgba(255,255,255,.26);transform:scale(1.08)}
.hx-big{font-size:40px;font-weight:700;line-height:1.1;color:#fff}.hx-big b{font-weight:700}
.hx-today{background:linear-gradient(135deg,rgba(230,193,88,.28),rgba(255,255,255,.06))}
.hx-flow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0;font-size:14px;cursor:pointer}.hx-flow span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hx-switch{appearance:none;-webkit-appearance:none;flex:none;width:40px;height:23px;border-radius:999px;background:rgba(255,255,255,.22);position:relative;cursor:pointer;transition:background .2s;margin:0}
.hx-switch::after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.hx-switch:checked{background:#34d399}.hx-switch:checked::after{transform:translateX(17px)}.hx-switch:focus-visible{outline:2px solid var(--hx-gold);outline-offset:2px}
.hx-lead{display:flex;gap:10px;align-items:center;padding:6px 0;color:inherit;text-decoration:none;border-radius:10px}.hx-lead:hover{background:rgba(255,255,255,.06)}
.hx-lead small{display:block;color:rgba(238,242,255,.65);font-size:12px}
.hx-score{--s:50;flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--hx-gold) calc(var(--s)*1%),rgba(255,255,255,.14) 0)}
.hx-score b{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#13207a;font-size:13px}
.hx-leads{grid-column:span 5}.hx-flows{grid-column:span 4}.hx-agenda{grid-column:span 3}
.hx-arow{display:flex;gap:10px;align-items:baseline;padding:6px 0;color:inherit;text-decoration:none}.hx-arow b{font-size:26px;min-width:34px;color:var(--hx-gold)}.hx-arow span{font-size:13px;color:rgba(238,242,255,.8)}
@media (max-width:1100px){.hx-card,.hx-goal,.hx-leads,.hx-flows,.hx-agenda{grid-column:span 6}}
@media (max-width:640px){.hero-x{padding:12px;gap:10px;border-radius:18px;margin-left:-4px;margin-right:-4px}.hx-card,.hx-goal,.hx-leads,.hx-flows,.hx-agenda{grid-column:span 12}.hx-today,.hx-agenda{grid-column:span 6}.hx-big{font-size:30px}}
@media (prefers-reduced-motion:reduce){.hx-card{animation:none;transition:none}.hx-arc{transition:none}}
.hero-x label.hx-flow{display:flex;flex-direction:row;justify-content:space-between;align-items:center;text-align:left;color:#eef2ff;font-weight:500;margin:0}

/* Page builder */
.pg-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,44%);gap:16px;align-items:start}
.pg-prev{position:sticky;top:12px}
.pg-prev iframe{width:100%;height:calc(100vh - 170px);min-height:480px;border:1px solid var(--line,#e5e7eb);border-radius:14px;background:#fff}
.pg-prev.phone iframe{width:390px;max-width:100%;margin:0 auto;display:block}
.pg-blk{border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:10px 12px;margin:0 0 10px}
.pg-blk .form{margin-top:6px}
.pg-thumb{display:block;max-width:160px;max-height:90px;border-radius:8px;margin:4px 0}
.pg-slug{display:flex;align-items:center;gap:2px}
.pg-slug input{flex:1}
.kpis.mini{margin:8px 0}
.kpis.mini .kpi{padding:6px 10px}
.kpis.mini .kpi b{font-size:1.1rem}
.tbl-wrap{overflow:auto;max-height:60vh}
@media (max-width:900px){.pg-split{grid-template-columns:1fr}.pg-prev{position:static}.pg-prev iframe{height:70vh}}

/* Workflow If / else */
.wf-node.if{border-color:#a78bfa;background:color-mix(in srgb,#a78bfa 8%,var(--card,#fff))}
.wf-br{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.wf-br span{font-size:.78rem;padding:2px 8px;border-radius:999px;font-weight:600}
.wf-br .yes{background:#dcfce7;color:#166534}
.wf-br .no{background:#fee2e2;color:#991b1b}

/* Projects board */
.pj-board{display:grid;grid-template-columns:repeat(4,minmax(240px,1fr));gap:14px;overflow-x:auto;padding-bottom:8px;align-items:start}
.pj-col{background:var(--soft,#f4f6fb);border-radius:14px;padding:10px;min-height:200px;transition:background .15s}
.pj-col.over{background:color-mix(in srgb,#e6c158 25%,var(--soft,#f4f6fb))}
.pj-head{display:flex;justify-content:space-between;align-items:center;padding:4px 6px 10px}
.pj-card{background:var(--card,#fff);border-radius:12px;padding:10px 12px;margin-bottom:10px;box-shadow:0 1px 4px rgba(15,23,42,.08);cursor:pointer;border-left:4px solid #1b2f9e;display:flex;flex-direction:column;gap:4px}
.pj-col[data-col=doing] .pj-card{border-left-color:#e6c158}
.pj-col[data-col=waiting] .pj-card{border-left-color:#f97316}
.pj-col[data-col=done] .pj-card{border-left-color:#16a34a;opacity:.85}
.pj-card.drag{opacity:.4}
.pj-top{display:flex;gap:6px;align-items:flex-start}
.pj-bar{height:6px;background:#e5e7eb;border-radius:9px;overflow:hidden;margin-top:4px}
.pj-bar i{display:block;height:100%;background:linear-gradient(90deg,#1b2f9e,#e6c158)}
.pj-meta{display:flex;gap:10px;flex-wrap:wrap;font-size:.8rem;color:#64748b}
.pj-move{font-size:.8rem;padding:2px 6px;margin-top:4px;align-self:flex-start}
.pj-empty{color:#94a3b8;text-align:center;padding:16px}
.pj-steps{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.pj-step{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--line,#e5e7eb);border-radius:10px}
.pj-step label.chk{flex:1;display:flex;flex-direction:row;align-items:center;gap:8px;text-align:left;margin:0}
.pj-step.done span{text-decoration:line-through;color:#94a3b8}
@media (min-width:901px){.pj-move{display:none}}
@media (max-width:900px){.pj-board{grid-template-columns:repeat(4,82vw);scroll-snap-type:x mandatory}.pj-col{scroll-snap-align:start}}

.site.past{opacity:.7}

.api-ref td{vertical-align:top;padding:6px 8px}
.api-ref code{word-break:break-all;font-size:.82rem}
pre.code{background:#0f172a;color:#e2e8f0;padding:12px;border-radius:10px;overflow:auto;font-size:.8rem;white-space:pre-wrap}

/* Google reviews */
.gr-list{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.gr-item{border:1px solid var(--line,#e5e7eb);border-radius:12px;padding:10px 12px}
.gr-item.new{border-left:4px solid #e6c158}
.gr-item p{margin:6px 0}
.gr-item textarea{width:100%;margin:6px 0}
.gr-stars{color:#f5b301;letter-spacing:1px;margin:0 6px}
.gr-stars i{color:#d1d5db;font-style:normal}
.gr-reply{background:var(--soft,#f4f6fb);border-radius:10px;padding:6px 10px}

/* Royal glass theme: the whole app in the dashboard's style (royal-blue background, frosted glass panels, gold accents) */
:root[data-theme="glass"] {
  --bg: #0d1a5c; --panel: rgba(255,255,255,.075); --card: rgba(255,255,255,.075); --text: #eef2ff; --muted: rgba(226,232,255,.66);
  --border: rgba(255,255,255,.15); --line: rgba(255,255,255,.15); --soft: rgba(255,255,255,.06);
  --primary: #9db2ff; --primary-dark: #0a1450; --primary-weak: rgba(255,255,255,.1);
  --gold: #e6c158; --gold-light: #f6dc8c; --gold-weak: rgba(230,193,88,.16);
  --danger: #fca5a5; --ok: #86efac; --warn: #fcd34d; --radius: 16px; color-scheme: dark;
}
:root[data-theme="glass"] body {
  background: radial-gradient(70% 60% at 0% 0%, #2a47c9 0%, transparent 60%), radial-gradient(60% 55% at 100% 100%, rgba(230,193,88,.30) 0%, transparent 60%), linear-gradient(135deg, #0f1f6b 0%, #13207a 45%, #0a1450 100%);
  background-attachment: fixed; background-color: #0d1a5c;
}
:root[data-theme="glass"] .sidebar { background: rgba(6,14,60,.45); border-right: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
:root[data-theme="glass"] .sidebar nav a.active { background: linear-gradient(135deg, #f6dc8c, #d4a72c); color: #0f1f6b; box-shadow: 0 6px 16px rgba(212,167,44,.35); }
:root[data-theme="glass"] .topbar, :root[data-theme="glass"] .subnav { background: rgba(10,20,80,.45); border-bottom-color: rgba(255,255,255,.1); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
:root[data-theme="glass"] .subnav a.active { color: #fff; }
:root[data-theme="glass"] .card, :root[data-theme="glass"] .kpi {
  background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.15); border-radius: 18px;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 30px rgba(0,0,0,.12); transition: background .25s, box-shadow .25s;
}
:root[data-theme="glass"] .card { animation: hxIn .4s ease both; }
:root[data-theme="glass"] .card:hover { background: rgba(255,255,255,.095); }
:root[data-theme="glass"] .kpi { border-top: 3px solid var(--gold); }
:root[data-theme="glass"] .kpi b, :root[data-theme="glass"] .stat .n { color: #fff; }
:root[data-theme="glass"] h1 { color: #fff; letter-spacing: .01em; }
:root[data-theme="glass"] h2, :root[data-theme="glass"] th { color: rgba(238,242,255,.78); }
:root[data-theme="glass"] a { color: var(--gold-light); }
:root[data-theme="glass"] .sidebar nav a, :root[data-theme="glass"] .subnav a { color: rgba(226,232,255,.78); }
:root[data-theme="glass"] .sidebar nav a.active, :root[data-theme="glass"] .subnav a.active { color: #0f1f6b; }
:root[data-theme="glass"] .subnav a.active { color: #fff; }
:root[data-theme="glass"] .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #eef2ff; transition: background .2s, transform .2s; }
:root[data-theme="glass"] .btn:hover { background: rgba(255,255,255,.18); }
:root[data-theme="glass"] .btn.primary, :root[data-theme="glass"] .seg button.active, :root[data-theme="glass"] .modes button.active, :root[data-theme="glass"] .chips button.active, :root[data-theme="glass"] .funnel-tabs button.active { background: #2f54d6; border-color: #4b6cf0; color: #fff; }
:root[data-theme="glass"] .btn.primary:hover { background: #3b62ec; }
:root[data-theme="glass"] .btn.gold { background: linear-gradient(135deg, #f6dc8c, #d4a72c); color: #0f1f6b; border-color: transparent; }
:root[data-theme="glass"] .btn.danger { color: #fca5a5; }
:root[data-theme="glass"] input, :root[data-theme="glass"] select, :root[data-theme="glass"] textarea { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #eef2ff; }
:root[data-theme="glass"] input::placeholder, :root[data-theme="glass"] textarea::placeholder { color: rgba(226,232,255,.45); }
:root[data-theme="glass"] input:focus, :root[data-theme="glass"] select:focus, :root[data-theme="glass"] textarea:focus { outline: 2px solid rgba(230,193,88,.6); outline-offset: 0; }
:root[data-theme="glass"] option, :root[data-theme="glass"] optgroup { background: #13207a; color: #eef2ff; }
:root[data-theme="glass"] .search input { background: rgba(255,255,255,.1); }
:root[data-theme="glass"] .search-results, :root[data-theme="glass"] .qadd-menu, :root[data-theme="glass"] .wf-menu { background: rgba(16,30,110,.96); border-color: rgba(255,255,255,.16); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
:root[data-theme="glass"] .qadd-menu button { color: #eef2ff; }
:root[data-theme="glass"] dialog { background: linear-gradient(160deg, #1a2d96, #0f1c66); color: #eef2ff; border: 1px solid rgba(255,255,255,.18); }
:root[data-theme="glass"] dialog::backdrop { background: rgba(4,8,35,.6); backdrop-filter: blur(4px); }
:root[data-theme="glass"] tr.click:hover, :root[data-theme="glass"] .search-results a:hover, :root[data-theme="glass"] .search-results a.sel { background: rgba(255,255,255,.08); }
:root[data-theme="glass"] .col { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
:root[data-theme="glass"] .col-head { border-bottom-color: #6d8cff; }
:root[data-theme="glass"] .col-head.won { border-color: var(--gold); }
:root[data-theme="glass"] .deal, :root[data-theme="glass"] .pj-card { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); border-left-color: #6d8cff; transition: transform .2s, background .2s; }
:root[data-theme="glass"] .deal:hover, :root[data-theme="glass"] .pj-card:hover { background: rgba(255,255,255,.15); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
:root[data-theme="glass"] .pj-col { background: rgba(255,255,255,.05); }
:root[data-theme="glass"] .pj-bar { background: rgba(255,255,255,.14); }
:root[data-theme="glass"] .badge { background: rgba(255,255,255,.14); color: #eef2ff; }
:root[data-theme="glass"] .badge.ok { background: rgba(52,211,153,.22); color: #a7f3d0; }
:root[data-theme="glass"] .badge.warn { background: rgba(251,191,36,.2); color: #fde68a; }
:root[data-theme="glass"] .badge.danger, :root[data-theme="glass"] .wf-br .no { background: rgba(248,113,113,.22); color: #fecaca; }
:root[data-theme="glass"] .badge.blue { background: rgba(109,140,255,.25); color: #c7d2fe; }
:root[data-theme="glass"] .badge.gold, :root[data-theme="glass"] .tseg.hi { background: rgba(230,193,88,.2); color: #f6dc8c; }
:root[data-theme="glass"] .tseg.lo { background: rgba(255,255,255,.06); }
:root[data-theme="glass"] .ai-warn, :root[data-theme="glass"] .qr-done.no { background: rgba(248,113,113,.2); color: #fecaca; }
:root[data-theme="glass"] .msg.bot, :root[data-theme="glass"] .feed .k-sms .bub { background: rgba(255,255,255,.1); }
:root[data-theme="glass"] .msg.user { background: #2f54d6; }
:root[data-theme="glass"] .wf-add { background: #13207a; border-color: var(--gold); color: var(--gold); }
:root[data-theme="glass"] .wf-node.if { background: rgba(167,139,250,.14); }
:root[data-theme="glass"] .bulkbar, :root[data-theme="glass"] #toast { background: rgba(10,20,80,.92); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(14px); }
:root[data-theme="glass"] #toast.err { background: #b91c1c; }
:root[data-theme="glass"] .tabs button.active { color: #fff; border-color: var(--gold); }
:root[data-theme="glass"] .qr-box, :root[data-theme="glass"] .qr2fa { background: #fff; }
:root[data-theme="glass"] .hero-x { background: transparent; box-shadow: none; padding: 0; overflow: visible; }
:root[data-theme="glass"] .hero-x::before { display: none; }
:root[data-theme="glass"] ::-webkit-scrollbar { width: 10px; height: 10px; }
:root[data-theme="glass"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 10px; }
:root[data-theme="glass"] ::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { :root[data-theme="glass"] .card { animation: none; } }

/* Referrals, community, team */
.li-emoji{width:18px;text-align:center;flex:none}
.inline-sel{padding:3px 6px;font-size:13px;max-width:180px}
.gold-txt{color:var(--gold)}
.cm-new textarea{width:100%;margin:10px 0 6px}
.cm-list{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.cm-post{border:1px solid var(--border);border-radius:12px;padding:10px 12px}
.cm-post.pinned{border-left:4px solid var(--gold)}
.cm-post p{margin:6px 0}
.hidden-post{opacity:.55}
.cm-com{margin:6px 0 0 14px;padding:6px 10px;border-left:2px solid var(--border);font-size:13px}
.cm-reply{display:flex;gap:6px;margin-top:8px}.cm-reply input{flex:1}
.linkbtn{background:none;border:0;color:var(--muted);font-size:12px;cursor:pointer;text-decoration:underline;padding:0}

/* Attach from the CRM (composer picker, chips, AI draft card) */
.att-list { max-height: 320px; overflow: auto; display: grid; gap: 4px; }
.att-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 2px 2px; }
.att-row { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, var(--border)); background: transparent; color: inherit; font-weight: 400; cursor: pointer; }
.att-row:hover { border-color: var(--blue, #1d3fae); }
.att-row.on { border-color: var(--gold, #c9a227); background: rgba(201, 162, 39, .12); }
.att-ck { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: rgba(127, 127, 127, .15); }
.att-row.on .att-ck { background: var(--gold, #c9a227); color: #1a2240; }
.ib-fchip.crm { border-color: var(--gold, #c9a227); }
.ai-draft .mc-files { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-draft .mc-sig { margin: 6px 0; }
.doc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
