/* Workspace redesign, stage 3 (founder approved the previews, 10 Nov 2026): page header, tabs, one action per row with a
   More menu, empty states, Needs you today, the Team edit panel and the phone's top and bottom bars. Company and agency
   workspaces share it. Colours and sizes come from ui/tokens.css only, so light and dark both follow the tokens.
   Loaded after workspace-v2.css. Behaviour: web/workspace-v3.js. */

/* ---------- Page width: the new blocks line up with the cards ---------- */
body.cfb-app .acct-team:has(>.ws-rail)>:is(.ws3-head,.ws3-back,.ws3-tabs,.ws3-needs,.ws3-tiles,.ws3-pair,.ws3-split,.ws3-plan-line){max-width:var(--content-max);width:calc(100% - 64px);margin:0 auto 24px;box-sizing:border-box}

/* The rail on the sidebar tone, as in the approved preview. */
body.cfb-app .ws-rail{background:var(--sidebar)!important}

/* ---------- Page header: company line, serif title, one sentence, the main action on the right ---------- */
body.cfb-app .ws3-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px;background:none;border:0;padding:0}
body.cfb-app .ws3-head-text{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1 1 320px}
body.cfb-app .ws3-head-text>*{margin:0}
body.cfb-app .ws3-company{font-size:var(--text-sm);color:var(--text-muted)}
body.cfb-app .ws3-head h1{margin:0!important;color:var(--text)}
body.cfb-app .ws3-head .ws3-lede,body.cfb-app .ws3-head .sub{font-size:15px;color:var(--text-secondary);margin:0;max-width:72ch}
body.cfb-app .ws3-head .trav-note{margin:4px 0 0}
body.cfb-app .ws3-head-action{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
body.cfb-app .acct-team:has(>.ws-rail)>.ws3-back{margin-bottom:8px;font-size:var(--text-sm)}
body.cfb-app .acct-team:has(>.ws-rail)>.ws3-head+.ws3-tabs{margin-top:-4px}

/* ---------- Tabs: never cut a word; scroll on a phone, More on a wide screen ---------- */
body.cfb-app .ws3-tabs{display:flex;align-items:flex-end;gap:8px;border-bottom:1px solid var(--border)}
body.cfb-app .ws3-tabs-track{display:flex;gap:24px;overflow-x:auto;flex:1 1 auto;min-width:0;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
body.cfb-app .ws3-tab{display:inline-flex;align-items:center;gap:4px;min-height:44px;padding:10px 2px;border:0;border-bottom:2px solid transparent;background:none;font:inherit;font-size:var(--text-base);font-weight:500;color:var(--text-secondary);white-space:nowrap;text-decoration:none;cursor:pointer;flex:none;margin-bottom:-1px}
body.cfb-app .ws3-tab:hover{color:var(--text);text-decoration:none}
body.cfb-app .ws3-tab.active{color:var(--text);border-bottom-color:var(--primary);font-weight:600}
body.cfb-app .ws3-tab[hidden],body.cfb-app .ws3-mi[hidden],body.cfb-app .ws3-more[hidden]{display:none}
body.cfb-app .ws3-tabs-more{flex:none}
body.cfb-app .ws3-tab:focus-visible,body.cfb-app .ws3-mi:focus-visible,body.cfb-app .ws3-tb:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* ---------- More menu ---------- */
body.cfb-app .ws3-more{position:relative;display:inline-flex}
body.cfb-app .ws3-menu{position:absolute;inset-inline-end:0;top:calc(100% + 6px);z-index:30;width:max-content;min-width:200px;max-width:min(300px,calc(100vw - 32px));background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:6px;box-shadow:var(--shadow-popover);display:flex;flex-direction:column;gap:2px}
body.cfb-app .ws3-menu[hidden]{display:none}
body.cfb-app .ws3-more.ws3-start .ws3-menu{inset-inline-end:auto;inset-inline-start:0}
body.cfb-app .ws3-more.ws3-up .ws3-menu{top:auto;bottom:calc(100% + 6px)}
body.cfb-app .ws3-more.open>.ws3-more-button{border-color:var(--primary)}
body.cfb-app .ws3-menu .ws3-mi{display:flex;align-items:center;width:100%;min-height:44px;padding:10px 12px;border:0;border-radius:8px;background:none;font:inherit;font-size:var(--text-base);font-weight:500;color:var(--text);text-align:start;text-decoration:none;cursor:pointer;white-space:normal;box-shadow:none}
body.cfb-app .ws3-menu .ws3-mi:hover,body.cfb-app .ws3-menu .ws3-mi:focus{background:var(--surface-hover);text-decoration:none}
body.cfb-app .ws3-menu .ws3-mi.active{font-weight:600}
body.cfb-app .ws3-menu .ws3-mi-danger{color:var(--danger);border-top:1px solid var(--border);border-radius:0 0 8px 8px;margin-top:4px}
body.cfb-app .ws3-row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}

/* ---------- Status as a coloured word ---------- */
body.cfb-app .ws3-ok{color:var(--success);font-weight:600}
body.cfb-app .ws3-warn{color:var(--warning);font-weight:600}
body.cfb-app .ws3-bad{color:var(--danger);font-weight:600}
body.cfb-app .ws3-num{font-variant-numeric:tabular-nums}

/* ---------- Empty state: a title, one sentence, one action ---------- */
body.cfb-app .ws3-empty{display:flex;flex-direction:column;align-items:flex-start;gap:8px;border:1px dashed var(--border-strong);border-radius:10px;padding:28px 24px;margin:8px 0 0;color:var(--text-secondary)}
body.cfb-app .ws3-empty>p{margin:0}
body.cfb-app .ws3-empty-title{font-size:var(--text-lg);font-weight:600;color:var(--text)}
body.cfb-app .ws3-empty-text{color:var(--text-secondary)}
body.cfb-app .ws3-empty>.button{margin-top:8px}

/* ---------- Overview: Needs you today, tiles, next trip, budget, plan line ---------- */
body.cfb-app .ws3-needs{display:flex;flex-direction:column;gap:12px}
body.cfb-app .ws3-needs>h2,body.cfb-app .ws3-card h2{margin:0;font-family:var(--font-sans);font-size:18px;font-weight:600;line-height:1.3;color:var(--text)}
body.cfb-app .ws3-need{display:flex;flex-wrap:wrap;align-items:center;gap:16px;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:18px 20px}
body.cfb-app .ws3-need>svg{width:22px;height:22px;color:var(--accent-text);flex:none}
body.cfb-app .ws3-need-text{flex:1 1 300px;min-width:0}
body.cfb-app .ws3-need>.button,body.cfb-app .ws3-head-action>.button,body.cfb-app .ws3-empty>.button{margin:0!important}
body.cfb-app .ws3-empty>.button{margin-top:8px!important}
body.cfb-app .ws3-need-text>p,body.cfb-app .ws3-card p{margin:0}
body.cfb-app .ws3-need-title{font-size:15px;font-weight:600;color:var(--text)}
body.cfb-app .ws3-need-meta{font-size:var(--text-sm);color:var(--text-muted)}
body.cfb-app .ws3-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:12px}
body.cfb-app .ws3-tile{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px}
body.cfb-app .ws3-tile p{margin:0;font-size:var(--text-sm);color:var(--text-muted)}
body.cfb-app .ws3-tile strong{font-size:24px;font-weight:600;color:var(--text)}
body.cfb-app .ws3-pair{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:24px}
body.cfb-app .ws3-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:22px 24px;display:flex;flex-direction:column;gap:12px;min-width:0}
body.cfb-app .ws3-card-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:12px}
body.cfb-app .ws3-card-head a{font-weight:600;font-size:var(--text-base)}
body.cfb-app .ws3-big{font-size:17px;font-weight:600;color:var(--text)}
body.cfb-app .ws3-card .ws3-num .ws3-big{font-size:22px}
body.cfb-app .ws3-bar{height:8px;border-radius:4px;background:var(--chart-soft);overflow:hidden}
body.cfb-app .ws3-bar>div{height:100%;background:var(--chart);border-radius:4px}
body.cfb-app .ws3-plan-line{font-size:var(--text-sm);color:var(--text-muted)}
body.cfb-app .ws3-plan-line a{font-weight:600}
body.cfb-app .ws3-plan-line:empty{display:none}

/* ---------- Team: read-only list and its edit panel ---------- */
body.cfb-app .acct-team:has(>.ws-rail)>.ws3-split{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start}
body.cfb-app .ws3-split>.ws3-team{flex:999 1 560px;min-width:0;width:auto;margin:0;overflow-x:auto}
body.cfb-app .ws3-panel{flex:1 1 320px;max-width:440px;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:22px 24px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow-popover)}
body.cfb-app .ws3-panel:focus{outline:2px solid var(--focus);outline-offset:2px}
body.cfb-app .ws3-panel>p,body.cfb-app .ws3-panel .acct-field{margin:0}
body.cfb-app .ws3-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
body.cfb-app .ws3-panel-head h2{margin:0;font-family:var(--font-sans);font-size:18px;font-weight:600}
body.cfb-app .ws3-panel-head p{margin:0}
body.cfb-app .ws3-close{width:44px;height:44px;border:0;background:none;border-radius:8px;color:var(--text-secondary);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
body.cfb-app .ws3-close:hover{background:var(--surface-hover)}
body.cfb-app .ws3-static{margin:0;padding:8px 0;color:var(--text)}
body.cfb-app .ws3-access{border-top:1px solid var(--border);padding-top:16px;display:flex;flex-direction:column;gap:14px}
body.cfb-app .ws3-access h3{margin:0;font-size:15px;font-weight:600}
body.cfb-app .ws3-access>div{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
body.cfb-app .ws3-access p{margin:0}
body.cfb-app .button.secondary.ws3-danger{color:var(--danger)!important}
body.cfb-app .ws3-row-open>td{background:var(--surface-hover)}
body.cfb-app .ws3-cell-action{text-align:end;white-space:nowrap}
body.cfb-app .ws3-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- Account menu: the language picker lives here on every width ---------- */
body.cfb-app .ws-account-menu .cfb-lang-account{display:flex;flex-direction:column;gap:4px;margin:8px 0}
body.cfb-app .ws-account-menu .cfb-lang-account select{width:100%;max-width:none;min-height:40px}
body.cfb-app .ws3-top-brand{display:none}

/* ---------- Phone: brand + company + avatar on top, four places at the bottom ---------- */
body.cfb-app .ws3-bottom{display:none}
@media (max-width:767px){
  body.cfb-app .ws-top.acct-top{padding:10px 16px!important;padding-top:max(10px,env(safe-area-inset-top))!important;min-height:64px;margin-bottom:20px}
  body.cfb-app .ws-top .ws-menu-toggle,body.cfb-app .ws-top .ws-page-name>span,body.cfb-app .ws-top .ui-command-trigger,body.cfb-app .ws-top .ws-account-name{display:none!important}
  body.cfb-app .ws3-top-brand{display:inline-flex;align-items:center;gap:10px;min-width:0;min-height:44px;color:var(--text);text-decoration:none;font-weight:600;font-size:var(--text-lg)}
  body.cfb-app .ws3-top-brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.cfb-app .ws-page-name{min-width:0;flex:1 1 auto}
  body.cfb-app .ws-account-menu>summary{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center}
  body.cfb-app .ws-account-menu .ws-avatar{width:44px;height:44px;border-radius:10px;background:var(--primary);color:var(--on-primary);font-size:var(--text-base)}
  body.cfb-app .ws-account-menu>div{max-width:calc(100vw - 32px)}
  body.cfb-app .acct-team:has(>.ws-rail){padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}
  body.cfb-app .acct-team:has(>.ws-rail)>:is(.ws3-head,.ws3-back,.ws3-tabs,.ws3-needs,.ws3-tiles,.ws3-pair,.ws3-split,.ws3-plan-line){width:calc(100% - 32px)}
  body.cfb-app .ws3-head h1{font-size:30px!important}
  body.cfb-app .ws3-tabs-track{scrollbar-width:none}
  body.cfb-app .ws3-tabs-track::-webkit-scrollbar{display:none}
  body.cfb-app .ws3-overview .ws3-company{display:none}
  body.cfb-app .ws3-head-action{width:100%}
  body.cfb-app .ws3-need{flex-direction:column;align-items:stretch;gap:12px;padding:16px}
  body.cfb-app .ws3-need>svg{display:none}
  body.cfb-app .ws3-need-text{flex:none}
  body.cfb-app .ws3-need>.button,body.cfb-app .ws3-row-actions>.button{min-height:44px}
  body.cfb-app .ws3-card,body.cfb-app .ws3-panel{padding:18px 16px}
  body.cfb-app .ws3-panel{max-width:none}
  body.cfb-app .ws3-row-actions .button,body.cfb-app .ws3-more-button{min-height:44px}
  body.cfb-app .ws3-bottom{display:flex;position:fixed;inset-inline:0;bottom:0;z-index:40;background:var(--surface);border-top:1px solid var(--border);padding:4px 8px calc(4px + env(safe-area-inset-bottom));padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right))}
  body.cfb-app .ws3-tb{flex:1 1 0;min-width:0;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:0;background:none;color:var(--text-secondary);font:inherit;font-size:var(--text-xs);font-weight:500;text-decoration:none;cursor:pointer;border-radius:10px}
  body.cfb-app .ws3-tb span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  body.cfb-app .ws3-tb.active{color:var(--text);font-weight:600}
  body.cfb-app .ws3-tb.active svg{color:var(--primary)}
  body.cfb-app .ws3-tb:hover{text-decoration:none;color:var(--text)}
  /* The full menu opens above the bottom bar and scrolls on its own. */
  body.cfb-app.ws-menu-open .ws-rail{bottom:calc(64px + env(safe-area-inset-bottom));overflow-y:auto;max-height:none}
}
/* An open menu is never clipped by the card or table that holds its row. */
body.cfb-app :is(.acct-card,.trav-item,.table-wrap,.ws3-team):has(.ws3-more.open){overflow:visible!important}
/* Sign-in, sign-up and the other single-card pages: one background, no lighter strip down the middle on wide screens. */
html body.cfb-app main.acct-page:not(.acct-team){background:transparent!important}

/* ---------- Super Admin menu groups that fold (BoardUI look kept: only the group heading becomes a toggle) ---------- */
.sa .sa-group>summary.sa-group-title{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:36px;padding:6px 10px;margin:0;border-radius:8px;cursor:pointer;list-style:none;user-select:none}
.sa .sa-group>summary.sa-group-title::-webkit-details-marker{display:none}
.sa .sa-group>summary.sa-group-title:hover{background:var(--bu-hover,rgba(0,0,0,.04))}
.sa .sa-group>summary.sa-group-title:focus-visible{outline:2px solid var(--bu-accent,#245879);outline-offset:1px}
.sa .sa-group-chevron{flex:none;transition:transform .15s}
.sa details.sa-group[open]>summary .sa-group-chevron{transform:rotate(90deg)}
.sa details.sa-group:not([open])>a{display:none}
@media (prefers-reduced-motion:reduce){.sa .sa-group-chevron{transition:none}}
/* The phone menu panel kept the old navy ground behind BoardUI's dark link text (under 4.5:1): it takes BoardUI's page colour. */
@media (max-width:900px){.sa.sa .sa-rail.open .sa-menu-panel{background:var(--bu-page);color:var(--bu-ink)}.sa.sa .sa-rail.open .sa-menu-panel :is(.sa-menu-sheet-head strong,.sa-menu-foot,.sa-menu-foot .acct-link,.sa-menu-foot .cfb-lang-label){color:var(--bu-ink)}}
/* Getting started (25 Nov 2026): the steps to an open workspace. */
body.cfb-app .gs-card .ws3-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
body.cfb-app .gs-count{margin:0;color:var(--text-secondary);font-size:var(--text-sm);font-variant-numeric:tabular-nums}
body.cfb-app .gs-bar{height:6px;border-radius:3px;background:var(--chart-soft);overflow:hidden;margin:8px 0 14px}
body.cfb-app .gs-bar>span{display:block;height:100%;background:var(--chart);border-radius:3px}
body.cfb-app .gs-steps{list-style:none;margin:0;padding:0}
body.cfb-app .gs-step{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--border)}
body.cfb-app .gs-step:first-child{border-top:0}
body.cfb-app .gs-step>div{flex:1;min-width:0}
body.cfb-app .gs-mark{flex:none;width:22px;height:22px;border-radius:50%;border:1.5px solid var(--border);display:inline-flex;align-items:center;justify-content:center;font-size:13px;color:var(--surface)}
body.cfb-app .gs-done .gs-mark{background:var(--primary);border-color:var(--primary)}
body.cfb-app .gs-done .gs-title{color:var(--text-muted)}
body.cfb-app .gs-title{margin:0;font-weight:600}
body.cfb-app .gs-text{margin:2px 0 0;color:var(--text-secondary);font-size:var(--text-sm)}
body.cfb-app .gs-next .gs-mark{border-color:var(--primary)}
@media (max-width:560px){body.cfb-app .gs-step{flex-wrap:wrap}body.cfb-app .gs-step .button{margin-left:34px}}
