:root {
  --bg: #f5f6fc;
  --panel: #ffffff;
  --ink: #14162b;
  --muted: #6a6f8e;
  --line: #e7e9f4;
  --primary: #6366f1;
  --primary-d: #4f46e5;
  --accent: #a855f7;
  --ai-cyan: #22d3ee;
  --ai-grad: linear-gradient(115deg, #6366f1 0%, #a855f7 50%, #22d3ee 100%);
  --ai-grad-soft: linear-gradient(115deg, rgba(99,102,241,.14), rgba(168,85,247,.12), rgba(34,211,238,.12));
  --glow: 0 0 0 1px rgba(99,102,241,.12), 0 8px 30px rgba(99,102,241,.22);
  --wa: #25d366;
  --sms: #0a84ff;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,24,60,.05), 0 2px 8px rgba(20,24,60,.06);
  --side-bg: #0b0d24;
  --side-ink: #aab0d0;
  --side-w: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
}
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 18px; }
h3 { font-size: 16px; margin: 0 0 6px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }

/* layout — app shell with left sidebar */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex: none; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0e1130 0%, #131740 55%, #1a1450 100%);
  color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 12px 14px; z-index: 30;
}
.brand { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 10px; white-space: nowrap; color: #fff; padding: 2px 8px 16px; letter-spacing: .01em; }
.brand em { font-style: normal; background: linear-gradient(90deg, #8b8bff, #c58bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand img.logo { width: 34px; height: 34px; object-fit: contain; flex: none; filter: drop-shadow(0 0 8px rgba(140,100,255,.6)); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-lbl { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #565d8a; padding: 14px 10px 5px; }
.nav-btn {
  border: 0; background: transparent; color: var(--side-ink); font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
}
.nav-btn .ni { width: 20px; text-align: center; font-size: 14px; opacity: .85; flex: none; }
.nav-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-btn.active { background: linear-gradient(90deg, rgba(91,91,246,.35), rgba(147,51,234,.22)); color: #fff; box-shadow: inset 2px 0 0 #8b8bff; }
.nav-btn .badge { margin-left: auto; background: rgba(255,255,255,.1); color: #c5c9e8; border-radius: 999px; font-size: 10.5px; padding: 1px 7px; font-weight: 700; }
.nav-btn.active .badge { background: var(--primary); color: #fff; }
.side-foot { padding: 10px 8px 2px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.syncbadge { font-size: 12px; color: #7c83ad; white-space: nowrap; }

main { flex: 1; min-width: 0; max-width: 1180px; margin: 0 auto; padding: 24px 26px 90px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-title { margin: 22px 0 10px; }

/* buttons */
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: #fafafe; border-color: #d6d8e0; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #f3c7c7; }
.btn.danger:hover { background: #fef2f2; }
.btn.danger.ghost { border-color: transparent; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #053a1b; }
.btn.wa:hover { filter: brightness(.96); }
.btn.sms { background: var(--sms); border-color: var(--sms); color: #fff; }
.btn.sms:hover { filter: brightness(.96); }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 6px; border-radius: 7px; color: var(--muted); line-height: 1; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }

/* inputs */
.input { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; font: inherit; color: var(--ink); width: 100%; }
.input:focus { outline: 2px solid #c7d2fe; border-color: var(--primary); }
.input.small { width: auto; padding: 7px 9px; }
select.input { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* cards / stats */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.danger-card { border-color: #f3c7c7; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-num { font-size: 28px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); width: 100%; text-align: left; font: inherit; color: inherit; cursor: default; }
button.list-row { cursor: pointer; }
button.list-row:hover { border-color: #c7cbd6; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.progress { width: 120px; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.progress.wide { width: 160px; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 999px; }
.pct { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 46px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chip { --c: var(--primary); font-size: 11.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 30%, white); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* table */
.table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tr { display: grid; grid-template-columns: 36px 1fr auto auto; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); gap: 16px; }
.table.nocalls .cell.quicklog { justify-content: flex-start; }
.tr.th { background: #fafbfd; border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.tr:hover:not(.th) { background: #fafbff; }
.tr.bl { opacity: .62; }
.tr.bl .name strong { text-decoration: line-through; }
.cell { min-width: 0; }
.cell.name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.phone { font-variant-numeric: tabular-nums; color: #374151; }
.cell.cb { display: flex; align-items: center; }
.cell.actions { display: flex; gap: 9px; justify-content: flex-end; flex-wrap: nowrap; align-items: center; }
.cell.quicklog { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.name-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ph-inline { font-variant-numeric: tabular-nums; color: #2563eb; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.ph-inline:hover { text-decoration: underline; }
.cell.name .name-link { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-weight: 600; font-size: 15px; color: #1f2937; text-align: left; }
.cell.name .name-link:hover { text-decoration: underline; }
.tr.bl .name .name-link { text-decoration: line-through; }
.cell.name .lc-line { margin-top: 2px; }
.tr.logged { box-shadow: inset 4px 0 0 var(--lc, #c7d2fe); }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.qchip { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.qchip:hover { border-color: var(--primary); }
.qchip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.qchip.tagq.on { background: #6366f1; border-color: #6366f1; }
.tchip.manage { margin-left: auto; color: var(--muted); }
.recap { display: flex; flex-wrap: wrap; gap: 20px; }
.recap-item { text-align: center; min-width: 60px; }
.recap-num { font-size: 19px; font-weight: 800; }
.recap-lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.taglist { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.tagrow { display: flex; align-items: center; gap: 8px; }
.flash-next { animation: flashnext 1.3s ease; }
@keyframes flashnext { 0%, 55% { background: #fff7ed; } 100% { background: transparent; } }
.icon-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; align-items: center; padding: 4px 4px 10px; font-size: 12px; color: var(--muted); }
.icon-legend .leg-lbl { font-weight: 700; color: var(--ink); }
.icon-legend .leg b { font-weight: 700; color: var(--ink); }
.icon-btn.del-x { color: #b91c1c; }
.icon-btn.del-x:hover { background: #fee2e2; }
.live-timer { margin-top: 3px; font-size: 12.5px; font-weight: 700; color: #15803d; }
.tr.calling { background: #f0fdf4 !important; box-shadow: inset 4px 0 0 #16a34a !important; }
.qbtn.call.live, .btn.wa.live { background: #16a34a; border-color: #16a34a; color: #fff; animation: callpulse 1.2s ease-in-out infinite; }
@keyframes callpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } 50% { box-shadow: 0 0 0 5px rgba(22, 163, 74, 0); } }
.filter-clear { display: block; width: 100%; text-align: left; background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.filter-clear:hover { background: #fef3c7; }
.past-results { max-height: 250px; overflow-y: auto; }
.past-add:not(:empty) { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 6px; }
.past-result.add-new { color: var(--primary); font-weight: 700; }
.past-result.quick-log { color: #92400e; font-weight: 700; }
.tag.quicktag { background: #fef3c7; color: #92400e; }
.past-recap { background: #ecfdf5; border: 1px solid #a7f3d0; color: #15803d; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.qbtn { font-size: 12px; font-weight: 700; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: #374151; cursor: pointer; line-height: 1; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.qbtn:hover { background: #eef2ff; border-color: var(--primary); }
.qbtn:active { transform: translateY(1px); }
.qbtn.call { background: #ecfdf5; border-color: #a7f3d0; font-size: 14px; }
.qbtn.ans { color: #15803d; border-color: #bbf7d0; }
.tag-chip { --c: #6366f1; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.tchip { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.tchip:hover { border-color: var(--primary); }
.tchip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.tagpick { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.dispo-manage { display: flex; flex-wrap: wrap; gap: 8px; }
.dispo-chip-s { --c: #64748b; display: inline-flex; align-items: center; gap: 2px; }
.chip-x { background: none; border: none; color: #b91c1c; cursor: pointer; font-size: 12px; padding: 0 0 0 3px; line-height: 1; }
.srclist { display: flex; flex-direction: column; gap: 8px; }
.srcrow { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; }
.srcname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srcbar { background: var(--bg); border-radius: 6px; height: 10px; overflow: hidden; }
.srcbarfill { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.srcnum { font-size: 12px; color: var(--muted); white-space: nowrap; }
.recent-list { display: flex; flex-direction: column; gap: 1px; }
.recent-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 9px 10px; cursor: pointer; font: inherit; }
.recent-row:hover { background: var(--bg); }
.rc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-dispo { font-size: 13px; white-space: nowrap; }
.rc-when { white-space: nowrap; }
.tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-left: 6px; vertical-align: middle; }
.tag.bl { background: #fee2e2; color: #b91c1c; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* send table */
.send-table .tr.send { grid-template-columns: 38px 1.2fr auto 130px; }
.tr.send.done { background: #f3fbf5; }
.cell.sendbtns { display: flex; gap: 6px; justify-content: flex-end; }
.cell.sentat { text-align: right; }
.campaign-summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; box-shadow: var(--shadow); margin-bottom: 12px; }
.msg-preview { background: #fffdf5; border: 1px solid #f0e6c8; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.msg-preview pre { margin: 6px 0 0; white-space: pre-wrap; font: inherit; }
.back { margin-bottom: 4px; padding-left: 4px; }

/* segmented */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg-btn { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg-btn.on { background: var(--primary); color: #fff; }

/* bulk bar */
.bulkbar { position: sticky; top: 12px; z-index: 10; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; box-shadow: var(--shadow); }

/* empty states */
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); }
.empty.cta { border-style: solid; }
.empty h3 { color: var(--ink); }

/* import */
.import-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dropzone { border: 2px dashed #cdd2e0; border-radius: 12px; padding: 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: center; }
.dropzone.over { border-color: var(--primary); background: #eef2ff; }
.dz-icon { font-size: 26px; }
.paste-box { display: flex; flex-direction: column; gap: 8px; }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 520px; padding: 22px 22px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 14px; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.phone-row { display: flex; gap: 6px; margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; position: relative; border: 2px solid transparent; }
.swatch input { position: absolute; opacity: 0; }
.swatch:has(input:checked) { border-color: #111; box-shadow: 0 0 0 2px #fff inset; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* GHL-style: the sidebar NEVER moves to the top — on narrow screens it
   collapses to an icon rail on the left. */
@media (max-width: 860px) {
  .sidebar { width: 62px; padding: 14px 8px; }
  .brand { padding: 2px 4px 14px; justify-content: center; }
  .brand span.t { display: none; }
  .brand img.logo { width: 30px; height: 30px; }
  .side-lbl { padding: 10px 0 4px; text-align: center; font-size: 8px; letter-spacing: .04em; }
  .nav-btn { justify-content: center; padding: 10px 6px; font-size: 0; gap: 0; }
  .nav-btn .ni { font-size: 17px; width: auto; opacity: 1; }
  .nav-btn .badge { display: none; }
  .side-foot { display: none; }
  main { padding: 16px 12px 80px; }
}
@media (max-width: 720px) {
  .import-grid { grid-template-columns: 1fr; }
  .tr { grid-template-columns: 30px 1fr auto; gap: 10px; }
  .cell.actions { display: none; }
  .send-table .tr.send { grid-template-columns: 32px 1fr auto; }
  .cell.sentat { display: none; }
  main { padding: 16px 12px 80px; }
}

/* call tracker */
.callstats { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.callstats .cs { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; box-shadow: var(--shadow); min-width: 120px; flex: 1; }
.callstats .cs-num { font-size: 24px; font-weight: 800; }
.callstats .cs-lbl { color: var(--muted); font-size: 12.5px; }
.call-table .tr.callrow { grid-template-columns: 38px 1.3fr 130px 1.5fr auto; align-items: center; }
.tr.callrow.cb { background: #fffaf0; box-shadow: inset 3px 0 0 #f59e0b; }
.cell.lastcall { min-width: 0; }
.lc-out { font-weight: 600; }
.cell.lastcall .note { font-style: italic; }
.outcomes { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.outcome:hover { border-color: var(--primary); background: #eef2ff; }
.feed { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.feed-row { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.feed-row:first-child { border-top: 0; }
.feed-when { color: var(--muted); font-size: 12px; min-width: 96px; flex: none; }
.feed-out { white-space: nowrap; }
.feed-row .del-call { margin-left: auto; flex: none; }
.hist { display: flex; flex-direction: column; gap: 4px; }
.hist-row { font-size: 13px; }

@media (max-width: 720px) {
  .call-table .tr.callrow { grid-template-columns: 34px 1fr auto; }
  .call-table .cell.phone, .call-table .cell.lastcall { display: none; }
  .feed-when { min-width: 64px; }
  .callstats .cs { padding: 10px 12px; }
}

/* mini-CRM: contact hub, dispositions, tasks/reminders */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary-d); font-weight: 700; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.task-pill { font-size: 11px; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.dispo { font-size: 12px; font-weight: 700; background: #eef2ff; color: var(--primary-d); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.dispo.none { background: var(--line); color: var(--muted); }
.reminder-banner { display: block; width: 100%; text-align: left; border: 1px solid #f3d99b; background: #fffaf0; color: #92400e; font-weight: 700; border-radius: 10px; padding: 11px 14px; margin-bottom: 12px; cursor: pointer; font-size: 14px; }
.reminder-banner:hover { background: #fef6e6; }
.hub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hub-head h2 { margin: 0; }
.hub-links { display: flex; gap: 8px; margin: 14px 0 4px; }
.hub-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.hub-lbl { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.log-meta { display: flex; gap: 6px; margin-top: 8px; }
.log-meta input[type=date] { max-width: 160px; }
.task-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-add input[type=date] { max-width: 165px; }
.task-list { display: flex; flex-direction: column; gap: 2px; }
.task-list.card-list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; margin-bottom: 6px; }
.task-line { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.task-line:hover { background: var(--bg); }
.task-line.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { flex: 1; min-width: 0; }
.task-due { font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--muted); }
.task-due.b-overdue { color: #b91c1c; }
.task-due.b-today { color: #b45309; }
.del-task { margin-left: 2px; }
.section-title.danger { color: #b91c1c; }
@media (max-width: 720px) {
  .log-meta { flex-direction: column; }
  .log-meta input[type=date], .task-add input[type=date] { max-width: none; }
}

/* disposition chips + calls-per-day chart */
.dispo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dchip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); white-space: nowrap; }
.dchip:hover { border-color: #c7cbd6; }
.dchip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.daychart { padding: 14px 16px; margin-bottom: 14px; }
.dc-head { font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.dc-bars { display: flex; align-items: stretch; gap: 8px; height: 96px; }
.dc-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.dc-n { font-size: 11px; font-weight: 700; color: var(--muted); height: 15px; }
.dc-barwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.dc-bar { width: 62%; max-width: 34px; min-height: 3px; background: linear-gradient(180deg, #6366f1, #4f46e5); border-radius: 5px 5px 0 0; }
.dc-lbl { font-size: 11px; color: var(--muted); margin-top: 5px; }
.dc-lbl.today { color: var(--primary-d); font-weight: 700; }
.dc-bars { position: relative; }
.dc-goal { position: absolute; left: 0; right: 0; border-top: 2px dashed #f59e0b; height: 0; z-index: 1; pointer-events: none; }
.dc-bar.hit { background: linear-gradient(180deg, #34d399, #10b981); }
.streak { float: right; font-size: 12px; color: #b45309; font-weight: 700; }
.funnel { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fn { text-align: center; padding: 4px 8px; }
.fn b { display: block; font-size: 22px; font-weight: 800; }
.fn span { font-size: 11.5px; color: var(--muted); }
.fn.won b { color: #047857; }
.fnarrow { color: #c5c9d6; font-weight: 700; }
.hourbars { display: flex; align-items: flex-end; gap: 3px; height: 72px; margin-top: 8px; }
.hb { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.hbarwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.hbar { width: 72%; min-height: 2px; background: #c7d2fe; border-radius: 3px 3px 0 0; }
.hbar.pk { background: var(--primary); }
.hl { font-size: 9px; color: var(--muted); margin-top: 3px; height: 11px; }
.kbd { display: inline-block; min-width: 15px; text-align: center; font-size: 11px; background: rgba(0,0,0,.12); border-radius: 4px; padding: 0 4px; font-weight: 700; }

/* passcode lock */
#lockscreen { position: fixed; inset: 0; background: var(--bg); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lockbox { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px 26px; text-align: center; max-width: 320px; width: 100%; box-shadow: var(--shadow); }
.lockico { font-size: 40px; margin-bottom: 6px; }
.locklogo { width: 148px; max-width: 60%; display: block; margin: 0 auto 12px; }
.auth-or { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 8px; position: relative; }
.auth-or:before, .auth-or:after { content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line); }
.auth-or:before { left: 0; } .auth-or:after { right: 0; }
.btn.fbbtn { background: #1877F2; border-color: #1877F2; color: #fff; width: 100%; justify-content: center; }
.btn.fbbtn:hover { background: #0f6ae0; }
.btn.fbbtn span { font-weight: 900; font-family: Georgia, serif; margin-right: 4px; }
.lockbox h2 { margin-bottom: 14px; }
.lockbox input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 20px; text-align: center; letter-spacing: 6px; margin-bottom: 12px; }
.lockbox .btn { width: 100%; }
#lockErr { color: #dc2626; min-height: 18px; margin-bottom: 8px; font-size: 13px; }
#authscreen { position: fixed; inset: 0; background: var(--bg); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
#authscreen .lockbox { max-width: 340px; }
#authscreen .lockbox h2 { margin-bottom: 6px; }
#authscreen .lockbox input { font-size: 15px; text-align: left; letter-spacing: normal; }
.lockerr { color: #dc2626; min-height: 18px; margin-bottom: 8px; font-size: 13px; }

/* power-dial mode */
.dial-wrap { max-width: 460px; margin: 0 auto; }
.dial-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dial-prog { font-size: 13px; font-weight: 700; color: var(--muted); }
.dial-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; text-align: center; }
.dial-name { font-size: 26px; font-weight: 800; line-height: 1.2; }
.dial-num { font-size: 16px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.chips.center { justify-content: center; margin-top: 8px; }
.dial-call { display: flex; justify-content: center; background: var(--wa); border-color: var(--wa); color: #053a1b; font-size: 18px; padding: 16px; border-radius: 12px; margin: 18px 0 14px; font-weight: 800; }
.dial-call:hover { filter: brightness(.96); }
.dial-note { margin-bottom: 14px; }
.dial-dispos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dial-dispos .outcome { justify-content: center; padding: 13px 8px; }
.dial-skip { margin-top: 14px; width: 100%; justify-content: center; }
.dial-hint { text-align: center; margin-top: 14px; }
.dial-done { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 44px 24px; box-shadow: var(--shadow); }
.dial-done-emoji { font-size: 48px; margin-bottom: 8px; }

/* log-past-call modal */
.past-results { max-height: 280px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }
.past-result { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 12px; font: inherit; cursor: pointer; }
.past-result:last-child { border-bottom: 0; }
.past-result:hover { background: var(--bg); }
.past-selected { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.date-presets { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-presets input[type=date] { max-width: 175px; }

/* per-call timer + backup reminder */
.timer-bar { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timer-bar #callTimerDisplay { font-variant-numeric: tabular-nums; font-size: 17px; }
.backup-nag { display: block; width: 100%; text-align: left; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; font-weight: 700; border-radius: 10px; padding: 11px 14px; margin-bottom: 12px; cursor: pointer; font-size: 14px; }
.backup-nag:hover { background: #fef3c7; }

/* undo bar */
#undobar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: #1b1f2a; color: #fff; border-radius: 10px; padding: 8px 10px 8px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 200; font-size: 14px; max-width: 92vw; }
#undobar .btn { background: #fff; color: #1b1f2a; border-color: #fff; }
#undobar .btn:hover { background: #e9e9f5; }
#undobar .undo-x { color: #cbd5e1; }
#undobar .undo-x:hover { color: #fff; }

/* hot star */
.star { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 3px; color: #cbd5e1; vertical-align: middle; }
.star:hover { color: #f59e0b; }
.star.on { color: #f59e0b; }

/* revenue (won) */
.won-amt { color: #047857; font-weight: 700; }
.revcard .rev-total { font-size: 26px; font-weight: 800; margin: 2px 0 8px; }
.rev-groups { display: flex; flex-direction: column; gap: 6px; }
.rev-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rev-row strong { margin-left: auto; }

/* text templates */
.tpl-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.tpl-pick { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tpl-pick .past-result { white-space: normal; }

/* sales pipeline (kanban) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 14px; }
.kcol { background: #eef0f7; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kcol-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; padding: 2px 4px 10px; }
.kcol-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--kc, var(--primary)); flex: none; box-shadow: 0 0 6px var(--kc, var(--primary)); }
.kcol-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 700; background: #fff; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line); }
.kcards { display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; box-shadow: var(--shadow); border-top: 3px solid var(--kc, var(--primary)); cursor: grab; }
.kcard.dragging { opacity: .45; }
.kcol.kover { outline: 2px dashed var(--primary); outline-offset: -2px; background: #eef2ff; }
.kcard .kname { font-weight: 700; font-size: 14px; display: block; }
.kcard .kphone { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kcard select { margin-top: 8px; font-size: 12px; padding: 4px 24px 4px 8px; }
.kcard .chips { margin-top: 6px; }
.kempty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 14px 4px; }

/* toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch .knob { width: 42px; height: 24px; border-radius: 999px; background: #d3d7e5; position: relative; transition: background .15s; flex: none; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + .knob { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.switch input:checked + .knob::after { left: 21px; }

/* integration store */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.store-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); position: relative; }
.store-card.on { border-color: #a7f3d0; }
.store-ico { font-size: 26px; flex: none; }
.store-body { display: flex; flex-direction: column; min-width: 0; }
.store-body strong { font-size: 14px; }
.store-env { font-size: 10px; color: var(--muted); background: var(--bg); padding: 1px 4px; border-radius: 4px; margin-top: 3px; align-self: flex-start; }
.store-badge { position: absolute; top: 10px; right: 12px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.store-badge.live { color: #059669; }

/* page builder mini preview */
.pg-mini { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pm { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.pm b { font-size: 13px; } .pm span { font-size: 11.5px; color: var(--muted); } .pm em { font-size: 11px; color: var(--primary); font-style: normal; font-weight: 700; }
.pm.hero { background: linear-gradient(135deg, #0e1130, #1a1450); } .pm.hero b, .pm.hero span { color: #fff; } .pm.hero em { color: #b7b7ff; }
.pm.cta { background: #0e1130; } .pm.cta b { color: #fff; }

/* contact detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.detail-grid > div { display: flex; flex-direction: column; }
.detail-grid .dk { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
@media (max-width: 620px) { .detail-grid { grid-template-columns: 1fr; } }

/* form builder */
.fb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .fb-grid { grid-template-columns: 1fr; } }
.fb-field { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fafbff; }
.fb-grip { color: #c5c9d6; cursor: grab; font-size: 12px; }
.fb-preview { background: #f9fafe; }
.fp { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.check.small { font-size: 12.5px; gap: 4px; }

/* spreadsheet */
.ss-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ss { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 13.5px; }
.ss th { background: #f7f8fc; text-align: left; padding: 10px 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ss td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ss tr:hover td { background: #fafbff; }
.ss .mono { font-variant-numeric: tabular-nums; }
.ss select.input.small, .ss input.input.small { margin: 0; min-width: 120px; }

/* calendar */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-head > div { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; min-height: 92px; padding: 6px; }
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.cal-d { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-cell.today .cal-d { color: var(--primary-d); }
.cal-ev { font-size: 11px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.ev-appt { background: #eef2ff; color: #4338ca; }
.cal-ev.ev-task { background: #fff7ed; color: #b45309; }
@media (max-width: 720px) { .cal-cell { min-height: 62px; } .cal-ev { font-size: 9px; } }

/* threaded conversations inbox */
.conv-grid { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; min-height: 480px; }
@media (max-width: 860px) { .conv-grid { grid-template-columns: 1fr; } }
.conv-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: 70vh; overflow-y: auto; }
.conv-item { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 9px 10px; cursor: pointer; font: inherit; }
.conv-item:hover { background: var(--bg); }
.conv-item.on { background: #eef2ff; }
.conv-ava { font-size: 18px; flex: none; }
.conv-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.conv-meta strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-when { flex: none; font-size: 10.5px; }
.conv-pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 70vh; }
.conv-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bubbles { flex: 1; overflow-y: auto; padding: 16px; background: #f8f9fd; display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.brow { display: flex; }
.brow.me { justify-content: flex-end; }
.bub { max-width: 72%; padding: 9px 13px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.brow.me .bub { background: linear-gradient(135deg, var(--primary), #6d5cf6); color: #fff; border: 0; }
.bnote { font-size: 10px; opacity: .75; font-weight: 700; }
.conv-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.conv-compose textarea { flex: 1; }
.conv-compose .btn { padding: 10px 16px; }
.conv-compose-wrap { padding: 10px; border-top: 1px solid var(--line); }
.conv-compose-wrap .conv-compose { padding: 0; border-top: 0; }
.chan-filter { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.chan-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 14px; line-height: 1; }
.chan-chip.on { background: #eef2ff; border-color: var(--primary); }
.conv-item.unread strong { font-weight: 800; }
.conv-item.unread { background: #fbfbff; }
.brow.note { justify-content: center; }
.bub.note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; max-width: 92%; }
.brow.note .bub.note b { color: #78350f; }

/* support-desk setup steps */
.setup-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.setup-step { display: flex; gap: 12px; align-items: flex-start; }
.setup-step .sn { flex: none; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.setup-step > div { min-width: 0; }
.setup-step ol { margin: 6px 0; padding-left: 18px; line-height: 1.7; }
.route { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: #fafbff; }
.codeblock { background: #0e1130; color: #dfe2ff; border-radius: 9px; padding: 12px 14px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; margin: 8px 0 0; white-space: pre; }

/* app launcher (Odoo-style tile grid) */
.apps-btn { position: fixed; top: 14px; right: 16px; z-index: 60; width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--accent)); border: 0; cursor: pointer; box-shadow: 0 6px 22px rgba(91,91,246,.45); display: flex; align-items: center; justify-content: center; }
.apps-btn:hover { filter: brightness(1.06); }
.apps-btn:active { transform: scale(.94); }
.apps-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.apps-dots, .apps-dots::before, .apps-dots::after { display: block; }
.apps-dots { width: 4px; height: 4px; border-radius: 50%; background: #fff; position: relative; box-shadow: 7px 0 #fff, -7px 0 #fff, 0 7px #fff, 7px 7px #fff, -7px 7px #fff, 0 -7px #fff, 7px -7px #fff, -7px -7px #fff; transition: opacity .12s; }
.apps-btn.open { z-index: 62; }
.apps-btn.open .apps-dots { opacity: 0; }
.apps-btn.open::after { content: "✕"; position: absolute; color: #fff; font-size: 21px; font-weight: 400; line-height: 1; }
.lt-hint { color: #8a90ba; font-size: 12.5px; }
@media (max-width: 560px) { .lt-hint { display: none; } }
.launcher { position: fixed; inset: 0; z-index: 55; background: rgba(12,15,40,.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: flex; flex-direction: column; align-items: center; padding: 0 22px 40px; overflow-y: auto; animation: launcherIn .18s ease; }
.launcher[hidden] { display: none; }
.launcher-topbar { position: sticky; top: 0; align-self: stretch; display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.12); background: linear-gradient(rgba(12,15,40,.4), transparent); }
.lt-brand { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.lt-brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(140,100,255,.6)); }
.lt-close { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; font-size: 17px; cursor: pointer; }
.lt-close:hover { background: rgba(255,255,255,.18); }
.lt-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes launcherIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .launcher { animation: none; } }
.launcher-inner { max-width: 940px; width: 100%; }
.launcher-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.launcher-head h2 { color: #fff; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.launcher-head .lwmark { color: #c5c9e8; font-size: 13px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 26px 12px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; font: inherit; padding: 4px; animation: tilePop .42s cubic-bezier(.34, 1.56, .5, 1) backwards; }
@keyframes tilePop { 0% { opacity: 0; transform: scale(.4) translateY(10px); } 70% { opacity: 1; transform: scale(1.05) translateY(0); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .app-tile { animation: none; } }
.app-ico { width: 62px; height: 62px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 8px 20px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .13s ease; }
.app-tile:hover .app-ico { transform: translateY(-3px) scale(1.05); }
.app-tile:active .app-ico { transform: scale(.92); }
.app-tile:focus-visible { outline: 0; }
.app-tile:focus-visible .app-ico { outline: 2px solid #fff; outline-offset: 3px; }
.app-label { font-size: 12.5px; font-weight: 600; color: #eef0fb; text-align: center; max-width: 84px; line-height: 1.25; }
.app-tile.current .app-ico { box-shadow: 0 0 0 3px #fff, 0 8px 20px rgba(0,0,0,.3); }
.app-tile.locked .app-ico { filter: grayscale(.7) brightness(.7); position: relative; }
.app-tile.locked .app-label { color: #b6bad6; }
.app-lock { position: absolute; right: -4px; top: -4px; font-size: 15px; background: #14162b; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.pro-tag { font-size: 9px; font-weight: 800; letter-spacing: .04em; color: #fff; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; padding: 1px 4px; vertical-align: middle; }
.launcher-upsell { color: #c5c9e8; text-align: center; font-size: 13px; margin: 26px auto 0; max-width: 460px; }
.plan-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.plan-block.pro { border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); background: color-mix(in srgb, var(--primary) 4%, transparent); }
.plan-lbl { font-size: 12px; font-weight: 700; color: var(--ink-soft, var(--muted)); margin-bottom: 8px; }

/* embedded tutoring platform */
.tutoring-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--panel); height: calc(100vh - 220px); min-height: 420px; }
.tutoring-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* module toggles in settings */
.modrow { display: grid; grid-template-columns: 250px 1fr; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.modrow:first-of-type { border-top: 0; }
@media (max-width: 720px) { .modrow { grid-template-columns: 1fr; gap: 3px; } }

/* candidates pipeline */
.cand-table .tr.candrow { grid-template-columns: 1.5fr 130px 150px auto; align-items: center; }
.cand-table .cell.stage select { width: 100%; }
@media (max-width: 720px) { .cand-table .tr.candrow { grid-template-columns: 1fr 130px auto; } .cand-table .cell.phone { display: none; } }

/* ============================================================================
   AI-CENTRIC THEME LAYER
   ========================================================================== */

/* Sidebar: aurora glow at the top + subtle grid texture */
.sidebar { position: relative; }
.sidebar::before {
  content: ""; position: absolute; top: -60px; left: -40px; right: -40px; height: 260px;
  background: radial-gradient(60% 80% at 30% 0%, rgba(99,102,241,.5), transparent 70%),
              radial-gradient(50% 70% at 90% 10%, rgba(168,85,247,.4), transparent 70%),
              radial-gradient(40% 60% at 60% 30%, rgba(34,211,238,.25), transparent 70%);
  filter: blur(28px); opacity: .55; pointer-events: none; z-index: 0;
  animation: aurora 14s ease-in-out infinite alternate;
}
.sidebar > * { position: relative; z-index: 1; }
@keyframes aurora { 0% { transform: translateY(0) scale(1); opacity: .5; } 100% { transform: translateY(22px) scale(1.08); opacity: .68; } }
@media (prefers-reduced-motion: reduce) { .sidebar::before { animation: none; } }

/* Brand: gradient wordmark + glowing AI badge */
.brand .t em { background: linear-gradient(90deg, #a5a5ff, #d8a8ff, #7fe9ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand::after {
  content: "AI"; font-size: 9px; font-weight: 800; letter-spacing: .08em; color: #fff;
  background: var(--ai-grad); border-radius: 5px; padding: 2px 5px; margin-left: 2px;
  box-shadow: 0 0 12px rgba(99,102,241,.6); align-self: center;
}
@media (max-width: 860px) { .brand::after { display: none; } }

/* Active nav item: AI gradient rail + glow */
.nav-btn.active { background: linear-gradient(90deg, rgba(99,102,241,.4), rgba(168,85,247,.22), transparent); box-shadow: inset 2px 0 0 #8b8bff, 0 0 18px rgba(99,102,241,.15); }
.nav-btn .ni { transition: filter .15s; }
.nav-btn.active .ni { filter: drop-shadow(0 0 6px rgba(139,139,255,.9)); }

/* Primary buttons: AI gradient with glow */
.btn.primary { background: var(--ai-grad); border: 0; background-size: 160% 160%; box-shadow: 0 4px 16px rgba(99,102,241,.32); transition: background-position .4s, box-shadow .2s, transform .1s; }
.btn.primary:hover { background: var(--ai-grad); background-size: 160% 160%; background-position: 100% 0; box-shadow: 0 6px 22px rgba(99,102,241,.45); }
.btn.primary:active { transform: translateY(1px); }

/* Inputs: focus in AI violet with a soft glow */
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.16); }

/* Section/stat cards get a whisper of the AI gradient on hover */
.stat-card { transition: transform .14s, box-shadow .14s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }

/* Login screen: animated AI mesh backdrop */
#authscreen { background:
  radial-gradient(40% 50% at 15% 20%, rgba(99,102,241,.16), transparent 60%),
  radial-gradient(45% 55% at 85% 15%, rgba(168,85,247,.15), transparent 60%),
  radial-gradient(50% 60% at 70% 90%, rgba(34,211,238,.12), transparent 60%),
  var(--bg); }
#authscreen .lockbox { box-shadow: 0 20px 60px rgba(60,50,140,.16), 0 0 0 1px rgba(99,102,241,.08); }

/* Floating AI assistant button (bottom-right) */
.ai-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 58; height: 52px; padding: 0 20px 0 16px;
  border: 0; border-radius: 26px; cursor: pointer; color: #fff; font: inherit; font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; gap: 9px; background: var(--ai-grad); background-size: 180% 180%;
  box-shadow: 0 8px 30px rgba(99,102,241,.45); animation: aiPulse 3.4s ease-in-out infinite, aiShift 6s ease infinite;
}
.ai-fab:hover { filter: brightness(1.06); }
.ai-fab:active { transform: scale(.96); }
.ai-fab .spark { font-size: 18px; filter: drop-shadow(0 0 6px rgba(255,255,255,.7)); }
@keyframes aiPulse { 0%, 100% { box-shadow: 0 8px 30px rgba(99,102,241,.4); } 50% { box-shadow: 0 8px 38px rgba(168,85,247,.6); } }
@keyframes aiShift { 0% { background-position: 0 0; } 50% { background-position: 100% 50%; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .ai-fab { animation: none; } }
@media (max-width: 560px) { .ai-fab span.ai-fab-label { display: none; } .ai-fab { padding: 0 15px; } }

/* AI assistant modal */
.ai-modal .ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ai-modal .ai-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--ai-grad); display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 0 16px rgba(99,102,241,.5); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.ai-chip { font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--ai-grad-soft); color: var(--primary-d); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.ai-chip:hover { border-color: var(--primary); }
.ai-out { background: var(--ai-grad-soft); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line)); border-radius: 12px; padding: 14px; margin-top: 10px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; min-height: 40px; }
.ai-out.think { color: var(--muted); font-style: italic; }

/* ============================================================================
   AI THEME — STUNNING LAYER
   ========================================================================== */
/* Ambient gradient aura behind the whole workspace (subtle, light-mode) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 42% at 82% 8%, rgba(168,85,247,.10), transparent 60%),
    radial-gradient(34% 40% at 96% 60%, rgba(34,211,238,.09), transparent 60%),
    radial-gradient(40% 44% at 60% 100%, rgba(99,102,241,.08), transparent 60%);
  animation: auraDrift 22s ease-in-out infinite alternate;
}
@keyframes auraDrift { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(-2%,2%,0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
main, .sidebar { position: relative; z-index: 1; }

/* Cards: crisper glass with a gradient hairline that lights up on hover */
.card, .stat-card { position: relative; background: rgba(255,255,255,.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .15s, box-shadow .18s, border-color .18s; }
.card:hover { border-color: color-mix(in srgb, var(--primary) 26%, var(--line)); box-shadow: 0 2px 8px rgba(20,24,60,.05), 0 10px 34px rgba(99,102,241,.10); }

/* Dashboard stat cards: gradient top-accent + big gradient numbers */
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--ai-grad); opacity: 0; transition: opacity .18s; }
.stat-card:hover::before { opacity: 1; }
.stat-num { background: linear-gradient(120deg, var(--ink), #4f46e5 120%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* View headings get a gradient underline flourish */
.view-head > h1, .view-head > div > h1 { position: relative; }
.view-head h1::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 42px; height: 3px; border-radius: 3px; background: var(--ai-grad); }

/* App launcher: deeper space backdrop + glow ring behind the grid */
.launcher { background: rgba(9,11,32,.66); }
.launcher-inner { position: relative; }
.launcher-inner::before { content: ""; position: absolute; top: -40px; left: 50%; width: 620px; height: 320px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(50% 60% at 50% 0%, rgba(99,102,241,.32), transparent 70%), radial-gradient(45% 55% at 75% 20%, rgba(168,85,247,.24), transparent 70%);
  filter: blur(30px); }
.launcher-head h2 { background: linear-gradient(90deg, #fff, #d8c8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.app-ico { box-shadow: 0 8px 22px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.35), inset 0 -8px 16px rgba(0,0,0,.12); }

/* Login lockbox: glass with a gradient ring */
#authscreen .lockbox { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border: 1px solid rgba(99,102,241,.14); }
.lockbox .btn.primary { width: 100%; justify-content: center; }

/* ---- Mapbox address autocomplete ---- */
.mbx-wrap { position: relative; }
.mbx-suggest {
  display: none; position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
}
.mbx-item {
  display: block; width: 100%; text-align: left; padding: 10px 13px; border: 0;
  background: transparent; font: inherit; color: #1e293b; cursor: pointer; line-height: 1.35;
  border-bottom: 1px solid #f1f5f9;
}
.mbx-item:last-child { border-bottom: 0; }
.mbx-item:hover, .mbx-item.on { background: linear-gradient(90deg, rgba(99,102,241,.10), rgba(168,85,247,.06)); color: #4338ca; }

/* ===================== Design Studio — workflow builder ===================== */
.studio-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.studio-eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 700;
  background: var(--ai-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 2px; }
.wf-settings { margin-bottom: 16px; }
.studio-grid { display: grid; grid-template-columns: 1fr 250px; gap: 22px; align-items: start; }
@media (max-width: 860px) { .studio-grid { grid-template-columns: 1fr; } }

.studio-flow { min-width: 0; }
.wf-trigger, .wf-step {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 16px;
  background: #fff; border: 1px solid #e6e9f2; box-shadow: 0 6px 18px rgba(15,23,42,.05);
}
.wf-trigger { border-color: #111827; background: linear-gradient(180deg,#fff,#f8fafc); }
.wf-step { border-left: 4px solid var(--c, #6366f1); cursor: grab; transition: box-shadow .15s, transform .05s; }
.wf-step:hover { box-shadow: 0 10px 26px rgba(15,23,42,.12); }
.wf-step.dragging { opacity: .45; }
.wf-grip { color: #cbd5e1; cursor: grab; font-size: 13px; letter-spacing: -2px; }
.wf-step-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 11px; color: #fff; font-size: 16px; flex-shrink: 0; box-shadow: 0 4px 10px rgba(15,23,42,.18); }
.wf-step-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.wf-step-body strong { font-size: 14px; color: #0f172a; }
.wf-step-sum { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-mini { border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 8px; flex-shrink: 0; }
.wf-mini:hover { background: #f1f5f9; color: #4338ca; }

.wf-zone { position: relative; margin: 8px 0; border: 2px dashed #d6dbe7; border-radius: 14px; padding: 7px;
  text-align: center; transition: all .15s; }
.wf-zone.over { border-color: #6366f1; background: linear-gradient(90deg, rgba(99,102,241,.09), rgba(168,85,247,.06)); padding: 18px 7px; }
.wf-zone-hint { font-size: 11px; color: #a5adbd; }
/* connector line between the trigger/steps and the drop-zones */
.wf-zone::before { content: ""; position: absolute; left: 50%; top: -9px; width: 2px; height: 9px; background: #d6dbe7; }
.wf-trigger + .wf-zone::before, .wf-step + .wf-zone::before { background: #cbd5e1; }

.studio-lib { position: sticky; top: 14px; background: #fff; border: 1px solid #e6e9f2; border-radius: 16px; padding: 14px; box-shadow: 0 6px 18px rgba(15,23,42,.05); }
.studio-lib-title { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 10px; }
.wf-lib-block { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid #eef1f7;
  margin-bottom: 8px; cursor: grab; background: #fff; transition: border-color .12s, box-shadow .12s, transform .05s; }
.wf-lib-block:hover { border-color: var(--c, #6366f1); box-shadow: 0 6px 16px rgba(15,23,42,.09); }
.wf-lib-block:active { cursor: grabbing; transform: scale(.98); }
.wf-lib-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; font-size: 14px; flex-shrink: 0; }
.wf-lib-txt { min-width: 0; display: flex; flex-direction: column; }
.wf-lib-txt strong { font-size: 13px; color: #0f172a; }
.wf-lib-desc { font-size: 11px; color: #94a3b8; }

/* ---- Mapbox address verification badge ---- */
.abadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.abadge.ok { background: #dcfce7; color: #15803d; }
.abadge.warn { background: #fef3c7; color: #b45309; }
.abadge.bad { background: #fee2e2; color: #b91c1c; }
.abadge.unk { background: #eef2f7; color: #64748b; }

/* ===================== App footer (Unmasked-style, CRM edition) ===================== */
.app-foot { margin-top: 34px; padding: 22px 4px 10px; border-top: 1px solid #e7e9f2; font-size: 13px; color: #64748b; }
.foot-brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.foot-brand strong { font-size: 15px; color: #0f172a; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px 20px; margin-bottom: 16px; }
.fcol-t { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: #94a3b8; font-weight: 700; margin: 0 0 7px; }
.fcol ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.flink { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: #4f46e5; cursor: pointer; text-align: left; text-decoration: none; }
.flink:hover { text-decoration: underline; color: #4338ca; }
.foot-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #eef0f6; font-size: 12px; color: #94a3b8; }

/* ===================== THEMES: light (default) · dark · purple ===================== */
html[data-theme="dark"] {
  --bg: #0f1120; --panel: #181b31; --ink: #e8eaf6; --muted: #9aa0c0; --line: #272b47;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 10px rgba(0,0,0,.35);
  --glow: 0 0 0 1px rgba(129,140,248,.25), 0 8px 30px rgba(99,102,241,.35);
  --side-bg: #090b1a; color-scheme: dark;
}
html[data-theme="purple"] {
  --bg: #f3efff; --panel: #ffffff; --ink: #241a47; --muted: #7b6fa8; --line: #e4dcf7;
  --primary: #7c3aed; --primary-d: #6d28d9; --accent: #c026d3;
  --ai-grad: linear-gradient(115deg, #7c3aed 0%, #c026d3 55%, #f472b6 100%);
  --ai-grad-soft: linear-gradient(115deg, rgba(124,58,237,.15), rgba(192,38,211,.12), rgba(244,114,182,.12));
  --glow: 0 0 0 1px rgba(124,58,237,.15), 0 8px 30px rgba(124,58,237,.25);
  --side-bg: #1e1339;
}
/* dark: neutralize hardcoded light backgrounds from later layers */
html[data-theme="dark"] .card, html[data-theme="dark"] .stat-card { background: rgba(24,27,49,.92); border-color: var(--line); }
html[data-theme="dark"] body::before { opacity: .25; }
html[data-theme="dark"] .input, html[data-theme="dark"] select.input, html[data-theme="dark"] textarea.input,
html[data-theme="dark"] input.input { background: #12142a; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .ss th { background: #1c2038; }
html[data-theme="dark"] .ss td, html[data-theme="dark"] .ss th { border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .feed-row, html[data-theme="dark"] .list-row { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .modal-card { background: var(--panel); color: var(--ink); }
html[data-theme="dark"] .kcol { background: #14172c; }
html[data-theme="dark"] .kcard { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .mbx-suggest { background: var(--panel); border-color: var(--line); }
html[data-theme="dark"] .mbx-item { color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .stat-num { background: linear-gradient(120deg, #c7d2fe, #a5b4fc 120%); -webkit-background-clip: text; background-clip: text; }
html[data-theme="dark"] .app-foot { border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .foot-bar { border-color: var(--line); }
html[data-theme="dark"] .flink { color: #a5b4fc; }
html[data-theme="dark"] .tchip, html[data-theme="dark"] .chip { filter: brightness(1.15); }
html[data-theme="dark"] .empty { background: #14172c; border-color: var(--line); }
html[data-theme="dark"] .launcher-inner { background: rgba(18,20,42,.96); }
html[data-theme="purple"] .side-nav .nav-btn.on { background: linear-gradient(90deg, rgba(124,58,237,.5), rgba(192,38,211,.3)); }

/* ===================== Toasts ===================== */
#toasts { position: fixed; right: 18px; bottom: 84px; z-index: 240; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 12px; padding: 11px 16px; font-size: 13.5px; box-shadow: 0 12px 32px rgba(15,23,42,.18);
  animation: toastIn .22s ease; max-width: 340px; pointer-events: auto; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===================== Command palette (⌘K) ===================== */
.palette { position: fixed; inset: 0; z-index: 230; background: rgba(10,12,30,.45); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.pal-box { width: 100%; max-width: 560px; background: var(--panel); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(10,12,40,.4); overflow: hidden; }
.pal-box input { width: 100%; border: 0; outline: 0; padding: 17px 20px; font: inherit; font-size: 16.5px; background: transparent; color: var(--ink); }
.pal-list { max-height: 46vh; overflow: auto; border-top: 1px solid var(--line); padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 0;
  padding: 10px 12px; border-radius: 10px; font: inherit; color: var(--ink); cursor: pointer; }
.pal-item .pi { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; background: var(--ai-grad-soft); flex: none; }
.pal-item .pl { min-width: 0; flex: 1; } .pal-item .pl b { display: block; font-size: 14px; }
.pal-item .pl span { font-size: 11.5px; color: var(--muted); }
.pal-item.on, .pal-item:hover { background: var(--ai-grad-soft); }
.pal-hint { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; gap: 14px; }
.pal-hint kbd { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-family: inherit; }
.sidebar .search-trigger { display: flex; align-items: center; gap: 8px; margin: 2px 10px 10px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #aab0d0; font: inherit; font-size: 12.5px; cursor: pointer; width: calc(100% - 20px); }
.sidebar .search-trigger:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .search-trigger kbd { margin-left: auto; font-size: 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 1px 5px; }

/* ===================== Contact avatars ===================== */
.avat { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  color: #fff; font-size: 12.5px; font-weight: 700; flex: none; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(15,23,42,.18); }
.avat.lg { width: 52px; height: 52px; font-size: 19px; }

/* ===================== Onboarding checklist ===================== */
.onboard { border-left: 4px solid var(--primary); }
.onboard .ob-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.onboard .ob-row.done { color: var(--muted); text-decoration: line-through; }
.onboard .ob-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.onboard .ob-row.done .ob-dot { background: #10b981; border-color: #10b981; color: #fff; }
.onboard .ob-bar { height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; margin: 8px 0 4px; }
.onboard .ob-bar i { display: block; height: 100%; background: var(--ai-grad); border-radius: 99px; transition: width .4s; }

/* ===================== Mobile bottom tabs ===================== */
#mobileTabs { display: none; }
@media (max-width: 760px) {
  #mobileTabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; background: var(--panel);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgba(15,23,42,.08); }
  #mobileTabs button { flex: 1; background: none; border: 0; font: inherit; font-size: 10.5px; color: var(--muted); display: flex;
    flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; cursor: pointer; border-radius: 10px; }
  #mobileTabs button .mt-i { font-size: 19px; line-height: 1; }
  #mobileTabs button.on { color: var(--primary); }
  main#app { padding-bottom: 86px !important; }
  .ai-fab { bottom: 76px; }
  #toasts { bottom: 140px; }
}

/* ===================== Empty states, upgraded ===================== */
.empty { border: 2px dashed var(--line); border-radius: 18px; background: var(--panel); text-align: center; padding: 44px 24px; }
.empty::before { content: attr(data-e); display: block; font-size: 44px; margin-bottom: 10px; filter: saturate(1.1); }
.empty:not([data-e])::before { content: "✨"; opacity: .85; }
.empty p { color: var(--muted); max-width: 440px; margin: 0 auto 8px; }

/* ===================== Shortcuts overlay ===================== */
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: center; font-size: 14px; }
.kbd-grid kbd { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-family: inherit; font-size: 12.5px; box-shadow: 0 1px 0 var(--line); white-space: nowrap; }

/* ===================== Dashboard drag widgets ===================== */
.dwidget { position: relative; }
.dwidget .dw-grip { position: absolute; top: 10px; right: 10px; z-index: 5; cursor: grab; color: var(--muted); opacity: 0;
  transition: opacity .15s; font-size: 14px; letter-spacing: -2px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 2px 7px; }
.dwidget:hover .dw-grip { opacity: .9; }
.dwidget.dragging { opacity: .5; }
.dwidget.dover { outline: 2px dashed var(--primary); outline-offset: 4px; border-radius: var(--radius); }
