:root{
  --bg:#f5f7fb;--card:#fff;--text:#0f172a;--muted:#64748b;--line:#e2e8f0;
  --primary:#2563eb;--primary-soft:#dbeafe;--nav:#0f172a;--nav2:#1e293b;
  --green:#16a34a;--red:#ef4444;--orange:#f59e0b;--purple:#7c3aed;--cyan:#06b6d4;--pink:#e11d48;
  --radius:14px;--shadow:0 8px 24px rgba(15,23,42,.06)
}
*{box-sizing:border-box}
html{font-size:15px}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:14px;font-weight:400;line-height:1.45}
h1,h2,h3,strong,b{font-weight:600}a{color:var(--primary);text-decoration:none}code{display:block;white-space:pre-wrap;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:10px;color:#334155}.app-shell{display:grid;grid-template-columns:220px 1fr;min-height:100vh}.sidebar{background:var(--nav);color:#fff;padding:22px 12px;position:sticky;top:0;height:100vh;z-index:10}.brand{display:flex;gap:10px;align-items:center;margin:0 6px 24px}.brand-mark,.logo-mark{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,#2563eb,#22c55e);display:grid;place-items:center;color:#fff;font-weight:600;font-size:12px}.brand small{display:block;color:#b6c2d4;font-size:12px;margin-top:1px}.nav-link{display:flex;gap:9px;align-items:center;color:#dbe3f0;padding:10px 11px;border-radius:10px;margin:3px 0;font-weight:500;font-size:13px}.nav-link span{width:16px;text-align:center;color:#9fb0c8}.nav-link:hover,.nav-link.active{background:var(--nav2);color:#fff}.main{padding:24px;min-width:0}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:12px}.topbar h1{font-size:24px;margin:0;letter-spacing:-.02em}.crumb{margin:4px 0 0;color:var(--muted);font-size:12px}.top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.user-pill{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 11px;color:#334155;font-size:12px}.btn{border:1px solid var(--line);background:#fff;color:#1e293b;border-radius:9px;padding:8px 11px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;font-size:13px;min-height:34px}.btn:hover{border-color:#bfdbfe;background:#f8fbff}.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn.success{background:var(--green);border-color:var(--green);color:#fff}.btn.danger{color:#b91c1c;border-color:#fecaca;background:#fff5f5}.btn.ghost{background:#fff}.btn.tiny{padding:5px 7px;font-size:12px;border-radius:7px;min-height:28px}.btn.full{width:100%;justify-content:center}.alert{padding:12px 14px;border-radius:10px;margin:0 0 16px;background:#ecfdf5;border:1px solid #bbf7d0;color:#166534}.alert-danger{background:#fef2f2;border-color:#fecaca;color:#991b1b}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;margin-bottom:16px}.card h2{font-size:16px;margin:0 0 12px}.card h3{font-size:14px;margin:16px 0 10px}.card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.muted{color:var(--muted)}.small{font-size:12px}.metric-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:12px;margin-bottom:16px}.metric{background:#fff;border:1px solid var(--line);border-bottom:3px solid var(--primary);border-radius:12px;padding:14px 16px;box-shadow:var(--shadow);display:flex;justify-content:space-between;min-height:78px}.metric span{display:block;color:#334155;font-size:12px;font-weight:500}.metric strong{display:block;font-size:24px;margin-top:4px;line-height:1}.metric small{color:var(--muted);font-size:12px}.accent-green{border-bottom-color:var(--green)}.accent-red{border-bottom-color:var(--red)}.accent-orange{border-bottom-color:var(--orange)}.accent-purple{border-bottom-color:var(--purple)}.accent-cyan{border-bottom-color:var(--cyan)}.dash-grid{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:16px}.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.report-grid .wide{grid-column:1/-1}.mini-list{display:grid;gap:8px}.mini-list a{display:grid;grid-template-columns:minmax(140px,1fr) auto;gap:10px;align-items:center;border:1px solid var(--line);background:#f8fafc;border-radius:10px;padding:9px 10px}.mini-list b{display:block;color:#111827}.mini-list span{display:block;font-size:12px;color:var(--muted);margin-top:2px}.activity{display:grid;gap:10px}.activity>div{display:flex;gap:10px;margin:0}.avatar{width:28px;height:28px;border-radius:999px;background:var(--primary);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:600;flex:0 0 auto}.activity p{margin:0;color:#334155}.activity small{display:block;color:var(--muted);font-size:12px;margin-top:3px}.toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.filters input,.filters select{min-width:145px}.filters input[name=search]{min-width:240px}.toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}.seg{background:#fff;border:1px solid var(--line);border-radius:999px;padding:3px;display:inline-flex}.seg a{padding:6px 14px;border-radius:999px;color:#334155;font-weight:500}.seg a.on{background:var(--primary);color:#fff}.subtabs{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}.subtabs a{background:#fff;border:1px solid var(--line);border-radius:999px;padding:8px 12px;color:#334155;font-weight:500}.subtabs a.active{background:var(--primary-soft);border-color:#93c5fd;color:#1d4ed8}.table-card,.table-wrap{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:auto;box-shadow:var(--shadow)}table{width:100%;border-collapse:collapse}.lead-table{min-width:980px}.lead-table th{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.02em;background:#f8fafc;font-weight:600;position:sticky;top:0;z-index:1}.lead-table th,.lead-table td{padding:10px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}.lead-table tr:last-child td{border-bottom:0}.lead-table tr.row-today td:first-child{border-left:3px solid #3b82f6}.lead-table tr.row-followup{background:#fffbeb}.lead-table tr.row-overdue{background:#fef2f2}.lead-table tr.row-overdue td:first-child{border-left:3px solid var(--red)}.lead-table tr.row-converted{background:#f0fdf4}.row-actions{display:flex;gap:5px;flex-wrap:wrap}.badge,.type-chip{display:inline-flex;align-items:center;border-radius:999px;padding:4px 8px;font-size:12px;font-weight:500;background:#f1f5f9;color:#334155;white-space:nowrap}.badge-blue{background:#dbeafe;color:#1d4ed8}.badge-sky{background:#e0f2fe;color:#0369a1}.badge-orange{background:#ffedd5;color:#c2410c}.badge-purple{background:#ede9fe;color:#6d28d9}.badge-indigo{background:#e0e7ff;color:#4338ca}.badge-pink{background:#fce7f3;color:#be185d}.badge-green{background:#dcfce7;color:#15803d}.badge-red{background:#fee2e2;color:#b91c1c}.badge-gray{background:#f1f5f9;color:#475569}.badge-violet{background:#f3e8ff;color:#7e22ce}.type-chip{background:#eef2ff;color:#3730a3}.board{display:grid;grid-template-columns:repeat(4,minmax(260px,1fr));gap:12px}.board-col{background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:12px;min-height:240px}.board-col h3{margin:0 0 10px;font-size:13px;display:flex;align-items:center;gap:6px}.board-col h3 em{font-style:normal;color:var(--muted);margin-left:auto}.dot-status{width:8px;height:8px;border-radius:999px;background:#94a3b8}.dot-status.blue{background:#3b82f6}.dot-status.sky{background:#06b6d4}.dot-status.orange{background:#f59e0b}.dot-status.purple{background:#8b5cf6}.dot-status.indigo{background:#6366f1}.dot-status.pink{background:#e11d48}.dot-status.green{background:#22c55e}.dot-status.red{background:#ef4444}.dot-status.violet{background:#7c3aed}.lead-card{background:#fff;border:1px solid var(--line);border-left:3px solid #94a3b8;border-radius:10px;padding:11px;margin-bottom:10px;box-shadow:0 3px 10px rgba(15,23,42,.04)}.lead-card.status-blue{border-left-color:#3b82f6}.lead-card.status-sky{border-left-color:#06b6d4}.lead-card.status-orange{border-left-color:#f59e0b}.lead-card.status-purple{border-left-color:#8b5cf6}.lead-card.status-indigo{border-left-color:#6366f1}.lead-card.status-pink{border-left-color:#e11d48}.lead-card.status-green{border-left-color:#22c55e}.lead-card.status-red{border-left-color:#ef4444}.lead-card.status-violet{border-left-color:#7c3aed}.lead-card.status-gray{border-left-color:#94a3b8}.card-title{font-weight:600;color:#0f172a}.lead-card p{margin:5px 0;color:#334155;font-size:12px}.lead-card small{color:var(--muted)}.card-actions{margin-top:8px}.quick-form label,form label{display:block;font-weight:500;margin:0 0 10px}.quick-form input,.quick-form select,.quick-form textarea,input,select,textarea{width:100%;border:1px solid #cbd5e1;border-radius:9px;padding:8px 10px;font:inherit;font-weight:400;background:#fff;margin-top:5px}input[type=checkbox],input[type=radio]{width:auto;margin:0 7px 0 0;vertical-align:middle}.check-label{display:flex!important;align-items:center;gap:7px;min-height:38px;margin:0!important;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:9px 10px}.check-label input{margin:0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.form-grid.eight{grid-template-columns:repeat(4,minmax(0,1fr))}.form-grid.small{grid-template-columns:1fr 1fr}.compact-form{max-width:1180px}.quick-form details{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:10px;padding:10px;margin:8px 0 14px}.quick-form summary{cursor:pointer;font-weight:500;color:#334155}.column-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px}.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.summary-grid div{background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:10px}.summary-grid span{display:block;color:var(--muted);font-size:12px}.summary-grid strong{display:block;margin-top:4px;font-size:13px;word-break:break-word}.quick-stack{display:grid;grid-template-columns:1fr 1fr;gap:8px}.timeline-item{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}.timeline-item:last-child{border-bottom:0}.timeline-item>span{width:9px;height:9px;border-radius:999px;background:var(--primary);margin-top:5px;flex:0 0 auto}.timeline-item p{margin:3px 0;color:#334155}.timeline-item small{color:var(--muted)}.modal[hidden]{display:none!important}.modal{position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:9999;align-items:center;justify-content:center;padding:20px}.modal.show{display:flex}.modal-box{background:#fff;border-radius:16px;width:min(620px,100%);max-height:92vh;overflow:auto;box-shadow:0 20px 70px rgba(0,0,0,.25);padding:18px;position:relative}.modal-close{position:absolute;right:12px;top:10px;border:0;background:#f1f5f9;border-radius:8px;width:30px;height:30px;cursor:pointer;font-size:20px;line-height:1}.template-row{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 12px}.template-note{border:1px solid var(--line);background:#f8fafc;border-radius:999px;padding:6px 9px;cursor:pointer;color:#334155}.mini-table td{padding:8px 0;border-bottom:1px solid var(--line)}.mini-table td:last-child{text-align:right;font-weight:600}.report-box{background:#0f172a;color:#e2e8f0;border-radius:10px;padding:14px;white-space:pre-wrap;overflow:auto;max-height:360px}.empty{color:var(--muted);padding:14px!important}.login-body{display:grid;place-items:center;min-height:100vh;background:#f1f5f9}.login-card{width:min(420px,92vw);background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:28px}.login-card h1{margin:8px 0 4px}.help-list{margin:8px 0 0;padding-left:18px;color:#475569}.help-list li{margin:5px 0}.kbd{display:inline-block;background:#f1f5f9;border:1px solid #cbd5e1;border-radius:7px;padding:2px 6px;color:#334155;font-size:12px}@media(max-width:1400px){.metric-grid{grid-template-columns:repeat(3,1fr)}.dash-grid{grid-template-columns:1fr}.board{grid-template-columns:repeat(3,minmax(260px,1fr))}.form-grid.eight{grid-template-columns:repeat(2,1fr)}.summary-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:980px){.app-shell{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.main{padding:14px}.topbar,.toolbar{align-items:flex-start;flex-direction:column}.toolbar-actions{margin-left:0}.metric-grid,.grid.two,.report-grid,.detail-layout,.form-grid,.form-grid.eight,.column-grid{grid-template-columns:1fr}.board{grid-template-columns:1fr}.lead-table{min-width:0}.lead-table thead{display:none}.lead-table tr{display:block;padding:8px;border-bottom:1px solid var(--line)}.lead-table td{display:flex;justify-content:space-between;gap:12px;border:0;padding:7px 10px}.lead-table td:before{content:attr(data-label);font-weight:600;color:var(--muted)}.mini-list a{grid-template-columns:1fr}.top-actions{width:100%}}

/* v4 visual smart cards */
.wide{grid-column:1/-1}.visual-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:16px}.visual-card{overflow:hidden}.visual-top .metric{min-height:84px}.followup-strip{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px}.bucket{display:block;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:12px;color:#0f172a}.bucket span{display:block;font-size:12px;color:#475569}.bucket strong{display:block;font-size:22px;margin:2px 0 8px}.bucket i,.bar-row i,.funnel-row i{display:block;height:8px;background:#e2e8f0;border-radius:999px;overflow:hidden}.bucket i em,.bar-row i em,.funnel-row i em{display:block;height:100%;background:var(--primary);border-radius:999px}.bucket-red i em,.pill-red{--local:var(--red)}.bucket-orange i em{background:var(--orange)}.bucket-green i em{background:var(--green)}.bucket-purple i em{background:var(--purple)}.bucket-cyan i em{background:var(--cyan)}.bucket-pink i em{background:var(--pink)}.bucket-red i em{background:var(--red)}.bucket-indigo i em{background:#6366f1}.smart-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;margin:0 0 16px}.smart-pill{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;box-shadow:var(--shadow);color:#0f172a}.smart-pill span{display:block;color:#475569;font-size:12px}.smart-pill strong{display:block;font-size:23px}.mini-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}.mini-stat-grid .smart-pill{box-shadow:none;background:#f8fafc}.donut-wrap{display:grid;grid-template-columns:138px 1fr;gap:18px;align-items:center}.donut,.score-ring{border-radius:999px;display:grid;place-items:center;background:conic-gradient(var(--primary) calc(var(--p,50)*1%),#e2e8f0 0)}.donut{width:128px;height:128px}.donut span,.score-ring span{background:#fff;border-radius:999px;width:74px;height:74px;display:grid;place-items:center;font-weight:600}.legend{display:grid;gap:8px}.legend a{display:grid;grid-template-columns:12px 1fr auto;gap:8px;align-items:center;color:#334155}.legend i{width:10px;height:10px;border-radius:999px}.bar-list{display:grid;gap:9px}.bar-row{display:grid;grid-template-columns:105px minmax(80px,1fr) 34px;gap:8px;align-items:center}.bar-row span{font-size:12px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-row b{text-align:right;font-size:12px}.bar-row i em{background:var(--primary)}.funnel{display:grid;gap:11px}.funnel-row{display:grid;grid-template-columns:95px 34px 1fr;gap:10px;align-items:center}.funnel-row span{font-weight:500;color:#334155}.funnel-row b{font-size:13px;text-align:right}.funnel-row i{height:14px}.staff-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.staff-card{border:1px solid var(--line);background:#f8fafc;border-radius:12px;padding:12px;display:grid;gap:8px}.staff-card small{display:block;color:var(--muted);font-size:12px}.score-ring{--p:50;width:62px;height:62px;background:conic-gradient(var(--green) calc(var(--p)*1%),#e2e8f0 0);justify-self:end;margin-top:-42px}.score-ring span{width:40px;height:40px;font-size:12px}.score-ring.big{width:92px;height:92px;margin:0;justify-self:auto}.score-ring.big span{width:58px;height:58px;font-size:18px}.stars{color:#d97706;margin:0}.tiny-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.tiny-grid span{background:#fff;border:1px solid var(--line);border-radius:8px;padding:6px;font-size:12px;color:#475569}.tiny-grid b{float:right;color:#0f172a}.lead-score-line{display:flex;align-items:center;gap:16px}.map-frame{width:100%;height:220px;border:0;border-radius:12px;background:#f1f5f9}.score-mini{display:inline-grid;place-items:center;min-width:34px;height:28px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:600}.danger-text{color:#b91c1c;font-weight:600}.visual-subtitle{margin:2px 0 8px!important}.pill-red{border-color:#fecaca}.pill-orange{border-color:#fed7aa}.pill-green{border-color:#bbf7d0}.pill-violet{border-color:#ddd6fe}.pill-blue{border-color:#bfdbfe}.pill-cyan{border-color:#a5f3fc}
@media(max-width:1400px){.visual-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.followup-strip{grid-template-columns:repeat(4,1fr)}.smart-grid{grid-template-columns:repeat(4,1fr)}.staff-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:980px){.visual-grid,.followup-strip,.smart-grid,.staff-grid,.donut-wrap{grid-template-columns:1fr}.mini-stat-grid{grid-template-columns:1fr 1fr}.bar-row{grid-template-columns:88px 1fr 30px}.funnel-row{grid-template-columns:78px 30px 1fr}.score-ring{margin-top:0;justify-self:start}}

/* v5 Herozi-inspired compact CRM refinements */
.nav-link{position:relative}.nav-link b{font-weight:500;flex:1}.nav-badge{margin-left:auto;min-width:22px;height:20px;padding:0 7px;border-radius:999px;background:#2563eb;color:#fff;display:inline-grid;place-items:center;font-size:11px;font-style:normal;font-weight:600}.side-summary{margin:16px 6px 0;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.06);display:grid;gap:2px}.side-summary span,.side-summary small{color:#b6c2d4;font-size:12px}.side-summary strong{font-size:24px;color:#fff;line-height:1}.period-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 16px}.period-tabs span{color:#64748b;font-weight:600;margin-right:2px}.period-tabs a{background:#fff;border:1px solid var(--line);border-radius:999px;color:#334155;padding:8px 14px;font-weight:500;box-shadow:0 3px 10px rgba(15,23,42,.03)}.period-tabs a.active{background:#2563eb;border-color:#2563eb;color:#fff}.period-card{border-top:3px solid #2563eb}.period-groups{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.period-groups article{border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:12px}.period-groups h3{margin:0 0 8px!important;color:#0f172a}.period-groups p{margin:0;padding:7px 0;border-bottom:1px solid #e5edf6;display:flex;justify-content:space-between;gap:12px}.period-groups p:last-child{border-bottom:0}.period-groups span{color:#64748b}.period-groups strong{font-size:16px}.period-bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:16px}.report-menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:16px}.report-menu{display:grid;gap:10px;align-content:start}.report-menu h2{margin-bottom:2px}.report-tile{display:block;border:1px solid var(--line);border-left:3px solid var(--primary);border-radius:12px;background:#f8fafc;padding:11px;color:#0f172a}.report-tile span,.report-tile small{display:block;color:#64748b;font-size:12px}.report-tile strong{display:block;font-size:22px;line-height:1.1;margin:4px 0}.tile-green{border-left-color:var(--green)}.tile-orange{border-left-color:var(--orange)}.tile-red{border-left-color:var(--red)}.report-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.report-text-card{border-top:3px solid #0f172a}.report-actions{display:flex;gap:8px;flex-wrap:wrap}.report-mini-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.report-action .report-tile{box-shadow:none}.follow-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.follow-card{border:1px solid var(--line);border-left:4px solid #94a3b8;background:#fff;border-radius:14px;padding:13px;box-shadow:0 6px 18px rgba(15,23,42,.05)}.follow-card.status-blue{border-left-color:#3b82f6}.follow-card.status-sky{border-left-color:#06b6d4}.follow-card.status-orange{border-left-color:#f59e0b}.follow-card.status-purple{border-left-color:#8b5cf6}.follow-card.status-indigo{border-left-color:#6366f1}.follow-card.status-pink{border-left-color:#e11d48}.follow-card.status-green{border-left-color:#22c55e}.follow-card.status-red{border-left-color:#ef4444}.follow-card.status-violet{border-left-color:#7c3aed}.follow-title{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px}.follow-title a{font-weight:600;color:#0f172a}.follow-title small{display:block;color:#64748b;margin-top:2px}.follow-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}.follow-meta p{margin:0;border:1px solid var(--line);border-radius:10px;background:#f8fafc;padding:8px}.follow-meta span{display:block;font-size:11px;color:#64748b}.follow-meta b{display:block;font-size:12px;color:#0f172a;margin-top:2px;word-break:break-word}.badge-line{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0 10px}.mini-history{border-top:1px solid var(--line);padding-top:8px;margin-top:8px;display:grid;gap:6px}.mini-history p{display:grid;grid-template-columns:48px 86px 1fr;gap:6px;margin:0;align-items:start}.mini-history span{color:#64748b;font-size:11px}.mini-history b{font-size:12px;color:#334155}.mini-history small{font-size:12px;color:#64748b;line-height:1.25}.columns-card{max-width:none}.columns-six{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.columns-six section{border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:12px;display:grid;gap:8px;align-content:start}.columns-six h3{margin:0 0 4px!important}.columns-six .check-label{background:#fff;min-height:34px;padding:8px;font-size:12px}.column-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}.visual-report .staff-grid{grid-column:1/-1}
@media(max-width:1400px){.period-groups{grid-template-columns:repeat(2,1fr)}.period-bottom,.report-menu-grid,.report-grid.three,.follow-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.columns-six{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:980px){.period-groups,.period-bottom,.report-menu-grid,.report-grid.three,.follow-card-grid,.columns-six,.report-mini-grid{grid-template-columns:1fr}.mini-history p{grid-template-columns:44px 80px 1fr}.report-actions{width:100%}.report-actions .btn{flex:1}}

/* v6 compact filters, grouped buckets, export center, WATI cards */
.compact-list-toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px;position:relative;z-index:2}.quick-search{display:flex;gap:8px;align-items:center;flex:1;min-width:0}.quick-search input{margin-top:0;min-width:280px;max-width:760px}.quick-filter-panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:13px 14px;margin-bottom:14px;display:grid;grid-template-columns:150px repeat(7,minmax(0,auto));gap:10px;align-items:start}.quick-filter-title h2{font-size:15px;margin:0 0 2px}.quick-filter-title p{margin:0}.chip-group{display:grid;gap:5px}.chip-group>span{font-size:11px;color:#64748b;font-weight:600;text-transform:uppercase;letter-spacing:.03em}.chip-group>div{display:flex;gap:6px;flex-wrap:wrap}.chip-btn,.export-option{border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:500;color:#334155;white-space:nowrap;display:inline-flex;align-items:center;gap:5px}.chip-btn.active,.chip-btn:hover{box-shadow:inset 0 0 0 1px currentColor}.chip-blue{border-color:#bfdbfe!important;background:#eff6ff!important;color:#1d4ed8!important}.chip-indigo{border-color:#c7d2fe!important;background:#eef2ff!important;color:#4338ca!important}.chip-violet,.chip-purple{border-color:#ddd6fe!important;background:#f5f3ff!important;color:#6d28d9!important}.chip-orange{border-color:#fed7aa!important;background:#fff7ed!important;color:#c2410c!important}.chip-cyan{border-color:#a5f3fc!important;background:#ecfeff!important;color:#0e7490!important}.chip-slate{border-color:#cbd5e1!important;background:#f8fafc!important;color:#334155!important}.chip-green{border-color:#bbf7d0!important;background:#f0fdf4!important;color:#15803d!important}.chip-amber{border-color:#fde68a!important;background:#fffbeb!important;color:#b45309!important}.chip-red,.chip-red-soft{border-color:#fecaca!important;background:#fef2f2!important;color:#b91c1c!important}.chip-dark{border-color:#94a3b8!important;background:#e2e8f0!important;color:#0f172a!important}.chip-gray{border-color:#e2e8f0!important;background:#f8fafc!important;color:#475569!important}.filter-drawer{position:fixed;right:28px;top:92px;width:390px;max-width:calc(100vw - 32px);background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.22);padding:16px;z-index:80}.drawer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px}.drawer-head h2{margin:0;font-size:18px}.drawer-head p{margin:2px 0 0}.drawer-close{width:32px;height:32px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:20px;line-height:1;cursor:pointer}.drawer-form{display:grid;gap:10px}.drawer-form label{margin:0}.drawer-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.drawer-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:4px}.report-main-grid{align-items:stretch}.report-text-mini{display:flex;flex-direction:column;min-height:100%}.report-box.compact{max-height:190px;min-height:150px;overflow:auto;font-size:12px;line-height:1.45;white-space:pre-wrap;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:10px;margin:0 0 10px}.import-export-grid{display:grid;grid-template-columns:1.1fr 1.4fr;gap:16px}.history-card{grid-column:1/-1}.upload-box{border:1px dashed #cbd5e1;background:#f8fafc;border-radius:12px;padding:12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}.upload-box input{margin:0;max-width:360px}.export-option-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.export-option{border-radius:12px;padding:12px;display:grid;gap:3px;align-content:start;min-height:82px}.export-option strong{font-size:14px;color:inherit}.export-option span{font-size:12px;color:#64748b}.export-option em{font-style:normal;font-size:11px;font-weight:600;justify-self:start;border-radius:999px;background:#fff;padding:3px 7px;border:1px solid currentColor}.export-text-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.wati-dashboard-form{display:block}.wati-layout{display:grid;grid-template-columns:1fr 1fr;gap:16px}.wati-card{margin-bottom:0}.templates-wide{grid-column:1/-1}.wati-connection-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.wati-rule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.wati-rule{display:flex!important;align-items:flex-start;gap:10px;border:1px solid var(--line);background:#f8fafc;border-radius:12px;padding:12px;margin:0!important}.wati-rule input{margin-top:4px}.wati-rule span{display:grid;gap:2px}.wati-rule b{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.03em}.wati-rule strong{font-size:13px}.wati-rule small{color:#64748b;font-size:12px}.wati-queue-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.queue-card{border:1px solid var(--line);border-radius:13px;padding:13px;display:grid;gap:3px;color:#0f172a}.queue-card b{font-size:24px;line-height:1}.queue-card span{font-size:12px;color:#475569}.template-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.template-card{border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:11px;margin:0!important}.template-card span{display:block;font-weight:600;margin-bottom:7px}.template-card textarea{margin:0;background:#fff;min-height:92px}.mini-table th{font-size:11px;text-transform:uppercase;color:#64748b;background:#f8fafc}.mini-table th,.mini-table td{padding:9px 10px;border-bottom:1px solid var(--line);text-align:left}
@media(max-width:1400px){.quick-filter-panel{grid-template-columns:1fr 1fr 1fr}.export-option-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wati-queue-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:980px){.compact-list-toolbar{display:grid}.quick-search{display:grid;grid-template-columns:1fr auto auto}.quick-search input{min-width:0}.quick-filter-panel,.import-export-grid,.wati-layout,.wati-connection-grid,.wati-rule-grid,.template-card-grid{grid-template-columns:1fr}.filter-drawer{left:12px;right:12px;top:auto;bottom:12px;width:auto;max-height:88vh;overflow:auto}.drawer-two,.export-option-grid,.wati-queue-grid{grid-template-columns:1fr}.toolbar-actions{margin-left:0}.history-card,.templates-wide{grid-column:auto}}

/* v7 targeted UI corrections */
.quick-search{flex:0 1 560px;max-width:620px}.quick-search input{min-width:220px;max-width:420px;width:100%}.compact-list-toolbar{align-items:center}.reset-btn{white-space:nowrap}.quick-filter-panel{grid-template-columns:150px repeat(4,minmax(0,1fr));align-items:start}.chip-group{min-width:0}.chip-group>div{min-width:0}.period-wrap{display:grid;gap:10px;margin-bottom:14px}.range-form{display:flex;gap:10px;align-items:end;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 12px;box-shadow:var(--shadow)}.range-form label{font-size:12px;color:#64748b;margin:0}.range-form input{margin:4px 0 0;min-width:150px}.age-badge{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:999px;padding:4px 8px;font-size:11px;font-weight:600;white-space:nowrap}.age-badge b{font-size:10px;text-transform:uppercase;letter-spacing:.02em;color:#64748b}.age-blue{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.age-green{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}.age-amber{background:#fffbeb;border-color:#fde68a;color:#b45309}.age-red{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.board-card-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.board-card-top .age-badge{transform:scale(.92);transform-origin:right top}.report-detail-card{grid-column:1/-1}.report-detail-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.report-detail-group{border:1px solid var(--line);border-radius:14px;background:#f8fafc;padding:12px}.report-detail-group h3{margin:0 0 8px;font-size:14px}.report-detail-group p{display:flex;justify-content:space-between;gap:12px;margin:0;padding:7px 0;border-bottom:1px dashed #dbe4ef;font-size:13px}.report-detail-group p:last-child{border-bottom:0}.report-detail-group span{color:#64748b}.report-detail-group strong{text-align:right}.report-detail-bottom{display:grid;grid-template-columns:1fr 1fr 1.1fr;gap:14px;margin-top:14px}.report-box.detail{min-height:230px;max-height:300px;overflow:auto;white-space:pre-wrap;background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:12px;margin:0;font-size:13px;line-height:1.55}.report-actions.top{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.report-selected-visuals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px}.reminder-toast{position:fixed;right:22px;bottom:22px;width:285px;background:#0f172a;color:#fff;border-radius:18px;box-shadow:0 22px 60px rgba(15,23,42,.35);padding:16px;z-index:120}.reminder-toast h3{margin:0 0 8px;font-size:16px}.reminder-toast p{margin:5px 0;color:#dbeafe;font-size:13px}.reminder-toast b{font-size:16px;color:#fff}.reminder-toast .btn{background:#fff;color:#0f172a;border-color:#fff;margin-right:6px}.reminder-toast .btn.primary{background:#2563eb;color:#fff;border-color:#2563eb}.reminder-close{position:absolute;right:10px;top:8px;border:0;background:transparent;color:#fff;font-size:20px;cursor:pointer}.template-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.report-main-grid{grid-template-columns:1fr!important}.report-text-mini{max-width:none}
@media(max-width:1180px){.quick-filter-panel{grid-template-columns:1fr 1fr}.report-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.report-detail-bottom,.report-selected-visuals{grid-template-columns:1fr}.template-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.main{padding:14px}.compact-list-toolbar{gap:10px}.quick-search{display:grid;grid-template-columns:1fr 1fr;max-width:none;width:100%;flex-basis:100%}.quick-search input{grid-column:1/-1;max-width:none}.quick-search .primary,.quick-search .filter-toggle,.quick-search .reset-btn{width:100%;justify-content:center}.toolbar-actions{display:grid;grid-template-columns:1fr;gap:8px;width:100%}.toolbar-actions .seg{width:100%;display:grid;grid-template-columns:1fr 1fr}.toolbar-actions .btn{width:100%;justify-content:center}.quick-filter-panel{grid-template-columns:1fr;padding:12px}.chip-group>div{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px}.chip-btn{flex:0 0 auto}.report-detail-grid,.report-detail-bottom,.report-selected-visuals,.template-card-grid{grid-template-columns:1fr}.report-actions.top{justify-content:flex-start}.range-form{display:grid;grid-template-columns:1fr}.range-form input{width:100%}.reminder-toast{left:12px;right:12px;bottom:12px;width:auto}.board-card-top{display:grid}.age-badge{width:max-content}.lead-table td[data-label="New Lead"]{min-width:135px}}
/* v8 shortcut keys + new-lead workflow */
.next-top,.next-lead-btn{white-space:nowrap}.age-orange{background:#fff7ed;border-color:#fed7aa;color:#c2410c}.age-badge{font-weight:600}.shortcut-box{max-width:560px}.shortcut-list{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin:14px 0}.shortcut-list p{display:flex;align-items:center;gap:10px;margin:0;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#f8fafc}.shortcut-list kbd,.shortcut-settings kbd{border:1px solid #cbd5e1;background:#fff;border-radius:7px;padding:3px 7px;font-weight:600;color:#0f172a;min-width:46px;text-align:center}.shortcut-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}.shortcut-setting{border:1px solid var(--line);background:#f8fafc;border-radius:13px;padding:11px;margin:0!important;display:grid;gap:8px}.shortcut-setting span{font-weight:600}.shortcut-setting input[type=text],.shortcut-setting input:not([type]){margin:0;background:#fff}.shortcut-setting em{font-style:normal;color:#64748b;font-size:12px;display:flex;gap:6px;align-items:center}.switch-row{display:flex!important;align-items:center;gap:10px;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px;margin:0!important}.form-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.reminder-toast[data-closed=true]{display:none!important}@media(max-width:980px){.shortcut-grid{grid-template-columns:1fr 1fr}.top-actions{flex-wrap:wrap}.next-top{order:-1}}@media(max-width:700px){.shortcut-grid,.shortcut-list{grid-template-columns:1fr}.next-top{width:100%;justify-content:center}.next-lead-btn{width:100%;justify-content:center}}

/* v9 lead detail workdesk: Inter, fixed header, one-column cards, sidebar/full preview, labels/favorites */
body{font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif}.app-shell{transition:grid-template-columns .18s ease}.topbar{position:sticky;top:0;z-index:50;background:rgba(245,247,251,.96);backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:14px;padding:8px 10px;margin:-8px 0 14px;min-height:54px}.topbar h1{font-size:20px}.top-title{min-width:0}.top-actions .btn,.top-actions .user-pill{min-height:30px;padding:6px 9px;font-size:12px}.icon-btn,.side-collapse-btn{border:1px solid var(--line);background:#fff;color:#334155;border-radius:9px;min-width:32px;height:32px;display:inline-grid;place-items:center;cursor:pointer;font-weight:600}.top-side-toggle{flex:0 0 auto}.side-collapse-btn{position:absolute;left:12px;bottom:84px;background:#172033;color:#dbeafe;border-color:#26354e}.sidebar{transition:transform .18s ease,opacity .18s ease}.sidebar-hidden .app-shell{grid-template-columns:0 minmax(0,1fr)}.sidebar-hidden .sidebar{transform:translateX(-100%);opacity:0;pointer-events:none;overflow:hidden}.sidebar-hidden .main{padding-left:18px}.fullscreen-preview .app-shell{grid-template-columns:0 minmax(0,1fr)}.fullscreen-preview .sidebar{display:none}.fullscreen-preview .main{padding:12px 18px}.fullscreen-preview .topbar{margin:0 0 10px;border-radius:12px}.fullscreen-preview .topbar .crumb,.fullscreen-preview .topbar .user-pill{display:none}.detail-stack{display:grid;grid-template-columns:1fr;gap:12px;max-width:1080px;margin:0 auto}.detail-stack>.card{margin-bottom:0}.lead-identity-card{border-left:5px solid #cbd5e1}.lead-identity-head{align-items:flex-start}.identity-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.mini-preference-form,.label-form{margin:0}.label-form select{min-width:155px;margin:0;padding:7px 10px}.heart-btn{width:34px;height:34px;border-radius:999px;border:1px solid #fecdd3;background:#fff;color:#94a3b8;font-size:18px;line-height:1;cursor:pointer}.heart-btn.active{background:#fff1f2;color:#e11d48;border-color:#fda4af}.label-chip{display:inline-flex;align-items:center;border-radius:999px;border:1px solid var(--line);padding:3px 8px;font-size:11px;font-weight:600;white-space:nowrap}.label-none{background:#f8fafc;color:#64748b}.label-red{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.label-yellow{background:#fffbeb;border-color:#fde68a;color:#b45309}.label-green{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}.label-blue{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.label-purple{background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9}.label-gray{background:#f1f5f9;border-color:#cbd5e1;color:#475569}.label-border-red{border-left-color:#ef4444!important}.label-border-yellow{border-left-color:#f59e0b!important}.label-border-green{border-left-color:#16a34a!important}.label-border-blue{border-left-color:#2563eb!important}.label-border-purple{border-left-color:#7c3aed!important}.label-border-gray{border-left-color:#64748b!important}.compact-summary{grid-template-columns:repeat(4,minmax(0,1fr))}.next-task-card{display:flex;align-items:center;justify-content:space-between;gap:14px;border-left:5px solid var(--primary);background:linear-gradient(90deg,#eff6ff,#fff)}.next-task-main{display:flex;align-items:center;gap:12px}.next-task-main h2,.next-task-main p{margin:0}.key-badge{width:42px;height:42px;border-radius:14px;background:#2563eb;color:#fff;display:grid;place-items:center;font-weight:600;font-size:18px;box-shadow:0 8px 18px rgba(37,99,235,.22)}.next-task-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.detail-stack .quick-stack{grid-template-columns:repeat(5,minmax(0,1fr))}.detail-stack>.card:not(.lead-identity-card):not(.next-task-card):not(.visual-card) form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end}.detail-stack>.card:not(.lead-identity-card):not(.next-task-card):not(.visual-card) form label{margin:0}.detail-stack>.card:not(.lead-identity-card):not(.next-task-card):not(.visual-card) form textarea{min-height:68px}.detail-stack>.card:not(.lead-identity-card):not(.next-task-card):not(.visual-card) form button{justify-self:start}.detail-stack .timeline{max-height:none}.lead-name-cell{display:grid;gap:4px}.lead-name-cell>a{font-weight:600;color:#0f172a}.lead-name-cell>span,.preference-line{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.heart-mini{color:#e11d48;font-weight:600}.map-frame{width:100%;height:220px;border:0;border-radius:12px;background:#e2e8f0}.quick-filter-panel{grid-template-columns:150px repeat(7,minmax(0,auto))}
@media(max-width:1180px){.compact-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-stack>.card:not(.lead-identity-card):not(.next-task-card):not(.visual-card) form{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-filter-panel{grid-template-columns:1fr 1fr 1fr}.detail-stack .quick-stack{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.topbar{display:grid;grid-template-columns:auto 1fr;align-items:start}.top-actions{grid-column:1/-1}.top-actions .btn,.top-actions .user-pill{flex:1 1 auto}.detail-stack{max-width:none}.identity-actions{justify-content:flex-start}.compact-summary,.detail-stack>.card:not(.lead-identity-card):not(.next-task-card):not(.visual-card) form,.detail-stack .quick-stack{grid-template-columns:1fr}.next-task-card{display:grid}.next-task-actions{justify-content:stretch}.next-task-actions .btn{flex:1}.sidebar-hidden .main,.main{padding-left:12px;padding-right:12px}}


/* v10 workdesk layout: full-width 4-column lead detail, task rail, clean import/export */
.top-title h1{display:flex;align-items:center;gap:10px;white-space:nowrap;font-size:18px}
.crumb-inline{font-size:11px;color:var(--muted);font-weight:500;letter-spacing:0}
.route-lead-view .main,.route-import-export .main{padding:14px 18px}
.route-lead-view .topbar,.route-import-export .topbar{margin:0 0 10px;border-radius:12px;min-height:46px}
.route-lead-view .alert{margin-bottom:10px}
.lead-workdesk{display:grid;grid-template-columns:280px minmax(0,1fr);gap:12px;height:calc(100vh - 84px);min-height:600px;overflow:hidden}
.task-rail{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:12px;min-height:0;display:flex;flex-direction:column}
.task-rail-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.task-rail-head>span{width:34px;height:34px;border-radius:11px;background:var(--primary);color:#fff;display:grid;place-items:center;font-weight:600}
.task-rail-head h2{font-size:14px;margin:0}.task-rail-head p{margin:2px 0 0;color:var(--muted);font-size:11px}
.task-rail-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}.task-rail-actions .full{width:100%}
.task-scroll{overflow:auto;display:grid;gap:8px;padding-right:3px}
.task-item{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;background:#f8fafc;padding:10px;color:#0f172a}
.task-item.active{background:#eff6ff;border-color:#93c5fd;box-shadow:inset 3px 0 0 var(--primary)}
.task-item b{display:flex;align-items:center;gap:5px;font-size:13px}.task-item span{font-size:12px;color:#334155}.task-item small{font-size:11px;color:var(--muted)}
.lead-detail-scroll{min-width:0;overflow:auto;padding-right:3px}
.lead-four-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:start}
.lead-four-grid>.card{margin-bottom:0;min-width:0}
.lead-card-span-4{grid-column:1/-1}.lead-card-span-3{grid-column:span 3}.lead-card-span-2{grid-column:span 2}.lead-card-span-1{grid-column:span 1}
.lead-identity-card{padding:14px}.lead-identity-head h2{display:flex;align-items:center;gap:7px;font-size:16px;margin:0 0 4px}
.compact-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.compact-summary div{padding:8px 10px}.compact-summary strong{font-size:12px}
.stage-hearts{display:inline-flex;align-items:center;margin-right:5px;font-size:14px;letter-spacing:1px;font-weight:600;white-space:nowrap}
.stage-favorite,.stage-converted{color:#16a34a}.stage-demo,.stage-demo-done{color:#2563eb}.stage-payment{color:#f59e0b}
.heart-btn.active{background:#f0fdf4;color:#16a34a;border-color:#86efac}
.lead-name-cell>a{display:flex;align-items:center;gap:4px}.lead-name-cell>span:empty,.preference-line:empty{display:none}
.next-task-card{min-height:130px}.next-task-main{align-items:flex-start}.next-task-main p{line-height:1.35}
.quick-action-card .quick-stack{grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.phone-card h2,.form-card h2,.timeline-card h2{font-size:14px}
.phone-list{display:grid;gap:8px;max-height:210px;overflow:auto;margin-bottom:10px}
.phone-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:9px}
.phone-row b{display:block;font-size:13px}.phone-row span,.phone-row small{display:block;color:var(--muted);font-size:11px;margin-top:1px}
.phone-row.is-invalid{opacity:.72;background:#fff5f5}.phone-actions{display:flex;gap:5px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.phone-actions form{margin:0!important;display:inline!important}.phone-actions em{font-style:normal;background:#dcfce7;color:#15803d;border-radius:999px;padding:4px 7px;font-size:11px;font-weight:600}.phone-actions em.bad{background:#fee2e2;color:#b91c1c}
.phone-add-form{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:8px;align-items:end}.phone-add-form label{margin:0}
.lead-score-card .lead-score-line{display:grid;place-items:center;text-align:center}.lead-score-card .score-ring.big{margin-bottom:8px}
.timeline-card .timeline{max-height:360px;overflow:auto}.timeline-item{padding:8px 0}.timeline-item p{margin:2px 0;font-size:12px}
.form-card .work-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;align-items:end}.form-card .work-form label{margin:0}.form-card .work-form .wide-field{grid-column:1/-1}.form-card .work-form button{justify-self:start}
.location-card .map-frame{height:210px}.location-card p{margin:6px 0}
.fullscreen-preview .app-shell{grid-template-columns:0 minmax(0,1fr)}.fullscreen-preview .sidebar{display:none!important}.fullscreen-preview .main{padding:10px 14px}.fullscreen-preview .topbar{margin:0 0 8px}.fullscreen-preview.route-lead-view .lead-workdesk{height:calc(100vh - 66px)}
.fullscreen-preview .top-actions .user-pill{display:none}
.import-workdesk{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:start}
.import-workdesk>.card{margin-bottom:0}.import-tile{min-height:420px}.export-main{grid-column:span 2}.report-export{grid-column:span 1}.import-history-wide{grid-column:1/-1}
.upload-box.compact{display:flex;flex-direction:column;gap:10px;align-items:stretch;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc;padding:12px}.upload-box.compact input{margin:0}
.csv-code{font-size:12px;line-height:1.5;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:10px;max-height:400px;overflow:auto;word-break:break-word;color:#334155}
.export-option-grid.compact{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.export-option{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;padding:10px;background:#f8fafc;color:#0f172a;min-height:76px}
.export-option strong{font-size:13px}.export-option span{font-size:11px;color:var(--muted)}.export-option em{font-style:normal;font-size:10px;font-weight:600;color:#64748b}
.txt-export-grid{display:grid;gap:8px;margin-bottom:10px}.help-list.compact{font-size:12px;margin:0;padding-left:18px}.table-wrap.clean{box-shadow:none}
@media(max-width:1400px){.lead-workdesk{grid-template-columns:250px minmax(0,1fr)}.lead-four-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.lead-card-span-4{grid-column:1/-1}.lead-card-span-2{grid-column:span 2}.lead-card-span-1{grid-column:span 1}.export-option-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1080px){.lead-workdesk{height:auto;overflow:visible;grid-template-columns:1fr}.task-rail{max-height:260px}.lead-detail-scroll{overflow:visible}.lead-four-grid,.import-workdesk{grid-template-columns:repeat(2,minmax(0,1fr))}.lead-card-span-4,.lead-card-span-3,.lead-card-span-2,.lead-card-span-1,.export-main,.report-export,.import-history-wide{grid-column:1/-1}.phone-add-form{grid-template-columns:1fr 1fr}.phone-add-form button{grid-column:1/-1}.top-title h1{white-space:normal;align-items:flex-start;flex-direction:column;gap:2px}}
@media(max-width:700px){.route-lead-view .main,.route-import-export .main{padding:10px}.lead-four-grid,.import-workdesk{grid-template-columns:1fr}.task-rail-actions,.quick-action-card .quick-stack,.form-card .work-form,.phone-add-form,.export-option-grid.compact{grid-template-columns:1fr}.phone-row{grid-template-columns:1fr}.phone-actions{justify-content:flex-start}.compact-summary{grid-template-columns:1fr}.top-title h1{font-size:16px}.crumb-inline{font-size:10px}}

/* v11 compact fullscreen repair: dashboard/lead workdesk + task manager + no-overlap buckets */
html,body{overflow-x:hidden}.app-body.fullscreen-preview{background:#eef2f7}
.fullscreen-preview .app-shell{grid-template-columns:minmax(0,1fr)!important;min-height:100vh}.fullscreen-preview .sidebar{display:none!important}.fullscreen-preview .main{padding:8px 10px!important;min-width:0;width:100%}
.fullscreen-preview .topbar{position:sticky;top:0;z-index:90;display:grid!important;grid-template-columns:34px minmax(170px,1fr) auto!important;align-items:center!important;gap:8px!important;min-height:44px!important;margin:0 0 8px!important;padding:6px 8px!important;border-radius:12px!important}.fullscreen-preview .top-title h1{display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;white-space:nowrap!important;font-size:16px!important;line-height:1.15!important;margin:0!important;overflow:hidden;text-overflow:ellipsis}.fullscreen-preview .crumb-inline{display:inline!important;font-size:10px!important;color:#64748b!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;max-width:420px}.fullscreen-preview .top-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:nowrap!important;width:auto!important;min-width:0}.fullscreen-preview .top-actions .btn,.fullscreen-preview .top-actions .user-pill{min-height:28px!important;padding:5px 8px!important;font-size:11px!important;border-radius:8px!important;white-space:nowrap!important;flex:0 0 auto!important}.fullscreen-preview .top-actions .user-pill{display:none!important}.fullscreen-preview .icon-btn{width:30px!important;height:30px!important;min-width:30px!important;border-radius:8px!important}
.dashboard-workdesk{display:grid;grid-template-columns:270px minmax(0,1fr);gap:12px;height:calc(100vh - 86px);overflow:hidden;min-height:560px}.dashboard-scroll{min-width:0;overflow:auto;padding-right:3px}.dashboard-scroll>.card:last-child{margin-bottom:0}.dashboard-workdesk .task-rail{min-height:0;height:100%;position:relative}.dashboard-workdesk .task-scroll{min-height:0;overflow:auto}
.fullscreen-preview.route-dashboard .dashboard-workdesk{height:calc(100vh - 60px);grid-template-columns:250px minmax(0,1fr);gap:10px;min-height:0}.fullscreen-preview.route-dashboard .dashboard-scroll{overflow:auto}.fullscreen-preview.route-dashboard .task-rail{padding:10px;border-radius:14px}.fullscreen-preview.route-dashboard .task-item{padding:8px;border-radius:10px}.fullscreen-preview.route-dashboard .task-item b{font-size:12px}.fullscreen-preview.route-dashboard .task-item span,.fullscreen-preview.route-dashboard .task-item small{font-size:10.5px}
.fullscreen-preview.route-dashboard .card{padding:10px;border-radius:13px;margin-bottom:10px}.fullscreen-preview.route-dashboard .card h2{font-size:13px;margin-bottom:8px}.fullscreen-preview.route-dashboard .card h3{font-size:12px}.fullscreen-preview.route-dashboard .metric-grid{grid-template-columns:repeat(auto-fit,minmax(118px,1fr))!important;gap:8px;margin-bottom:10px}.fullscreen-preview.route-dashboard .metric{min-height:58px;padding:9px 10px;border-radius:11px}.fullscreen-preview.route-dashboard .metric strong{font-size:19px}.fullscreen-preview.route-dashboard .metric span,.fullscreen-preview.route-dashboard .metric small{font-size:10.5px}.fullscreen-preview.route-dashboard .followup-strip{grid-template-columns:repeat(auto-fit,minmax(116px,1fr))!important;gap:8px;margin-bottom:10px}.fullscreen-preview.route-dashboard .bucket{padding:9px;border-radius:11px}.fullscreen-preview.route-dashboard .bucket strong{font-size:18px;margin:1px 0 5px}.fullscreen-preview.route-dashboard .bucket span{font-size:10.5px}.fullscreen-preview.route-dashboard .smart-grid{grid-template-columns:repeat(auto-fit,minmax(112px,1fr))!important;gap:8px;margin-bottom:10px}.fullscreen-preview.route-dashboard .smart-pill{padding:9px;border-radius:11px}.fullscreen-preview.route-dashboard .smart-pill strong{font-size:18px}.fullscreen-preview.route-dashboard .smart-pill span{font-size:10.5px}.fullscreen-preview.route-dashboard .visual-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;gap:10px}.fullscreen-preview.route-dashboard .dash-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;gap:10px}.fullscreen-preview.route-dashboard .staff-grid{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;gap:8px}.fullscreen-preview.route-dashboard .period-tabs{gap:6px;margin-bottom:10px}.fullscreen-preview.route-dashboard .period-tabs a{padding:6px 10px;font-size:11px}.fullscreen-preview.route-dashboard .period-tabs span{font-size:12px}.fullscreen-preview.route-dashboard .period-groups{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:8px}.fullscreen-preview.route-dashboard .period-groups article{padding:9px}.fullscreen-preview.route-dashboard .period-groups p{font-size:11.5px;padding:5px 0}.fullscreen-preview.route-dashboard .mini-list{gap:6px}.fullscreen-preview.route-dashboard .mini-list a{padding:7px 8px;border-radius:9px}.fullscreen-preview.route-dashboard .mini-list b{font-size:12px}.fullscreen-preview.route-dashboard .mini-list span{font-size:10.5px}
.fullscreen-preview.route-lead-view .lead-workdesk{grid-template-columns:250px minmax(0,1fr)!important;height:calc(100vh - 60px)!important;min-height:0!important;overflow:hidden!important;gap:10px}.fullscreen-preview.route-lead-view .lead-four-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px}.fullscreen-preview.route-lead-view .lead-detail-scroll{overflow:auto!important}.fullscreen-preview.route-lead-view .task-rail{height:100%;min-height:0}.fullscreen-preview.route-lead-view .card{padding:10px;border-radius:13px}.fullscreen-preview.route-lead-view .card h2{font-size:13px;margin-bottom:8px}.fullscreen-preview.route-lead-view .lead-card-span-4{grid-column:1/-1!important}.fullscreen-preview.route-lead-view .lead-card-span-3{grid-column:span 3!important}.fullscreen-preview.route-lead-view .lead-card-span-2{grid-column:span 2!important}.fullscreen-preview.route-lead-view .lead-card-span-1{grid-column:span 1!important}.fullscreen-preview.route-lead-view .compact-summary{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px}.fullscreen-preview.route-lead-view .compact-summary div{padding:7px 8px}.fullscreen-preview.route-lead-view .compact-summary span{font-size:10.5px}.fullscreen-preview.route-lead-view .compact-summary strong{font-size:11.5px}.fullscreen-preview.route-lead-view .next-task-card{min-height:90px}.fullscreen-preview.route-lead-view .key-badge{width:34px;height:34px;border-radius:11px;font-size:15px}.fullscreen-preview.route-lead-view .quick-action-card .quick-stack{grid-template-columns:repeat(5,minmax(0,1fr))!important}.fullscreen-preview.route-lead-view .form-card .work-form{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fullscreen-preview.route-lead-view .timeline-card .timeline,.fullscreen-preview.route-lead-view .phone-list{max-height:240px;overflow:auto}.fullscreen-preview.route-lead-view .location-card .map-frame{height:170px}
.route-leads.fullscreen-preview .quick-filter-panel,.route-board.fullscreen-preview .quick-filter-panel{grid-template-columns:170px repeat(auto-fit,minmax(160px,1fr))!important;gap:8px;padding:10px;margin-bottom:10px;overflow:visible}.quick-filter-panel{overflow:visible}.chip-group,.chip-group>div{min-width:0}.chip-group>div{display:flex;flex-wrap:wrap;gap:5px}.chip-btn{font-size:11px;padding:6px 9px;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis}.quick-filter-title h2{white-space:nowrap}
.fullscreen-preview.route-import-export .import-workdesk{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px}.fullscreen-preview.route-import-export .card{padding:10px;border-radius:13px}.fullscreen-preview.route-import-export .export-main{grid-column:span 2!important}.fullscreen-preview.route-import-export .report-export{grid-column:span 1!important}.fullscreen-preview.route-import-export .import-history-wide{grid-column:1/-1!important}.fullscreen-preview.route-import-export .export-option-grid.compact{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))!important}.fullscreen-preview.route-import-export .export-option{min-height:64px;padding:8px;border-radius:10px}.fullscreen-preview.route-import-export .export-option strong{font-size:12px}.fullscreen-preview.route-import-export .export-option span,.fullscreen-preview.route-import-export .export-option em{font-size:10.5px}.fullscreen-preview.route-import-export .csv-code{max-height:400px;font-size:11px}.fullscreen-preview.route-import-export .table-wrap{max-height:210px;overflow:auto}
@media(max-width:900px){.fullscreen-preview .topbar{grid-template-columns:30px minmax(120px,1fr)!important}.fullscreen-preview .top-actions{grid-column:1/-1;justify-content:flex-start!important;overflow-x:auto;padding-bottom:2px}.fullscreen-preview .crumb-inline{max-width:260px}.fullscreen-preview.route-dashboard .dashboard-workdesk{grid-template-columns:1fr!important;height:auto!important;overflow:visible}.fullscreen-preview.route-dashboard .task-rail{max-height:190px;height:auto}.fullscreen-preview.route-dashboard .task-scroll{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(190px,230px);overflow-x:auto;overflow-y:hidden}.fullscreen-preview.route-dashboard .dashboard-scroll{overflow:visible}.fullscreen-preview.route-lead-view .lead-workdesk{grid-template-columns:1fr!important;height:auto!important;overflow:visible!important}.fullscreen-preview.route-lead-view .task-rail{max-height:190px;height:auto}.fullscreen-preview.route-lead-view .task-scroll{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(190px,230px);overflow-x:auto;overflow-y:hidden}.fullscreen-preview.route-lead-view .lead-four-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fullscreen-preview.route-lead-view .lead-card-span-4,.fullscreen-preview.route-lead-view .lead-card-span-3,.fullscreen-preview.route-lead-view .lead-card-span-2,.fullscreen-preview.route-lead-view .lead-card-span-1{grid-column:span 1!important}.fullscreen-preview.route-lead-view .lead-identity-card,.fullscreen-preview.route-lead-view .next-task-card{grid-column:1/-1!important}.route-leads.fullscreen-preview .quick-filter-panel,.route-board.fullscreen-preview .quick-filter-panel{grid-template-columns:1fr 1fr!important}.fullscreen-preview.route-import-export .import-workdesk{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fullscreen-preview.route-import-export .export-main,.fullscreen-preview.route-import-export .report-export,.fullscreen-preview.route-import-export .import-history-wide{grid-column:1/-1!important}}
@media(max-width:640px){.fullscreen-preview .main{padding:6px!important}.fullscreen-preview .topbar{padding:5px!important}.fullscreen-preview .top-title h1{font-size:14px!important}.fullscreen-preview .crumb-inline{display:none!important}.fullscreen-preview.route-dashboard .metric-grid,.fullscreen-preview.route-dashboard .followup-strip,.fullscreen-preview.route-dashboard .smart-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.fullscreen-preview.route-dashboard .visual-grid,.fullscreen-preview.route-dashboard .dash-grid{grid-template-columns:1fr!important}.fullscreen-preview.route-lead-view .lead-four-grid,.fullscreen-preview.route-import-export .import-workdesk{grid-template-columns:1fr!important}.route-leads.fullscreen-preview .quick-filter-panel,.route-board.fullscreen-preview .quick-filter-panel{grid-template-columns:1fr!important}.chip-group>div{flex-wrap:nowrap;overflow-x:auto;padding-bottom:2px}.chip-btn{flex:0 0 auto}}

/* V12: persistent app fullscreen + sidebar shortcut + CRM UI size control */
.ui-scale-control{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:3px 7px;color:#334155;font-size:12px;font-weight:500;min-height:34px}.ui-scale-control select{width:auto;min-width:66px;margin:0;border:0;background:transparent;padding:2px 2px;font-size:12px;font-weight:600;color:#0f172a}.ui-scale-control span{color:#64748b;font-size:11px}.fullscreen-preview .ui-scale-control{min-height:28px;padding:2px 6px}.fullscreen-preview .ui-scale-control select{font-size:11px;min-width:58px}.fullscreen-preview .ui-scale-control span{font-size:10px}
html[data-ui-scale="100"]{--ui-sidebar:220px;--ui-main-pad:24px;--ui-card-pad:16px;--ui-card-gap:16px;--ui-btn-y:8px;--ui-btn-x:11px;--ui-btn-font:13px;--ui-input-y:8px;--ui-input-x:10px;--ui-nav-font:13px;--ui-nav-y:10px;--ui-h1:24px;--ui-h2:16px;--ui-body:14px;--ui-table-y:10px;--ui-table-x:12px;--ui-radius:14px;--ui-top-gap:20px}
html[data-ui-scale="90"]{--ui-sidebar:198px;--ui-main-pad:18px;--ui-card-pad:13px;--ui-card-gap:12px;--ui-btn-y:7px;--ui-btn-x:9px;--ui-btn-font:12px;--ui-input-y:7px;--ui-input-x:9px;--ui-nav-font:12px;--ui-nav-y:8px;--ui-h1:21px;--ui-h2:14px;--ui-body:13px;--ui-table-y:8px;--ui-table-x:10px;--ui-radius:12px;--ui-top-gap:14px}
html[data-ui-scale="80"]{--ui-sidebar:176px;--ui-main-pad:12px;--ui-card-pad:10px;--ui-card-gap:9px;--ui-btn-y:5px;--ui-btn-x:8px;--ui-btn-font:11px;--ui-input-y:6px;--ui-input-x:8px;--ui-nav-font:11px;--ui-nav-y:7px;--ui-h1:18px;--ui-h2:13px;--ui-body:12px;--ui-table-y:7px;--ui-table-x:8px;--ui-radius:11px;--ui-top-gap:10px}
html[data-ui-scale="75"]{--ui-sidebar:165px;--ui-main-pad:9px;--ui-card-pad:8px;--ui-card-gap:7px;--ui-btn-y:4px;--ui-btn-x:7px;--ui-btn-font:10.5px;--ui-input-y:5px;--ui-input-x:7px;--ui-nav-font:10.5px;--ui-nav-y:6px;--ui-h1:16px;--ui-h2:12px;--ui-body:11.5px;--ui-table-y:6px;--ui-table-x:7px;--ui-radius:10px;--ui-top-gap:8px}
html[data-ui-scale="65"]{--ui-sidebar:143px;--ui-main-pad:7px;--ui-card-pad:7px;--ui-card-gap:6px;--ui-btn-y:3px;--ui-btn-x:6px;--ui-btn-font:10px;--ui-input-y:4px;--ui-input-x:6px;--ui-nav-font:10px;--ui-nav-y:5px;--ui-h1:15px;--ui-h2:11.5px;--ui-body:10.5px;--ui-table-y:5px;--ui-table-x:6px;--ui-radius:9px;--ui-top-gap:6px}
html[data-ui-scale] body.app-body{font-size:var(--ui-body)}html[data-ui-scale] .app-shell{grid-template-columns:var(--ui-sidebar) minmax(0,1fr)}html[data-ui-scale] .main{padding:var(--ui-main-pad)}html[data-ui-scale] .topbar{margin-bottom:var(--ui-top-gap);gap:8px}html[data-ui-scale] .topbar h1{font-size:var(--ui-h1)}html[data-ui-scale] .card{padding:var(--ui-card-pad);border-radius:var(--ui-radius);margin-bottom:var(--ui-card-gap)}html[data-ui-scale] .card h2{font-size:var(--ui-h2);margin-bottom:8px}html[data-ui-scale] .card h3{font-size:calc(var(--ui-h2) - 1px);margin:10px 0 7px}html[data-ui-scale] .btn{padding:var(--ui-btn-y) var(--ui-btn-x);font-size:var(--ui-btn-font);min-height:28px;border-radius:8px}html[data-ui-scale] input,html[data-ui-scale] select,html[data-ui-scale] textarea{padding:var(--ui-input-y) var(--ui-input-x);font-size:var(--ui-body);border-radius:8px}html[data-ui-scale] .sidebar{padding:14px 8px}html[data-ui-scale] .brand{gap:7px;margin:0 5px 16px}html[data-ui-scale] .brand-mark{width:28px;height:28px;border-radius:8px;font-size:10px}html[data-ui-scale] .brand strong{font-size:12px}html[data-ui-scale] .brand small{font-size:10px}html[data-ui-scale] .nav-link{font-size:var(--ui-nav-font);padding:var(--ui-nav-y) 8px;border-radius:8px;gap:7px}html[data-ui-scale] .side-summary{padding:10px;border-radius:10px}html[data-ui-scale] .side-summary strong{font-size:22px}html[data-ui-scale] .metric-grid,html[data-ui-scale] .dash-grid,html[data-ui-scale] .grid.two,html[data-ui-scale] .report-grid,html[data-ui-scale] .form-grid,html[data-ui-scale] .summary-grid,html[data-ui-scale] .lead-four-grid,html[data-ui-scale] .import-workdesk{gap:var(--ui-card-gap)}html[data-ui-scale] .metric{padding:9px 10px;min-height:58px;border-radius:10px}html[data-ui-scale] .metric strong{font-size:20px}html[data-ui-scale] .metric span,html[data-ui-scale] .metric small,html[data-ui-scale] .small{font-size:11px}html[data-ui-scale] .lead-table th,html[data-ui-scale] .lead-table td{padding:var(--ui-table-y) var(--ui-table-x)}html[data-ui-scale] .badge,html[data-ui-scale] .type-chip{font-size:11px;padding:3px 7px}html[data-ui-scale] .top-actions{gap:6px}html[data-ui-scale] .user-pill{padding:6px 9px;font-size:11px}html[data-ui-scale] .task-rail{padding:10px;border-radius:12px}html[data-ui-scale] .task-item{padding:8px;border-radius:10px}html[data-ui-scale] .task-item b{font-size:12px}html[data-ui-scale] .task-item span,html[data-ui-scale] .task-item small{font-size:10.5px}html[data-ui-scale] .compact-summary div{padding:7px 8px}html[data-ui-scale] .compact-summary span{font-size:10.5px}html[data-ui-scale] .compact-summary strong{font-size:11.5px}
html[data-ui-scale="80"] .metric-grid{grid-template-columns:repeat(8,minmax(0,1fr))}html[data-ui-scale="80"] .smart-grid,html[data-ui-scale="80"] .followup-strip{grid-template-columns:repeat(auto-fit,minmax(108px,1fr))}html[data-ui-scale="80"] .dashboard-workdesk{grid-template-columns:230px minmax(0,1fr);height:calc(100vh - 54px);gap:8px}html[data-ui-scale="80"] .lead-workdesk{grid-template-columns:230px minmax(0,1fr);gap:8px}html[data-ui-scale="80"] .lead-four-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}html[data-ui-scale="75"] .metric-grid{grid-template-columns:repeat(8,minmax(0,1fr))}html[data-ui-scale="75"] .dashboard-workdesk{grid-template-columns:210px minmax(0,1fr);height:calc(100vh - 48px);gap:7px}html[data-ui-scale="75"] .lead-workdesk{grid-template-columns:210px minmax(0,1fr);gap:7px}html[data-ui-scale="75"] .lead-four-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}html[data-ui-scale="65"] .metric-grid{grid-template-columns:repeat(8,minmax(0,1fr));gap:6px}html[data-ui-scale="65"] .smart-grid,html[data-ui-scale="65"] .followup-strip{grid-template-columns:repeat(auto-fit,minmax(88px,1fr))}html[data-ui-scale="65"] .dashboard-workdesk{grid-template-columns:188px minmax(0,1fr);height:calc(100vh - 42px);gap:6px}html[data-ui-scale="65"] .lead-workdesk{grid-template-columns:188px minmax(0,1fr);gap:6px}html[data-ui-scale="65"] .lead-four-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}html[data-ui-scale="65"] .metric{padding:7px 8px;min-height:50px}html[data-ui-scale="65"] .metric strong{font-size:17px}.sidebar-hidden .ui-scale-control{display:inline-flex}
html[data-ui-scale] body.sidebar-hidden .app-shell,body.sidebar-hidden .app-shell{grid-template-columns:0 minmax(0,1fr)!important}html[data-ui-scale] body.fullscreen-preview .app-shell,body.fullscreen-preview .app-shell{grid-template-columns:0 minmax(0,1fr)!important}html[data-ui-scale] body.sidebar-hidden .main{padding-left:var(--ui-main-pad)}

/* v13 smart task focus navigation */
.task-item{position:relative}
.task-item em{display:inline-flex;align-items:center;align-self:flex-start;margin-top:4px;padding:2px 7px;border-radius:999px;background:#eef2ff;color:#1d4ed8;font-size:10px;font-style:normal;font-weight:600;line-height:1.2}
.task-item.is-current-focus{outline:2px solid rgba(37,99,235,.28);box-shadow:0 10px 22px rgba(37,99,235,.12)}
.focus-pulse{animation:leadFocusPulse 2.4s ease;border-color:#2563eb!important;box-shadow:0 0 0 4px rgba(37,99,235,.16),0 18px 40px rgba(37,99,235,.16)!important}
@keyframes leadFocusPulse{0%{transform:translateY(-2px);box-shadow:0 0 0 0 rgba(37,99,235,.34)}35%{transform:translateY(0);box-shadow:0 0 0 7px rgba(37,99,235,.18),0 18px 40px rgba(37,99,235,.16)}100%{transform:none;box-shadow:0 0 0 0 rgba(37,99,235,0)}}

/* v14/v15 fullscreen + task rail repair */
html[data-ui-scale] body.fullscreen-preview .app-shell,
body.fullscreen-preview .app-shell{grid-template-columns:minmax(0,1fr)!important;min-height:100vh!important}
body.fullscreen-preview .main{grid-column:1/-1!important;width:100%!important;max-width:none!important}
.lead-list-workdesk{display:grid;grid-template-columns:280px minmax(0,1fr);gap:12px;align-items:start;min-height:0}
.lead-list-workdesk>.task-rail{position:sticky;top:76px;align-self:start;max-height:calc(100vh - 96px);overflow:hidden}
.lead-list-scroll{min-width:0;width:100%}
.fullscreen-preview.route-leads .lead-list-workdesk,
.fullscreen-preview.route-board .lead-list-workdesk{grid-template-columns:250px minmax(0,1fr)!important;height:calc(100vh - 60px)!important;min-height:0!important;overflow:hidden!important;gap:10px!important}
.fullscreen-preview.route-leads .lead-list-scroll,
.fullscreen-preview.route-board .lead-list-scroll{overflow:auto!important;min-width:0!important;height:100%!important;padding-right:2px}
.fullscreen-preview.route-leads .lead-list-workdesk>.task-rail,
.fullscreen-preview.route-board .lead-list-workdesk>.task-rail{position:relative!important;top:auto!important;height:100%!important;max-height:none!important;min-height:0!important;padding:10px;border-radius:14px}
.fullscreen-preview.route-leads .table-card{max-height:calc(100vh - 230px);overflow:auto!important}
.fullscreen-preview.route-board .board{min-height:0}
@media(max-width:900px){.lead-list-workdesk,.fullscreen-preview.route-leads .lead-list-workdesk,.fullscreen-preview.route-board .lead-list-workdesk{grid-template-columns:1fr!important;height:auto!important;overflow:visible!important}.lead-list-workdesk>.task-rail{position:relative!important;top:auto!important;max-height:220px!important}.lead-list-scroll{overflow:visible!important;height:auto!important}.fullscreen-preview.route-leads .table-card{max-height:none}}


/* V15: stable fullscreen workdesk + rebuilt compact 4-column lead detail */
body.route-lead-view,
body.route-dashboard{
  overflow:hidden!important;
}
body.route-lead-view .main,
body.route-dashboard .main{
  height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
body.route-lead-view .topbar,
body.route-dashboard .topbar{
  flex:0 0 auto!important;
  min-height:42px!important;
  margin-bottom:8px!important;
  position:sticky!important;
  top:0!important;
  z-index:120!important;
}
body.route-lead-view .alert,
body.route-dashboard .alert{
  flex:0 0 auto!important;
}
body.route-lead-view .lead-workdesk,
body.route-dashboard .dashboard-workdesk{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
}
body.route-lead-view .lead-detail-scroll,
body.route-dashboard .dashboard-scroll{
  height:100%!important;
  min-height:0!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
body.fullscreen-preview{
  overflow:hidden!important;
}
body.fullscreen-preview .main{
  height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
body.fullscreen-preview .topbar{
  flex:0 0 auto!important;
  min-height:38px!important;
  padding:5px 8px!important;
  margin:0 0 7px!important;
  border-radius:10px!important;
}
body.fullscreen-preview.route-lead-view .lead-workdesk,
body.fullscreen-preview.route-dashboard .dashboard-workdesk{
  grid-template-columns:minmax(0,1fr)!important;
  flex:1 1 auto!important;
  height:auto!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.fullscreen-preview.route-lead-view .lead-workdesk>.task-rail,
body.fullscreen-preview.route-dashboard .dashboard-workdesk>.task-rail{
  display:none!important;
}
body.fullscreen-preview.route-lead-view .lead-detail-scroll,
body.fullscreen-preview.route-dashboard .dashboard-scroll{
  height:100%!important;
  overflow:auto!important;
}
body.fullscreen-preview .top-actions .user-pill{
  display:none!important;
}
body.fullscreen-preview .top-actions .btn,
body.fullscreen-preview .ui-scale-control{
  min-height:26px!important;
  padding:4px 7px!important;
  font-size:10.5px!important;
}

/* V15 lead detail: balanced 4-column card rows */
.lead-detail-v15-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:9px!important;
  align-items:stretch!important;
}
.lead-detail-v15-grid>.card{
  min-width:0!important;
  height:auto;
}
.lead-detail-v15-grid .lead-identity-card{
  grid-column:1/-1!important;
  padding:10px!important;
}
.lead-detail-v15-grid .v15-card-next,
.lead-detail-v15-grid .v15-card-quick,
.lead-detail-v15-grid .v15-card-score,
.lead-detail-v15-grid .v15-card-owner,
.lead-detail-v15-grid .v15-card-demo,
.lead-detail-v15-grid .v15-card-conversion{
  grid-column:span 1!important;
}
.lead-detail-v15-grid .v15-card-phone,
.lead-detail-v15-grid .v15-card-timeline,
.lead-detail-v15-grid .v15-card-location{
  grid-column:span 2!important;
}
.lead-detail-v15-grid .compact-summary{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;
}
.lead-detail-v15-grid .compact-summary div{
  padding:6px 8px!important;
}
.lead-detail-v15-grid .compact-summary span{
  font-size:10px!important;
}
.lead-detail-v15-grid .compact-summary strong{
  font-size:11.5px!important;
  line-height:1.25!important;
}
.lead-detail-v15-grid .lead-identity-head{
  margin-bottom:8px!important;
}
.lead-detail-v15-grid .lead-identity-head h2{
  font-size:14px!important;
}
.lead-detail-v15-grid .identity-actions{
  gap:6px!important;
}
.lead-detail-v15-grid .label-form select{
  min-width:132px!important;
  padding:5px 7px!important;
}
.lead-detail-v15-grid .heart-btn{
  width:30px!important;
  height:30px!important;
  font-size:16px!important;
}
.v15-card-next{
  min-height:0!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  align-content:start!important;
  gap:8px!important;
}
.v15-card-next .next-task-main{
  align-items:flex-start!important;
}
.v15-card-next .key-badge{
  width:34px!important;
  height:34px!important;
  border-radius:11px!important;
  font-size:14px!important;
}
.v15-card-next .next-task-actions{
  width:100%!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
}
.v15-card-next .next-task-actions .next-top,
.v15-card-next .next-task-actions a[data-shortcut-action="next"]{
  grid-column:1/-1!important;
}
.v15-card-quick .quick-stack{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}
.v15-card-quick .quick-stack .btn:last-child{
  grid-column:1/-1!important;
}
.v15-card-score .lead-score-line{
  min-height:132px!important;
}
.v15-card-score .score-ring.big{
  width:82px!important;
  height:82px!important;
}
.v15-card-score .score-ring.big span{
  font-size:18px!important;
}
.lead-detail-v15-grid .form-card .work-form{
  grid-template-columns:1fr!important;
  gap:7px!important;
}
.lead-detail-v15-grid .form-card .work-form label{
  margin:0!important;
}
.lead-detail-v15-grid .form-card textarea{
  min-height:58px!important;
}
.v15-card-phone .phone-list{
  max-height:186px!important;
}
.v15-card-phone .phone-add-form{
  grid-template-columns:1fr 1fr!important;
  gap:7px!important;
}
.v15-card-phone .phone-add-form label:nth-child(3),
.v15-card-phone .phone-add-form button{
  grid-column:span 1!important;
}
.v15-card-timeline .timeline{
  max-height:286px!important;
}
.v15-card-location .map-frame{
  height:206px!important;
}
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
}
body.fullscreen-preview.route-lead-view .v15-card-phone .phone-list{
  max-height:170px!important;
}
body.fullscreen-preview.route-lead-view .v15-card-timeline .timeline{
  max-height:260px!important;
}
body.fullscreen-preview.route-lead-view .v15-card-location .map-frame{
  height:180px!important;
}

/* V15: keep task rail useful in normal mode but out of the way in preview */
.v15-detail-workdesk>.task-rail,
.dashboard-workdesk>.task-rail{
  height:100%!important;
  min-height:0!important;
}
.v15-detail-workdesk>.task-rail .task-scroll,
.dashboard-workdesk>.task-rail .task-scroll{
  min-height:0!important;
  overflow:auto!important;
}

@media(max-width:1280px){
  .lead-detail-v15-grid,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .lead-detail-v15-grid .lead-identity-card,
  .lead-detail-v15-grid .v15-card-phone,
  .lead-detail-v15-grid .v15-card-timeline,
  .lead-detail-v15-grid .v15-card-location{
    grid-column:1/-1!important;
  }
}
@media(max-width:720px){
  body.route-lead-view,
  body.route-dashboard{
    overflow:auto!important;
  }
  body.route-lead-view .main,
  body.route-dashboard .main{
    height:auto!important;
    min-height:100vh!important;
    overflow:visible!important;
  }
  body.route-lead-view .lead-workdesk,
  body.route-dashboard .dashboard-workdesk{
    height:auto!important;
    overflow:visible!important;
  }
  body.route-lead-view .lead-detail-scroll,
  body.route-dashboard .dashboard-scroll{
    height:auto!important;
    overflow:visible!important;
  }
  .lead-detail-v15-grid,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid{
    grid-template-columns:1fr!important;
  }
  .lead-detail-v15-grid .lead-identity-card,
  .lead-detail-v15-grid .v15-card-next,
  .lead-detail-v15-grid .v15-card-quick,
  .lead-detail-v15-grid .v15-card-score,
  .lead-detail-v15-grid .v15-card-owner,
  .lead-detail-v15-grid .v15-card-phone,
  .lead-detail-v15-grid .v15-card-demo,
  .lead-detail-v15-grid .v15-card-conversion,
  .lead-detail-v15-grid .v15-card-timeline,
  .lead-detail-v15-grid .v15-card-location{
    grid-column:1/-1!important;
  }
  .lead-detail-v15-grid .compact-summary{
    grid-template-columns:1fr!important;
  }
  .v15-card-phone .phone-add-form{
    grid-template-columns:1fr!important;
  }
}


/* V16: real fullscreen + single task selection repair */
body.fullscreen-preview .sidebar{display:none!important}
body.fullscreen-preview .app-shell{grid-template-columns:minmax(0,1fr)!important;height:100vh!important;max-height:100vh!important;overflow:hidden!important}
body.fullscreen-preview .main{padding:6px!important;width:100%!important;max-width:none!important}
body.fullscreen-preview .topbar{position:sticky!important;top:0!important;z-index:300!important;box-shadow:0 6px 18px rgba(15,23,42,.08)!important}
body.fullscreen-preview .top-title h1{font-size:15px!important;line-height:1.1!important}
body.fullscreen-preview .crumb-inline{font-size:10px!important;margin-left:7px!important;max-width:240px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.fullscreen-preview.route-lead-view .lead-workdesk,
body.fullscreen-preview.route-dashboard .dashboard-workdesk{grid-template-columns:minmax(0,1fr)!important;gap:0!important}
body.fullscreen-preview.route-lead-view .lead-workdesk>.task-rail,
body.fullscreen-preview.route-dashboard .dashboard-workdesk>.task-rail{display:none!important;width:0!important;min-width:0!important}
.task-item.is-current-focus:not(.active){outline:0!important;box-shadow:none!important}
.task-item.active,
.task-item.active.is-current-focus{background:#eff6ff!important;border-color:#93c5fd!important;box-shadow:inset 3px 0 0 var(--primary),0 10px 22px rgba(37,99,235,.12)!important}

/* V18: compact dashboard + lead detail CSS standard repair */
.lead-detail-v15-grid .compact-summary{
  grid-template-columns:repeat(8,minmax(0,1fr))!important;
  gap:7px!important;
}
.lead-detail-v15-grid .v15-card-phone,
.lead-detail-v15-grid .v15-card-timeline,
.lead-detail-v15-grid .v15-card-location{
  grid-column:span 1!important;
}
.lead-detail-v15-grid .v15-card-timeline{order:5!important;}
.lead-detail-v15-grid .v15-card-location{order:6!important;}
.lead-detail-v15-grid .v15-card-demo{order:7!important;}
.lead-detail-v15-grid .v15-card-conversion{order:8!important;}
.lead-detail-v15-grid .v15-card-phone{order:9!important;}
.lead-detail-v15-grid .v15-card-owner{order:10!important;}
.v15-card-phone .phone-list,
.v15-card-timeline .timeline{
  max-height:190px!important;
  overflow:auto!important;
}
.v15-card-location .map-frame{height:190px!important;}
.follow-card-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
.donut{width:96px!important;height:96px!important;}
.donut span{width:76px!important;height:76px!important;}
.score-ring:not(.big){width:50px!important;height:50px!important;}
.score-ring:not(.big) span{width:40px!important;height:40px!important;}
.score-ring.big,
.v15-card-score .score-ring.big{width:96px!important;height:96px!important;}
.score-ring.big span,
.v15-card-score .score-ring.big span{width:76px!important;height:76px!important;}
.bucket i,
.bar-row i,
.funnel-row i{height:4px!important;}
.bucket i em,
.bar-row i em,
.funnel-row i em{height:4px!important;}
.metric{
  border:1px solid #2563eb!important;
  border-bottom:1px solid #2563eb!important;
}
.period-groups p{padding:2px 0!important;}
.task-scroll{scrollbar-width:thin;scrollbar-color:#94a3b8 transparent;}
.task-scroll::-webkit-scrollbar{width:5px!important;height:5px!important;}
.task-scroll::-webkit-scrollbar-thumb{background:#94a3b8;border-radius:999px;}
.task-scroll::-webkit-scrollbar-track{background:transparent;}
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-phone,
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-timeline,
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-location{
  grid-column:span 1!important;
}
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .compact-summary{
  grid-template-columns:repeat(8,minmax(0,1fr))!important;
}
body.fullscreen-preview.route-lead-view .v15-card-location .map-frame{height:170px!important;}
@media(max-width:1280px){
  .lead-detail-v15-grid .compact-summary,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .compact-summary{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  .lead-detail-v15-grid .v15-card-phone,
  .lead-detail-v15-grid .v15-card-timeline,
  .lead-detail-v15-grid .v15-card-location,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-phone,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-timeline,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-location{
    grid-column:span 1!important;
  }
}
@media(max-width:980px){
  .follow-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px){
  .lead-detail-v15-grid .compact-summary,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .compact-summary{
    grid-template-columns:1fr!important;
  }
  .lead-detail-v15-grid .v15-card-phone,
  .lead-detail-v15-grid .v15-card-timeline,
  .lead-detail-v15-grid .v15-card-location,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-phone,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-timeline,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .v15-card-location{
    grid-column:1/-1!important;
  }
  .follow-card-grid{grid-template-columns:1fr!important;}
}

/* V19: global scrollbar standard + lead detail owner/location position repair */
html,
body,
*{
  scrollbar-width:thin;
  scrollbar-color:#94a3b8 transparent;
}
*::-webkit-scrollbar{
  width:5px!important;
  height:5px!important;
  max-width:5px!important;
  max-height:5px!important;
}
*::-webkit-scrollbar-thumb{
  background:#94a3b8;
  border-radius:999px;
}
*::-webkit-scrollbar-track{
  background:transparent;
}
body.route-lead-view .lead-detail-scroll,
body.route-dashboard .dashboard-scroll{
  scrollbar-width:thin!important;
  scrollbar-color:#94a3b8 transparent!important;
}
body.route-lead-view .lead-detail-scroll::-webkit-scrollbar,
body.route-dashboard .dashboard-scroll::-webkit-scrollbar{
  width:5px!important;
  height:5px!important;
  max-width:5px!important;
  max-height:5px!important;
}

/* V20: staff 8-column grid + compact Mail / Messages cards */
.staff-grid{
  grid-template-columns:repeat(8,minmax(0,1fr))!important;
  gap:8px!important;
}
.staff-card{
  padding:10px!important;
  gap:6px!important;
}
.staff-card .tiny-grid{
  grid-template-columns:1fr!important;
  gap:4px!important;
}
.message-compact-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  align-items:start;
  margin-bottom:16px;
}
.message-compact-grid .message-card{
  margin-bottom:0!important;
  min-width:0;
  min-height:260px;
  max-height:260px;
  overflow:hidden;
}
.message-card .card-head{
  margin-bottom:8px;
}
.message-card .card-head h2{
  font-size:14px;
  margin:0;
}
.message-card-scroll{
  max-height:200px;
  overflow:auto;
  padding-right:3px;
}
.message-card-scroll::-webkit-scrollbar{
  width:5px!important;
  height:5px!important;
}
.message-card-scroll .bar-list,
.message-card-scroll .activity{
  gap:7px;
}
.message-card-scroll .bar-row{
  grid-template-columns:86px minmax(40px,1fr) 28px;
  gap:6px;
}
.message-card-scroll .activity>div{
  gap:8px;
}
.message-card-scroll .activity p{
  font-size:12px;
  line-height:1.3;
}
.message-card-scroll .activity small{
  font-size:11px;
}
@media(max-width:1600px){
  .staff-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
}
@media(max-width:1080px){
  .staff-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .message-compact-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px){
  .staff-grid,
  .message-compact-grid{grid-template-columns:1fr!important;}
  .message-compact-grid .message-card{max-height:none;min-height:0;}
  .message-card-scroll{max-height:220px;}
}
body.fullscreen-preview.route-dashboard .staff-grid{
  grid-template-columns:repeat(8,minmax(0,1fr))!important;
}
@media(max-width:1600px){
  body.fullscreen-preview.route-dashboard .staff-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
}
@media(max-width:1080px){
  body.fullscreen-preview.route-dashboard .staff-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px){
  body.fullscreen-preview.route-dashboard .staff-grid{grid-template-columns:1fr!important;}
}

/* V21: Add Lead layout repair + conversion price fields */
.add-lead-card{
  max-width:1180px!important;
  margin:0 auto 16px!important;
}
.quick-form-v21{
  display:grid;
  gap:10px;
}
.add-section-label{
  display:flex;
  align-items:center;
  gap:8px;
  color:#0f172a;
  font-size:12px;
  margin-top:2px;
}
.add-section-label span{
  color:var(--muted);
  font-size:11px;
}
.form-grid.four,
.quick-form-v21 .form-grid.four{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.quick-form-v21 .lead-add-primary,
.quick-form-v21 .lead-add-follow-row,
.quick-form-v21 .price-grid{
  gap:8px!important;
}
.quick-form-v21 label{
  font-size:12px;
  margin:0!important;
}
.quick-form-v21 input,
.quick-form-v21 select{
  min-height:32px;
  margin-top:4px!important;
}
.quick-form-v21 .wide-field{
  grid-column:span 2;
}
.lead-add-choice-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.choice-box{
  border:1px solid var(--line);
  background:#f8fafc;
  border-radius:12px;
  padding:10px;
  min-width:0;
}
.choice-title{
  display:block;
  font-size:12px;
  font-weight:600;
  margin-bottom:7px;
  color:#0f172a;
}
.mode-pill-grid,
.label-pill-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}
.choice-pill{
  position:relative;
  display:flex!important;
  margin:0!important;
  min-width:0;
  cursor:pointer;
}
.choice-pill input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.choice-pill span{
  width:100%;
  min-height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #cbd5e1;
  background:#fff;
  border-radius:999px;
  padding:6px 8px;
  color:#334155;
  font-size:11.5px;
  line-height:1.15;
  text-align:center;
  white-space:normal;
}
.choice-pill input:checked+span{
  border-color:#2563eb;
  background:#dbeafe;
  color:#1d4ed8;
  box-shadow:inset 0 0 0 1px #2563eb;
}
.label-choice.label-red input:checked+span{background:#fee2e2;color:#b91c1c;border-color:#fca5a5;box-shadow:none;}
.label-choice.label-yellow input:checked+span{background:#fef3c7;color:#92400e;border-color:#fcd34d;box-shadow:none;}
.label-choice.label-green input:checked+span{background:#dcfce7;color:#15803d;border-color:#86efac;box-shadow:none;}
.label-choice.label-blue input:checked+span{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd;box-shadow:none;}
.label-choice.label-purple input:checked+span{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd;box-shadow:none;}
.label-choice.label-gray input:checked+span{background:#f1f5f9;color:#334155;border-color:#cbd5e1;box-shadow:none;}
.quick-details{
  border:1px dashed #cbd5e1!important;
  background:#f8fafc!important;
  border-radius:12px!important;
  padding:9px 10px!important;
  margin:0!important;
}
.quick-details summary{
  font-weight:600!important;
  font-size:12px!important;
  color:#1e293b!important;
}
.quick-details[open] summary{
  margin-bottom:9px;
}
.price-details{
  border-color:#bfdbfe!important;
  background:#f8fbff!important;
}
.quick-actions{
  display:flex;
  gap:8px;
  align-items:center;
  margin-top:4px;
}
@media(max-width:1100px){
  .form-grid.eight,
  .quick-form-v21 .form-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .lead-add-choice-grid{grid-template-columns:1fr!important;}
}
@media(max-width:720px){
  .form-grid.eight,
  .quick-form-v21 .form-grid.four{grid-template-columns:1fr!important;}
  .quick-form-v21 .wide-field{grid-column:1/-1!important;}
  .mode-pill-grid,.label-pill-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* V22: new lead workflow repair + WATI 4-card layout + grouped shortcuts */
.dashboard-workdesk{margin-top:10px!important;}
.wati-dashboard-form{display:block!important;}
.wati-grid-4{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;align-items:stretch!important;}
.wati-compact-card{min-height:340px!important;max-height:800px!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;margin:0!important;}
.wati-compact-card .card-head{flex:0 0 auto!important;margin-bottom:8px!important;}
.wati-card-scroll{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;padding-right:3px!important;}
.wati-card-scroll::-webkit-scrollbar{width:5px!important;height:5px!important;}
.wati-grid-4 .wati-connection-grid{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;}
.wati-grid-4 .wati-rule-grid{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
.wati-grid-4 .wati-rule{padding:9px!important;border-radius:11px!important;}
.wati-grid-4 .wati-rule strong{font-size:12px!important;}
.wati-grid-4 .wati-rule small{font-size:11px!important;}
.wati-grid-4 .wati-queue-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
.wati-grid-4 .queue-card{padding:10px!important;min-height:68px!important;align-content:center!important;}
.wati-grid-4 .queue-card b{font-size:20px!important;}
.wati-grid-4 .template-card-grid{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
.wati-grid-4 .template-card{padding:9px!important;border-radius:11px!important;}
.wati-grid-4 .template-card textarea{min-height:76px!important;font-size:12px!important;}
.wati-mini-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:2px;}
.wati-mini-stats p{margin:0;border:1px solid var(--line);background:#f8fafc;border-radius:10px;padding:8px;display:grid;gap:2px;}
.wati-mini-stats span{font-size:11px;color:#64748b;}
.wati-mini-stats b{font-size:18px;color:#0f172a;}
.shortcut-box{max-width:760px!important;}
.shortcut-grouped-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0;}
.shortcut-help-group{border:1px solid var(--line);background:#f8fafc;border-radius:13px;padding:10px;}
.shortcut-help-group h3,.shortcut-group-card h3{margin:0 0 8px;font-size:13px;color:#334155;letter-spacing:.02em;}
.shortcut-help-group>div{display:grid;gap:7px;}
.shortcut-help-group p{display:flex;align-items:center;gap:9px;margin:0;padding:7px 8px;border:1px solid var(--line);border-radius:9px;background:#fff;}
.shortcut-group-settings{display:grid;gap:14px;margin-top:14px;}
.shortcut-group-card{border:1px solid var(--line);background:#fff;border-radius:14px;padding:12px;}
.shortcut-group-card .shortcut-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:0;}
@media(max-width:1400px){.wati-grid-4{grid-template-columns:repeat(2,minmax(0,1fr))!important;}.shortcut-group-card .shortcut-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:760px){.wati-grid-4,.shortcut-grouped-list,.shortcut-group-card .shortcut-grid{grid-template-columns:1fr!important;}.wati-compact-card{max-height:none!important;}.wati-card-scroll{max-height:300px!important;}}

/* V24: task completion button - completed due tasks hide from pending rail */
.task-link{display:grid;gap:3px;color:inherit;text-decoration:none;min-width:0}
.task-done-form{position:absolute;right:8px;bottom:8px;margin:0}
.task-done-btn{border:1px solid #bbf7d0;background:#ecfdf5;color:#15803d;border-radius:999px;padding:3px 8px;font-size:10.5px;font-weight:600;cursor:pointer;line-height:1.2}
.task-done-btn:hover{background:#dcfce7;border-color:#86efac}
.task-item{padding-bottom:34px}
.task-item em{margin-right:46px}
html[data-ui-scale] .task-done-btn{font-size:10px;padding:2px 7px}

/* V25: compact 6-column shortcut cards */
.shortcut-settings-v25{overflow:visible;}
.shortcut-v25-head{align-items:center;gap:12px;}
.shortcut-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.shortcut-master-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);background:#fff;border-radius:13px;padding:10px 12px;margin:12px 0 14px;}
.shortcut-master-bar .switch-row{border:0;background:transparent;border-radius:0;padding:0;font-weight:600;}
.shortcut-master-bar p{margin:0;}
.shortcut-flat-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:0;}
.shortcut-mini-card{border:1px solid var(--line);background:#f8fafc;border-radius:14px;padding:10px;min-height:116px;display:flex;flex-direction:column;gap:8px;box-shadow:0 1px 0 rgba(15,23,42,.03);}
.shortcut-mini-card.is-disabled{opacity:.58;}
.shortcut-mini-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.shortcut-key-badge{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:30px;padding:0 8px;border-radius:10px;background:#2563eb;color:#fff;font-size:13px;font-weight:700;line-height:1;box-shadow:0 4px 10px rgba(37,99,235,.18);}
.shortcut-mini-group{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:92px;}
.shortcut-mini-title{display:grid!important;gap:6px;margin:0!important;font-size:12px;font-weight:600;color:#0f172a;}
.shortcut-mini-title span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.shortcut-mini-title input{height:30px;margin:0!important;background:#fff;border-radius:9px;font-size:13px;font-weight:600;text-align:center;padding:5px 8px;}
.shortcut-mini-enabled{display:flex!important;align-items:center;gap:6px;margin:auto 0 0!important;color:#475569;font-size:12px;}
.shortcut-mini-enabled input{margin:0;}
.shortcut-actions-v25{margin-top:14px;}
@media(max-width:1500px){.shortcut-flat-grid{grid-template-columns:repeat(5,minmax(0,1fr));}}
@media(max-width:1250px){.shortcut-flat-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:980px){.shortcut-flat-grid{grid-template-columns:repeat(3,minmax(0,1fr));}.shortcut-master-bar{align-items:flex-start;flex-direction:column;}}
@media(max-width:640px){.shortcut-flat-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.shortcut-mini-group{display:none;}.shortcut-v25-head{align-items:flex-start;flex-direction:column;}}

/* V26: Post-conversion growth + referral tracking */
.growth-top{margin-top:14px;}
.v26-card-growth,.v26-card-referral{align-self:start;}
.growth-card .card-head{align-items:flex-start;}
.growth-list{display:grid;gap:8px;margin:10px 0 12px;max-height:230px;overflow:auto;padding-right:2px;}
.growth-row{border:1px solid var(--line);background:#f8fafc;border-radius:13px;padding:9px;display:grid;grid-template-columns:1fr auto;gap:5px 9px;align-items:start;}
.growth-row div{min-width:0;display:grid;gap:3px;}
.growth-row b{font-size:13px;font-weight:600;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.growth-row span,.growth-row small{font-size:11px;color:#64748b;}
.growth-row p{grid-column:1/-1;margin:0;font-size:11.5px;color:#334155;line-height:1.35;}
.growth-row .btn{justify-self:end;}
.growth-details{border:1px solid var(--line);background:#fff;border-radius:12px;padding:8px;margin-top:8px;}
.growth-details summary{cursor:pointer;font-size:12px;font-weight:600;color:#1e293b;}
.growth-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:9px;align-items:end;}
.growth-form label{font-size:11px;color:#475569;display:grid;gap:4px;margin:0;}
.growth-form input,.growth-form select{height:32px;border-radius:9px;border:1px solid #cbd5e1;background:#fff;padding:5px 8px;font-size:12px;min-width:0;}
.growth-form .btn{height:32px;padding:5px 10px;}
.referral-form{grid-template-columns:repeat(6,minmax(0,1fr));}
.check-inline{display:flex!important;align-items:center;gap:6px;border:1px dashed var(--line);border-radius:10px;padding:6px 8px;background:#f8fafc;height:32px;}
.check-inline input{width:auto;height:auto;margin:0;}
.referred-by-box{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #bae6fd;background:#ecfeff;border-radius:12px;padding:8px 10px;margin:8px 0;}
.referred-by-box span{font-size:11px;color:#0369a1;text-transform:uppercase;letter-spacing:.04em;}
.referred-by-box b{font-size:12px;color:#0f172a;font-weight:600;}
.badge-cyan{background:#cffafe;color:#0369a1;}
@media(max-width:1400px){.growth-form,.referral-form{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:760px){.growth-form,.referral-form{grid-template-columns:1fr;}.growth-row{grid-template-columns:1fr;}.growth-row .btn{justify-self:start;}}

/* V27: Admin-only SEO / Audience Insights page */
.audience-workdesk{display:grid;gap:14px;}
.audience-hero{overflow:hidden;}
.audience-metrics{margin-top:10px;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;align-items:stretch;}
.audience-metrics>.metric{grid-column:auto;min-width:0;}
.audience-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;align-items:start;}
.audience-grid .visual-card,.audience-grid .insight-note-card{min-height:260px;}
.insight-note-list{display:grid;gap:9px;margin-top:8px;}
.insight-note-list p{margin:0;border:1px solid var(--line);background:#f8fafc;border-radius:12px;padding:10px;font-size:13px;line-height:1.35;}
.insight-note-list b{font-weight:600;color:#0f172a;}
.route-audience-insights .period-wrap{margin-bottom:0;}
.route-audience-insights .donut-wrap{min-height:190px;}
.route-audience-insights .bar-list{max-height:225px;overflow:auto;padding-right:3px;}
.route-audience-insights .bar-list::-webkit-scrollbar{width:5px;height:5px;}
.route-audience-insights .bar-list::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;}
@media(max-width:1400px){.audience-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:1200px){.audience-metrics{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:760px){.audience-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}.audience-grid{grid-template-columns:1fr;}.audience-hero .card-head{align-items:flex-start;flex-direction:column;}}
@media(max-width:520px){.audience-metrics{grid-template-columns:1fr;}}

/* V28: requested compact grids + dashboard activity scroll + 65% UI */
.route-dashboard .recent-activity-card .activity{max-height:260px;overflow:auto;padding-right:4px;}
.route-dashboard .recent-activity-card .activity::-webkit-scrollbar{width:5px;height:5px;}
.route-dashboard .recent-activity-card .activity::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;}
html[data-ui-scale="75"] .route-dashboard .recent-activity-card .activity{max-height:220px;}
html[data-ui-scale="65"] .route-dashboard .recent-activity-card .activity{max-height:190px;}
html[data-ui-scale="65"] .top-actions{gap:5px;}
html[data-ui-scale="65"] .ui-scale-control{min-height:26px;padding:2px 5px;}
html[data-ui-scale="65"] .ui-scale-control select{min-width:54px;font-size:10px;}
@media(max-width:1400px){.metric-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:980px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* v29 caller notes / staff performance */
.caller-notes-card{border-left:4px solid var(--brand);background:linear-gradient(180deg,#fff,#f8fbff)}
.caller-snapshot-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:8px 0 10px}
.caller-snapshot-grid>div{border:1px solid var(--line);background:#fff;border-radius:10px;padding:8px 9px;min-width:0}
.caller-snapshot-grid span{display:block;font-size:10.5px;color:var(--muted);margin-bottom:3px}.caller-snapshot-grid b{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pinned-note{display:grid;grid-template-columns:120px minmax(0,1fr);gap:10px;align-items:center;padding:9px 10px;border-radius:12px;background:#fff7d6;border:1px solid #f6dd86;margin-bottom:10px}.pinned-note span{font-size:11px;color:#8a6200}.pinned-note b{font-size:12px;font-weight:600;color:#3f3100}
.caller-desk-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}.caller-desk-grid section,.caller-note-lists section{border:1px solid var(--line);border-radius:12px;background:#fff;padding:10px;min-width:0}.caller-desk-grid h3,.caller-note-lists h3{margin:0 0 8px;font-size:12px;font-weight:600;color:var(--text)}
.talk-points{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.talk-points li{font-size:11.5px;border:1px dashed var(--line);border-radius:9px;padding:6px 8px;background:#f9fafb}
.winning-note-list{display:grid;gap:6px;max-height:126px;overflow:auto}.winning-note-list p{margin:0;border-bottom:1px solid var(--line);padding:0 0 5px}.winning-note-list b{font-size:11px;display:block}.winning-note-list span{font-size:11px;color:var(--muted)}
.caller-note-lists{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:10px 0}.caller-note-mini-list{display:grid;gap:7px;max-height:190px;overflow:auto}.caller-note-mini-list article{border:1px solid var(--line);border-radius:10px;padding:7px 8px;background:#fbfdff}.caller-note-mini-list article>div{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.caller-note-mini-list b{font-size:11.5px}.caller-note-mini-list em{font-style:normal;font-size:10px;color:var(--muted);background:#f1f5f9;border-radius:999px;padding:2px 6px}.caller-note-mini-list p{font-size:11.5px;margin:5px 0;color:var(--text);line-height:1.35}.caller-note-mini-list small{font-size:10.5px;color:var(--muted)}
.caller-note-form-wrap{border:1px solid var(--line);border-radius:12px;background:#fff;margin-top:10px;padding:8px 10px}.caller-note-form-wrap summary{cursor:pointer;font-weight:600;font-size:12px}.caller-note-form{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:10px}.caller-note-form label{min-width:0}.caller-note-form .wide-field{grid-column:1/-1}.caller-note-form .check-inline{grid-column:span 2;align-self:center}.caller-note-form .template-row{grid-column:1/-1}.caller-note-form button[type="submit"]{grid-column:1/-1;justify-self:start}
.demo-note-mini{border-top:1px solid var(--line);margin-top:10px;padding-top:8px;display:grid;gap:6px}.demo-note-mini>b{font-size:12px}.demo-note-mini p{margin:0;padding:6px 8px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:11.5px}.demo-note-mini small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
@media(max-width:1400px){.caller-snapshot-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.caller-note-lists{grid-template-columns:repeat(2,minmax(0,1fr))}.caller-note-form{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.caller-snapshot-grid,.caller-desk-grid,.caller-note-lists,.caller-note-form{grid-template-columns:1fr}.talk-points{grid-template-columns:1fr}.pinned-note{grid-template-columns:1fr}.caller-note-form .check-inline{grid-column:1/-1}}
.fullscreen-preview.route-lead-view .caller-snapshot-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.fullscreen-preview.route-lead-view .caller-note-lists{grid-template-columns:repeat(4,minmax(0,1fr))}.fullscreen-preview.route-lead-view .caller-note-form{grid-template-columns:repeat(6,minmax(0,1fr))}.fullscreen-preview.route-lead-view .caller-note-mini-list{max-height:125px}.fullscreen-preview.route-lead-view .talk-points{grid-template-columns:repeat(3,minmax(0,1fr))}

/* v30 caller notes edit/update/delete audit controls */
.v30-caller-notes .caller-note-mini-list{max-height:260px;}
.v30-caller-notes .caller-note-item{position:relative;}
.v30-caller-notes .caller-note-item.is-deleted{background:#fff1f2;border-color:#fecdd3;opacity:.9;}
.v30-caller-notes .caller-note-item>small{display:block;margin-top:3px;}
.note-inline-actions{display:grid;gap:6px;margin-top:7px;}
.note-edit-box,.note-delete-box,.deleted-notes-wrap{border:1px dashed var(--line);border-radius:9px;background:#fff;padding:6px;margin-top:5px;}
.note-edit-box summary,.note-delete-box summary,.deleted-notes-wrap summary{cursor:pointer;font-size:11px;font-weight:600;color:#334155;}
.caller-note-edit-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:7px;}
.caller-note-edit-form label,.note-delete-form label{font-size:10.5px;color:#475569;display:grid;gap:3px;margin:0;}
.caller-note-edit-form input,.caller-note-edit-form select,.caller-note-edit-form textarea,.note-delete-form select{border:1px solid #cbd5e1;border-radius:8px;padding:5px 7px;font-size:11px;background:#fff;min-width:0;}
.caller-note-edit-form textarea{resize:vertical;min-height:58px;}
.caller-note-edit-form .wide-field{grid-column:1/-1;}
.caller-note-edit-form .check-inline{grid-column:span 2;height:28px;}
.note-delete-form{display:grid;grid-template-columns:1fr auto;gap:7px;align-items:end;margin-top:7px;}
.note-restore-form{display:flex;justify-content:flex-start;margin-top:7px;}
.deleted-notes-wrap{background:#fff7f7;border-color:#fecdd3;margin:10px 0;}
.deleted-notes-wrap>.caller-note-mini-list{max-height:230px;}
.badge-red{background:#fee2e2;color:#991b1b;}
.btn.danger{border-color:#fecaca;background:#fee2e2;color:#991b1b;}
.btn.danger:hover{background:#fecaca;}
@media(max-width:1200px){.caller-note-edit-form{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:720px){.caller-note-edit-form,.note-delete-form{grid-template-columns:1fr;}.caller-note-edit-form .check-inline{grid-column:1/-1;}}

/* V31 archive import + reactivation performance layer */
.pager-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;padding:10px 12px;border:1px solid var(--line,#e5e7eb);border-radius:14px;background:var(--card,#fff)}
.pager-bar>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pager-bar select{min-height:32px;padding:4px 8px;border-radius:10px}.pager-bar b{font-weight:600;color:var(--muted,#64748b)}
.archive-workdesk{display:grid;gap:14px}.archive-hero .card-head{align-items:flex-start}.archive-stat-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}.archive-split{display:grid;grid-template-columns:1fr 1fr;gap:16px}.archive-activate-controls{display:grid;grid-template-columns:minmax(180px,240px) 1fr auto;gap:10px;align-items:end;margin-bottom:12px}.archive-activate-controls input,.archive-activate-controls select{width:100%}.old-import-card .upload-box{display:flex;flex-direction:column;gap:10px}.archive-import-form .checkline{display:flex;align-items:center;gap:8px;min-height:42px;padding:9px 10px;border:1px solid var(--line,#e5e7eb);border-radius:12px;background:rgba(15,23,42,.025)}.archive-import-form .checkline input{width:auto}.route-archive-center .main,.route-import-export .main{overflow:auto}.badge-slate,.chip-slate,.pill-slate{--accent:#475569}.archive-hero .smart-pill strong{font-size:1.35rem}.archive-workdesk .mini-table th:first-child,.archive-workdesk .mini-table td:first-child{text-align:center;width:36px}
@media(max-width:1200px){.archive-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.archive-activate-controls{grid-template-columns:1fr}.archive-split{grid-template-columns:1fr}}
@media(max-width:700px){.archive-stat-grid{grid-template-columns:1fr}.pager-bar{align-items:flex-start;flex-direction:column}.pager-bar>div{width:100%}}
.pill-slate{border-color:#cbd5e1;background:#f8fafc}.badge-slate{background:#f1f5f9;color:#334155}


/* V32: archive layout + master lead form / original user message */
.route-archive-center .archive-hero{width:100%!important;overflow:visible!important;}
.route-archive-center .archive-stat-grid,
.route-archive-center .archive-metric-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(150px,1fr))!important;
  gap:12px!important;
  width:100%!important;
  align-items:stretch!important;
}
.route-archive-center .archive-metric-card{
  display:block!important;
  min-width:0!important;
  width:auto!important;
  min-height:86px!important;
  padding:12px 14px!important;
}
.route-archive-center .archive-metric-card span{
  min-height:30px;
  line-height:1.2;
}
.route-archive-center .archive-metric-card strong{
  font-size:24px!important;
  line-height:1!important;
  margin:4px 0!important;
}
.upload-box.compact,
.old-import-card .upload-box,
.archive-import-form{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:10px!important;
}
.archive-import-form .drawer-two{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
.quick-form-v21 textarea{
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:9px;
  padding:8px 10px;
  font:inherit;
  font-weight:400;
  background:#fff;
  margin-top:4px!important;
  resize:vertical;
}
.quick-form-v21 .full-message-field{
  grid-column:1/-1!important;
}
.original-message-box{
  margin-top:10px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  border-radius:12px;
  padding:10px 12px;
}
.original-message-box span{
  display:block;
  color:#1d4ed8;
  font-size:12px;
  font-weight:600;
  margin-bottom:4px;
}
.original-message-box p{
  margin:0;
  color:#0f172a;
  line-height:1.45;
  white-space:pre-wrap;
}
.user-message-preview{
  display:inline-block;
  max-width:260px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#334155;
}
@media(max-width:1200px){
  .route-archive-center .archive-stat-grid,
  .route-archive-center .archive-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:760px){
  .route-archive-center .archive-stat-grid,
  .route-archive-center .archive-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .archive-import-form .drawer-two{grid-template-columns:1fr!important;}
}
@media(max-width:520px){
  .route-archive-center .archive-stat-grid,
  .route-archive-center .archive-metric-grid{grid-template-columns:1fr!important;}
}

/* V33: hard archive metric grid + cache-busted layout repair */
body.route-archive-center .archive-workdesk{
  display:block!important;
  width:100%!important;
  max-width:none!important;
}
body.route-archive-center .archive-hero{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  overflow:visible!important;
  clear:both!important;
}
body.route-archive-center .archive-hero .card-head{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:12px!important;
  width:100%!important;
  margin-bottom:12px!important;
}
body.route-archive-center .archive-stat-grid.archive-metric-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  align-items:stretch!important;
}
body.route-archive-center .archive-stat-grid.archive-metric-grid>.smart-pill,
body.route-archive-center .archive-stat-grid.archive-metric-grid>.archive-metric-card{
  display:grid!important;
  grid-template-rows:auto auto 1fr!important;
  align-content:start!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:78px!important;
  height:100%!important;
  margin:0!important;
  padding:10px 12px!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#0f172a!important;
  text-decoration:none!important;
  white-space:normal!important;
  overflow:hidden!important;
  box-shadow:0 7px 18px rgba(15,23,42,.045)!important;
}
body.route-archive-center .archive-stat-grid.archive-metric-grid>.smart-pill span,
body.route-archive-center .archive-stat-grid.archive-metric-grid>.archive-metric-card span{
  display:block!important;
  min-height:0!important;
  font-size:11.5px!important;
  line-height:1.2!important;
  color:#334155!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.route-archive-center .archive-stat-grid.archive-metric-grid>.smart-pill strong,
body.route-archive-center .archive-stat-grid.archive-metric-grid>.archive-metric-card strong{
  display:block!important;
  font-size:22px!important;
  line-height:1!important;
  margin:4px 0!important;
  color:#0f172a!important;
}
body.route-archive-center .archive-stat-grid.archive-metric-grid>.smart-pill small,
body.route-archive-center .archive-stat-grid.archive-metric-grid>.archive-metric-card small{
  display:block!important;
  font-size:10.5px!important;
  line-height:1.25!important;
  color:#64748b!important;
  min-width:0!important;
}
body.route-archive-center .upload-box.compact,
body.route-import-export .upload-box.compact{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:10px!important;
}
body.route-archive-center .archive-split{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;
  width:100%!important;
  margin-top:10px!important;
}
@media(max-width:1300px){
  body.route-archive-center .archive-stat-grid.archive-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:900px){
  body.route-archive-center .archive-stat-grid.archive-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.route-archive-center .archive-split{grid-template-columns:1fr!important;}
}
@media(max-width:560px){
  body.route-archive-center .archive-stat-grid.archive-metric-grid{grid-template-columns:1fr!important;}
  body.route-archive-center .archive-hero .card-head{flex-direction:column!important;}
}


/* v34 User & Role Management Studio */
.user-studio{display:grid;gap:12px}.user-studio-hero{display:flex;justify-content:space-between;gap:16px;align-items:center}.user-metric-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;min-width:420px}.user-metric-row span,.transfer-preview .mini-stat-grid span{border:1px solid var(--line);border-radius:14px;padding:10px;background:#fff}.user-metric-row b,.transfer-preview b{display:block;font-size:20px}.user-grid-form,.transfer-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.user-grid-form label,.transfer-grid label,.mini-edit-form label{display:grid;gap:5px;font-size:12px}.user-grid-form input,.user-grid-form select,.transfer-grid input,.transfer-grid select,.mini-edit-form input,.mini-edit-form select{min-height:34px;border:1px solid var(--line);border-radius:10px;padding:7px 9px}.checkline{display:flex!important;align-items:center;gap:8px;align-self:end;min-height:34px}.checkline input{min-height:auto!important}.full-row{grid-column:1/-1}.user-table td small{display:block;color:var(--muted);margin-top:3px}.ok{color:#15803d;font-weight:600}.danger-text{color:#b91c1c;font-weight:600}.inline-form{display:inline-flex;gap:6px;margin-top:6px}.mini-edit-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:min(680px,80vw);padding:10px;border:1px solid var(--line);border-radius:14px;background:#fff;margin:8px 0}.transfer-preview{border:1px solid #bbf7d0;background:#f0fdf4;border-radius:16px;padding:12px;margin-top:12px}.transfer-preview .mini-stat-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}.role-permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.permission-card{border:1px solid var(--line);border-radius:16px;padding:12px;background:#fff}.permission-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:360px;overflow:auto;padding-right:4px}.permission-list label{font-size:12px;display:flex;gap:7px;align-items:center}.route-users .lead-table td{vertical-align:top}@media(max-width:1100px){.user-studio-hero{display:block}.user-metric-row,.user-grid-form,.transfer-grid{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}.transfer-preview .mini-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.role-permission-grid{grid-template-columns:1fr}}@media(max-width:640px){.user-metric-row,.user-grid-form,.transfer-grid,.mini-edit-form,.transfer-preview .mini-stat-grid,.permission-list{grid-template-columns:1fr}.inline-form{display:flex;flex-wrap:wrap}}


/* v36 clean login + transfer preview anchor */
.clean-login{padding:30px 28px 32px;width:min(420px,92vw)}
.clean-login .logo-mark{margin-bottom:14px;width:34px;height:34px}
.clean-login h1{margin:0 0 22px;font-size:28px;line-height:1.12;letter-spacing:-.03em}
.login-form{display:grid;gap:0;margin:0}
.login-field{display:grid!important;gap:6px;margin:0 0 12px!important;font-size:13px;color:#0f172a;font-weight:500}
.login-field span{line-height:1.25}
.login-field input{margin:0!important;min-height:40px;border-radius:10px;padding:9px 11px;background:#fff}
.login-form .btn.full{height:38px;margin-top:2px;border-radius:10px;font-weight:600}
.clean-login .alert{margin:0 0 16px}
.user-transfer-card{scroll-margin-top:14px}
#transfer-preview{scroll-margin-top:14px}

/* V41: sticky sidebar + sticky page header + fixed workdesk scroll for Leads/Board/Follow-ups */
body.route-leads,
body.route-board,
body.route-followups,
body.route-demo-queue{
  overflow:hidden!important;
}
body.route-leads .app-shell,
body.route-board .app-shell,
body.route-followups .app-shell,
body.route-demo-queue .app-shell{
  height:100vh!important;
  min-height:100vh!important;
  overflow:hidden!important;
}
body.route-leads .sidebar,
body.route-board .sidebar,
body.route-followups .sidebar,
body.route-demo-queue .sidebar{
  position:sticky!important;
  top:0!important;
  align-self:start!important;
  height:100vh!important;
  max-height:100vh!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
}
body.route-leads .main,
body.route-board .main,
body.route-followups .main,
body.route-demo-queue .main{
  height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
body.route-leads .topbar,
body.route-board .topbar,
body.route-followups .topbar,
body.route-demo-queue .topbar{
  flex:0 0 auto!important;
  position:sticky!important;
  top:0!important;
  z-index:260!important;
  background:var(--bg)!important;
  margin-bottom:8px!important;
  padding-bottom:6px!important;
  border-bottom:1px solid rgba(226,232,240,.9)!important;
  box-shadow:0 8px 22px rgba(15,23,42,.06)!important;
}
body.route-leads .alert,
body.route-board .alert,
body.route-followups .alert,
body.route-demo-queue .alert{
  flex:0 0 auto!important;
}
body.route-leads .lead-list-workdesk,
body.route-board .lead-list-workdesk{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body.route-leads .lead-list-workdesk>.task-rail,
body.route-board .lead-list-workdesk>.task-rail{
  position:sticky!important;
  top:0!important;
  align-self:stretch!important;
  height:100%!important;
  max-height:none!important;
  min-height:0!important;
  overflow:hidden!important;
}
body.route-leads .task-rail-head,
body.route-board .task-rail-head,
body.route-leads .task-rail-actions,
body.route-board .task-rail-actions{
  flex:0 0 auto!important;
}
body.route-leads .task-scroll,
body.route-board .task-scroll{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:auto!important;
  overscroll-behavior:contain;
}
body.route-leads .lead-list-scroll,
body.route-board .lead-list-scroll{
  height:100%!important;
  min-height:0!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  padding-right:4px;
}
body.route-leads .table-card,
body.route-board .table-card,
body.route-followups .table-card,
body.route-demo-queue .table-card{
  max-height:calc(100vh - 235px);
  overflow:auto!important;
  overscroll-behavior:contain;
}
body.route-leads .lead-table th,
body.route-board .lead-table th,
body.route-followups .lead-table th,
body.route-demo-queue .lead-table th{
  position:sticky!important;
  top:0!important;
  z-index:70!important;
  background:#f8fafc!important;
  box-shadow:0 1px 0 var(--line),0 6px 14px rgba(15,23,42,.05)!important;
}
body.route-board .board{
  min-height:0!important;
}
body.route-board .board-col{
  max-height:calc(100vh - 168px);
  overflow:auto;
  overscroll-behavior:contain;
}
body.route-followups .subtabs{
  flex:0 0 auto!important;
  position:sticky!important;
  top:0!important;
  z-index:220!important;
  background:var(--bg)!important;
  padding:2px 0 8px!important;
  margin-bottom:8px!important;
}
body.route-followups .main>.card,
body.route-demo-queue .main>.card{
  min-height:0!important;
  overflow:auto!important;
  overscroll-behavior:contain;
}
body.route-followups .main>.card:first-of-type{
  flex:1 1 52%!important;
}
body.route-followups .main>.card:last-of-type{
  flex:1 1 48%!important;
}
@media(max-width:900px){
  body.route-leads,
  body.route-board,
  body.route-followups,
  body.route-demo-queue{overflow:auto!important;}
  body.route-leads .app-shell,
  body.route-board .app-shell,
  body.route-followups .app-shell,
  body.route-demo-queue .app-shell{height:auto!important;overflow:visible!important;}
  body.route-leads .main,
  body.route-board .main,
  body.route-followups .main,
  body.route-demo-queue .main{height:auto!important;overflow:visible!important;display:block!important;}
  body.route-leads .lead-list-scroll,
  body.route-board .lead-list-scroll{height:auto!important;overflow:visible!important;}
  body.route-leads .table-card,
  body.route-board .table-card,
  body.route-followups .table-card,
  body.route-demo-queue .table-card{max-height:none;}
}

/* V43: 10k lead board speed helpers */
.board-limit-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:10px 0 12px;padding:10px 12px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow)}
.board-limit-bar span{font-size:12px;color:var(--muted)}
.board-limit-bar>div{display:flex;gap:6px;flex-wrap:wrap}
.board-more{display:grid;gap:6px;background:#fff7ed;border:1px dashed #fdba74;border-radius:10px;padding:10px;margin-top:10px;color:#9a3412;font-size:12px}
.board-more b{color:#9a3412}.board-more span{color:#c2410c}

/* V47: browser-batch CSV import terminal, 50k-safe */
.import-async-card{grid-column:span 1!important;}
.import-terminal-card{margin-top:10px;border:1px solid #0f172a;background:#020617;color:#dbeafe;border-radius:13px;padding:10px;display:grid;gap:8px;box-shadow:0 12px 28px rgba(15,23,42,.18)}
.import-terminal-card[hidden]{display:none!important;}
.terminal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.terminal-head strong{font-weight:600;color:#fff}.terminal-head span{font-size:10.5px;color:#93c5fd;border:1px solid rgba(147,197,253,.35);border-radius:999px;padding:3px 7px;background:rgba(37,99,235,.18)}
.terminal-progress{height:8px;background:#1e293b;border-radius:999px;overflow:hidden;border:1px solid rgba(148,163,184,.25)}.terminal-progress i{display:block;height:100%;background:linear-gradient(90deg,#38bdf8,#22c55e);transition:width .25s ease;border-radius:999px}
.terminal-stats{display:grid;grid-template-columns:1fr 1fr;gap:6px}.terminal-stats p{margin:0;border:1px solid rgba(148,163,184,.25);background:rgba(15,23,42,.75);border-radius:9px;padding:6px 8px;display:grid;gap:2px}.terminal-stats span{font-size:10px;color:#94a3b8;text-transform:uppercase;letter-spacing:.03em}.terminal-stats b{font-size:13px;color:#f8fafc;font-weight:600;line-height:1.1;word-break:break-word}.import-terminal-card pre{margin:0;min-height:96px;max-height:150px;overflow:auto;white-space:pre-wrap;font:11px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;color:#bbf7d0;background:#020617;border:1px solid rgba(148,163,184,.22);border-radius:9px;padding:8px}.terminal-actions{display:flex;justify-content:space-between;gap:8px;align-items:center}.terminal-actions .btn{border-color:rgba(148,163,184,.35)!important;color:#e2e8f0!important;background:rgba(15,23,42,.8)!important}
@media(max-width:1080px){.import-async-card{grid-column:1/-1!important}.terminal-stats{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:620px){.terminal-stats{grid-template-columns:1fr 1fr}.import-terminal-card pre{max-height:180px}}

/* V50: 50k read-cache indicator */
.speed-badge{display:inline-flex;align-items:center;margin-left:6px;padding:2px 7px;border-radius:999px;background:#ecfdf5;border:1px solid #bbf7d0;color:#047857;font-size:10.5px;font-style:normal;font-weight:600;vertical-align:middle}

/* V52 speed: lazy map preview and fast detail helpers */
.map-lazy-box{margin-top:8px;border:1px solid var(--line);border-radius:12px;background:#f8fafc;overflow:hidden}.map-lazy-box>summary{cursor:pointer;padding:8px 10px;font-weight:600;color:#334155}.map-lazy-box .map-frame{margin:0;border-radius:0}

/* V54 work-based Staff Performance */
.staff-performance-card{border-left:4px solid var(--brand);background:linear-gradient(180deg,#fff,#f8fbff)}
.staff-rule-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0 12px}
.staff-rule-grid>div{border:1px solid var(--line);border-radius:12px;background:#fff;padding:9px 10px;min-width:0}
.staff-rule-grid b{display:block;font-size:12px;font-weight:600;color:var(--text);margin-bottom:3px}
.staff-rule-grid span{display:block;font-size:11px;color:var(--muted);line-height:1.35}
.staff-performance-table td{vertical-align:middle}.block{display:block;margin-top:3px}.staff-score{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:28px;border-radius:999px;font-size:12px;font-weight:600;border:1px solid var(--line);background:#f8fafc}.staff-score.good{background:#dcfce7;border-color:#86efac;color:#166534}.staff-score.warn{background:#fef9c3;border-color:#fde68a;color:#854d0e}.staff-score.bad{background:#fee2e2;border-color:#fecaca;color:#991b1b}.delay-chip-row{display:flex;gap:4px;flex-wrap:wrap}.delay-chip{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;font-size:10px;line-height:1;padding:4px 6px;border:1px solid var(--line);background:#f8fafc}.delay-chip.mild{background:#fff7ed;border-color:#fed7aa;color:#9a3412}.delay-chip.serious{background:#fef3c7;border-color:#fcd34d;color:#92400e}.delay-chip.critical{background:#fee2e2;border-color:#fecaca;color:#991b1b}
@media(max-width:1100px){.staff-rule-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.staff-rule-grid{grid-template-columns:1fr}.staff-performance-table{min-width:980px}}


/* V57 compact Quick Buckets: primary row + More Filters panel */
.quick-filter-panel.quick-filter-panel-v57{display:block!important;padding:10px 12px!important;margin-bottom:10px!important;border-radius:14px!important;min-height:0!important;}
.quick-filter-panel-v57 .quick-filter-compact-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:7px;}
.quick-filter-panel-v57 .quick-filter-title{display:flex;align-items:baseline;gap:9px;min-width:0;}
.quick-filter-panel-v57 .quick-filter-title h2{font-size:14px;margin:0;white-space:nowrap;}
.quick-filter-panel-v57 .quick-filter-title p{margin:0;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.quick-filter-main-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.quick-filter-panel-v57 .chip-btn{padding:5px 9px;font-size:11.5px;line-height:1.2;min-height:26px;}
.quick-more{position:relative;display:inline-block;}
.quick-more>summary{list-style:none;cursor:pointer;user-select:none;}
.quick-more>summary::-webkit-details-marker{display:none;}
.quick-more-panel{position:absolute;left:0;top:calc(100% + 8px);width:min(760px,calc(100vw - 90px));max-height:62vh;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.20);padding:12px;z-index:70;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.chip-group-more{border:1px solid #edf2f7;background:#f8fafc;border-radius:12px;padding:9px;}
.chip-group-more>span{margin-bottom:6px;display:block;}
.chip-group-more>div{gap:5px;}
.quick-active-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:7px;padding-top:7px;border-top:1px dashed #e2e8f0;}
.quick-active-row>span{font-size:11px;color:#64748b;font-weight:600;text-transform:uppercase;letter-spacing:.03em;}
.quick-clear-link{font-size:11.5px;color:#64748b;text-decoration:underline;text-underline-offset:2px;}
@media(max-width:1180px){.quick-filter-panel-v57 .quick-filter-title{display:grid;gap:2px;}.quick-filter-panel-v57 .quick-filter-title p{white-space:normal;}.quick-more-panel{grid-template-columns:repeat(2,minmax(0,1fr));width:min(680px,calc(100vw - 40px));}}
@media(max-width:700px){.quick-filter-main-row{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;}.quick-filter-main-row::-webkit-scrollbar{height:4px;}.quick-filter-main-row::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;}.quick-more{position:static;}.quick-more-panel{position:fixed;left:12px;right:12px;top:auto;bottom:12px;width:auto;max-height:72vh;grid-template-columns:1fr;}.quick-filter-panel-v57 .chip-btn{white-space:nowrap;}}

/* V58 compact More Filters: floating 4-column popover, no large section push */
.quick-filter-panel.quick-filter-panel-v58{position:relative!important;z-index:35!important;padding:8px 10px!important;margin-bottom:8px!important;overflow:visible!important;}
.quick-filter-panel-v58 .quick-filter-compact-head{margin-bottom:5px!important;}
.quick-filter-panel-v58 .quick-filter-title h2{font-size:13px!important;line-height:1.1!important;}
.quick-filter-panel-v58 .quick-filter-title p{font-size:10.5px!important;line-height:1.2!important;color:#64748b!important;}
.quick-filter-panel-v58 .quick-filter-main-row{gap:5px!important;position:relative!important;overflow:visible!important;}
.quick-filter-panel-v58 .chip-btn{min-height:24px!important;padding:4px 8px!important;font-size:11px!important;line-height:1.1!important;max-width:145px;overflow:hidden;text-overflow:ellipsis;}
.quick-filter-panel-v58 .quick-more{position:relative!important;display:inline-flex!important;z-index:210!important;}
.quick-filter-panel-v58 .quick-more>summary{height:24px!important;box-shadow:0 1px 0 rgba(15,23,42,.06)!important;}
.quick-filter-panel-v58 .quick-more-panel{position:absolute!important;left:auto!important;right:0!important;top:calc(100% + 7px)!important;width:min(820px,calc(100vw - 40px))!important;max-height:70vh!important;overflow:auto!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px!important;padding:9px!important;background:#fff!important;border:1px solid #dbe4ef!important;border-radius:14px!important;box-shadow:0 22px 60px rgba(15,23,42,.22)!important;z-index:220!important;}
.quick-filter-panel-v58 .chip-group-more{padding:7px!important;border-radius:10px!important;background:#f8fafc!important;border:1px solid #e8eef6!important;min-height:0!important;align-content:start!important;}
.quick-filter-panel-v58 .chip-group-more>span{font-size:10px!important;line-height:1.1!important;margin:0 0 5px!important;color:#5b6f8d!important;font-weight:600!important;}
.quick-filter-panel-v58 .chip-group-more>div{display:flex!important;flex-wrap:wrap!important;gap:4px!important;align-items:flex-start!important;min-width:0!important;overflow:visible!important;}
.quick-filter-panel-v58 .chip-group-more .chip-btn{min-height:22px!important;padding:4px 7px!important;font-size:10.5px!important;border-radius:999px!important;max-width:100%!important;}
.quick-filter-panel-v58 .quick-active-row{margin-top:5px!important;padding-top:5px!important;gap:5px!important;}
.quick-filter-panel-v58 .quick-active-row>span,.quick-filter-panel-v58 .quick-clear-link{font-size:10.5px!important;}
body.route-leads .table-card,body.route-board .table-card{position:relative;z-index:1;}
@media(max-width:1180px){.quick-filter-panel-v58 .quick-more-panel{grid-template-columns:repeat(3,minmax(0,1fr))!important;width:min(680px,calc(100vw - 30px))!important;}}
@media(max-width:820px){.quick-filter-panel-v58 .quick-more-panel{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:min(520px,calc(100vw - 24px))!important;}.quick-filter-panel-v58 .quick-filter-title p{display:none!important;}}
@media(max-width:620px){.quick-filter-panel-v58{padding:8px!important;}.quick-filter-panel-v58 .quick-filter-main-row{flex-wrap:nowrap!important;overflow-x:auto!important;padding-bottom:4px!important;}.quick-filter-panel-v58 .quick-more{position:static!important;}.quick-filter-panel-v58 .quick-more-panel{position:fixed!important;left:10px!important;right:10px!important;top:auto!important;bottom:10px!important;width:auto!important;max-height:76vh!important;grid-template-columns:1fr!important;padding:10px!important;border-radius:16px!important;}.quick-filter-panel-v58 .chip-group-more{padding:8px!important;}.quick-filter-panel-v58 .chip-group-more>div{flex-wrap:wrap!important;overflow:visible!important;}.quick-filter-panel-v58 .chip-btn{flex:0 0 auto!important;}}


/* V59: Quick bucket popover overlap + compact density repair */
body.route-leads .quick-filter-panel.quick-filter-panel-v59{
  position:relative!important;
  z-index:260!important;
  padding:7px 9px!important;
  margin-bottom:6px!important;
  overflow:visible!important;
}
.quick-filter-panel-v59 .quick-filter-compact-head{
  margin-bottom:4px!important;
}
.quick-filter-panel-v59 .quick-filter-title{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  min-width:0!important;
}
.quick-filter-panel-v59 .quick-filter-title h2{
  font-size:13px!important;
  line-height:1!important;
  margin:0!important;
  flex:0 0 auto!important;
}
.quick-filter-panel-v59 .quick-filter-title p{
  font-size:10px!important;
  line-height:1.1!important;
  margin:0!important;
  max-width:430px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.quick-filter-panel-v59 .quick-filter-main-row{
  gap:4px!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  overflow:visible!important;
}
.quick-filter-panel-v59 .quick-filter-main-row>.chip-btn,
.quick-filter-panel-v59 .quick-more>summary{
  min-height:22px!important;
  height:22px!important;
  padding:3px 8px!important;
  font-size:10.5px!important;
  line-height:1!important;
  max-width:none!important;
}
.quick-filter-panel-v59 .quick-more{
  position:relative!important;
  display:inline-flex!important;
  z-index:310!important;
}
.quick-filter-panel-v59 .quick-more-panel{
  position:absolute!important;
  right:0!important;
  left:auto!important;
  top:calc(100% + 6px)!important;
  width:min(620px,calc(100vw - 320px))!important;
  max-width:calc(100vw - 24px)!important;
  max-height:62vh!important;
  overflow:auto!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
  padding:7px!important;
  background:#fff!important;
  border:1px solid #dbe4ef!important;
  border-radius:12px!important;
  box-shadow:0 20px 54px rgba(15,23,42,.24)!important;
  z-index:330!important;
}
.quick-filter-panel-v59 .chip-group-more{
  padding:6px!important;
  border-radius:9px!important;
  background:#f8fafc!important;
  border:1px solid #e8eef6!important;
  min-height:auto!important;
  align-content:start!important;
}
.quick-filter-panel-v59 .chip-group-more>span{
  display:block!important;
  font-size:9.5px!important;
  line-height:1!important;
  margin:0 0 5px!important;
  letter-spacing:.025em!important;
  color:#5b6f8d!important;
  font-weight:600!important;
}
.quick-filter-panel-v59 .chip-group-more>div{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:3px!important;
  align-items:flex-start!important;
  min-width:0!important;
  overflow:visible!important;
}
.quick-filter-panel-v59 .chip-group-more .chip-btn{
  min-height:20px!important;
  height:20px!important;
  padding:3px 6px!important;
  font-size:10px!important;
  line-height:1!important;
  border-radius:999px!important;
  max-width:none!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
.quick-filter-panel-v59 .quick-active-row{
  margin-top:4px!important;
  padding-top:4px!important;
  gap:5px!important;
}
body.route-leads .lead-table th{
  z-index:40!important;
}
@media(max-width:1180px){
  .quick-filter-panel-v59 .quick-more-panel{
    width:min(560px,calc(100vw - 285px))!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
@media(max-width:980px){
  .quick-filter-panel-v59 .quick-more-panel{
    width:min(520px,calc(100vw - 30px))!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:760px){
  .quick-filter-panel-v59 .quick-filter-title p{display:none!important;}
  .quick-filter-panel-v59 .quick-filter-main-row{overflow-x:auto!important;padding-bottom:3px!important;}
  .quick-filter-panel-v59 .quick-more-panel{
    width:min(430px,calc(100vw - 24px))!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:520px){
  .quick-filter-panel-v59 .quick-more{position:static!important;}
  .quick-filter-panel-v59 .quick-more-panel{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    top:auto!important;
    bottom:10px!important;
    width:auto!important;
    max-height:76vh!important;
    grid-template-columns:1fr!important;
    padding:10px!important;
    border-radius:16px!important;
  }
}


/* V60: keep More filter popover inside Quick Buckets card to stop left clipping/rail overlap */
body.route-leads .quick-filter-panel.quick-filter-panel-v60{
  position:relative!important;
  z-index:500!important;
  overflow:visible!important;
}
body.route-leads .quick-filter-panel-v60 .quick-filter-main-row{
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  padding-bottom:2px!important;
  scrollbar-width:thin;
}
body.route-leads .quick-filter-panel-v60 .quick-filter-main-row::-webkit-scrollbar{height:4px;}
body.route-leads .quick-filter-panel-v60 .quick-filter-main-row::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;}
body.route-leads .quick-filter-panel-v60 .quick-filter-main-row>.chip-btn,
body.route-leads .quick-filter-panel-v60 .quick-more>summary{
  flex:0 0 auto!important;
}
body.route-leads .quick-filter-panel-v60 .quick-more{
  position:static!important;
  display:inline-flex!important;
  z-index:auto!important;
}
body.route-leads .quick-filter-panel-v60 .quick-more-panel{
  position:absolute!important;
  left:8px!important;
  right:auto!important;
  top:calc(100% + 6px)!important;
  width:min(720px,calc(100% - 16px))!important;
  max-width:calc(100% - 16px)!important;
  min-width:0!important;
  max-height:60vh!important;
  overflow:auto!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
  padding:7px!important;
  background:#fff!important;
  border:1px solid #dbe4ef!important;
  border-radius:12px!important;
  box-shadow:0 18px 48px rgba(15,23,42,.22)!important;
  z-index:999!important;
}
body.route-leads .quick-filter-panel-v60 .chip-group-more{
  min-width:0!important;
  padding:6px!important;
}
body.route-leads .quick-filter-panel-v60 .chip-group-more>span{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.route-leads .quick-filter-panel-v60 .chip-group-more .chip-btn{
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body.route-leads .lead-list-workdesk,
body.route-leads .lead-list-scroll{
  overflow:visible!important;
}
body.route-leads .table-card{
  overflow:auto!important;
}
@media(max-width:1180px){
  body.route-leads .quick-filter-panel-v60 .quick-more-panel{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:calc(100% - 16px)!important;
  }
}
@media(max-width:980px){
  body.route-leads .quick-filter-panel-v60 .quick-more-panel{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:760px){
  body.route-leads .quick-filter-panel-v60 .quick-more-panel{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:520px){
  body.route-leads .quick-filter-panel-v60 .quick-more-panel{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    top:auto!important;
    bottom:10px!important;
    width:auto!important;
    max-width:none!important;
    max-height:76vh!important;
    grid-template-columns:1fr!important;
    padding:10px!important;
    border-radius:16px!important;
  }
}

/* V61: JS-controlled More Filters button. Panel is outside the horizontal chip row, so it is not clipped by row scrolling. */
body.route-leads .quick-filter-panel.quick-filter-panel-v61{
  position:relative!important;
  z-index:600!important;
  overflow:visible!important;
}
body.route-leads .quick-filter-panel-v61 .quick-more-toggle{
  cursor:pointer!important;
  appearance:none!important;
  border-style:solid!important;
  font-family:inherit!important;
}
body.route-leads .quick-filter-panel-v61 .quick-more-toggle.is-open,
body.route-leads .quick-filter-panel-v61 .quick-more-toggle.active{
  box-shadow:0 0 0 2px rgba(37,99,235,.10)!important;
}
body.route-leads .quick-filter-panel-v61 .quick-more-panel[hidden]{
  display:none!important;
}
body.route-leads .quick-filter-panel-v61 .quick-more-panel{
  position:absolute!important;
  left:8px!important;
  right:auto!important;
  top:calc(100% + 6px)!important;
  width:min(720px,calc(100% - 16px))!important;
  max-width:calc(100% - 16px)!important;
  min-width:0!important;
  max-height:60vh!important;
  overflow:auto!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:6px!important;
  padding:7px!important;
  background:#fff!important;
  border:1px solid #dbe4ef!important;
  border-radius:12px!important;
  box-shadow:0 18px 48px rgba(15,23,42,.22)!important;
  z-index:1200!important;
}
body.route-leads .quick-filter-panel-v61 .chip-group-more{
  padding:6px!important;
  border-radius:9px!important;
  min-width:0!important;
}
body.route-leads .quick-filter-panel-v61 .chip-group-more>span{
  font-size:9.5px!important;
  line-height:1!important;
  margin:0 0 5px!important;
}
body.route-leads .quick-filter-panel-v61 .chip-group-more .chip-btn{
  min-height:20px!important;
  height:20px!important;
  padding:3px 6px!important;
  font-size:10px!important;
  line-height:1!important;
}
@media(max-width:980px){
  body.route-leads .quick-filter-panel-v61 .quick-more-panel{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}
@media(max-width:760px){
  body.route-leads .quick-filter-panel-v61 .quick-more-panel{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:520px){
  body.route-leads .quick-filter-panel-v61 .quick-more-panel{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    top:auto!important;
    bottom:10px!important;
    width:auto!important;
    max-width:none!important;
    max-height:76vh!important;
    grid-template-columns:1fr!important;
    padding:10px!important;
    border-radius:16px!important;
  }
}

/* V62: compact 220px Next Task side panel + show/hide control + single-line pager */
body.route-leads .lead-list-workdesk,
body.route-board .lead-list-workdesk{
  grid-template-columns:220px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:stretch!important;
}
body.route-leads .lead-list-workdesk>.task-rail,
body.route-board .lead-list-workdesk>.task-rail{
  width:220px!important;
  min-width:220px!important;
  max-width:220px!important;
  position:sticky!important;
  top:0!important;
  align-self:stretch!important;
  height:100%!important;
  max-height:none!important;
  padding:10px!important;
  border-radius:14px!important;
}
body.route-leads .task-rail-head,
body.route-board .task-rail-head{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) 26px!important;
  gap:8px!important;
  align-items:center!important;
  margin-bottom:8px!important;
}
body.route-leads .task-rail-head h2,
body.route-board .task-rail-head h2{
  font-size:13px!important;
  line-height:1.15!important;
  white-space:normal!important;
}
body.route-leads .task-rail-head p,
body.route-board .task-rail-head p{
  font-size:10.5px!important;
  line-height:1.1!important;
}
body.route-leads .task-rail-hide,
body.route-board .task-rail-hide{
  width:26px!important;
  height:26px!important;
  display:inline-grid!important;
  place-items:center!important;
  border:1px solid #dbe4ef!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#64748b!important;
  cursor:pointer!important;
  font-size:16px!important;
  line-height:1!important;
}
body.route-leads .task-rail-actions,
body.route-board .task-rail-actions{
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
  margin-bottom:8px!important;
}
body.route-leads .task-rail-actions .btn,
body.route-board .task-rail-actions .btn{
  min-height:28px!important;
  padding:6px 8px!important;
  font-size:11px!important;
  white-space:nowrap!important;
}
body.route-leads .task-scroll,
body.route-board .task-scroll{
  gap:7px!important;
}
body.route-leads .task-item,
body.route-board .task-item{
  padding:8px!important;
  border-radius:10px!important;
}
body.route-leads .task-item b,
body.route-board .task-item b{
  font-size:12px!important;
}
body.route-leads .task-panel-show,
body.route-board .task-panel-show{
  display:none!important;
  align-items:center!important;
  justify-content:center!important;
  width:max-content!important;
  margin:0 0 8px!important;
  min-height:30px!important;
  padding:6px 10px!important;
  border:1px solid #cbd5e1!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#0f172a!important;
  font-weight:600!important;
  box-shadow:0 6px 18px rgba(15,23,42,.08)!important;
  cursor:pointer!important;
}
body.route-leads.task-panel-hidden .lead-list-workdesk,
body.route-board.task-panel-hidden .lead-list-workdesk{
  grid-template-columns:minmax(0,1fr)!important;
}
body.route-leads.task-panel-hidden .lead-list-workdesk>.task-rail,
body.route-board.task-panel-hidden .lead-list-workdesk>.task-rail{
  display:none!important;
}
body.route-leads.task-panel-hidden .task-panel-show,
body.route-board.task-panel-hidden .task-panel-show{
  display:inline-flex!important;
}
body.route-leads .pager-bar.pager-bar-v62,
body.route-board .pager-bar.pager-bar-v62{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-height:42px!important;
  padding:8px 12px!important;
  margin:8px 0!important;
  flex-wrap:nowrap!important;
}
body.route-leads .pager-bar-v62 .pager-left,
body.route-board .pager-bar-v62 .pager-left{
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  min-width:0!important;
  white-space:nowrap!important;
}
body.route-leads .pager-bar-v62 .pager-right,
body.route-board .pager-bar-v62 .pager-right{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex-wrap:nowrap!important;
  width:auto!important;
  min-width:max-content!important;
  white-space:nowrap!important;
}
body.route-leads .pager-bar-v62 label,
body.route-board .pager-bar-v62 label{
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  margin:0!important;
  width:auto!important;
  white-space:nowrap!important;
}
body.route-leads .pager-bar-v62 label span,
body.route-board .pager-bar-v62 label span{
  font-size:11px!important;
  color:#475569!important;
  font-weight:600!important;
}
body.route-leads .pager-bar-v62 select,
body.route-board .pager-bar-v62 select{
  width:76px!important;
  min-width:76px!important;
  min-height:30px!important;
  padding:4px 8px!important;
}
body.route-leads .pager-bar-v62 b,
body.route-board .pager-bar-v62 b{
  display:inline-flex!important;
  align-items:center!important;
  font-size:12px!important;
  font-weight:600!important;
  color:#475569!important;
  white-space:nowrap!important;
}
@media(max-width:900px){
  body.route-leads .lead-list-workdesk,
  body.route-board .lead-list-workdesk{
    grid-template-columns:1fr!important;
    height:auto!important;
    overflow:visible!important;
  }
  body.route-leads .lead-list-workdesk>.task-rail,
  body.route-board .lead-list-workdesk>.task-rail{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    max-height:190px!important;
    position:relative!important;
    top:auto!important;
  }
  body.route-leads .task-scroll,
  body.route-board .task-scroll{
    display:grid!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(180px,220px)!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
}
@media(max-width:640px){
  body.route-leads .pager-bar.pager-bar-v62,
  body.route-board .pager-bar.pager-bar-v62{
    align-items:flex-start!important;
    flex-direction:column!important;
    gap:8px!important;
  }
  body.route-leads .pager-bar-v62 .pager-right,
  body.route-board .pager-bar-v62 .pager-right{
    justify-content:flex-start!important;
  }
}


/* V63: task rail/sidebar stability + pager single-row repair */
.app-shell{
  align-items:start!important;
}
.sidebar{
  position:sticky!important;
  top:0!important;
  height:100vh!important;
  max-height:100vh!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
}
.main{
  min-width:0!important;
}
body.route-dashboard .dashboard-workdesk,
body.route-lead-view .lead-workdesk,
body.route-leads .lead-list-workdesk,
body.route-board .lead-list-workdesk{
  margin-top:6px!important;
}
body.route-dashboard .dashboard-workdesk,
body.route-lead-view .lead-workdesk{
  grid-template-columns:220px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:stretch!important;
}
body.route-dashboard .dashboard-workdesk>.task-rail,
body.route-lead-view .lead-workdesk>.task-rail,
body.route-leads .lead-list-workdesk>.task-rail,
body.route-board .lead-list-workdesk>.task-rail{
  width:220px!important;
  min-width:220px!important;
  max-width:220px!important;
  align-self:stretch!important;
  height:100%!important;
  max-height:none!important;
  overflow:hidden!important;
}
body.route-dashboard .task-rail-head,
body.route-lead-view .task-rail-head{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) 26px!important;
  gap:8px!important;
  align-items:center!important;
  margin-bottom:8px!important;
}
body.route-dashboard .task-rail-head h2,
body.route-lead-view .task-rail-head h2{
  font-size:13px!important;
  line-height:1.15!important;
  white-space:normal!important;
}
body.route-dashboard .task-rail-head p,
body.route-lead-view .task-rail-head p{
  font-size:10.5px!important;
  line-height:1.1!important;
}
body.route-dashboard .task-rail-hide,
body.route-lead-view .task-rail-hide{
  width:26px!important;
  height:26px!important;
  display:inline-grid!important;
  place-items:center!important;
  border:1px solid #dbe4ef!important;
  border-radius:8px!important;
  background:#fff!important;
  color:#64748b!important;
  cursor:pointer!important;
  font-size:16px!important;
  line-height:1!important;
}
body.route-dashboard .task-rail-actions,
body.route-lead-view .task-rail-actions{
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
  margin-bottom:8px!important;
}
body.route-dashboard .task-rail-actions .btn,
body.route-lead-view .task-rail-actions .btn{
  min-height:28px!important;
  padding:6px 8px!important;
  font-size:11px!important;
  white-space:nowrap!important;
}
body.route-dashboard .task-panel-show,
body.route-lead-view .task-panel-show,
body.route-leads .task-panel-show,
body.route-board .task-panel-show{
  display:none!important;
  align-items:center!important;
  justify-content:center!important;
  width:max-content!important;
  margin:6px 0 8px!important;
  min-height:30px!important;
  padding:6px 10px!important;
  border:1px solid #cbd5e1!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#0f172a!important;
  font-weight:600!important;
  box-shadow:0 6px 18px rgba(15,23,42,.08)!important;
  cursor:pointer!important;
}
body.route-dashboard.task-panel-hidden .dashboard-workdesk,
body.route-lead-view.task-panel-hidden .lead-workdesk,
body.route-leads.task-panel-hidden .lead-list-workdesk,
body.route-board.task-panel-hidden .lead-list-workdesk{
  grid-template-columns:minmax(0,1fr)!important;
}
body.route-dashboard.task-panel-hidden .dashboard-workdesk>.task-rail,
body.route-lead-view.task-panel-hidden .lead-workdesk>.task-rail,
body.route-leads.task-panel-hidden .lead-list-workdesk>.task-rail,
body.route-board.task-panel-hidden .lead-list-workdesk>.task-rail{
  display:none!important;
}
body.route-dashboard.task-panel-hidden .task-panel-show,
body.route-lead-view.task-panel-hidden .task-panel-show,
body.route-leads.task-panel-hidden .task-panel-show,
body.route-board.task-panel-hidden .task-panel-show{
  display:inline-flex!important;
}
.pager-bar.pager-bar-v62,
.pager-bar.pager-bar-v63,
body.route-leads .pager-bar.pager-bar-v62,
body.route-board .pager-bar.pager-bar-v62{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  min-height:38px!important;
  padding:7px 12px!important;
  margin:8px 0!important;
  flex-wrap:nowrap!important;
  overflow-x:auto!important;
}
.pager-bar .pager-left,
.pager-bar .pager-right,
body.route-leads .pager-bar-v62 .pager-left,
body.route-board .pager-bar-v62 .pager-left,
body.route-leads .pager-bar-v62 .pager-right,
body.route-board .pager-bar-v62 .pager-right{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:7px!important;
  width:auto!important;
  min-width:0!important;
  white-space:nowrap!important;
  flex-wrap:nowrap!important;
}
.pager-bar .pager-left{
  flex:1 1 auto!important;
}
.pager-bar .pager-right{
  flex:0 0 auto!important;
  justify-content:flex-end!important;
  min-width:max-content!important;
}
.pager-bar label,
body.route-leads .pager-bar-v62 label,
body.route-board .pager-bar-v62 label{
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:6px!important;
  margin:0!important;
  width:auto!important;
  min-width:0!important;
  white-space:nowrap!important;
}
.pager-bar label span{
  display:inline!important;
  margin:0!important;
  white-space:nowrap!important;
}
.pager-bar select,
body.route-leads .pager-bar-v62 select,
body.route-board .pager-bar-v62 select{
  width:72px!important;
  min-width:72px!important;
  min-height:30px!important;
  margin:0!important;
  padding:4px 8px!important;
}
.pager-bar b{
  display:inline-flex!important;
  align-items:center!important;
  white-space:nowrap!important;
}
@media(max-width:900px){
  body.route-dashboard .dashboard-workdesk,
  body.route-lead-view .lead-workdesk,
  body.route-leads .lead-list-workdesk,
  body.route-board .lead-list-workdesk{
    grid-template-columns:1fr!important;
    height:auto!important;
    overflow:visible!important;
  }
  body.route-dashboard .dashboard-workdesk>.task-rail,
  body.route-lead-view .lead-workdesk>.task-rail,
  body.route-leads .lead-list-workdesk>.task-rail,
  body.route-board .lead-list-workdesk>.task-rail{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    max-height:190px!important;
    position:relative!important;
    top:auto!important;
  }
}
@media(max-width:640px){
  .pager-bar.pager-bar-v62,
  .pager-bar.pager-bar-v63,
  body.route-leads .pager-bar.pager-bar-v62,
  body.route-board .pager-bar.pager-bar-v62{
    flex-direction:row!important;
    align-items:center!important;
    justify-content:space-between!important;
  }
}


/* V64: global page spacing, fixed sidebar, reliable task-panel toggle, compact pager row */
:root{--crm-sidebar-width:220px;}
html[data-ui-scale]{--crm-sidebar-width:var(--ui-sidebar,220px);}
@media (min-width:901px){
  .app-shell{grid-template-columns:var(--crm-sidebar-width) minmax(0,1fr)!important;align-items:start!important;}
  .sidebar{position:fixed!important;left:0!important;top:0!important;bottom:0!important;width:var(--crm-sidebar-width)!important;height:100dvh!important;max-height:100dvh!important;z-index:210!important;overflow-y:auto!important;overflow-x:hidden!important;}
  .main{grid-column:2!important;width:100%!important;min-width:0!important;}
  .sidebar-hidden .app-shell{grid-template-columns:0 minmax(0,1fr)!important;}
  .sidebar-hidden .main{grid-column:2!important;padding-left:18px!important;}
}
.main>.topbar+*{margin-top:6px!important;}
body.route-followups .period-wrap,
body.route-demo-queue .card:first-of-type,
body.route-archive-center .card:first-of-type,
body.route-import-export .import-workdesk,
body.route-settings-wati .wati-dashboard-form,
body.route-users .card:first-of-type,
body.route-columns .card:first-of-type,
body.route-shortcut-keys .card:first-of-type,
body.route-messages .card:first-of-type,
body.route-reports .period-wrap,
body.route-audience-insights .audience-workdesk,
body.route-staff-performance .card:first-of-type{margin-top:6px!important;}
body.route-dashboard .task-rail-hide,
body.route-lead-view .task-rail-hide,
body.route-leads .task-rail-hide,
body.route-board .task-rail-hide{pointer-events:auto!important;z-index:5!important;}
.pager-bar.pager-bar-v64,
body.route-leads .pager-bar.pager-bar-v64,
body.route-board .pager-bar.pager-bar-v64{
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;min-height:38px!important;padding:7px 12px!important;margin:8px 0!important;flex-wrap:nowrap!important;overflow-x:auto!important;white-space:nowrap!important;
}
.pager-bar-v64 .pager-left{display:inline-flex!important;align-items:center!important;gap:7px!important;min-width:0!important;flex:1 1 auto!important;white-space:nowrap!important;}
.pager-bar-v64 .pager-right{display:inline-flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;flex:0 0 auto!important;min-width:max-content!important;white-space:nowrap!important;}
.pager-bar-v64 .pager-rows-label{display:inline-flex!important;align-items:center!important;margin:0!important;font-size:11px!important;font-weight:600!important;color:#475569!important;line-height:1!important;}
.pager-bar-v64 select{display:inline-block!important;width:72px!important;min-width:72px!important;max-width:72px!important;min-height:30px!important;margin:0!important;padding:4px 8px!important;line-height:1.2!important;}
.pager-bar-v64 b{display:inline-flex!important;align-items:center!important;margin:0!important;font-size:12px!important;font-weight:600!important;color:#475569!important;white-space:nowrap!important;}
.wati-compact-card{max-height:800px!important;}
@media(max-width:900px){
  .sidebar{position:sticky!important;width:auto!important;}
  .pager-bar.pager-bar-v64{flex-wrap:nowrap!important;}
}
@media(max-width:560px){
  .pager-bar.pager-bar-v64{gap:8px!important;padding:7px 9px!important;}
  .pager-bar-v64 .pager-left{font-size:11px!important;}
  .pager-bar-v64 .pager-right{gap:6px!important;}
  .pager-bar-v64 select{width:64px!important;min-width:64px!important;max-width:64px!important;}
}

/* V66: Import/Export equal cards + Board compact non-scroll columns */
body.route-import-export .import-workdesk{
  align-items:stretch!important;
  grid-auto-rows:auto!important;
}
body.route-import-export .import-workdesk>.card{
  height:100%!important;
  display:flex!important;
  flex-direction:column!important;
  margin-bottom:0!important;
}
body.route-import-export .import-tile{
  min-height:420px!important;
}
body.route-import-export .csv-code{
  max-height:400px!important;
  overflow:auto!important;
}
body.route-import-export .export-option-grid.compact,
body.route-import-export .txt-export-grid{
  flex:1 1 auto!important;
}

body.route-board .lead-list-workdesk,
body.route-board .lead-list-scroll{
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
}
body.route-board .board{
  align-items:start!important;
  grid-auto-rows:auto!important;
}
body.route-board .board-col{
  min-height:74px!important;
  max-height:none!important;
  height:auto!important;
  overflow:visible!important;
  padding:12px!important;
}
body.route-board .board-col:has(.lead-card){
  min-height:120px!important;
}
body.route-board .board-col h3{
  margin-bottom:0!important;
}
body.route-board .board-col .lead-card:first-of-type{
  margin-top:10px!important;
}
@media (max-width:900px){
  body.route-board .board-col{
    min-height:64px!important;
    max-height:none!important;
    overflow:visible!important;
  }
}

/* V68: compact shortcut help modal - removes stretched empty card space */
.shortcut-modal .shortcut-box{
  width:min(980px,calc(100vw - 32px))!important;
  max-width:980px!important;
  max-height:calc(100vh - 40px)!important;
  overflow:auto!important;
  padding:18px!important;
}
.shortcut-modal .shortcut-box h2{
  margin:0 0 8px!important;
  font-size:20px!important;
  line-height:1.2!important;
}
.shortcut-modal .shortcut-box>.muted.small{
  margin:0 0 10px!important;
}
.shortcut-modal .shortcut-grouped-list{
  display:block!important;
  column-count:2!important;
  column-gap:12px!important;
  margin:10px 0!important;
}
.shortcut-modal .shortcut-help-group{
  display:inline-block!important;
  width:100%!important;
  margin:0 0 10px!important;
  padding:9px!important;
  vertical-align:top!important;
  break-inside:avoid!important;
  -webkit-column-break-inside:avoid!important;
  page-break-inside:avoid!important;
}
.shortcut-modal .shortcut-help-group h3{
  margin:0 0 6px!important;
  font-size:12px!important;
  line-height:1.2!important;
}
.shortcut-modal .shortcut-help-group>div{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;
  gap:5px!important;
}
.shortcut-modal .shortcut-help-group p{
  min-height:30px!important;
  margin:0!important;
  padding:5px 7px!important;
  gap:6px!important;
  border-radius:8px!important;
  font-size:12px!important;
  line-height:1.25!important;
}
.shortcut-modal .shortcut-help-group kbd,
.shortcut-modal .shortcut-box kbd{
  min-width:36px!important;
  padding:2px 6px!important;
  border-radius:6px!important;
  font-size:11px!important;
  line-height:1.25!important;
}
.shortcut-modal .shortcut-help-group span{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.shortcut-modal .shortcut-box>p.muted.small:last-child{
  margin:8px 0 0!important;
}
@media(max-width:780px){
  .shortcut-modal .shortcut-box{
    width:calc(100vw - 18px)!important;
    max-height:calc(100vh - 18px)!important;
    padding:14px!important;
  }
  .shortcut-modal .shortcut-grouped-list{
    column-count:1!important;
  }
  .shortcut-modal .shortcut-help-group>div{
    grid-template-columns:1fr!important;
  }
}

/* V69: shortcut help true masonry columns - no stretched empty boxes */
.shortcut-modal .shortcut-box{
  width:min(900px,calc(100vw - 32px))!important;
  max-width:900px!important;
}
.shortcut-modal .shortcut-grouped-list.shortcut-help-columns{
  display:grid!important;
  grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)!important;
  gap:12px!important;
  column-count:auto!important;
  columns:auto!important;
  align-items:start!important;
}
.shortcut-modal .shortcut-help-column{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:10px!important;
  align-content:start!important;
  align-items:start!important;
  min-width:0!important;
}
.shortcut-modal .shortcut-help-group{
  display:block!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  align-self:start!important;
  break-inside:auto!important;
  -webkit-column-break-inside:auto!important;
  page-break-inside:auto!important;
}
.shortcut-modal .shortcut-help-group>div{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:6px!important;
}
.shortcut-modal .shortcut-help-group p{
  width:100%!important;
}
.shortcut-modal .shortcut-help-group[data-shortcut-group="Workflow"]{
  min-height:0!important;
}
@media(max-width:780px){
  .shortcut-modal .shortcut-grouped-list.shortcut-help-columns{
    grid-template-columns:1fr!important;
  }
}

/* V70: shortcut help modal width trim - compact without losing 2-column stack */
.shortcut-modal .shortcut-box{
  width:min(780px,calc(100vw - 32px))!important;
  max-width:780px!important;
}
.shortcut-modal .shortcut-grouped-list.shortcut-help-columns{
  grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)!important;
  gap:10px!important;
}
@media(max-width:780px){
  .shortcut-modal .shortcut-box{
    width:calc(100vw - 18px)!important;
    max-width:none!important;
  }
}

/* V72: Incoming Leads + multi-website connector module */
.incoming-tabs{margin-top:-4px}.incoming-metrics.metric-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.incoming-hero .card-head,.connected-hero .card-head{align-items:flex-start}.incoming-head-actions{display:flex;gap:8px;flex-wrap:wrap}.incoming-site-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.incoming-site-card{border:1px solid var(--line);background:#f8fafc;border-radius:14px;padding:12px;display:grid;gap:9px;min-width:0}.incoming-site-card>div:first-child{display:grid;gap:2px;min-width:0}.incoming-site-card strong{font-size:13px;color:#0f172a}.incoming-site-card small{font-size:11.5px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.incoming-site-stats{display:grid!important;grid-template-columns:1fr 1fr;gap:8px}.incoming-site-stats p{margin:0;border:1px solid var(--line);background:#fff;border-radius:10px;padding:8px;display:grid;gap:2px}.incoming-site-stats b{font-size:18px;color:#0f172a}.incoming-site-stats span{font-size:11px;color:#64748b}.conn-status{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:3px 8px;font-size:11px;line-height:1.2;border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;width:max-content}.conn-active,.conn-accepted{border-color:#bbf7d0;background:#f0fdf4;color:#15803d}.conn-paused,.conn-spam{border-color:#fed7aa;background:#fff7ed;color:#c2410c}.conn-disabled,.conn-rejected{border-color:#fecaca;background:#fef2f2;color:#b91c1c}.incoming-toolbar{margin:0 0 12px}.incoming-table td small,.webhook-table td small{display:block;color:#64748b;max-width:340px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.incoming-table td b{display:block;font-size:12px}.dup-chip{display:inline-flex;margin-left:6px;border:1px solid #fed7aa;background:#fff7ed;color:#c2410c;border-radius:999px;padding:2px 6px;font-size:10px;font-style:normal}.endpoint-box{border:1px solid var(--line);background:#f8fafc;border-radius:14px;padding:12px;display:grid;gap:7px}.endpoint-box span{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.endpoint-box code{margin:0;background:#fff}.connected-form{display:grid;gap:0}.connected-settings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}.connected-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.connected-card{border:1px solid var(--line);background:#fff;border-radius:16px;padding:12px;display:grid;gap:10px}.connected-card.is-new{border-style:dashed;background:#fbfdff}.connected-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.connected-card-head strong{font-size:14px}.connected-card-head select{max-width:120px}.connected-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.connected-fields label,.connected-settings label{display:grid;gap:5px;font-size:12px;color:#334155}.connected-fields input,.connected-fields select,.connected-fields textarea,.connected-settings input{border:1px solid var(--line);border-radius:10px;padding:7px 9px;min-height:34px;background:#fff}.connected-fields textarea{resize:vertical}.connected-fields .full-row{grid-column:1/-1}.wp-connector-card .code-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.wp-connector-card code{font-size:12px;margin:0;min-height:120px}.route-webhook-logs .lead-table,.route-incoming-leads .lead-table{min-width:1040px}@media(max-width:1400px){.incoming-metrics.metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.incoming-site-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:980px){.incoming-metrics.metric-grid,.incoming-site-grid,.connected-grid,.connected-settings,.wp-connector-card .code-grid{grid-template-columns:1fr}.connected-fields{grid-template-columns:1fr}.incoming-hero .card-head,.connected-hero .card-head{flex-direction:column}}

/* V76: count logic + compact lead preview card before full details */
.row-actions-v76{display:flex;gap:6px;align-items:center;justify-content:flex-start;flex-wrap:nowrap}.row-actions-v76 .btn{white-space:nowrap}.lead-preview-modal .lead-preview-box{width:min(620px,calc(100vw - 28px));max-height:calc(100vh - 34px);overflow:auto}.lead-preview-box .modal-head{align-items:flex-start}.lead-preview-box .eyebrow{display:block;font-size:11px;line-height:1.2;text-transform:uppercase;letter-spacing:.04em;color:#2563eb;font-weight:700;margin-bottom:4px}.lead-preview-box h2{font-size:18px;margin:0;color:#0f172a}.lead-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.lead-preview-grid p,.lead-preview-source p{border:1px solid var(--line);background:#f8fafc;border-radius:12px;padding:9px;margin:0;display:grid;gap:4px;min-width:0}.lead-preview-grid span,.lead-preview-source span,.lead-preview-message span{font-size:11px;color:#64748b}.lead-preview-grid b,.lead-preview-source b{font-size:13px;color:#0f172a;overflow-wrap:anywhere}.lead-preview-message{margin-top:8px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:13px;padding:10px;display:grid;gap:5px}.lead-preview-message p{margin:0;color:#0f172a;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.lead-preview-source{display:grid;grid-template-columns:1.25fr .75fr;gap:8px;margin-top:8px}.lead-preview-source a{font-size:12px;color:#2563eb;overflow-wrap:anywhere}.lead-preview-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.lead-preview-actions .btn{min-height:34px}.incoming-scope-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 10px}@media(max-width:720px){.lead-preview-grid,.lead-preview-source{grid-template-columns:1fr}.lead-preview-actions .btn{flex:1 1 42%}.row-actions-v76{flex-wrap:wrap}}

/* V78 compact lead card table layout */
.lead-preview-modal .lead-preview-box{width:min(680px,calc(100vw - 28px));max-height:calc(100vh - 34px);overflow:auto;padding:18px!important;border-radius:18px!important;background:#fff!important}.lead-preview-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:start!important}.lead-preview-head .modal-close{position:static!important;inline-size:38px;block-size:38px;border-radius:12px}.lead-preview-box .eyebrow{display:block;font-size:11px;line-height:1.2;text-transform:uppercase;letter-spacing:.05em;color:#2563eb;font-weight:700;margin-bottom:5px}.lead-preview-box h2{font-size:20px;line-height:1.2;margin:0;color:#0f172a}.lead-preview-head .status-chip{align-self:start;margin-top:2px;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:6px 11px;font-size:12px;font-weight:700}.lead-preview-table{margin-top:14px;border:1px solid #dbe7f5;border-radius:14px;overflow:hidden;background:#fff;display:grid;grid-template-columns:1fr 1fr}.lead-preview-row{display:grid;grid-template-columns:112px minmax(0,1fr);gap:10px;padding:10px 12px;border-right:1px solid #e6eef8;border-bottom:1px solid #e6eef8;min-width:0;align-items:center}.lead-preview-row:nth-child(2n){border-right:0}.lead-preview-row--wide{grid-column:1 / -1;border-right:0}.lead-preview-row span{font-size:12px;color:#64748b;font-weight:600}.lead-preview-row b,.lead-preview-row a{font-size:13px;color:#0f172a;font-weight:700;overflow-wrap:anywhere;min-width:0}.lead-preview-row a{color:#2563eb;text-decoration:none}.lead-preview-row a:hover{text-decoration:underline}.lead-preview-message{margin-top:10px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:14px;padding:11px 12px;display:grid;gap:6px}.lead-preview-message span{font-size:12px;color:#2563eb;font-weight:700}.lead-preview-message p{margin:0;color:#0f172a;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.lead-preview-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.lead-preview-actions .btn{min-height:34px}.lead-preview-source{display:none!important}.lead-preview-grid{display:none!important}@media(max-width:720px){.lead-preview-head{grid-template-columns:minmax(0,1fr) auto}.lead-preview-head .status-chip{grid-column:1 / 2}.lead-preview-table{grid-template-columns:1fr}.lead-preview-row{grid-template-columns:98px minmax(0,1fr);border-right:0}.lead-preview-actions .btn{flex:1 1 42%}}

/* V79: two-column quick lead preview - raw input + follow-up history */
.lead-preview-modal .lead-preview-box-v79{
  width:min(980px,calc(100vw - 28px))!important;
  max-height:calc(100vh - 34px)!important;
  overflow:auto!important;
  padding:18px!important;
  border-radius:18px!important;
  background:#fff!important;
}
.lead-preview-box-v79 .lead-preview-columns{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,.95fr);
  gap:12px;
  margin-top:14px;
  align-items:start;
}
.lead-preview-box-v79 .lead-preview-panel{
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  min-width:0;
}
.lead-preview-box-v79 .lead-preview-panel h3{
  margin:0;
  padding:10px 12px;
  font-size:13px;
  line-height:1.25;
  color:#0f172a;
  background:#f8fafc;
  border-bottom:1px solid #e6eef8;
}
.lead-preview-box-v79 .lead-preview-kv,
.lead-preview-box-v79 .lead-history-kv{
  display:grid;
  grid-template-columns:1fr 1fr;
  background:#fff;
}
.lead-preview-box-v79 .lead-preview-kv>div,
.lead-preview-box-v79 .lead-history-kv>div{
  display:grid;
  grid-template-columns:90px minmax(0,1fr);
  gap:8px;
  padding:9px 11px;
  border-right:1px solid #e6eef8;
  border-bottom:1px solid #e6eef8;
  min-width:0;
  align-items:center;
}
.lead-preview-box-v79 .lead-preview-kv>div:nth-child(2n),
.lead-preview-box-v79 .lead-history-kv>div:nth-child(2n){
  border-right:0;
}
.lead-preview-box-v79 .lead-preview-kv>div.wide,
.lead-preview-box-v79 .lead-history-kv>div.wide{
  grid-column:1 / -1;
  border-right:0;
  grid-template-columns:90px minmax(0,1fr);
}
.lead-preview-box-v79 .lead-preview-kv span,
.lead-preview-box-v79 .lead-history-kv span{
  color:#64748b;
  font-size:12px;
  font-weight:600;
}
.lead-preview-box-v79 .lead-preview-kv b,
.lead-preview-box-v79 .lead-preview-kv a,
.lead-preview-box-v79 .lead-history-kv b{
  color:#0f172a;
  font-size:13px;
  font-weight:700;
  overflow-wrap:anywhere;
  min-width:0;
}
.lead-preview-box-v79 .lead-preview-kv a{
  color:#2563eb;
  text-decoration:none;
}
.lead-preview-box-v79 .lead-preview-kv a:hover{text-decoration:underline}
.lead-preview-box-v79 .lead-preview-message{
  margin:10px 11px 11px!important;
}
.lead-preview-box-v79 .lead-history-empty{
  margin:10px 11px 11px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  border-radius:10px;
  color:#64748b;
  padding:9px 10px;
  font-size:12px;
}
.lead-preview-box-v79 .lead-preview-actions{
  border-top:1px solid #e6eef8;
  padding-top:12px;
  margin-top:12px;
}
@media(max-width:900px){
  .lead-preview-box-v79 .lead-preview-columns{grid-template-columns:1fr}
}
@media(max-width:640px){
  .lead-preview-box-v79 .lead-preview-kv,
  .lead-preview-box-v79 .lead-history-kv{grid-template-columns:1fr}
  .lead-preview-box-v79 .lead-preview-kv>div,
  .lead-preview-box-v79 .lead-history-kv>div,
  .lead-preview-box-v79 .lead-preview-kv>div.wide,
  .lead-preview-box-v79 .lead-history-kv>div.wide{
    grid-template-columns:92px minmax(0,1fr);
    border-right:0;
  }
}

/* V80 quick lead card: aligned text preview, no inner grids */
.lead-preview-modal .lead-preview-box-v80{
  width:min(980px,calc(100vw - 28px));
  max-height:calc(100vh - 34px);
  overflow:auto;
  padding:18px!important;
  border-radius:18px!important;
  background:#fff!important;
}
.lead-preview-box-v80 .lead-preview-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:10px;
  align-items:start!important;
}
.lead-preview-box-v80 .modal-close{
  position:static!important;
  inline-size:38px;
  block-size:38px;
  border-radius:12px;
}
.lead-preview-box-v80 .eyebrow{
  display:block;
  font-size:11px;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#2563eb;
  font-weight:700;
  margin-bottom:5px;
}
.lead-preview-box-v80 h2{
  font-size:20px;
  line-height:1.2;
  margin:0;
  color:#0f172a;
}
.lead-preview-box-v80 .status-chip{
  align-self:start;
  margin-top:2px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  border-radius:999px;
  padding:6px 11px;
  font-size:12px;
  font-weight:700;
}
.lead-preview-box-v80 .lead-preview-columns-v80{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:14px;
  margin-top:14px;
}
.lead-preview-box-v80 .lead-preview-panel{
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
}
.lead-preview-box-v80 .lead-preview-panel h3{
  margin:0;
  padding:10px 12px;
  font-size:13px;
  font-weight:700;
  color:#0f172a;
  background:#f8fafc;
  border-bottom:1px solid #e6eef8;
}
.lead-preview-box-v80 .lead-preview-lines{
  padding:10px 12px;
  display:grid;
  gap:7px;
}
.lead-preview-box-v80 .lead-preview-lines p{
  margin:0;
  display:grid;
  grid-template-columns:92px minmax(0,1fr);
  gap:8px;
  align-items:start;
  min-width:0;
  line-height:1.35;
}
.lead-preview-box-v80 .lead-preview-history .lead-preview-lines p{
  grid-template-columns:112px minmax(0,1fr);
}
.lead-preview-box-v80 .lead-preview-lines b{
  font-size:12.5px;
  font-weight:700;
  color:#64748b;
  white-space:nowrap;
}
.lead-preview-box-v80 .lead-preview-lines span,
.lead-preview-box-v80 .lead-preview-lines a{
  font-size:13px;
  font-weight:600;
  color:#0f172a;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
}
.lead-preview-box-v80 .lead-preview-lines a{
  color:#2563eb;
  text-decoration:none;
}
.lead-preview-box-v80 .lead-preview-lines a:hover{text-decoration:underline;}
.lead-preview-box-v80 .lead-preview-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #e6eef8;
}
.lead-preview-box-v80 .lead-preview-actions .btn{min-height:34px;}
@media(max-width:820px){
  .lead-preview-box-v80 .lead-preview-head{grid-template-columns:minmax(0,1fr) auto;}
  .lead-preview-box-v80 .status-chip{grid-column:1 / 2;}
  .lead-preview-box-v80 .lead-preview-columns-v80{grid-template-columns:1fr;}
  .lead-preview-box-v80 .lead-preview-lines p,
  .lead-preview-box-v80 .lead-preview-history .lead-preview-lines p{grid-template-columns:94px minmax(0,1fr);}
  .lead-preview-box-v80 .lead-preview-actions .btn{flex:1 1 42%;}
}


/* V81 quick lead card: no title repeat, no clickable page URL, manual follow-up only */
.lead-preview-box-v81 .lead-preview-head{
  grid-template-columns:minmax(0,1fr) auto auto!important;
  margin-bottom:2px;
}
.lead-preview-box-v81 .lead-preview-head h2{display:none!important;}
.lead-preview-box-v81 .lead-preview-lines p.lead-history-empty-line{
  display:block;
  padding:2px 0;
}
.lead-preview-box-v81 .lead-preview-lines p.lead-history-empty-line span{
  color:#64748b;
  font-weight:600;
  font-size:13px;
}
.lead-preview-box-v81 .lead-preview-lines a{color:#0f172a!important;text-decoration:none!important;pointer-events:none;}

/* V83: Quick Lead Card raw-only, no follow-up/history panel */
.lead-preview-modal .lead-preview-box-v83{
  width:min(760px,calc(100vw - 28px));
}
.lead-preview-box-v83 .lead-preview-single-v83{
  grid-template-columns:1fr!important;
}
.lead-preview-box-v83 .lead-preview-raw{
  max-width:none;
}
.lead-preview-box-v83 .lead-preview-lines p{
  grid-template-columns:92px minmax(0,1fr);
}
.lead-preview-box-v83 .lead-preview-actions{
  justify-content:flex-start;
}


/* V84 lead list order and page chip refinement */
.lead-page-chip{display:inline-block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;color:#334155}
body.route-leads .lead-table,body.route-followups .lead-table,body.route-demo-queue .lead-table{min-width:1320px}
.row-actions-v76{gap:5px}
.row-actions-v76 .btn.tiny{padding-left:7px;padding-right:7px}

/* V85 lead trash / soft delete */
.trash-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.trash-row-actions{align-items:center}.trash-row-actions form{margin:0}.lead-trash-box input[readonly]{background:#f8fafc;color:#475569}.route-trash .trash-hero{border-left:4px solid #ef4444}.row-actions-v85 .btn.danger{white-space:nowrap}

/* V87: Board page independent column scrolling repair */
body.route-board .lead-list-workdesk.board-workdesk{
  display:grid!important;
  grid-template-columns:220px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:stretch!important;
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
}
body.route-board .lead-list-scroll{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  height:100%!important;
  overflow:hidden!important;
  padding-right:2px!important;
}
body.route-board .quick-filter-panel,
body.route-board .board-limit-bar{
  flex:0 0 auto!important;
}
body.route-board .board{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body.route-board .board-col{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
}
body.route-board .board-col::-webkit-scrollbar{width:5px!important;height:5px!important;}
body.route-board .board-col::-webkit-scrollbar-thumb{background:#94a3b8;border-radius:999px;}
body.route-board .board-col::-webkit-scrollbar-track{background:transparent;}
body.fullscreen-preview.route-board .lead-list-workdesk.board-workdesk{
  grid-template-columns:minmax(0,1fr)!important;
  height:calc(100vh - 54px)!important;
}
body.fullscreen-preview.route-board .lead-list-workdesk.board-workdesk>.task-rail{
  display:none!important;
}
@media(max-width:900px){
  body.route-board .lead-list-workdesk.board-workdesk{display:block!important;height:auto!important;overflow:visible!important;}
  body.route-board .lead-list-scroll{display:block!important;height:auto!important;overflow:visible!important;}
  body.route-board .board{display:grid!important;overflow:visible!important;}
  body.route-board .board-col{height:auto!important;max-height:none!important;overflow:visible!important;}
}


/* V90: compact Next Task Timeline cards - remove tall blank task boxes */
body.route-dashboard .task-rail,
body.route-lead-view .task-rail,
body.route-leads .task-rail,
body.route-board .task-rail{
  background:#fff!important;
}
body.route-dashboard .task-rail-head,
body.route-lead-view .task-rail-head,
body.route-leads .task-rail-head,
body.route-board .task-rail-head{
  grid-template-columns:30px minmax(0,1fr) 24px!important;
  gap:7px!important;
  margin-bottom:7px!important;
}
body.route-dashboard .task-rail-head>span,
body.route-lead-view .task-rail-head>span,
body.route-leads .task-rail-head>span,
body.route-board .task-rail-head>span{
  width:30px!important;
  height:30px!important;
  border-radius:10px!important;
  font-size:12px!important;
}
body.route-dashboard .task-rail-head h2,
body.route-lead-view .task-rail-head h2,
body.route-leads .task-rail-head h2,
body.route-board .task-rail-head h2{
  font-size:12.5px!important;
  line-height:1.1!important;
  margin:0!important;
}
body.route-dashboard .task-rail-head p,
body.route-lead-view .task-rail-head p,
body.route-leads .task-rail-head p,
body.route-board .task-rail-head p{
  font-size:10px!important;
  line-height:1.1!important;
  margin:1px 0 0!important;
}
body.route-dashboard .task-rail-actions,
body.route-lead-view .task-rail-actions,
body.route-leads .task-rail-actions,
body.route-board .task-rail-actions{
  gap:5px!important;
  margin-bottom:7px!important;
}
body.route-dashboard .task-scroll,
body.route-lead-view .task-scroll,
body.route-leads .task-scroll,
body.route-board .task-scroll{
  gap:6px!important;
  padding-right:2px!important;
}
body.route-dashboard .task-item,
body.route-lead-view .task-item,
body.route-leads .task-item,
body.route-board .task-item{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:auto!important;
  gap:2px 6px!important;
  align-items:start!important;
  min-height:0!important;
  padding:7px 8px!important;
  padding-bottom:7px!important;
  border-radius:10px!important;
  border:1px solid #e2e8f0!important;
  border-left:3px solid #3b82f6!important;
  background:#fff!important;
  box-shadow:0 2px 8px rgba(15,23,42,.035)!important;
}
body.route-dashboard .task-item.active,
body.route-lead-view .task-item.active,
body.route-leads .task-item.active,
body.route-board .task-item.active{
  background:#eff6ff!important;
  border-color:#bfdbfe!important;
  border-left-color:var(--primary)!important;
  box-shadow:0 4px 12px rgba(37,99,235,.10)!important;
}
body.route-dashboard .task-link,
body.route-lead-view .task-link,
body.route-leads .task-link,
body.route-board .task-link{
  grid-column:1!important;
  grid-row:1!important;
  display:grid!important;
  gap:2px!important;
  min-width:0!important;
}
body.route-dashboard .task-item b,
body.route-lead-view .task-item b,
body.route-leads .task-item b,
body.route-board .task-item b{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11.5px!important;
  line-height:1.2!important;
}
body.route-dashboard .task-item span,
body.route-lead-view .task-item span,
body.route-leads .task-item span,
body.route-board .task-item span{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:10.5px!important;
  line-height:1.2!important;
  color:#334155!important;
}
body.route-dashboard .task-item small,
body.route-lead-view .task-item small,
body.route-leads .task-item small,
body.route-board .task-item small{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:10px!important;
  line-height:1.2!important;
  color:#64748b!important;
}
body.route-dashboard .task-item em,
body.route-lead-view .task-item em,
body.route-leads .task-item em,
body.route-board .task-item em{
  width:max-content!important;
  max-width:100%!important;
  margin:2px 0 0!important;
  padding:1px 6px!important;
  border-radius:999px!important;
  font-size:9.5px!important;
  line-height:1.15!important;
  background:#eef2ff!important;
  color:#1d4ed8!important;
}
body.route-dashboard .task-done-form,
body.route-lead-view .task-done-form,
body.route-leads .task-done-form,
body.route-board .task-done-form{
  position:static!important;
  grid-column:2!important;
  grid-row:1!important;
  align-self:start!important;
  justify-self:end!important;
  margin:0!important;
}
body.route-dashboard .task-done-btn,
body.route-lead-view .task-done-btn,
body.route-leads .task-done-btn,
body.route-board .task-done-btn{
  min-height:22px!important;
  padding:2px 7px!important;
  font-size:10px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
}
@media(max-width:900px){
  body.route-dashboard .task-scroll,
  body.route-lead-view .task-scroll,
  body.route-leads .task-scroll,
  body.route-board .task-scroll{
    display:grid!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(190px,230px)!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  body.route-dashboard .task-item,
  body.route-lead-view .task-item,
  body.route-leads .task-item,
  body.route-board .task-item{
    min-height:0!important;
  }
}

/* V91: true compact Next Task Timeline - stop CSS grid from stretching task rows */
body.route-dashboard .task-scroll,
body.route-lead-view .task-scroll,
body.route-leads .task-scroll,
body.route-board .task-scroll{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  align-items:start!important;
  justify-content:stretch!important;
  gap:6px!important;
}
body.route-dashboard .task-item,
body.route-lead-view .task-item,
body.route-leads .task-item,
body.route-board .task-item{
  align-self:start!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  padding:6px 8px!important;
  padding-bottom:6px!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:2px 6px!important;
}
body.route-dashboard .task-link,
body.route-lead-view .task-link,
body.route-leads .task-link,
body.route-board .task-link{
  gap:1px!important;
}
body.route-dashboard .task-item b,
body.route-lead-view .task-item b,
body.route-leads .task-item b,
body.route-board .task-item b{
  font-size:11px!important;
  line-height:1.12!important;
}
body.route-dashboard .task-item span,
body.route-lead-view .task-item span,
body.route-leads .task-item span,
body.route-board .task-item span,
body.route-dashboard .task-item small,
body.route-lead-view .task-item small,
body.route-leads .task-item small,
body.route-board .task-item small{
  font-size:9.8px!important;
  line-height:1.15!important;
}
body.route-dashboard .task-item em,
body.route-lead-view .task-item em,
body.route-leads .task-item em,
body.route-board .task-item em{
  margin-top:1px!important;
  padding:1px 6px!important;
  font-size:9px!important;
  line-height:1.1!important;
}
body.route-dashboard .task-done-btn,
body.route-lead-view .task-done-btn,
body.route-leads .task-done-btn,
body.route-board .task-done-btn{
  min-height:18px!important;
  padding:1px 6px!important;
  font-size:9.5px!important;
}
@media(max-width:900px){
  body.route-dashboard .task-scroll,
  body.route-lead-view .task-scroll,
  body.route-leads .task-scroll,
  body.route-board .task-scroll{
    display:grid!important;
    grid-auto-flow:column!important;
    grid-auto-columns:minmax(170px,210px)!important;
    grid-template-columns:none!important;
    grid-auto-rows:max-content!important;
    align-content:start!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
}

/* V92: Board columns natural height - remove inner column scrollbars */
body.route-board .board{
  align-items:start!important;
  grid-auto-rows:auto!important;
  overflow:visible!important;
}
body.route-board .board-col{
  align-self:start!important;
  height:auto!important;
  min-height:64px!important;
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
}
body.route-board .board-col .lead-card{
  break-inside:avoid!important;
}
body.route-board .lead-list-scroll{
  overflow:auto!important;
  overscroll-behavior:contain!important;
}
@media(max-width:900px){
  body.route-board .board-col{
    max-height:none!important;
    overflow:visible!important;
  }
}

/* V93: Board natural rows - no column inner scroll and no lower-row overlap */
body.route-board .lead-list-workdesk.board-workdesk{
  grid-template-columns:220px minmax(0,1fr)!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
body.route-board .lead-list-scroll{
  display:block!important;
  height:100%!important;
  min-height:0!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  padding-right:4px!important;
}
body.route-board .board{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:12px!important;
  align-items:flex-start!important;
  align-content:flex-start!important;
  justify-content:flex-start!important;
  flex:0 0 auto!important;
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
  grid-template-columns:none!important;
  grid-auto-rows:auto!important;
}
body.route-board .board-col{
  flex:0 0 calc((100% - 36px) / 4)!important;
  width:calc((100% - 36px) / 4)!important;
  max-width:calc((100% - 36px) / 4)!important;
  min-width:0!important;
  box-sizing:border-box!important;
  align-self:flex-start!important;
  display:block!important;
  height:auto!important;
  min-height:64px!important;
  max-height:none!important;
  overflow:visible!important;
  contain:none!important;
  position:relative!important;
}
body.route-board .board-col:has(.lead-card){
  min-height:120px!important;
}
body.route-board .board-col .lead-card{
  position:relative!important;
  display:block!important;
  height:auto!important;
  margin-bottom:10px!important;
  break-inside:avoid!important;
}
body.route-board .board-col .lead-card:last-child{
  margin-bottom:0!important;
}
@media(max-width:1500px){
  body.route-board .board-col{
    flex-basis:calc((100% - 24px) / 3)!important;
    width:calc((100% - 24px) / 3)!important;
    max-width:calc((100% - 24px) / 3)!important;
  }
}
@media(max-width:1180px){
  body.route-board .board-col{
    flex-basis:calc((100% - 12px) / 2)!important;
    width:calc((100% - 12px) / 2)!important;
    max-width:calc((100% - 12px) / 2)!important;
  }
}
@media(max-width:900px){
  body.route-board .lead-list-workdesk.board-workdesk,
  body.route-board .lead-list-scroll{
    display:block!important;
    height:auto!important;
    overflow:visible!important;
  }
  body.route-board .board-col{
    flex:0 0 100%!important;
    width:100%!important;
    max-width:100%!important;
  }
}

/* V94: lead detail source card readability + revised order */
.source-quality-card.source-quality-v94{
  min-height:0!important;
  border-left:5px solid #64748b;
}
.source-quality-v94 .source-quality-head{
  align-items:flex-start;
  gap:10px;
}
.source-quality-v94 .source-quality-head h2{
  margin-bottom:2px;
}
.source-quality-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:10px;
}
.source-quality-grid>div{
  border:1px solid var(--line);
  background:#f8fafc;
  border-radius:10px;
  padding:8px 9px;
  min-width:0;
}
.source-quality-grid span{
  display:block;
  font-size:10.5px;
  color:var(--muted);
  margin-bottom:3px;
  line-height:1.15;
}
.source-quality-grid b{
  display:block;
  font-size:12px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.source-quality-grid .source-quality-wide{
  grid-column:span 2;
}
.source-events-compact{
  margin-top:8px;
  border-top:1px dashed var(--line);
  padding-top:8px;
}
.source-events-compact summary{
  cursor:pointer;
  color:#475569;
  font-size:12px;
  font-weight:600;
}
.source-events-compact .source-event-list{
  margin-top:8px;
}
.source-events-compact .source-event-list p{
  margin:0 0 7px;
  padding:7px 8px;
  border-radius:9px;
  background:#fff;
  border:1px solid var(--line);
}
@media(max-width:1080px){
  .source-quality-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:640px){
  .source-quality-grid{
    grid-template-columns:1fr;
  }
  .source-quality-grid .source-quality-wide{
    grid-column:auto;
  }
}
.fullscreen-preview.route-lead-view .source-quality-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px;
}
.fullscreen-preview.route-lead-view .source-quality-grid>div{
  padding:6px 7px;
}
.fullscreen-preview.route-lead-view .source-events-compact{
  margin-top:6px;
  padding-top:6px;
}

/* V96: Lead detail top card compact table/list with source and message rows */
.lead-detail-v15-grid .lead-summary-table-card{
  margin-top:6px!important;
  border:1px solid var(--border)!important;
  border-radius:12px!important;
  overflow:hidden!important;
  background:#fff!important;
}
.lead-detail-v15-grid .lead-summary-table-card h3{
  margin:0!important;
  padding:7px 10px!important;
  font-size:12px!important;
  font-weight:600!important;
  line-height:1.2!important;
  color:#0f172a!important;
  background:#f8fafc!important;
  border-bottom:1px solid var(--border)!important;
}
.lead-detail-v15-grid .lead-summary-table{
  display:grid!important;
  gap:0!important;
}
.lead-detail-v15-grid .summary-pair-row{
  display:grid!important;
  grid-template-columns:minmax(112px,140px) minmax(0,1fr) minmax(94px,130px) minmax(0,1fr)!important;
  align-items:center!important;
  min-height:30px!important;
  border-bottom:1px solid #e5edf7!important;
}
.lead-detail-v15-grid .summary-pair-row:last-child,
.lead-detail-v15-grid .summary-full-row:last-child{border-bottom:0!important;}

.lead-detail-v15-grid .summary-full-row{
  display:grid!important;
  grid-template-columns:minmax(112px,140px) minmax(0,1fr)!important;
  align-items:start!important;
  min-height:30px!important;
  border-bottom:1px solid #e5edf7!important;
}
.lead-detail-v15-grid .summary-full-row .summary-value{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.35!important;
  max-height:54px!important;
  overflow-y:auto!important;
  border-right:0!important;
}
.lead-detail-v15-grid .summary-full-row .summary-label{
  height:100%!important;
}
.lead-detail-v15-grid .summary-label,
.lead-detail-v15-grid .summary-value{
  min-width:0!important;
  padding:6px 10px!important;
  line-height:1.25!important;
  font-size:11.5px!important;
}
.lead-detail-v15-grid .summary-label{
  color:#64748b!important;
  background:#f8fafc!important;
  font-weight:500!important;
  border-right:1px solid #e5edf7!important;
  white-space:nowrap!important;
}
.lead-detail-v15-grid .summary-value{
  color:#0f172a!important;
  font-weight:600!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  border-right:1px solid #e5edf7!important;
}
.lead-detail-v15-grid .summary-pair-row .summary-value:last-child{border-right:0!important;}
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .lead-summary-table-card{margin-top:5px!important;}
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-pair-row{min-height:28px!important;}
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-label,
body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-value{font-size:11px!important;padding:5px 8px!important;}
@media(max-width:980px){
  .lead-detail-v15-grid .summary-pair-row,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-pair-row,
  .lead-detail-v15-grid .summary-full-row,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-full-row{
    grid-template-columns:minmax(110px,135px) minmax(0,1fr)!important;
  }
  .lead-detail-v15-grid .summary-pair-row .summary-label:nth-child(3),
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-pair-row .summary-label:nth-child(3){
    border-top:1px solid #e5edf7!important;
  }
  .lead-detail-v15-grid .summary-pair-row .summary-value:nth-child(4),
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-pair-row .summary-value:nth-child(4){
    border-top:1px solid #e5edf7!important;
  }
}
@media(max-width:520px){
  .lead-detail-v15-grid .summary-pair-row,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-pair-row,
  .lead-detail-v15-grid .summary-full-row,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-full-row{
    grid-template-columns:1fr!important;
  }
  .lead-detail-v15-grid .summary-label,
  .lead-detail-v15-grid .summary-value,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-label,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-value{
    border-right:0!important;
  }
  .lead-detail-v15-grid .summary-value,
  body.fullscreen-preview.route-lead-view .lead-detail-v15-grid .summary-value{
    border-bottom:1px solid #e5edf7!important;
  }
}


/* V97: custom white box tooltip for long message previews (replaces browser title strip) */
.user-message-preview.hover-box-tip,
.hover-box-tip{
  display:inline-block!important;
  max-width:380px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  cursor:help!important;
  vertical-align:bottom!important;
}
.hover-box-tip:focus{outline:2px solid #bfdbfe!important;outline-offset:2px!important;border-radius:4px!important;}
.hover-box-tip-pop{
  position:fixed!important;
  z-index:999999!important;
  background:#fff!important;
  color:#0f172a!important;
  border:1px solid #dbe4f0!important;
  border-radius:12px!important;
  box-shadow:0 14px 34px rgba(15,23,42,.18)!important;
  padding:11px 13px!important;
  line-height:1.45!important;
  pointer-events:none!important;
  max-height:280px!important;
  overflow:auto!important;
}
.hover-box-tip-pop b{
  display:block!important;
  margin:0 0 6px!important;
  font-size:12px!important;
  color:#2563eb!important;
  font-weight:600!important;
}
.hover-box-tip-pop p{
  margin:0!important;
  font-size:12.5px!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  font-weight:400!important;
}

/* V98: Lead list single-line table rows; no broken date/action/header lines */
.lead-table-v98 th,
.lead-table-v98 td{
  white-space:nowrap!important;
  vertical-align:middle!important;
}
.lead-table-v98 th{
  line-height:1.15!important;
}
.lead-table-v98 td{
  line-height:1.2!important;
}
body.route-leads .lead-table-v98,
body.route-followups .lead-table-v98,
body.route-demo-queue .lead-table-v98,
body.route-dashboard .lead-table-v98{
  min-width:1580px!important;
}
.lead-table-v98 .col-created_at{min-width:82px!important;width:82px!important;}
.lead-table-v98 .col-name{min-width:120px!important;width:120px!important;}
.lead-table-v98 .col-student_name{min-width:118px!important;width:118px!important;}
.lead-table-v98 .col-learner_age,
.lead-table-v98 .col-class_age{min-width:56px!important;width:56px!important;text-align:left!important;}
.lead-table-v98 .col-mobile{min-width:112px!important;width:112px!important;}
.lead-table-v98 .col-place{min-width:110px!important;width:110px!important;}
.lead-table-v98 .col-original_message{min-width:300px!important;width:300px!important;max-width:300px!important;}
.lead-table-v98 .col-lead_type{min-width:115px!important;width:115px!important;}
.lead-table-v98 .col-status{min-width:78px!important;width:78px!important;}
.lead-table-v98 .col-actions{min-width:266px!important;width:266px!important;}
.lead-table-v98 .col-data_quality{min-width:94px!important;width:94px!important;}
.lead-table-v98 .col-completion_score{min-width:96px!important;width:96px!important;}
.lead-table-v98 .col-page_url{min-width:78px!important;width:78px!important;}
.lead-table-v98 .row-actions{
  flex-wrap:nowrap!important;
  gap:4px!important;
  align-items:center!important;
}
.lead-table-v98 .row-actions .btn.tiny{
  padding:4px 7px!important;
  min-height:25px!important;
  font-size:11.5px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.lead-table-v98 .user-message-preview.hover-box-tip,
.lead-table-v98 .hover-box-tip{
  max-width:292px!important;
}
.lead-table-v98 .badge,
.lead-table-v98 .type-chip,
.lead-table-v98 .score-mini,
.lead-table-v98 .lead-page-chip{
  white-space:nowrap!important;
}
@media(max-width:900px){
  .lead-table-v98 th,
  .lead-table-v98 td{white-space:normal!important;}
  .lead-table-v98 .row-actions{flex-wrap:wrap!important;}
  .lead-table-v98 .col-original_message{max-width:none!important;width:auto!important;}
}


/* V99: Compact no-horizontal-scroll lead tables */
.lead-table-card-compact-v99{
  overflow-x:hidden!important;
}
.lead-table-v99{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
.lead-table-v99 th,
.lead-table-v99 td{
  box-sizing:border-box!important;
  padding:8px 8px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.lead-table-v99 th{
  font-size:10.5px!important;
  line-height:1!important;
}
.lead-table-v99 td{
  font-size:12px!important;
  line-height:1.15!important;
}
body.route-leads .lead-table-v99,
body.route-followups .lead-table-v99,
body.route-demo-queue .lead-table-v99,
body.route-dashboard .lead-table-v99{
  min-width:0!important;
  max-width:100%!important;
}
.lead-table-v99 .col-created_at{width:60px!important;min-width:60px!important;max-width:60px!important;}
.lead-table-v99 .col-name{width:120px!important;min-width:120px!important;max-width:120px!important;}
.lead-table-v99 .col-student_name{width:92px!important;min-width:92px!important;max-width:92px!important;}
.lead-table-v99 .col-learner_age,
.lead-table-v99 .col-class_age{width:38px!important;min-width:38px!important;max-width:38px!important;text-align:left!important;}
.lead-table-v99 .col-mobile{width:96px!important;min-width:96px!important;max-width:96px!important;}
.lead-table-v99 .col-place{width:90px!important;min-width:90px!important;max-width:90px!important;}
.lead-table-v99 .col-original_message{width:265px!important;min-width:265px!important;max-width:265px!important;}
.lead-table-v99 .col-page_url{width:66px!important;min-width:66px!important;max-width:66px!important;}
.lead-table-v99 .col-lead_type{width:95px!important;min-width:95px!important;max-width:95px!important;}
.lead-table-v99 .col-status{width:65px!important;min-width:65px!important;max-width:65px!important;}
.lead-table-v99 .col-actions{width:226px!important;min-width:226px!important;max-width:226px!important;}
.lead-table-v99 .col-data_quality{width:82px!important;min-width:82px!important;max-width:82px!important;}
.lead-table-v99 .col-completion_score{width:78px!important;min-width:78px!important;max-width:78px!important;}
.lead-table-v99 .row-actions{
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:4px!important;
  align-items:center!important;
  overflow:hidden!important;
}
.lead-table-v99 .row-actions .btn.tiny{
  padding:3px 5px!important;
  min-height:23px!important;
  font-size:11px!important;
  line-height:1!important;
  border-radius:7px!important;
  white-space:nowrap!important;
}
.lead-table-v99 .user-message-preview.hover-box-tip,
.lead-table-v99 .hover-box-tip{
  display:inline-block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  vertical-align:middle!important;
}
.lead-table-v99 .badge,
.lead-table-v99 .type-chip,
.lead-table-v99 .score-mini,
.lead-table-v99 .lead-page-chip{
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  vertical-align:middle!important;
}
@media(max-width:900px){
  .lead-table-card-compact-v99{overflow-x:auto!important;}
  .lead-table-v99{min-width:920px!important;table-layout:auto!important;}
}

/* Three-site CRM compact source management */
.incoming-compact-hub{padding:12px 14px;display:grid;gap:7px}.incoming-compact-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.incoming-compact-head h2{margin:0}.incoming-compact-line{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0;font-size:12px}.incoming-compact-line .sep{color:#94a3b8}.connected-compact-head .card-head{align-items:center}.endpoint-inline{display:flex;align-items:center;gap:10px;border-top:1px solid var(--line);padding-top:10px}.endpoint-inline span{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.04em}.endpoint-inline code{margin:0;padding:7px 9px;flex:1}.connected-sites-table td small{display:block;color:#64748b;margin-top:2px}.connected-sites-table form{display:inline-flex;margin:0}.connected-editor{padding:0}.connected-editor>summary{cursor:pointer;font-weight:700;padding:13px 15px;list-style:none}.connected-editor>summary::-webkit-details-marker{display:none}.connected-editor[open]>summary{border-bottom:1px solid var(--line)}.simple-site-form{padding:14px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.simple-site-form label{display:grid;gap:5px;font-size:12px;color:#334155}.simple-site-form input,.simple-site-form select,.simple-site-form textarea{border:1px solid var(--line);border-radius:10px;padding:8px 9px;min-height:36px;background:#fff}.simple-site-form .wide,.form-actions.wide{grid-column:1/-1}.advanced-settings{grid-column:1/-1;border:1px solid var(--line);border-radius:12px;background:#f8fafc}.advanced-settings>summary{cursor:pointer;padding:10px 12px;font-weight:600}.advanced-settings .simple-site-form{padding:10px}.rotate-key-form{border-top:1px solid var(--line);padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px}.credential-once{border-color:#f59e0b;background:#fffbeb}.credential-once h3{margin:0 0 4px}.credential-grid{display:grid;grid-template-columns:100px 1fr;gap:8px;align-items:center;margin-top:10px}.credential-grid code{margin:0;word-break:break-all}@media(max-width:980px){.incoming-compact-head,.endpoint-inline,.rotate-key-form{align-items:flex-start;flex-direction:column}.simple-site-form{grid-template-columns:1fr}.credential-grid{grid-template-columns:1fr}}

/* repeat-enquiry-count-v1 */
.repeat-count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:20px;padding:0 6px;margin-left:6px;border-radius:999px;background:#e9f1ff;color:#1557d5;font-size:11px;font-weight:800;line-height:1;text-decoration:none;border:1px solid #b9d0ff;vertical-align:middle}.repeat-count-badge:hover{background:#1557d5;color:#fff}.mobile-repeat-wrap{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}.incoming-compact-line{display:flex;align-items:center;flex-wrap:wrap;gap:8px;line-height:1.45}.incoming-compact-line .sep{color:#8b97a8;font-weight:700;margin:0 2px}
