/* Sales Kanban */
.tiles{display:flex;flex-direction:column;gap:10px;margin-bottom:6px}
.tile{display:block;width:100%;text-align:left;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px 14px 12px;color:var(--text);box-shadow:0 1px 2px rgba(15,23,40,.06)}
.tile .thead{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;width:100%;background:none;text-align:left;cursor:pointer;color:inherit}
.tile .tname{font-weight:800;font-size:16px;letter-spacing:-.01em}
.tile .chev{color:var(--muted);font-size:18px}
.tile .kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.tile .kpi{display:block;text-align:left;background:none;color:inherit;cursor:pointer;border-radius:10px;padding:6px 4px;min-height:44px;transition:background .12s}
.tile .kpi:hover,.tile .kpi:active{background:var(--card2)}
.tile .kpi b{display:block;font-size:22px;font-weight:800;letter-spacing:-.02em;line-height:1.1}
.tile .kpi span{font-size:11px;color:var(--muted);display:block;margin-top:2px;line-height:1.3}
.tile .tstat{display:block;width:100%;text-align:left;margin-top:8px;font-size:12.5px;color:var(--muted);background:none;cursor:pointer;min-height:22px;border-radius:8px;padding:2px 4px}
.tile .tstat:hover,.tile .tstat:active{background:var(--card2)}
.tile .tstat.warn{color:var(--amber);font-weight:600}

.strip{display:flex;gap:6px;overflow-x:auto;padding:2px 2px 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.strip::-webkit-scrollbar{display:none}
.strip button{flex:none;font-size:11.5px;font-weight:600;padding:5px 10px;border-radius:999px;background:var(--card);border:1px solid var(--line);color:var(--muted);white-space:nowrap}
.strip button b{color:var(--text);margin-left:4px}
.strip button.has{border-color:var(--accent);color:var(--accent)}
.strip button.has b{color:var(--accent)}

.board{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 12px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;margin:0 -14px;padding-left:14px;padding-right:14px}
.col{flex:none;width:260px;scroll-snap-align:start;background:var(--card2);border:1px solid var(--line);border-radius:14px;padding:10px;min-height:140px;display:flex;flex-direction:column}
.col.empty{width:160px}
.col .chead{display:flex;align-items:flex-start;justify-content:space-between;gap:6px}
.col .cname{font-weight:700;font-size:13.5px;line-height:1.25}
.col .ccount{font-size:12px;font-weight:700;color:var(--accent);background:var(--accent-dim);border-radius:999px;padding:1px 8px;flex:none}
.col .csrc{display:flex;gap:4px;margin-top:6px;flex-wrap:wrap;align-items:center}
.col .csrc span{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);background:var(--card);border:1px solid var(--line);border-radius:5px;padding:1px 6px}
.col .bolt{margin-left:auto;font-size:13px;color:var(--muted);padding:0 4px;line-height:1}
.col .bolt.on{color:var(--amber)}
.col .autos{display:none;margin-top:8px;font-size:11.5px;color:var(--muted);line-height:1.45;border-top:1px dashed var(--line);padding-top:6px}
.col .autos.on{display:block}
.col .autos div::before{content:"\2022";margin-right:5px;color:var(--accent)}
.col .cards{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.col .cempty{color:var(--muted);font-size:12px;text-align:center;padding:18px 0}

.kcard{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px 11px;text-align:left;width:100%;color:var(--text);box-shadow:0 1px 2px rgba(15,23,40,.05);position:relative}
.kcard .kname{font-weight:700;font-size:13.5px;padding-right:14px;line-height:1.3}
.kcard .ksub{font-size:12px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kcard .kfoot{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:11.5px;color:var(--muted)}
.kcard .kval{font-weight:700;color:var(--text)}
.kcard .chips{margin:0;justify-content:flex-start;gap:3px;margin-left:auto}
.kcard .chip{display:inline-block;width:18px;height:18px;border-radius:5px;font-size:10.5px;font-weight:800;text-align:center;line-height:18px}
.chip.F{background:var(--accent-dim);color:var(--accent)}
.chip.L{background:rgba(180,83,9,.12);color:var(--amber)}
.chip.J{background:var(--green-dim);color:var(--green)}
.chip.W{background:rgba(124,58,237,.14);color:#7c3aed}

/* Board filter: All | Wonderly | FormVue */
.bfilter{display:flex;gap:6px;margin:0 2px 10px}
.bfilter button{flex:none;font-size:12px;font-weight:600;padding:5px 12px;border-radius:999px;background:var(--card);border:1px solid var(--line);color:var(--muted)}
.bfilter button.on{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}

.wonderly-alert{margin-bottom:10px;font-size:13px}
.wonderly-alert .chev{color:var(--muted);font-size:20px}
.kcard .stale{position:absolute;top:10px;right:10px;width:8px;height:8px;border-radius:99px;background:var(--red)}

.legend{display:flex;gap:12px;font-size:11.5px;color:var(--muted);margin:2px 2px 10px;flex-wrap:wrap;align-items:center}
.legend .chip{display:inline-block;width:16px;height:16px;border-radius:4px;font-size:9.5px;font-weight:800;text-align:center;line-height:16px;margin-right:3px}

.sheet .facts{font-size:13px;line-height:1.6;margin-bottom:6px}
.sheet .facts b{color:var(--muted);font-weight:600;display:inline-block;min-width:76px}

/* Ops / books stat tiles are now buttons */
button.stat{cursor:pointer;width:100%}
button.stat:hover,button.stat:active{background:var(--card2)}

/* Consult / deposit badges */
.cbadges{display:flex;gap:5px;flex-wrap:wrap;margin-top:6px}
.kcard .cbadges{margin-top:6px}
.kcard .cbadges .badge{font-size:10px;padding:1px 7px}

/* Global search */
#searchwrap{position:sticky;top:0;z-index:30;background:var(--bg);padding:8px 0;margin-bottom:4px}
#searchwrap .sinner{position:relative}
#search{width:100%;padding:11px 38px 11px 14px;border-radius:12px;border:1px solid var(--line);background:var(--card);color:var(--text);font:inherit;font-size:15px}
#searchclear{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:999px;color:var(--muted);font-size:20px;line-height:1;display:flex;align-items:center;justify-content:center}
#searchresults{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 26px rgba(15,23,40,.16);max-height:60vh;overflow:auto;z-index:35}
#searchresults[hidden]{display:none}
.sr-group{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;padding:9px 12px 3px}
.sr-row{display:block;width:100%;text-align:left;padding:9px 12px;color:var(--text);border-bottom:1px solid var(--line)}
.sr-row:last-child{border-bottom:0}
.sr-row.sel,.sr-row:hover{background:var(--card2)}
.sr-name{font-weight:600;font-size:14px}
.sr-sub{font-size:12px;color:var(--muted);margin-top:1px;display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.sr-sub .chip{display:inline-block;width:16px;height:16px;border-radius:4px;font-size:9.5px;font-weight:800;text-align:center;line-height:16px}
.sr-empty{padding:18px;text-align:center;color:var(--muted);font-size:13px}

/* Hover / long-press preview popover */
#preview{position:fixed;z-index:55;background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(15,23,40,.2);min-width:210px;max-width:290px;overflow:hidden}
#preview[hidden]{display:none}
.pv-row{display:block;width:100%;text-align:left;padding:9px 12px;color:var(--text);border-bottom:1px solid var(--line)}
.pv-row:last-child{border-bottom:0}
.pv-row:hover,.pv-row:active{background:var(--card2)}
.pv-name{font-weight:600;font-size:13.5px}
.pv-sub{font-size:12px;color:var(--muted);margin-top:1px;display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.pv-sub .chip{display:inline-block;width:15px;height:15px;border-radius:4px;font-size:9px;font-weight:800;text-align:center;line-height:15px}

@media (min-width:900px){
  body{max-width:1240px}
  .board{margin:0;padding-left:2px;padding-right:2px}
  .tiles{flex-direction:row}
  .tile{flex:1}
}
