/* ── Cross-document View Transitions (the iframe shell's replacement) ──────────────
   Every tab is a REAL page load again; there is no page iframe, so modals/overlays
   behave exactly as they do on a standalone page.
   `navigation:auto` here is used ONLY for its paint-holding: the browser keeps the
   old page on screen until the new document paints, so the chrome (sidebar, topbar,
   customer header, tabs — pixel-identical between pages) never blinks. Every snapshot
   layer stays un-animated (see the safety net below): an earlier attempt that let the
   layers animate flashed BLACK for the first frame of the new document. Do NOT animate
   the ::view-transition layers, and do not remove the opaque html/body backgrounds.
   The soft cross-fade is done instead by the new document itself — `.body` fades in on
   load, which behaves identically in Chrome, Safari and Firefox. */
@view-transition{ navigation:auto; }
.body{ animation:abzBodyIn .18s cubic-bezier(.4,0,.2,1) both; }
@keyframes abzBodyIn{ from{ opacity:0; } }

/* ---------- Table title rails: one control height everywhere ----------
   Every button, dropdown, search field and icon button that sits in a table's
   toolbar rail is exactly 38px tall, on every page, so the rail reads as one
   band. Vertical padding is zeroed (heights are fixed); horizontal padding,
   colours and borders stay with each control's own rule. */
:is(.sectoolbar,.toolrow,.tbar,.sumtoolbar,.sumtools,.ch.chrow,.actiongroup,.tkbar)
:is(.search,.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.entbtn,.entgrp,.rd-btn,.exp-btn,.ftbtn,.ftgrp,select,button:not(.searchclear):not(.stog)){
  height:38px;box-sizing:border-box;padding-top:0;padding-bottom:0;
}
:is(.sectoolbar,.toolrow,.tbar,.sumtoolbar,.sumtools,.ch.chrow) :is(.entgrp,.ftgrp){display:inline-flex;align-items:center;}

/* Row selection is shown by the CHECKBOX ONLY — never tint the row, in either theme.
   Only the td background is cleared, so the tr-level zebra stripe still shows through. */
:is(.table,.tutable,.dtable,.sumtbl,.mptable,.striped-rows) tbody tr:is(.selected,.sel)>td{background:transparent !important;}

/* DARK MODE: #D0D4D9 is the main "white" — card/table/modal titles, buttons, table text */
html.dark :is(.cname h1,.card .ch h3,.card>.ch h3,.sectoolbar h2,.toolrow h2,.tbar h2,.sumtoolbar h2,#tblTitle,
  .tkhead h2,.hxhd h3,.cdochd h3,.vthead h2,.vtmhead h2,.mphd h2,.ptmhd h2,.shead h2,
  .table tbody td,.table td.lead,.table td.num,.dtable td,.sumtbl tbody td,.hxtbl tbody td,.vtatbl td,.asttbl td,.mptable td,.ftptable td){color:#D0D4D9 !important;}
html.dark :is(.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.mbtn,.entbtn,.tkcancel,.hxa,.vtbtn,.vtedit,.cdocbtn,.acttrackbtn,.fchoose,#vtChoose):not(.cyan):not(.tabactive):not(.open):not(.active):not(.ghost-cyan){color:#D0D4D9 !important;}
html.dark :is(.table tbody td,.hxtbl tbody td) :is(b,strong,.lead,.c2a){color:#D0D4D9 !important;}

/* DARK MODE: every modal / off-canvas backdrop wash is #373745 at 80% */
html.dark :is(.tkov,.hxov,.cdocov,.ov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov,.scrim,.offscrim){background:rgba(55,55,69,.8) !important;}

/* Toasts ALWAYS sit above every modal wash, off-canvas panel and nested popover.
   Page-level `.toastwrap{z-index:120}` (and view-ticket.js's inline 200000) lose to this
   !important rule, so a toast fired from inside any modal is never dimmed or buried. */
:is(.toastwrap,#toastWrap,.vttoastwrap,#vtToastWrap,#ordToastWrap){z-index:300000 !important;}

/* LIGHT MODE: one border colour everywhere + flat cards (no drop shadow) */
html:not(.dark){--line:#E6EAEE;--line-2:#E6EAEE;}
/* FLAT: no drop shadow on cards or buttons, in either theme (overlays/menus keep theirs) */
:is(.card,.kpi,.listcard,.chartcard,.cardpad,.fccard,.sumcard,.tblwrap,.sheet,.ftpinfo,.contact,.prod,.tile,.msg,.stat),
:is(.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.mbtn,.entbtn,.entgrp,.rd-btn,.exp-btn,.ftbtn,.ftgrp,.actbtn,.detbtn,.simchip,.dchip,.tkcancel,.tknext,.tkopt,.acttrackbtn,.astexport,.asgexport,.hxa,.vtbtn,.vtedit,.vtmsave,.cdocbtn,.fchoose,#vtChoose,.actdrop-btn,.pgb,.sbtn,button.cyan){box-shadow:none !important;}
html:not(.dark) :is(.card,.kpi,.listcard,.chartcard,.cardpad,.fccard,.sumcard,.tblwrap,.sheet,.ftpinfo,.contact,.prod){box-shadow:none;}

/* LIGHT MODE: bordered (plain/neutral) buttons all use #E6EAEE, hover changes the
   background only — the border never deepens. Coloured/solid + active states keep theirs. */
html:not(.dark) :is(.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.mbtn,.entbtn,.entgrp,.rd-btn,.exp-btn,.ftbtn,.ftgrp,.ftpill,.actbtn,.detbtn,.simchip,.dchip,.tkcancel,.acttrackbtn,.astexport,.asgexport,.hxa,.vtbtn,.vtedit,.vtchoose,#vtChoose,.fchoose,.vtdd-btn,.ftpeye,.actdrop-btn):not(.cyan):not(.open):not(.tabactive):not(.active),
html:not(.dark) :is(.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.mbtn,.entbtn,.entgrp,.rd-btn,.exp-btn,.ftbtn,.ftgrp,.ftpill,.actbtn,.detbtn,.simchip,.dchip,.tkcancel,.acttrackbtn,.astexport,.asgexport,.hxa,.vtbtn,.vtedit,.vtchoose,#vtChoose,.fchoose,.vtdd-btn,.ftpeye,.actdrop-btn):not(.cyan):not(.open):not(.tabactive):not(.active):hover{
  border-color:#E6EAEE;
}

/* DARK MODE: same contract — neutral/bordered buttons and icon buttons keep var(--line)
   at rest AND on hover; only the background changes. Coloured/solid + active states keep theirs. */
html.dark :is(.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.mbtn,.entbtn,.entgrp,.rd-btn,.exp-btn,.ftbtn,.ftgrp,.ftpill,.actbtn,.detbtn,.simchip,.dchip,.tkcancel,.acttrackbtn,.astexport,.asgexport,.hxa,.vtbtn,.vtedit,.vtchoose,#vtChoose,.fchoose,.vtdd-btn,.ftpeye,.actdrop-btn,.cal-preset,.cal-nav):not(.cyan):not(.open):not(.tabactive):not(.active):not(.primary),
html.dark :is(.btn,.fbtn,.bulkbtn,.vubtn,.repbtn,.mbtn,.entbtn,.entgrp,.rd-btn,.exp-btn,.ftbtn,.ftgrp,.ftpill,.actbtn,.detbtn,.simchip,.dchip,.tkcancel,.acttrackbtn,.astexport,.asgexport,.hxa,.vtbtn,.vtedit,.vtchoose,#vtChoose,.fchoose,.vtdd-btn,.ftpeye,.actdrop-btn,.cal-preset,.cal-nav):not(.cyan):not(.open):not(.tabactive):not(.active):not(.primary):hover{
  border-color:var(--line) !important;
}

/* Customer header meta rail (Brighouse, UK · Since · Partner · Account Manager)
   sits on ONE line only where it actually FITS. The rail measures ~700px nowrap
   and the header actions ~330px, so below 1280px the sheet (overflow:hidden)
   clipped the actions clean off — the rail must be allowed to wrap there.
   Verify any change by measuring .chead scrollWidth vs clientWidth at 1024 /
   1280 / 1440px: it must never exceed clientWidth. */
@media(min-width:1280px){.chead .cmeta{flex-wrap:nowrap;}}

/* Main nav: the active (magenta) tab is FLAT — no drop shadow, in either theme.
   Every page declares its own `.tab.active{box-shadow:…}`; this shared rule
   outranks it (0,3,0) and loads after the page's inline <style>. */
.tabs .tab.active,.tabs .tab.active:hover,html.dark .tabs .tab.active{box-shadow:none !important;}

/* Main nav rhythm (LOCKED): tabs sit further apart and carry tighter inner padding,
   so each reads as its own pill/button. Shared here because every page declares its
   own `.tabs`/`.tab` block and this file loads after them. */
.tabs{gap:10px;}
.tabs .tab{padding:11px 8px;}

/* Main nav: the Tasks tab carries an open-task count pill (same chip language as the
   sub-tab count badges — translucent magenta tint, white on the selected tab). */
.tabs .tab .cnt{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:-3px;padding:0 6px;border-radius:999px;background:#E6EAEE;color:#5C6068;font-family:"Nunito",sans-serif;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1;}
.tabs .tab.active .cnt{background:rgba(255,255,255,.24);color:#fff;}
html.dark .tabs .tab .cnt{background:rgba(255,255,255,.10);color:#8E9099;}
html.dark .tabs .tab.active .cnt{background:rgba(255,255,255,.24);color:#fff;}

/* "N selected" sits immediately after the table title + count pill, in one plain colour */
:is(.sectoolbar,.toolrow,.tbar,.sumtoolbar,.actiongroup) .selinfo{order:-1;color:var(--ink-2);}
/* Connections / Usage › By Connection: the label is a direct child of the title row,
   which is justify-content:space-between — the auto margin keeps it beside the pill. */
.card .ch.chrow>.selinfo{margin-right:auto;color:var(--ink-2);}
:is(.sectoolbar,.sumtoolbar)>:is(h2,h3),:is(.sectoolbar,.sumtoolbar)>.scount,.sumtitle{order:-2;}
.selinfo b{color:inherit;font-weight:600;}

/* Customer-header meta links (e.g. Partner name) — same treatment as the
   Company Details field links: cyan, underline on hover. */
.cmeta a.plink,.chead .meta a.plink{color:var(--cyan-d,#0091c4);text-decoration:none;}
.cmeta a.plink b,.chead .meta a.plink b{color:inherit;}
.cmeta a.plink:hover,.chead .meta a.plink:hover,.cmeta a.plink:hover b,.chead .meta a.plink:hover b{text-decoration:underline;}

html { background: #f3f5f8; color-scheme: light; }
html.dark { background: #0B0A1A; color-scheme: dark; }
body { background: #f3f5f8; }
html.dark body { background: #0B0A1A; }

/* Safety net: if a transition is ever triggered programmatically, keep the
   snapshot layers opaque and un-animated so nothing dark can show through. */
::view-transition { background: #f3f5f8; }
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*){ animation: none !important; mix-blend-mode: normal; }

/* ---------- App-shell embed mode ----------
   When a page is loaded inside Customer Record.html (the app shell), the shell
   injects `.in-shell` onto the page's <html>. The shell already provides the
   persistent sidebar, topbar, customer header and tabs, so we hide this page's
   own copies and let only its .body content flow — filling the iframe. */
.in-shell .side,
.in-shell .topbar,
.in-shell .sheet > .accent,
.in-shell .sheet > .chead,
.in-shell .sheet > .tabs{ display: none !important; }

/* Overlays opened INSIDE the shell's auto-sized page iframe keep their own
   `position:fixed;inset:0` — inside the iframe that covers the ENTIRE embedded document,
   so the dim wash always fills the page area with no visible edge. Do NOT pin them to a
   measured "visible slice": that clipped tall modals to a couple hundred px and stranded
   them at the top of the document. shell-overlay-fit.js instead SCROLLS the shell so the
   open modal is centred in the real viewport. It also publishes the real viewport height as
   --svh, because inside the tall iframe a modal's own `max-height:92vh` measures against the
   document-tall viewport and overflows the screen; cap the modal child with it (the modals
   already scroll internally, so nothing is lost). --sovm is the top margin that drops the
   modal into the middle of the visible slice: the overlay itself must stay `fixed;inset:0`
   (so its wash covers the whole page area), so the MODAL is offset instead of the overlay
   being repositioned. */
.in-shell :is(.tkov,.hxov,.cdocov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov){align-items:flex-start;}
.in-shell :is(.tkov,.hxov,.cdocov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov)>*{margin-top:var(--sovm,0px);max-height:calc(var(--svh,100vh) - 40px);overflow:auto;}
/* --sovm/--svh are re-measured a few frames after open (and on scroll). Animating those
   writes makes the modal slide/resize after it has already appeared — the "clumsy" open.
   Animate only opacity + transform; geometry lands instantly. */
.in-shell :is(.tkov,.hxov,.cdocov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov)>*{transition:opacity .2s cubic-bezier(.4,0,.2,1),transform .2s cubic-bezier(.4,0,.2,1)!important;}
.in-shell :is(.tkov,.hxov,.cdocov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov){transition:opacity .2s cubic-bezier(.4,0,.2,1)!important;}
/* Class-agnostic: shell-overlay-fit.js stamps `data-abz-fit` on whichever backdrop it is
   currently fitting (including modals whose overlay class isn't in the list above), so any
   screen's modal centres in the real viewport inside the shell. */
.in-shell [data-abz-fit]{align-items:flex-start;}
.in-shell [data-abz-fit]>*{margin-top:var(--sovm,0px);max-height:calc(var(--svh,100vh) - 40px);overflow:auto;transition:opacity .2s cubic-bezier(.4,0,.2,1),transform .2s cubic-bezier(.4,0,.2,1)!important;}

/* Off-canvas filter panel inside the shell iframe: it is right-pinned + full height, and
   inside the auto-sized iframe "full height" = the whole DOCUMENT, so it read as a tall
   strip starting under the tabs instead of behaving like the shell-level View Ticket panel.
   shell-overlay-fit.js publishes the visible slice as --socT/--socH; pin the panel to it. */
.in-shell .fcv .fcpanel{top:var(--socT,0px);height:var(--socH,100%);}

/* No SECOND scrollbar inside the shell. The shell sizes the iframe to its content and
   the whole page scrolls in .scroll, so the embedded document must never present its
   own scrollbar. The shell adds `.in-shell-fit` on desktop only (on mobile the iframe
   genuinely scrolls internally, so it must keep its overflow). */
.in-shell-fit{ overflow: hidden !important; scrollbar-width: none; -ms-overflow-style: none; }
.in-shell-fit::-webkit-scrollbar,
.in-shell-fit body::-webkit-scrollbar{ width: 0; height: 0; display: none; }

.in-shell,
.in-shell body{ background: var(--card, #fff) !important; height: auto !important; }
.in-shell .app{ height: auto !important; min-height: 100%; overflow: visible !important; }
.in-shell .main{ min-height: 100%; }
.in-shell .scroll{ overflow: visible !important; padding: 0 !important; }
.in-shell .sheet{
  border: none !important; box-shadow: none !important; border-radius: 0 !important;
  margin: 0 !important; min-height: 100% !important; background: var(--card, #fff) !important;
}

/* MODAL DROPDOWNS (shared, all pages): every native <select> inside a modal wears the
   Bulk-actions button chrome — white, 1.5px --line border, 5px radius, 13px/600 label —
   with a CYAN chevron in place of the OS arrow (no leading icon). */
:is(.tkov,.tkmodal,[role="dialog"],.hxov,.cdocov,.ov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov) select{
  appearance:none !important;-webkit-appearance:none !important;
  border:1.5px solid var(--line) !important;border-radius:5px !important;background-color:var(--card,#fff) !important;
  color:var(--ink) !important;font-family:inherit !important;font-size:12px !important;font-weight:500 !important;
  padding:9px 34px 9px 15px !important;transition:.12s;cursor:pointer;line-height:1.15 !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009CC7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;background-position:right 11px center !important;background-size:16px !important;
}
:is(.tkov,.tkmodal,[role="dialog"],.hxov,.cdocov,.ov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov) select:hover{border-color:#cfd5df !important;background-color:var(--fill,#F5F7F9) !important;}
:is(.tkov,.tkmodal,[role="dialog"],.hxov,.cdocov,.ov,.dlhov,.dpaov,.mpov,.ptmov,.vtov,.asgov,.invov,.hxdocov,.capzov,.msgov,.fileov,.ftpov,.addrov,.contactov,.mandateov,.ddsetupov,.ddtrackov) select:focus{outline:none;border-color:#009CC7 !important;box-shadow:0 0 0 3px color-mix(in srgb,#009CC7 18%,transparent);}
