/* ===== Tracker 2.0 (Colin, 2026-10-06) — ChatGPT's design system applied to the real tracker.
   Loaded by index.html on the tracker-2.0 branch only. Everything is scoped to html.ui2 (set by ui2.js),
   so removing the two lines that load ui2.css / ui2.js gives back the old look exactly.
   Shell: left sidebar (≥961px) / bottom bar + More sheet (≤960px), slim top bar, new Overview on the home view. */


/* ---------- shell ---------- */
html.ui2 #app.wrap{max-width:none;margin:0 0 0 var(--side-w);padding:0 0 40px}
html.ui2 header.app{position:sticky;top:0;z-index:30;height:68px;margin:0;padding:0 34px;background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:nowrap;gap:12px}
html.ui2 header.app .brand .bnb-icon,html.ui2 header.app .brand h1,html.ui2 header.app .navmore,html.ui2 header.app .toolbar>button:not(#btnBell):not(#btnBack){display:none!important}
html.ui2 header.app .brand{min-width:0}html.ui2 header.app #crumb{font-size:13px;color:var(--text-muted);font-weight:550;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.ui2 header.app .toolbar{flex-wrap:nowrap;gap:6px}
html.ui2 header.app .toolbar button{background:transparent;color:var(--text-muted);box-shadow:none;border:1px solid var(--border);border-radius:10px;font-weight:600;min-height:36px}
html.ui2 header.app .toolbar button:hover{background:var(--soft);color:var(--accent-deep);filter:none}
html.ui2 header.app #btnBell{border-color:transparent;position:relative}
html.ui2 #view{max-width:1480px;margin:0 auto;padding:30px 34px 10px}
html.ui2 #legend{max-width:1480px;margin:0 auto;padding:0 34px}


/* ---------- components ---------- */
html.ui2 .card{border-radius:16px}
html.ui2 .card:hover{transform:none;box-shadow:0 1px 2px rgba(23,21,40,.04),0 8px 24px rgba(124,58,237,.10);border-color:color-mix(in srgb,var(--accent) 35%,var(--border))}
html.ui2 .card:not(.add-card)::before{display:none}
html.ui2 .dash-head{margin:8px 0 18px}
html.ui2 .dash-head h2{font-size:18px;letter-spacing:-.45px;font-weight:700}
html.ui2 .modal{border-radius:20px}
html.ui2 button:not(.u2-item):not(.u2-icbtn):not(.u2-studio){min-height:36px}
html.ui2 button.primary{border-radius:var(--radius-sm,10px)}
html.ui2 input,html.ui2 select,html.ui2 textarea{border-radius:10px}
html.ui2 table.tasks th{font-size:10.5px;font-weight:600;color:var(--text-muted);background:var(--surface-2)}
html.ui2 .stage-group{margin-top:26px}

/* ---------- Overview (home) ---------- */
html.ui2 .u2-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:24px}
html.ui2 .u2-kicker{font-size:10px;letter-spacing:1.2px;text-transform:uppercase;font-weight:750;color:var(--text-muted)}
html.ui2 .u2-head h1{font-size:32px;letter-spacing:-1.1px;line-height:1.2;font-weight:750;margin:9px 0 0}
html.ui2 .u2-head p{color:var(--text-muted);font-size:13px;margin:7px 0 0}
html.ui2 .u2-actions{display:flex;gap:8px;flex-wrap:wrap}
html.ui2 .u2-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:21px}
html.ui2 .u2-panel{background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);min-width:0}
html.ui2 .u2-stat{padding:19px 20px;cursor:default}
html.ui2 .u2-stat[data-go]{cursor:pointer}html.ui2 .u2-stat[data-go]:hover{border-color:color-mix(in srgb,var(--accent) 35%,var(--border))}
html.ui2 .u2-stat-top{display:flex;justify-content:space-between;align-items:center;color:var(--text-muted);font-size:11.5px;font-weight:500}
html.ui2 .u2-stat-ic{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:var(--surface-2);color:var(--text-muted)}
html.ui2 .u2-stat-ic .u2-ic{width:15px;height:15px}
html.ui2 .u2-stat.hot .u2-stat-ic{background:var(--soft);color:var(--accent)}
html.ui2 .u2-stat-val{font-size:30px;font-weight:700;letter-spacing:-1.2px;margin:11px 0 6px;line-height:1}
html.ui2 .u2-stat-sub{font-size:11px;color:var(--text-muted)}
html.ui2 .u2-stat-sub b{color:var(--amber)}
html.ui2 .u2-pad{padding:21px 22px}
html.ui2 .u2-ph{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
html.ui2 .u2-ph h2{font-size:15px;margin:0;letter-spacing:-.3px}
html.ui2 .u2-ph p{font-size:11.5px;color:var(--text-muted);margin:4px 0 0}
html.ui2 .u2-link{all:unset;cursor:pointer;color:var(--accent-deep);font-size:12px;font-weight:650;white-space:nowrap}
html.ui2 .u2-link:hover{text-decoration:underline}
html.ui2 .u2-pipe{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
html.ui2 .u2-pipe button{all:unset;cursor:pointer;display:block;border-right:1px solid var(--border);padding:0 12px 0 0}
html.ui2 .u2-pipe button:last-child{border:0}
html.ui2 .u2-pipe span{font-size:10.5px;display:flex;align-items:center;gap:6px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.ui2 .u2-pipe span i{width:6px;height:6px;border-radius:50%;flex:none}
html.ui2 .u2-pipe b{font-size:26px;letter-spacing:-.8px;display:block;margin:8px 0}
html.ui2 .u2-bar{height:4px;background:var(--border);border-radius:99px;overflow:hidden}
html.ui2 .u2-bar i{display:block;height:100%;border-radius:99px}
html.ui2 .u2-split{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr);gap:21px;margin:21px 0 8px}
html.ui2 .u2-task{display:flex;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid var(--border);cursor:pointer}
html.ui2 .u2-task:last-child{border:0}
html.ui2 .u2-task:hover b{color:var(--accent-deep)}
html.ui2 .u2-task>div{flex:1;min-width:0}
html.ui2 .u2-task b{font-size:12.5px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.ui2 .u2-task p{font-size:11px;color:var(--text-muted);margin:4px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.ui2 .u2-due{font-size:11px;color:var(--text-muted);white-space:nowrap}
html.ui2 .u2-due.late{color:var(--red);font-weight:650}
html.ui2 .u2-dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--accent)}
html.ui2 .u2-empty{font-size:12px;color:var(--text-muted);padding:18px 0}
html.ui2 .u2-move{display:flex;align-items:center;gap:11px;padding:11px 0;border-bottom:1px solid var(--border);cursor:pointer}
html.ui2 .u2-move:last-child{border:0}
html.ui2 .u2-move>div{flex:1;min-width:0}
html.ui2 .u2-move b{font-size:12.5px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.ui2 .u2-move small{font-size:10.5px;color:var(--text-muted)}
html.ui2 .u2-move .u2-bar{width:70px;flex:none}
html.ui2 .u2-pct{font-size:11px;color:var(--text-muted);width:34px;text-align:right;flex:none}
html.ui2 .u2-clients-head{margin-top:26px}

/* Let card content and actions fit the available width, including beside the sidebar. */
html.ui2 :is(.u2-head,.u2-ph,.u2-stats,.u2-split)>*{min-width:0}
html.ui2 :is(.u2-head,.u2-ph) :is(h1,h2,p){overflow-wrap:anywhere}
html.ui2 .u2-stat-top{gap:8px;flex-wrap:wrap}
html.ui2 .u2-stat-ic{flex:none}
html.ui2 :is(.u2-stat-val,.u2-stat-sub){overflow-wrap:anywhere}
html.ui2 .u2-pipe span{white-space:normal;overflow:visible;line-height:1.5;overflow-wrap:anywhere}
html.ui2 .u2-actions button{max-width:100%;white-space:normal;overflow-wrap:anywhere}

/* ---------- responsive ---------- */
@media(max-width:1200px){html.ui2 header.app,html.ui2 #view{padding-left:26px;padding-right:26px}html.ui2 .u2-split{grid-template-columns:minmax(0,1.3fr) minmax(250px,1fr)}html.ui2 .u2-stat-val{font-size:27px}}
@media(max-width:960px){
  html.ui2 #app.wrap{margin-left:0;padding-bottom:96px}
  html.ui2 header.app{height:60px;padding:0 16px}
  html.ui2 .toast{bottom:92px}
  html.ui2 .u2-split{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:680px){
  html.ui2 #view{padding:22px 16px 10px}html.ui2 #legend{padding:0 16px}
  html.ui2 .u2-head{flex-direction:column;align-items:flex-start;gap:14px;margin-bottom:20px}
  html.ui2 .u2-head h1{font-size:27px;letter-spacing:-.8px}
  html.ui2 .u2-actions{width:100%}html.ui2 .u2-actions button{flex:1 1 140px;justify-content:center;min-height:44px}
  html.ui2 .u2-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-bottom:16px}
  html.ui2 .u2-stat{padding:16px}html.ui2 .u2-stat-val{font-size:26px}
  html.ui2 .u2-pipe{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 12px}
  html.ui2 .u2-pipe button:nth-child(3){border:0}
  html.ui2 .u2-pad{padding:18px}
}
@media(prefers-reduced-motion:reduce){html.ui2 *{transition:none!important;animation:none!important}}
/* the admin "View as" switcher: keep it clear of the sidebar and the phone bar */
html.ui2 #viewAsBar{left:auto!important;right:16px!important;bottom:16px!important}
@media(max-width:960px){html.ui2 #viewAsBar{bottom:84px!important;right:10px!important}}
/* pages opened inside the tracker (Operations, Prospecting, Settings, Community): kept loaded, shown under the top bar */
html.ui2 .u2-frames{position:fixed;top:68px;left:var(--side-w);right:0;bottom:0;z-index:25;display:none;background:var(--bg)}
html.ui2.u2-framed .u2-frames{display:block}
html.ui2 .u2-frames iframe{width:100%;height:100%;border:0;display:none;background:var(--bg)}
html.ui2 .u2-frames iframe.on{display:block}
html.ui2.u2-framed #view,html.ui2.u2-framed #legend,html.ui2.u2-framed header.app #btnBack{display:none!important}
@media(max-width:960px){html.ui2 .u2-frames{top:60px;left:0;bottom:calc(62px + env(safe-area-inset-bottom))}}

/* Keep the assistant and preview controls out of the last row of page actions. */
html.ui2:has(body > #jv-root) #app.wrap{padding-bottom:160px}
html.ui2 body > #jv-root{bottom:80px}
@media(max-width:960px){
  html.ui2:has(body > #jv-root) #app.wrap{padding-bottom:calc(176px + env(safe-area-inset-bottom))}
  html.ui2 body > #jv-root{left:14px;right:auto;bottom:calc(84px + env(safe-area-inset-bottom))}
  html.ui2 body > #jv-root #jv-orb{width:44px;height:44px}
  html.ui2 body > #jv-root #jv-panel{left:0;right:auto;bottom:58px;max-height:calc(100dvh - 224px)}
  html.ui2 body > #jv-root .jv-log{min-height:0}
  html.ui2:has(body > #jv-root) #viewAsBar{left:72px!important;right:10px!important;bottom:calc(84px + env(safe-area-inset-bottom))!important;width:auto;max-width:320px;gap:6px!important;padding:6px!important;flex-wrap:wrap}
  html.ui2:has(body > #jv-root) #viewAsBar >span{font-size:10px;white-space:nowrap}
  html.ui2:has(body > #jv-root) #viewAs{min-width:0;flex:1;min-height:44px}
  html.ui2:has(body > #jv-root) #viewAsSize{min-height:44px}
  html.ui2:has(body > #jv-root) .u2-frames{bottom:calc(152px + env(safe-area-inset-bottom))}
}

/* A page shown inside the tracker (Operations, Prospecting) puts its back button in the top bar, like "← Clients" (Colin, 2026-10-18). Phones use the bottom bar instead. */
html.ui2.u2-framed.u2-frame-back-on header.app #btnBack{display:inline-flex!important}
@media (max-width:960px){html.ui2.u2-framed.u2-frame-back-on header.app #btnBack{display:none!important}}

/* Medium phone/tablet content: keep the shared 960px navigation boundary. */
@media(min-width:600px) and (max-width:960px){
 html.ui2 .u2-head{flex-direction:row;align-items:center;gap:18px}
 html.ui2 .u2-head>div:first-child{min-width:0;flex:1}
 html.ui2 .u2-actions{width:auto;flex:none}
 html.ui2 .u2-actions button{flex:none}
}
@media(min-width:800px) and (max-width:960px){
 html.ui2 .u2-split{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:16px}
}
@media(max-width:960px) and (max-height:700px){
 html.ui2 #view{padding-top:16px}
 html.ui2 .u2-head{margin-bottom:16px}
}
