/* Live-app additions to the approved demo's stylesheet (styles/vendigoose-ui.css, generated, never edited).
   Only what the live app needs and the demo has no rule for, token-based, never a redefinition of a demo component. */

/* The profile dock is mounted by vendigoose-auth.js into a preserved slot at the end of the top bar. */
.ven-authdock-slot{display:contents}

/* Long lists: the pager shows a gap instead of hundreds of page buttons. */
.pager .pg .gap{display:inline-grid;place-items:center;min-width:22px;color:var(--faint)}

/* A page still drawn with legacy markup sits inside the new frame; its own header row is gone (the top bar has it). */
.page.lg-page{max-width:none}

/* ===== Redesign G2 (Docks): team chat + assistant docks, vendor portal, boot splash ===== */
/* The top bar re-renders on its own, so the open dock's pressed button (the demo's .ibtn.on) is keyed off <body>. */
body.vg-dock-chat .top [data-action="open-team-chat"],body.vg-dock-assistant .top [data-action="open-assistant"]{background:color-mix(in srgb,var(--brand) 14%,transparent);color:var(--brand)}
/* The viewer portal replaces the whole app (the demo hides #app; the live shell lives in #vendigoose-root). */
html.vendigoose-viewer #vendigoose-root,body.portal-mode #vendigoose-root{display:none!important}

/* ===== Group C: Companies / Vendors lists, quick views, editors, vendor notifications ===== */
/* Vendor editor: linked companies are the demo's toggle chips over real checkboxes (name="companyIds"); a ticked one
   takes the demo's .chip.on look. */
.cv-copick .chip{position:relative;cursor:pointer}
.cv-copick .chip input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.cv-copick .chip svg{display:none;width:13px;height:13px}
.cv-copick .chip:has(input:checked){background:color-mix(in srgb,var(--brand) 16%,transparent);color:var(--brand);border-color:color-mix(in srgb,var(--brand) 32%,transparent)}
.cv-copick .chip:has(input:checked) svg{display:inline-block}
.cv-copick .chip:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:2px}
/* Vendor notifications window: the notification-centre panel (demo 64-c) under the top bar, over a clear backdrop. */
.scrim.vnotif-scrim{background:transparent;backdrop-filter:none}
.pop.notifpop.vnotif{left:auto;right:16px;top:60px}
/* Lists: once the live column resizer fixes the widths (table[data-resizable]), cells clip with an ellipsis exactly as the
   demo's resized tables (table.t.fixed) do, instead of names running into the next column. */
.cv-list table.t[data-resizable] th,.cv-list table.t[data-resizable] td{overflow:hidden;text-overflow:ellipsis}
.cv-list table.t[data-resizable] td .cellmain{min-width:0;overflow:hidden}
.cv-list table.t[data-resizable] td .cellmain>div{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* ===== G1 (Auth): sign-in screens, profile / team / environments, access gating (scripts/modules/vendigoose-auth.js) ===== */
/* The module's overlays live under <html>, outside <body>, so a body re-render never removes them: give them the body's type. */
#vendigoose-auth-root,#vendigoose-auth-toasts{font:13px/1.45 var(--font);color:var(--text);-webkit-font-smoothing:antialiased}
/* .authwrap is display:grid, which beats the hidden attribute; the gate hides that way between screens. */
#vendigoose-auth-gate[hidden]{display:none!important}
/* While the sign-in card is up nothing of the app (boot splash included) shows or takes focus behind it. */
body.vendigoose-auth-locked #vendigoose-root,body.vendigoose-auth-pending #vendigoose-root{visibility:hidden!important;pointer-events:none!important}
/* Layers other modules hang on <html> (chat / assistant dock) stay away too; only this module's own root and toasts remain. */
body.vendigoose-auth-locked~*:not(#vendigoose-auth-root):not(#vendigoose-auth-toasts){display:none!important}
/* Access gating (enforce): controls a role may not use are hidden or disabled, in converted and legacy markup alike. */
.ven-access-hidden{display:none!important}
[data-ven-disabled="1"]{opacity:.55!important;pointer-events:none!important;cursor:not-allowed!important}
/* The environment tag on legacy rows (scripts/services/environment-client.js); moved from vendigoose-auth.css, still fenced. */
.env-tag:where(:not(.vg, .vg *)){display:inline-flex;align-items:center;gap:5px;margin-top:3px;padding:1px 7px;border-radius:999px;font-size:10.5px;font-weight:700;background:rgba(100,116,139,.12);color:inherit;white-space:nowrap}
.env-tag i:where(:not(.vg, .vg *)){display:inline-block;width:8px;height:8px;border-radius:50%;flex:0 0 auto}

/* Redesign F (Settings + global dialogs/states). */
/* Approvals form: the demo's .sw drawn for a real checkbox (FormData carries it), the steps dimmed while approvals are off. */
.stg-sw-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
label.stg-sw{cursor:pointer}
.stg-sw-input:checked+.stg-sw .sw{background:linear-gradient(135deg,var(--brand),var(--brand-2))}
.stg-sw-input:checked+.stg-sw .sw::after{transform:translateX(14px)}
.stg-sw-input:focus-visible+.stg-sw .sw{outline:2px solid var(--brand);outline-offset:2px}
#venApprovalEnabled:not(:checked)~.stg-ap-config{opacity:.5;pointer-events:none}
/* The loading spinner and skeletons stop for people who asked for less motion. */
@media (prefers-reduced-motion: reduce){.spin,.skel{animation:none}}
/* ===== Group A: Overview (live-only) ===== */
/* An Excel-style table (data-resizable) before its first fit has no saved widths yet: text still ends in an ellipsis. */
table.t[data-resizable] th,table.t[data-resizable] td{overflow:hidden;text-overflow:ellipsis}
/* The Status check's background-activity slot: while empty it must not count as the dialog's first section. */
#ov-status-activity:empty+.sect{border-top:0}

/* ===== Group B: invoice workspace (drawer, document pane, payment / request / email dialogs) ===== */
/* The drawer slides in only on a real open; a node rebuilt while it is already open stays still. */
#invoice-workspace:not(.iv-still){animation:invoice-drawer-in 180ms var(--ease)}
.ov.drawer.iv-still{animation:none}
.scrim[data-invoice-backdrop]{background:rgb(2 8 23 / 24%);animation-duration:180ms}
@keyframes invoice-drawer-in{from{transform:translateX(100%)}to{transform:none}}
@media (prefers-reduced-motion:reduce){
  #invoice-workspace:not(.iv-still),[data-invoice-backdrop]{animation:none}
}
@media (min-width:761px){
  #invoice-workspace:not(.max){width:min(1280px,calc(100vw - 32px))}
}
/* The hydrated document fills the pane; zoom scales it, page mode keeps an A4 page. */
.docview .docscroll{position:relative}
.docview .preview-shell{position:relative;width:calc(100% * var(--iv-doc-zoom,1));height:calc(100% * var(--iv-doc-zoom,1));min-height:100%}
.docview .docscroll.is-page .preview-shell{height:auto;min-height:0;aspect-ratio:1/1.414}
.docview .preview-shell>.empty{min-height:100%;justify-content:center}
.docview .preview-frame{display:block;width:100%;height:100%;border:0;background:#fff}
.docview .preview-image{display:block;max-width:100%;margin:0 auto}
.docview .docscroll.is-page .preview-image{max-width:none;width:100%}
.docview .preview-text{margin:0;padding:14px 16px;white-space:pre-wrap;font-size:12px;line-height:1.5;color:var(--text)}
.docview .preview-fallback--overlay{position:absolute;inset:0;background:color-mix(in srgb,var(--surface-2) 92%,transparent)}
.docview .empty .skel{width:60%}
/* Invoice email window: conversations beside the reading pane. */
.ie-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);align-items:start}
.ie-split>.ie-list{border-right:1px solid var(--line);align-self:stretch}
@media (max-width:760px){.ie-split{grid-template-columns:1fr}.ie-split>.ie-list{border-right:0;border-bottom:1px solid var(--line)}}
.ivside .ivtabs .tabs{overflow-x:auto;scrollbar-width:none}.ivside .ivtabs .tabs::-webkit-scrollbar{display:none}.ivside .ivtabs .tabs button{flex:0 0 auto}

/* ===== Group D (Records): company + vendor pages and their overlays ===== */
/* A form that spans an overlay's body and footer (cvFormOverlay) must not add a box of its own. */
.ov form.cv-ovform{display:contents}
/* File preview: the live document pane that hydratePreview() fills (iframe / image / text / notes). */
.cv-prev.solo{grid-template-columns:minmax(0,1fr)}
.cv-docpane{position:relative;flex:1;display:flex;min-height:480px;overflow:auto;border-radius:0 0 14px 14px}
.cv-docpane>.preview-frame{flex:1;width:100%;min-height:480px;border:0;background:#fff;border-radius:0 0 13px 13px}
.cv-docpane>.preview-image{max-width:100%;height:auto;margin:auto;display:block;object-fit:contain}
.cv-docpane>.preview-text{flex:1;margin:0;padding:14px 16px;white-space:pre-wrap;word-break:break-word;font-size:12.5px;line-height:1.5;color:var(--text)}
.cv-docpane>.preview-fallback,.cv-docpane>.preview-unsupported{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:20px;text-align:center;color:var(--muted);font-weight:600}
.cv-docpane>.preview-fallback--overlay{position:absolute;inset:0;background:color-mix(in srgb,var(--surface-2) 92%,transparent)}
.cv-prev-side .extraction-editor .amount-negative{color:var(--bad)}

/* ===== Owner revisions 2026-11-05 (the owner's changes to the approved demo; token-based) ===== */
:root{--top:48px}

.twtop-slot{display:contents}
/* Keep scrolling and moving surfaces independent of the pixels behind them. */
.top.vg, .pv .pv-top { background:var(--bg); backdrop-filter:none; }
.rail.vg, .vg .panel, .ov.vg, .dock.vg, .vg .mb-lh {
  background:var(--surface);
  backdrop-filter:none;
}
.scrim.vg { backdrop-filter:none; }
#vendigoose-shell { transition:none; }
@media (max-width:760px) {
  .rail.vg { transition:transform 160ms var(--ease); }
  .rail.open:not(:hover):not(.pin) :is(.nav>span:not(.cnt), .brand .wm, .rail-sec, .rail-ver) { opacity:1; }
}
@media (prefers-reduced-motion:reduce) {
  .rail.vg, .dock.vg, .ov.vg, .scrim.vg { transition:none; animation:none; }
}

/* --- Shell: the profile + environment dock lives in the sidebar under Settings --- */
.rail .ven-authdock-slot{display:block;margin-top:6px}
.rail .dockbtn{width:100%;height:46px;padding:0 9px 0 6px;border-radius:12px;box-shadow:none;background:color-mix(in srgb,var(--surface-2) 70%,transparent)}
.rail .dockbtn:hover{box-shadow:none;background:var(--surface-2)}
.rail .dockbtn .dk{flex:1 1 auto;min-width:0}
.rail .dockbtn .dk b,.rail .dockbtn .dk small{overflow:hidden;text-overflow:ellipsis;max-width:130px}
.rail .dockbtn #envLbl{max-width:110px}
.rail .dockbtn>svg{margin-left:auto;flex:0 0 14px;transform:rotate(-90deg)}
.rail:not(:hover):not(.pin) .dockbtn{padding:0;justify-content:center;background:none;border-color:transparent}
.rail:not(:hover):not(.pin) .dockbtn .dk,.rail:not(:hover):not(.pin) .dockbtn>svg{display:none}
@media (max-width:760px){.rail .dockbtn{width:100%;border-radius:12px;padding:0 9px 0 6px;justify-content:flex-start}.rail .dockbtn .dk{display:flex}.rail .dockbtn>svg{display:block}}

/* --- Top bar: slimmer, one tool group on the right --- */
.top{gap:8px;padding:0 18px}
.top .search{flex:0 1 300px;height:30px;border-radius:10px;margin-left:8px;box-shadow:none;background:color-mix(in srgb,var(--surface-2) 70%,transparent)}
.top .search:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line-2));background:var(--surface)}
.top .topacts .btn{height:30px;padding:0 11px;border-radius:9px}
.toolgroup{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--line);border-radius:11px;background:color-mix(in srgb,var(--surface-2) 70%,transparent);flex:0 0 auto}
.toolgroup .ctx .chip{height:26px;border:0;background:none;border-radius:8px;padding:0 8px;color:var(--text)}
.toolgroup .ctx .chip:hover{background:var(--surface)}
.toolgroup .ibtn{width:28px;height:28px;flex-basis:28px;border-radius:8px}
.toolgroup .ibtn svg{width:16px;height:16px}
.toolgroup .tg-sep{width:1px;height:16px;background:var(--line-2);margin:0 3px;flex:0 0 1px}
.toolgroup .ibtn .badge{top:0;right:0}
@media (max-width:760px){.toolgroup{gap:0}}

/* --- Filters, search bars and view switches: one soft, platform-matched control look --- */
.toolbar{gap:8px;background:color-mix(in srgb,var(--surface-2) 38%,transparent)}
.toolbar .inp,.toolbar .sel,.toolbar .btn,.pv .toolbar .inp,.pv .toolbar .sel{height:30px;border-radius:10px;font-size:12.5px;font-weight:550;border:1px solid var(--line);background-color:color-mix(in srgb,var(--surface) 92%,transparent);background-image:linear-gradient(180deg,color-mix(in srgb,#fff 5%,transparent),transparent);box-shadow:inset 0 1px 0 color-mix(in srgb,#fff 6%,transparent),0 1px 2px color-mix(in srgb,#000 6%,transparent)}
.toolbar .sel{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238593b4' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"),linear-gradient(180deg,color-mix(in srgb,#fff 5%,transparent),transparent);background-repeat:no-repeat,no-repeat;background-position:right 10px center,0 0;padding-right:28px;text-overflow:ellipsis}
.toolbar .inp:hover,.toolbar .sel:hover,.toolbar .btn:hover{border-color:color-mix(in srgb,var(--brand) 45%,var(--line-2));background-color:var(--surface)}
.toolbar .inp:focus,.toolbar .sel:focus,.toolbar .btn:focus-visible{border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent)}
.toolbar .sel{max-width:150px}
.toolbar .btn svg{color:var(--faint)}
.toolbar .btn.on61{border-color:color-mix(in srgb,var(--brand) 38%,var(--line));background-color:color-mix(in srgb,var(--brand) 12%,transparent)}.toolbar .btn.on61 svg{color:var(--brand)}
.searchbox{position:relative}
.searchbox>svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:15px;height:15px;color:var(--faint);pointer-events:none;transition:color .12s}
.searchbox:focus-within>svg{color:var(--brand)}
.toolbar .searchbox .inp{padding-left:32px;min-width:0;width:220px}
.toolbar .tb-sep{width:1px;height:20px;background:var(--line-2);flex:0 0 1px;margin:0 2px}
.seg{background:color-mix(in srgb,var(--surface-2) 80%,transparent);box-shadow:inset 0 1px 2px color-mix(in srgb,#000 6%,transparent)}
.seg button{transition:background .12s,color .12s}.seg button:not(.on):hover{color:var(--text)}
.toolbar .seg button{height:24px}

/* --- Overview list: no title row, one slim toolbar --- */
.panel.ovlist>.toolbar{padding:9px 14px;gap:7px}
.panel.ovlist>.toolbar .grow1{flex:1 1 0;min-width:0}

/* --- Invoice workspace: slim one-line header, tidy details column --- */
#invoice-workspace .ovh{padding:6px 14px;min-height:0;gap:10px}
#invoice-workspace .ovh .ico{width:30px;height:30px;flex:0 0 30px;border-radius:9px}
#invoice-workspace .ovh .ico svg{width:16px;height:16px}
#invoice-workspace .ovh .grow1{display:flex;align-items:center;gap:12px;min-width:0;flex-wrap:nowrap}
#invoice-workspace .ovh h2{font-size:14.5px;white-space:nowrap;flex:0 0 auto}
#invoice-workspace .ovh .sub{margin:0;min-width:0;flex:1 1 auto;overflow:hidden;white-space:nowrap;font-size:12px}
#invoice-workspace .ovh .sub>span:not(.chips61i){overflow:hidden;text-overflow:ellipsis;flex:0 1 auto;min-width:0}
#invoice-workspace .ovh .acts{gap:5px}
#invoice-workspace .ovh .ibtn{width:30px;height:30px;flex-basis:30px}
#invoice-workspace .ovh .asgh .sel{height:28px;min-width:130px}
@media (min-width:1101px){
  .ivside .actbar61{padding:8px 16px 0;border-bottom:0;background:none;min-height:40px;align-items:center}
  .ivside .actbar61 .btn{height:32px}
  .ivside .route61{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:center;gap:0 14px;margin:10px 16px 0;padding:9px 12px 9px 14px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--surface-2) 45%,transparent)}
  .ivside .route61 .rf{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"l s" "n n";column-gap:8px;align-items:baseline}
  .ivside .route61 .rf>span{grid-area:l;margin:0;font-size:10px}
  .ivside .route61 .rf>small{grid-area:s;text-align:right;font-size:10.5px}
  .ivside .route61 .rf>b{grid-area:n;max-width:none;font-size:13px}
  .ivside .route61 .rf+.rf{padding-left:14px;border-left:1px solid var(--line)}
  .ivside .ivtabs{margin-top:8px;padding:0 10px}
  .ivside .ivtabs .tabs{justify-content:space-between}
  .ivside .ivtabs .tabs button{padding:0 7px;font-size:12.5px}
}
#invoice-workspace .invoice-figures{
  grid-template-columns:repeat(4,minmax(0,1fr));
  flex:none;
  margin:8px 0 0;
}
#invoice-workspace .invoice-figures .cell{min-width:0;padding:6px 10px;border-top:0}
#invoice-workspace .invoice-figures .cell+.cell{border-left:1px solid var(--line)}
.invoice-figures .val{font-size:16px;line-height:1.2;margin:2px 0;overflow-wrap:anywhere}
.invoice-figures .meta{font-size:11px;line-height:1.2;overflow-wrap:anywhere}

#invoice-workspace .ivtab .sect{padding:8px 16px}
#invoice-workspace .ivtab .sect-h{margin-bottom:5px}
.invoice-detail-list{margin:0;min-width:0}
.invoice-detail-list>div{display:grid;grid-template-columns:minmax(105px,36%) minmax(0,1fr);gap:12px;padding:7px 0;border-bottom:1px solid var(--line)}
.invoice-detail-list>div:last-child{border-bottom:0}
.invoice-detail-list dt{color:var(--muted);font-size:12px}
.invoice-detail-list dd{margin:0;font-weight:600;overflow-wrap:anywhere;white-space:pre-wrap}
.ov .invoice-detail-form{grid-template-columns:minmax(0,1fr);gap:10px}
.ov .invoice-detail-form .field{min-width:0}
.ov .invoice-detail-form :is(.inp,.sel,.txa){min-width:0;width:100%}
#invoice-workspace .payrow61{display:block;padding:10px 0}
#invoice-workspace .payrow61 .rowbtns{justify-content:flex-end;flex-wrap:wrap;margin-top:8px}

#invoice-workspace .ivdoc{grid-area:pdf;min-width:0;border:0}
#invoice-workspace .ivside{grid-area:details}
#invoice-workspace .ivdivider{grid-area:divider;position:relative;z-index:1;display:flex;flex-direction:column;align-items:center}
#invoice-workspace .ivswap{flex:none;background:var(--surface)}
#invoice-workspace .ivresize{flex:1;width:12px;cursor:col-resize;touch-action:none}
#invoice-workspace .ivresize::before{content:"";display:block;width:1px;height:100%;margin:auto;background:var(--line)}
#invoice-workspace .ivresize:is(:hover,:focus-visible)::before{width:3px;background:var(--brand)}
#invoice-workspace .iv61{grid-template-areas:"divider" "pdf" "details"}
#invoice-workspace .iv61.iv-swapped{grid-template-areas:"divider" "details" "pdf"}
@media (max-width:1100px){
  #invoice-workspace .ivdivider{align-items:flex-end;padding:5px 12px 0}
  #invoice-workspace .ivresize{display:none}
  #invoice-workspace .ivdoc{min-height:350px}
}
@media (min-width:1101px){
  #invoice-workspace .iv61{
    --pdf-width:calc(var(--invoice-pdf-share,57%) - 6px);
    grid-template-areas:"pdf divider details";
    grid-template-columns:minmax(0,var(--pdf-width)) 12px minmax(0,1fr);
  }
  #invoice-workspace .iv61.iv-swapped{
    grid-template-areas:"details divider pdf";
    grid-template-columns:minmax(0,1fr) 12px minmax(0,var(--pdf-width));
  }
  #invoice-workspace .ivswap{margin-top:5px}
}
#invoice-workspace [data-iv-tab="summary"] .savebar61{padding-top:6px;flex-wrap:wrap}

.ivtabs [data-tab="approval"] .invoice-approval-dot{
  position:absolute;
  top:4px;
  right:2px;
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--warn);
}
.ivtabs [data-tab="approval"] .invoice-approval-dot.bad{background:var(--bad)}
@media (max-width:520px){
  #invoice-workspace .invoice-figures{grid-template-columns:repeat(2,minmax(0,1fr))}
  #invoice-workspace .invoice-figures .cell:nth-child(3){border-left:0}
  #invoice-workspace .invoice-figures .cell:nth-child(n+3){border-top:1px solid var(--line)}
}


.mb-sync-results{padding:10px 14px}
.mb-sync-results ul{display:flex;flex-wrap:wrap;gap:6px 18px;list-style:none;margin:6px 0 0;padding:0}
.mb-sync-results li{display:flex;flex-wrap:wrap;gap:4px 8px}
.mb-sync-results li span{color:var(--muted)}
