/* Design tokens (palette, semantic roles, light/dark themes, motion) live in tokens.css,
   which every page loads before this file (ADR-189). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 13px; /* modernization pass: denser than the original 14px base for a
    business-app feel; the login canvas's own pt-sized hero typography (SRS §II) is
    absolute-unit, so it's unaffected by this. */
}

/* ADR-201: every property wins - a component rule such as `.mip-repeating-lines-table select
   { width: 100% }` used to resize the hidden native <select> behind a searchable dropdown to the
   page width, which (clipped but still in the scroll area) put a horizontal scrollbar under the
   journal forms. A visually hidden element must never take space, whatever else targets it. */
.mip-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  font-family: var(--mip-font-family);
  /* SRS §3 Typography: "All body text must be 1 rem." Explicit rather than relying on
     the browser default (which would already compute to the same rendered size given
     html's 13px base above, since 1rem == the root font-size by definition) - stated
     literally here so the rule is self-documenting and can't drift if html's base ever
     changes. */
  font-size: var(--mip-font-size-body);
  color: var(--mip-text-body);
  background: var(--mip-color-surface-muted);
  -webkit-font-smoothing: antialiased;
}

/* A single, deliberate focus-visible treatment (keyboard/AT users only - mouse clicks
   never show it) so every interactive element in the shared templates gets the same
   accessible focus ring instead of the browser default outline looking inconsistent
   next to the shell's own custom focus states (tier badge, utility icons). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.mip-btn:focus-visible {
  outline: var(--mip-border-width-focus) solid var(--mip-color-primary-blue);
  outline-offset: 2px;
  border-radius: var(--mip-radius-sm);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Typography rhythm + link treatment (modernization pass) - applied globally so every
   page's headings and inline links look like one product without each page repeating
   the same three declarations. */
h1,
h2,
h3 {
  font-family: var(--mip-font-family);
  color: var(--mip-text);
  margin: 0 0 var(--mip-space-4);
  line-height: 1.25;
}

h1 {
  font-size: 1.4rem;
}

h2 {
  font-size: 1.1rem;
}

h3 {
  font-size: 1rem;
}

a {
  color: var(--mip-color-link-blue);
  transition: color var(--mip-transition-fast);
}

a:hover {
  color: var(--mip-color-primary-blue);
}

/* The "Back to X" link every admin page opens with - a small arrow + muted-until-hover
   treatment so it reads as navigation chrome, not page content. Hidden app-wide (styles
   kept, not deleted, in case a future page type without a left submenu wants it back):
   every page that renders one also sits under a left-hand submenu (Configuration/
   Administration/Treasury's own nav column), which already provides the same "go back to
   the list" navigation, making this top-of-page duplicate redundant. */
.mip-back-link {
  display: none;
  align-items: center;
  gap: var(--mip-space-1);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mip-text);
  text-decoration: none;
  margin-bottom: var(--mip-space-4);
}

.mip-back-link:hover {
  color: var(--mip-color-link-blue);
}

.mip-back-link::before {
  content: "←";
}

/* ADR-711 / ADR-781: an entry form shows "Back to <its list>" above its title (setup.js). */
.mip-screen-back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: var(--mip-space-1);
  margin: 0 0 var(--mip-space-2);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mip-color-link-blue);
  text-decoration: none;
}

.mip-screen-back::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-right: 2px;
}

.mip-screen-back:hover,
.mip-screen-back:focus-visible {
  text-decoration: underline;
}

@media print {
  .mip-screen-back {
    display: none;
  }
}

/* Application Shell (Loop 14, SRS §III/§IV) - header + nav bar. Loop 15 fills the
   header (logo/tier/company selector), Loop 16 fills the nav (primary tabs + dropdown
   menus), Loop 17 adds the right-aligned utility icons. The modernization pass adds a
   soft shadow under the header for depth against the page below it. */
.mip-shell-header {
  background: var(--mip-header-bg);
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  gap: var(--mip-space-4);
  padding: 0 var(--mip-space-5);
  box-shadow: var(--mip-shadow-sm);
  position: relative;
  /* 28: its menus (company, favorites, user) open over the page - above the step rail (20), the status bar (25) and the form
     action bars (26), under the page popups (30+). */
  z-index: 28;
}

/* Tier branding (SRS §IV "Branding and Tier Assets") - logo mark + product name. */
.mip-tier-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--mip-space-2);
  padding: var(--mip-space-1) var(--mip-space-2);
  border-radius: var(--mip-radius-sm);
  transition: background var(--mip-transition-fast);
}

.mip-tier-badge:hover,
.mip-tier-badge:focus-within {
  background: rgba(255, 255, 255, 0.08);
}

.mip-tier-badge:hover > .mip-dropdown,
.mip-tier-badge:focus-within > .mip-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.mip-tier-badge__mark {
  height: 2.5rem;
  width: 2.5rem;
}

.mip-tier-badge__text {
  font-family: var(--mip-font-family);
  font-weight: bold;
  font-style: italic;
  /* Phase 07 Loop A (SRS §3 Typography): "Set the font size to 1.2 rem for main header
     modules (...)." This is the product-name module - was 0.95rem
     (a deliberate modernization-pass down-size from the SRS's own original 18pt token,
     per the old comment kept below in spirit); the new SRS section gives this exact
     family of header modules its own explicit 1.2rem, which now takes precedence. */
  font-size: var(--mip-font-size-nav);
  color: var(--mip-color-highlight-blue); /* #D5ECFF */
}

/* ADR-946 (QA TTS-021 GLOBAL DEFECT 019): the company as a static badge - the selector's look without its chevron or click. */
.mip-company-badge { display: inline-block; background: var(--mip-color-company-selector); color: var(--mip-color-white); font-family: var(--mip-font-family);
  font-size: var(--mip-font-size-nav); border-radius: var(--mip-radius-md); padding: var(--mip-space-2) var(--mip-space-3); white-space: nowrap; cursor: default; }

.mip-shell-header__spacer {
  flex: 1 1 auto;
}

/* Top-Right Utility Icons (SRS §IV, Loop 17): Administration gear + User Profile icon,
   sharing the tier badge's own hover-reveals-dropdown mechanism and the Universal
   Dropdown Menu styling below. Modernized with a circular hover backdrop, matching the
   tier badge's own hover treatment, so every header control feels like one family. */
.mip-utility-icons {
  display: flex;
  align-items: center;
  gap: var(--mip-space-2);
}

.mip-utility-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.mip-utility-icon:hover > .mip-dropdown,
.mip-utility-icon:focus-within > .mip-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.mip-utility-icon__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  color: var(--mip-color-highlight-blue); /* #D5ECFF - matches tier badge text color */
  cursor: pointer;
  border-radius: var(--mip-radius-pill);
  transition: background var(--mip-transition-fast), outline-color var(--mip-transition-fast);
}

.mip-utility-icon__glyph:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* "When selected, the profile icon receives a 2pt outline in #D5ECFF" (SRS §IV) - reusing
   --mip-border-width-focus, the same token the login page's own focus outline uses. */
.mip-utility-icon__glyph:hover,
.mip-utility-icon__glyph:focus-visible {
  outline: var(--mip-border-width-focus) solid var(--mip-color-highlight-blue);
  outline-offset: 2px;
}

.mip-utility-icons .mip-dropdown {
  left: auto;
  right: 0;
}

.mip-dropdown__form {
  margin: 0;
}

.mip-dropdown__item--button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.mip-shell-nav {
  background: var(--mip-color-surface);
  min-height: 3rem;
  border-bottom: 1px solid var(--mip-border-strong); /* §III: divider convention (#20476E,
    30% transparency) reused here for the nav bar's own bottom edge - the SRS doesn't
    separately specify this border, but it is the only "line" color the palette defines. */
  padding: 0 var(--mip-space-5);
  display: flex;
  align-items: center;
}

/* Primary Navigation Bar (SRS §IV "Primary Navigation Bar States") - Selected/Not
   Selected fill+text rules apply verbatim; both states share the same 20pt weight. The
   modernization pass adds a rounded-pill hover state distinct from the Selected fill,
   so a not-yet-selected tab still gives feedback on hover instead of feeling inert. */
.mip-primary-nav {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  gap: var(--mip-space-1);
}

.mip-primary-nav__item {
  position: relative;
}

.mip-primary-nav__tab {
  display: inline-block;
  padding: var(--mip-space-2) var(--mip-space-4);
  font-family: var(--mip-font-family);
  /* Phase 07 Loop A (SRS §3 Typography) - these are the Home/Sales/Procurement/
     Inventory/Treasury/Assets/Projects/Financial main header modules; see
     .mip-tier-badge__text's note above for the full rule text. */
  font-size: var(--mip-font-size-nav);
  color: var(--mip-text); /* on the light nav bar - "Not Selected" text */
  background: transparent; /* "Not Selected" fill */
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: var(--mip-radius-pill);
  transition: background var(--mip-transition-fast), color var(--mip-transition-fast);
}

.mip-primary-nav__item:not(.mip-primary-nav__item--selected):hover
  > .mip-primary-nav__tab {
  background: var(--mip-hover-bg);
}

.mip-primary-nav__item--selected > .mip-primary-nav__tab {
  background: var(--mip-selected-bg); /* #D5ECFF - "Selected" fill */
  color: var(--mip-text); /* #20476E - "Selected" text */
}

/* Universal Dropdown Menu Styling (SRS §IV) - shared by every primary tab's sub-menu,
   the tier badge's own menu, and the utility icons. Modernized: a fade + slight
   translate reveal instead of an instant display:none/block toggle, and a softer,
   larger-radius elevated card.

   Fixed a real hover bug found in review: this used to sit a `margin-top` gap below
   its trigger. `:hover` on the trigger only stays true while the pointer is over the
   trigger's own box or a descendant's box - the empty margin between them was neither,
   so moving the mouse from the tab down into the menu crossed a dead zone and the menu
   closed before you could reach it. Fixed by pinning the dropdown flush (`top: 100%`,
   no margin) so the hoverable area is contiguous, and moving the old margin's visual
   breathing room into `padding-top` instead (inside the now-contiguous box, so it no
   longer breaks the chain). A transparent `::before` bridge adds a few extra px of
   hover-safe margin above the box for users who don't move in a perfectly straight
   line. */
.mip-dropdown {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--mip-transition), transform var(--mip-transition),
    visibility 0s linear var(--mip-transition);
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  list-style: none;
  margin: 0;
  padding: var(--mip-space-3) 0 var(--mip-space-2);
  min-width: 13rem;
  background: var(--mip-surface);
  border-radius: var(--mip-radius-md);
  box-shadow: var(--mip-shadow-lg);
}

/* The right-most menus open leftwards so their (hidden or open) dropdown never extends past the
   viewport - otherwise the page scrolls sideways at tablet widths (Phase 16 Loop N). Only on a bar of four or more menus:
   myinvoiceph's Sales / Financial sit at the left edge, where opening leftwards pushed Sales' menu off the screen. */
.mip-primary-nav__item:nth-last-child(-n+2):nth-child(n+4) > .mip-dropdown {
  left: auto;
  right: 0;
}

.mip-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--mip-space-3);
}

.mip-primary-nav__item:hover > .mip-dropdown,
.mip-primary-nav__item:focus-within > .mip-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--mip-transition), transform var(--mip-transition);
}

.mip-dropdown__item {
  display: block;
  padding: var(--mip-space-2) var(--mip-space-4);
  font-family: var(--mip-font-family);
  font-size: 0.85rem; /* modernization pass - see .mip-tier-badge__text's note */
  color: var(--mip-text); /* #20476E - default item text */
  text-decoration: none;
  transition: background var(--mip-transition-fast), color var(--mip-transition-fast);
}

.mip-dropdown__item:hover {
  background: var(--mip-selected-bg); /* #D5ECFF */
  color: var(--mip-color-link-blue); /* #0078D7 */
}

.mip-shell-main {
  padding: var(--mip-space-5);
}

/* The three "System Layouts" templates (SRS §III). Base .mip-panel carries what's
   common to all three: white fill over the app background, rounded corners, auto-sized
   to content - never given a fixed height. The modernization pass swaps the flat
   0.25pt outline for a soft shadow + a hairline border (reads as "lifted card", the
   2026-modern equivalent of the SRS's own "main table container outline" intent) and
   adds a subtle entrance so panels don't just snap into place. */
.mip-panel {
  background: var(--mip-surface);
  border: 1px solid var(--mip-border-subtle);
  border-radius: var(--mip-radius-lg);
  box-shadow: var(--mip-shadow-sm);
  animation: mip-panel-in var(--mip-transition);
}

@keyframes mip-panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mip-panel--table {
  padding: var(--mip-space-5);
}

/* Wide report tables (BIR books, financial statements) scroll inside their panel on narrow
   screens instead of widening the page; printing is unaffected (Phase 16 Loop N). */
.mip-panel--table:has(> table.mip-fs-table) {
  overflow-x: auto;
}

@media print {
  .mip-panel--table:has(> table.mip-fs-table) {
    overflow: visible;
  }
}

/* "Module Entry Form": same base panel, centered, capped so it never spans an entire
   ultra-wide monitor edge-to-edge (an unbroken 2000px-wide row of fields reads worse
   than a comfortable multi-column layout, not better) but wide enough for
   .mip-form-grid's 2-column layout below to actually have room to work with - the SRS
   says only "the overall size is smaller [than a table layout]", not a specific width,
   so this picks a comfortable modern-SaaS form width rather than inventing false
   precision. Widened from the original single-column 32rem (Phase 2 Loop 6) once every
   entry form across the app adopted the grouped multi-column layout below - the old
   width forced every field into one long vertical list and forced any table with more
   than ~4 columns (e.g. Customer's Shipping Addresses) into a horizontal scrollbar. */
.mip-panel--form {
  max-width: min(94vw, 68rem);
  margin: var(--mip-space-5) auto 0;
  padding: var(--mip-space-5) var(--mip-space-6);
}

/* Groups a form's fields into a responsive multi-column layout instead of one long
   vertical list - each .mip-form-field becomes a grid cell instead of a full-width
   block, so related short fields (Code/Name/TIN, Days columns, etc.) sit side by side.
   Falls back to a single column below ~34rem (the grid gap starts to feel identical to
   the old vertical stack there anyway) rather than squeezing labels/inputs unreadably
   thin. A field that needs the full row regardless of viewport (a textarea, a table, a
   checklist) opts out via .mip-form-field--full. */
.mip-form-grid {
  display: grid;
  /* A view that needs a fixed column list sets --mip-grid-cols (e.g. a one-row filter bar,
     "auto auto auto"); everything else uses the responsive auto-fit default (ADR-195). */
  grid-template-columns: var(--mip-grid-cols, repeat(auto-fit, minmax(15rem, 1fr)));
  /* Phase 07 Loop C (SRS "Entry Form - UI Spacing": "Reduce the vertical and horizontal
     spacing between fields") - column-gap tightened from --mip-space-5, and
     .mip-form-grid > .mip-form-field's own margin-bottom (the vertical spacer) tightened
     from --mip-space-4, both one step down this file's own spacing scale rather than an
     arbitrary hand-picked px value. */
  column-gap: var(--mip-space-4);
  row-gap: 0;
}

.mip-form-grid > .mip-form-field {
  margin-bottom: var(--mip-space-3);
}

.mip-form-field--full {
  grid-column: 1 / -1;
}

/* Phase 07 Loop C (SRS "Entry Form - Defaults & Layout": "Reduce the width of the
   'Particulars' field") - Particulars previously opted out of the grid entirely via
   .mip-form-field--full (spanning the whole row). Narrowed to about half the row on wide
   viewports (still --full's own single-column full-width behavior below the grid's collapse
   breakpoint, ~34rem) rather than losing the textarea's usability entirely. */
.mip-form-field--narrow {
  grid-column: span 2;
  max-width: 32rem;
}

@media (max-width: 40rem) {
  .mip-form-field--narrow {
    grid-column: 1 / -1;
    max-width: none;
  }
}

/* Phase 07 Loop C (SRS "Entry Form - Read-Only Fields": TIN/Exchange Rate "auto-populate ...
   and be non-modifiable (Fill #E9ECF0)"). Distinct from the pre-existing :disabled treatment
   (--mip-color-surface-muted, greys out an INAPPLICABLE field) and :read-only treatment
   (transparent/borderless "plain text") immediately below - this is a field that IS
   applicable and DOES hold live data, just never hand-typed, so it keeps a normal bordered
   input look with the SRS's own exact fill color (reusing --mip-color-btn-disabled-fill,
   the Loop A token that already carries #E9ECF0 - no new hex introduced). */
.mip-form-field--auto-locked input,
.mip-form-field--auto-locked select {
  background: var(--mip-color-btn-disabled-fill);
  cursor: default;
}

/* Bare `:read-only` treatment (line ~829 below) has equal-or-higher specificity than the
   rule above and appears later in the cascade, so it silently wins for any auto-locked
   input that is ALSO marked readonly (TIN/Exchange Rate, Loop C2's own live-verification
   finding) - the #E9ECF0 fill never actually rendered. These two selectors intentionally
   out-specificity that rule (double class + :read-only) rather than reordering the
   cascade or adding !important, so future read-only-but-not-auto-locked fields elsewhere
   in the app keep their existing plain/borderless treatment unaffected. */
.mip-form-field.mip-form-field--auto-locked input:read-only,
.mip-form-field.mip-form-field--auto-locked select:read-only {
  background: var(--mip-color-btn-disabled-fill);
  border-color: transparent;
  padding-left: var(--mip-space-3);
  cursor: default;
}

/* Phase 07 Loop C (SRS "General Journal Voucher Entry Form" - "Payee Type" and "Payee" ...
   "must auto-populate based on the selected Ref No and become non-modifiable"). Radios and
   a <select> have no native `readonly` (unlike a text/number <input> above) - `disabled`
   would stop them submitting with the form, which auto-populated-FROM-Ref-No values still
   must do. `pointer-events: none` blocks user interaction while keeping the control enabled
   and submittable; applied by site.js (enhanceGeneralJournalRefNo) to the Payee Type/Payee
   fields only while a Ref No is selected, toggled off again the moment it's cleared. */
.mip-form-field--js-locked {
  background: var(--mip-color-btn-disabled-fill);
  pointer-events: none;
}

.mip-form-field--js-locked select,
.mip-form-field--js-locked input {
  background: var(--mip-color-btn-disabled-fill);
  cursor: default;
}

/* Phase 07 Loop C2 (follow-up to Loop C's own deferred "field resequencing" item) - a bare
   row-break primitive for .mip-form-grid. .mip-form-grid is display:grid with
   grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)) and no prior row concept -
   fields simply flowed and wrapped based on viewport width/DOM order. This empty marker
   spans every column (grid-column: 1 / -1, the same trick .mip-form-subheading already
   uses one line up, minus its visible border/label/spacing), which forces the CSS Grid's
   auto-placement algorithm to start the next field on a brand-new row regardless of how
   much horizontal space was left in the current one. Placed between each SRS-mandated
   field row group directly in the Razor markup (_JournalEntryForm.cshtml) so GJ/SJ/PJ each
   render their own exact Row 1/2/3 field sequence rather than an unpredictable wrap. */
.mip-form-row-break {
  grid-column: 1 / -1;
  height: 0;
  margin: 0;
  padding: 0;
}

/* One named group of related fields within a .mip-form-grid-bearing form - e.g.
   Customer's "Company Details" vs. "Contact Information" vs. "Shipping Addresses".
   Breaks a long entry form into scannable sections instead of one undifferentiated
   list, the same "grouping over length" goal .mip-tabs already serves at the
   whole-panel level (Customer's 3 tabs) - this is the same idea one level down, for a
   single tab/page that still has too many fields to read as one flat list. */
.mip-form-section + .mip-form-section {
  margin-top: var(--mip-space-6);
  padding-top: var(--mip-space-5);
  border-top: 1px solid var(--mip-border-subtle);
}

.mip-form-section__title {
  margin: 0 0 var(--mip-space-4);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mip-text);
}

/* Phase 08 Loop A (Treasury/Banking - Bank Statement Import Mapping): a plain row of
   action buttons inside a .mip-form-section (Upload Sample Statement/Reset Import
   Mapping above the grid, Save Mapping below it) - not itself a new control type, just a
   flex-row + wrap + gap convenience so those buttons don't sit flush against each
   other/the grid. */
.mip-form-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mip-space-3);
  margin-bottom: var(--mip-space-4);
}

/* Standardized Form Control Framework (Phase 2 Loop 6, master prompt §19). Covers text
   inputs, textareas, dropdowns (plain <select> and the existing searchable-dropdown
   pattern below), checkboxes, toggles, file inputs, and read-only fields - the control
   types the entry forms actually need.
   Deferred (master prompt §19 lists them, but nothing in the SRS needs one yet):
   dedicated numeric/currency/percentage inputs (plain <input type="number"> covers
   Approval Hierarchy's threshold amounts when Loop 18 gets there), date/time pickers
   (no date field exists anywhere in the Phase 2 SRS), radio groups, and multi-select
   controls. Add them when a real field needs one, not speculatively. */
.mip-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--mip-space-1);
  margin-bottom: var(--mip-space-4);
}

.mip-form-field label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--mip-text);
}

/* Phase 2 Loop 6 (Standardized Form Controls, master prompt §19-20) - REQUIRED is shown
   by marking the field itself, not by hand-adding an asterisk per label: any field whose
   control carries the native `required` attribute gets one automatically. OPTIONAL is
   simply the absence of this - no separate marker needed. */
.mip-form-field:has(:required) > label::after {
  content: " *";
  color: var(--mip-color-danger);
}

.mip-form-field input,
.mip-form-field select,
.mip-form-field textarea {
  padding: var(--mip-space-3);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  font-size: var(--mip-font-size-body);
  background: var(--mip-surface);
  transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast);
}

.mip-form-field textarea {
  resize: vertical;
  min-height: 5rem;
}

.mip-form-field input::placeholder,
.mip-form-field textarea::placeholder {
  color: var(--mip-color-text-placeholder);
}

/* A button's display:flex must not beat the hidden attribute (the BIR return pages hide
   Download / Start Amendment / Discard Draft until the return's state allows them). */
.mip-btn[hidden] {
  display: none !important;
}

/* Consistent dropdowns (client UI pass, 2026-09-27): every form and filter <select> uses the
   same custom chevron as the header's Company selector instead of each browser's native
   arrow, so dropdowns look alike across Home, Compliance and every module. */
.mip-form-field select:not([multiple]),
.mip-repeating-lines-table select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2320476e' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--mip-space-3) center;
  background-size: 1rem;
  padding-right: calc(var(--mip-space-3) + 1.5rem);
  cursor: pointer;
}

/* MIP-095 (user, 2026-11-19): every other dropdown - Home's Branch, a list's Branch filter, the import window, the Views panel,
   the record drawer's compare pickers - looks like a form dropdown too (border, rounded corners, padding, the same chevron). Zero
   specificity (:where), so a screen's own select rule (the viewer's Paper, a grid cell) still wins. */
:where(main, dialog, aside) :where(select:not([multiple]):not(.mip-visually-hidden)) {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-height: 2.5rem;
  padding: var(--mip-space-2) calc(var(--mip-space-3) + 1.5rem) var(--mip-space-2) var(--mip-space-3);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  font-size: var(--mip-font-size-body);
  color: var(--mip-text);
  background-color: var(--mip-surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2320476e' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--mip-space-3) center;
  background-size: 1rem;
  cursor: pointer;
  transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast);
}
:where(main, dialog, aside) :where(select:not([multiple]):not(.mip-visually-hidden)):focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: var(--mip-focus-ring);
}
:where(main, dialog, aside) :where(select:not([multiple]):not(.mip-visually-hidden)):disabled {
  cursor: not-allowed;
  background-color: var(--mip-color-surface-muted);
  color: var(--mip-color-text-disabled);
}

/* Without the native arrow a select is a little shorter than a text input; keep them equal. */
.mip-form-field select:not([multiple]) {
  box-sizing: border-box;
  min-height: 3.125rem;
}

.mip-form-field select:disabled {
  cursor: not-allowed;
}

.mip-form-field input:focus-visible,
.mip-form-field select:focus-visible,
.mip-form-field textarea:focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: var(--mip-focus-ring);
}

.mip-form-field input:disabled,
.mip-form-field select:disabled,
.mip-form-field textarea:disabled {
  background: var(--mip-color-surface-muted);
  color: var(--mip-color-text-disabled);
}

/* READ-ONLY is distinct from DISABLED (master prompt §20): a read-only field still
   submits with the form and still reads as live data, not a grayed-out control, so it
   gets a flat/borderless "plain text" treatment instead of the muted disabled look. */
.mip-form-field input:read-only,
.mip-form-field textarea:read-only {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  cursor: default;
}

/* LOCKED (master prompt §20) - reserved for Loop 9 (Transaction Lock & Concurrency):
   a field frozen because another user's edit is in progress, not because the field
   itself is inapplicable. Visually distinct from a plain disabled field via the lock
   affordance rather than just looking "turned off". */
.mip-form-field--locked input,
.mip-form-field--locked select,
.mip-form-field--locked textarea {
  background: var(--mip-color-surface-muted);
  border-style: dashed;
  cursor: not-allowed;
}

/* INVALID/VALID (master prompt §20) - applied by Loop 7's validation engine once it
   exists; the visual vocabulary is established here so that loop only adds classes,
   never new styling. */
.mip-form-field--invalid input,
.mip-form-field--invalid select,
.mip-form-field--invalid textarea {
  border-color: var(--mip-color-danger);
}

.mip-form-field--invalid input:focus-visible,
.mip-form-field--invalid select:focus-visible,
.mip-form-field--invalid textarea:focus-visible {
  box-shadow: var(--mip-focus-ring-danger);
}

.mip-field-error {
  color: var(--mip-color-danger);
  font-size: 0.78rem;
}

.mip-field-hint {
  color: var(--mip-color-text-muted); /* ADR-196: readable secondary text (was the placeholder grey) */
  font-size: 0.78rem;
}

/* LOADING (master prompt §20) - a field/section waiting on a server round trip. Reuses
   the same muted-and-inert look as disabled since the user shouldn't interact with it
   either way; the distinct semantic (temporary vs. permanent) is what matters for the
   class name Loop 7+ reaches for, not a different visual. */
.mip-form-field--loading input,
.mip-form-field--loading select,
.mip-form-field--loading textarea {
  background: var(--mip-color-surface-muted);
  color: var(--mip-color-text-disabled);
  cursor: progress;
}

/* Phase 4 Loop 5 (Customer Core Profile) - the first genuine multi-select field the
   codebase has needed (Payment Methods / Withholding Tax Codes, master prompt §19's own
   "add when a real field needs one" deferral from Phase 2 Loop 6). A wrapped list of
   .mip-checkbox-field items rather than a new control type - plain <input
   type="checkbox" name="X" value="id"> repeated binds straight to a List<int> with no
   custom JS. */
.mip-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mip-space-2) var(--mip-space-5);
  padding: var(--mip-space-3);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  background: var(--mip-surface);
}

/* Small helper/status text under a field - e.g. Customer Edit's read-only credit-hold
   held/released timestamps (Phase 4 Loop 5). */
.mip-field-note {
  font-size: 0.85rem;
  color: var(--mip-color-text-muted);
  margin: 0 0 var(--mip-space-2);
}

/* Pairs a .mip-toggle with its label text - deliberately not .mip-checkbox-field
   (that class's `input[type="checkbox"]` rule would win on specificity over .mip-toggle
   input's own sizing and collapse the switch down to a plain 1.1rem checkbox). */
.mip-toggle-field {
  display: flex;
  align-items: center;
  gap: var(--mip-space-2);
  font-size: 0.9rem;
  color: var(--mip-text);
}

/* Toggle switch (master prompt §19) - an alternate checkbox presentation for
   binary/Status-style fields (e.g. the Users/Company Active/Inactive field Loop 11+
   needs), built on a real <input type="checkbox"> so it keeps native form semantics -
   no custom JS, no hidden-field workaround. */
.mip-toggle {
  position: relative;
  display: inline-block;
  width: 2.4rem;
  height: 1.4rem;
  flex-shrink: 0;
}

.mip-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.mip-toggle__track {
  position: absolute;
  inset: 0;
  background: var(--mip-border);
  border-radius: var(--mip-radius-pill);
  transition: background var(--mip-transition-fast);
  pointer-events: none;
}

.mip-toggle__track::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--mip-surface);
  border-radius: 50%;
  transition: transform var(--mip-transition-fast);
}

.mip-toggle input:checked + .mip-toggle__track {
  background: var(--mip-color-success);
}

.mip-toggle input:checked + .mip-toggle__track::before {
  transform: translateX(1rem);
}

.mip-toggle input:focus-visible + .mip-toggle__track {
  outline: var(--mip-border-width-focus) solid var(--mip-color-primary-blue);
  outline-offset: 2px;
}

.mip-toggle input:disabled + .mip-toggle__track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* File input (master prompt §19) - for Profile Image/Logo fields (Loop 11+/Loop 14+).
   Just a styled native <input type="file">; no upload wiring belongs in this loop. */
.mip-form-field input[type="file"] {
  padding: var(--mip-space-2);
  background: var(--mip-color-surface);
  cursor: pointer;
}

/* Button system (modernization pass) - every shared template's Save/Create/Grant/
   Assign/Remove action used to be a bare, unstyled <button> (OS-default gray). One
   base class + three intent modifiers + one size modifier, reused verbatim by every
   admin page (Roles, UserAccess, Profile) so Phase 2 pages have one obvious button to
   reach for instead of styling their own. */
.mip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mip-space-2);
  font-family: var(--mip-font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: var(--mip-space-3) var(--mip-space-5);
  /* SRS §3 "Button width sizes must be uniform across all buttons" - a shared min-width
     so Save/Submit/Close/etc. line up on an entry-form action bar instead of each
     hugging its own label length. Deliberately modest (not a fixed width) so it doesn't
     force wrapping/overflow on narrow contexts that also use .mip-btn (table-row
     actions, pagination steps, .mip-btn--sm) - those get the same min-width but their
     shorter/icon-only labels never approach it, so they're unaffected in practice. */
  min-width: 6.5rem;
  border-radius: var(--mip-radius-sm);
  /* User feedback, live: the SRS's own literal "Outline #3640F5 (2pt)" spec for
     Secondary buttons read as too heavy/thick once seen rendered - reduced to 1px
     (the same thickness How To's own border already used before an earlier fix in
     this same pass mistakenly thickened it to 2px trying to match this rule instead
     of the other way around). A deliberate, user-directed deviation from the SRS's own
     literal point size, not a mistake - documented here since it's a real, considered
     choice overriding a written spec value. */
  border: 1px solid transparent;
  cursor: pointer;
  /* A <button> never carries a default underline, but an <a class="mip-btn"> does
     (plain browser UA stylesheet behavior) - without this reset, link-rendered buttons
     (e.g. the entry-form's own "Close") showed an underline no <button>-rendered one
     did, a real inconsistency a user caught live using the app. */
  text-decoration: none;
  transition: background var(--mip-transition-fast), border-color var(--mip-transition-fast),
    color var(--mip-transition-fast), box-shadow var(--mip-transition-fast),
    transform var(--mip-transition-fast);
}

.mip-btn:active {
  transform: translateY(1px);
}

.mip-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

/* Primary Action Buttons (Add, Save, Upload) - SRS §3. */
.mip-btn--primary {
  background: var(--mip-color-accent-blue); /* #3640F5 */
  border-color: transparent;
  color: var(--mip-color-white);
}

.mip-btn--primary:hover:not(:disabled) {
  background: var(--mip-color-btn-hover-blue); /* #5666F9 */
  box-shadow: var(--mip-shadow-sm);
}

.mip-btn--primary:active:not(:disabled) {
  background: var(--mip-color-btn-pressed-blue); /* #232AAD */
}

.mip-btn--primary:focus-visible {
  background: var(--mip-color-accent-blue);
  outline: var(--mip-border-width-focus) solid var(--mip-color-primary-blue); /* #151DA8 */
  outline-offset: 2px;
  color: var(--mip-color-white);
}

.mip-btn--primary:disabled {
  background: var(--mip-color-btn-disabled-fill); /* #E9ECF0 */
  color: var(--mip-color-text-disabled); /* #9CA2AB */
  opacity: 1;
}

/* Secondary Action Buttons (How To, ..., Close) - SRS §3. */
.mip-btn--secondary {
  background: transparent;
  color: var(--mip-action-text); /* #3640F5 */
  border-color: var(--mip-action-text);
}

.mip-btn--secondary:hover:not(:disabled) {
  background: var(--mip-color-btn-tint-hover); /* #F2F2FC */
  border-color: var(--mip-color-btn-hover-blue); /* #5666F9 */
  color: var(--mip-color-btn-hover-blue);
}

.mip-btn--secondary:active:not(:disabled) {
  background: var(--mip-color-btn-tint-pressed); /* #E8E9FC */
  border-color: var(--mip-color-btn-pressed-blue); /* #232AAD */
  color: var(--mip-color-btn-pressed-blue);
}

.mip-btn--secondary:focus-visible {
  background: transparent;
  border-color: var(--mip-color-primary-blue); /* #151DA8 */
  outline: var(--mip-border-width-focus) solid var(--mip-color-primary-blue);
  outline-offset: 2px;
  color: var(--mip-action-text);
}

.mip-btn--secondary:disabled {
  background: transparent;
  border-color: var(--mip-color-btn-disabled-fill); /* #E9ECF0 */
  color: var(--mip-color-text-disabled); /* #9CA2AB */
  opacity: 1;
}

/* Tertiary Action Buttons (How To, ..., Close) - SRS §3. Text-only, no border - distinct
   from the bordered --secondary above; unused by any live button yet (every existing
   How To/Close in this app is currently --secondary), added now so Loop B/C+ have the
   exact class ready per the SRS's own separate Tertiary row. */
.mip-btn--tertiary {
  background: transparent;
  border-color: transparent;
  color: var(--mip-action-text); /* #3640F5 */
}

.mip-btn--tertiary:hover:not(:disabled) {
  background: var(--mip-color-btn-tint-hover); /* #F2F2FC */
  color: var(--mip-color-btn-hover-blue); /* #5666F9 */
}

.mip-btn--tertiary:active:not(:disabled) {
  background: var(--mip-color-btn-tint-pressed); /* #E8E9FC */
  color: var(--mip-color-btn-pressed-blue); /* #232AAD */
}

.mip-btn--tertiary:focus-visible {
  background: transparent;
  outline: none;   /* GNRL001 #7: Tertiary focus has no outline... */
  color: var(--mip-action-text);
  /* ...so an underline marks keyboard focus instead (focus must stay visible, WCAG 2.4.7). */
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.mip-btn--tertiary:disabled {
  background: transparent;
  color: var(--mip-color-text-disabled); /* #9CA2AB */
  opacity: 1;
}

/* Phase 2 Loop 5 - a disabled pager step is a <span> (not a clickable/focusable <a>),
   styled to still read as "a button, just not this one right now". */
.mip-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Existing generic destructive-action button (Delete, Unassign, Cancel Entry, etc.) -
   left byte-for-byte unchanged. */
.mip-btn--danger {
  background: var(--mip-surface);
  color: var(--mip-color-danger);
  border-color: rgba(179, 38, 30, 0.35);
  /* Pinned back to the pre-Loop-A 1px width: the base .mip-btn border grew to 2px so
     the new SRS-spec'd variants (Secondary/Tertiary's visible 2pt outline) render at
     their exact spec width without a mismatched box size vs. the filled variants. That
     base change would otherwise also thicken this unrelated, already-live --danger
     button's outline as a side effect - explicitly reverted here to keep it visually
     byte-for-byte unchanged, per this loop's own scope decision not to touch --danger. */
  border-width: 1px;
}

.mip-btn--danger:hover:not(:disabled) {
  background: var(--mip-color-danger-tint);
  border-color: var(--mip-color-danger);
}

.mip-btn--sm {
  padding: var(--mip-space-1) var(--mip-space-3);
  font-size: 0.8rem;
  min-width: 0; /* small/icon/table-row action buttons opt back out of the base
    min-width - the uniform-width requirement applies to the module-level action-bar
    buttons (Save/Submit/Close/...), not compact in-grid controls like Unassign. */
  /* Report filter bars (Book/Report/Summary/etc., Phase 07 §11 "Generate" button)
     place this button inside a .mip-form-field, whose flex column default
     (align-items: stretch) otherwise stretches it to the field's own full column
     width (a real, user-reported bug - "Generate" rendered ~194px wide, as wide as
     the Start/End Date/Branch fields beside it). align-self opts this specific
     compact variant out of that stretch everywhere it's used, sizing it to its own
     content instead. */
  align-self: flex-start;
}

/* Report filter bars' own "Generate" button (Phase 07 §11: "reduce the width of the
   Filter button") - deliberately NOT .mip-btn--sm. A user-reported bug: .mip-btn--sm's
   own vertical padding (var(--mip-space-1), a quarter of a form input's own
   var(--mip-space-3)) made this button visibly short/stubby next to the full-height
   Start Date/End Date inputs beside it, even after alignment was fixed so the two sit
   on the same row - reducing WIDTH was the actual ask, not height. This modifier keeps
   .mip-btn--sm's own narrower horizontal padding/font-size/align-self (so the button
   still doesn't stretch to the field's own full column width) but restores the
   vertical padding to var(--mip-space-3), matching .mip-form-field input's own,
   so the button's HEIGHT matches the row it sits in. */
.mip-btn--report-generate {
  padding: var(--mip-space-3) var(--mip-space-4);
  font-size: 0.9rem;
  min-width: 0;
  align-self: flex-start;
  box-sizing: border-box;
}

/* Alerts (Loop 18's shared error partial, modernized) - a tinted card with a left
   accent bar instead of bare colored text, matching the SRS's own "container with
   fill" visual language rather than looking like a plain validation string. */
.mip-alert-error,
.mip-alert-success,
.mip-alert-warning {
  display: flex;
  align-items: center;
  gap: var(--mip-space-2);
  margin: 0 0 var(--mip-space-4);
  padding: var(--mip-space-3) var(--mip-space-4);
  border-radius: var(--mip-radius-sm);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}

.mip-alert-error {
  color: var(--mip-color-danger);
  background: var(--mip-color-danger-tint);
  border-left-color: var(--mip-color-danger);
}

.mip-alert-success {
  color: var(--mip-color-success);
  background: var(--mip-color-success-tint);
  border-left-color: var(--mip-color-success);
}

.mip-alert-error:empty,
.mip-alert-success:empty {
  display: none;
}

/* Post-Phase-6 UI/UX pass - the "locked" entry-form banner (a Submitted/Posted journal
   entry's own fields all carry the native `disabled` attribute already, but that alone
   reads as merely "grayed out"/half-loaded rather than deliberately locked - the user's
   own "is the locked state visually distinct enough" concern). Reuses the existing warning
   token (a locked-for-editing state is a notice, not an error) rather than inventing a new
   color, matching .mip-alert-error/-success's own tinted-card-with-accent-bar language. */
.mip-alert-warning {
  display: flex;
  align-items: center;
  gap: var(--mip-space-2);
  margin: 0 0 var(--mip-space-4);
  padding: var(--mip-space-3) var(--mip-space-4);
  border-radius: var(--mip-radius-sm);
  border-left: 3px solid var(--mip-color-warning);
  background: var(--mip-color-warning-tint);
  color: var(--mip-color-warning);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Universal Modal Dialog Architecture (Phase 2 Loop 8, master prompt §24-28). Built on
   the native <dialog> element - real modality (backdrop, focus trap, Escape-to-close)
   for free, no framework needed. Two presentations:
   - .mip-modal: the SRS "System Message" chrome (dark header + icon, orange close
     square, white body, light-gray footer) - used for confirmations and system
     alerts/errors, built once at runtime by site.js's MIPModal and reused for every
     call rather than one <dialog> per message.
   - .mip-dialog-panel: a plainer wrapper reusing the existing .mip-panel--form look,
     for placeholder entry-forms (Create Role) that need real modality now but will be
     rebuilt to the SRS's actual per-module mockup in Loop 11+. */
dialog.mip-modal,
dialog.mip-dialog-panel {
  padding: 0;
  border: none;
  border-radius: var(--mip-radius-lg);
  box-shadow: var(--mip-shadow-md);
  max-width: 30rem;
  width: 90vw;
  animation: mip-panel-in var(--mip-transition);
}

dialog.mip-modal::backdrop,
dialog.mip-dialog-panel::backdrop {
  background: var(--mip-overlay);
}

dialog.mip-dialog-panel {
  position: relative;
  padding: var(--mip-space-5);
}

/* Phase 6 Loop 6 (Universal Action Bar History icon) - the audit-trail table needs more
   room than the 30rem default .mip-dialog-panel width fits. */
dialog.mip-journal-history-panel {
  max-width: 48rem;
}

.mip-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mip-space-3);
  background: var(--mip-color-modal-header);
  padding: var(--mip-space-4) var(--mip-space-5);
  border-radius: var(--mip-radius-lg) var(--mip-radius-lg) 0 0;
}

.mip-modal__icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 2px solid var(--mip-color-white);
  border-radius: 50%;
  color: var(--mip-color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.mip-modal__close {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--mip-radius-sm);
  background: var(--mip-color-modal-close);
  color: var(--mip-color-white);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter var(--mip-transition-fast);
}

.mip-modal__close:hover {
  filter: brightness(1.1);
}

.mip-modal__body {
  background: var(--mip-surface);
  padding: var(--mip-space-5);
  color: var(--mip-text);
  font-size: 1rem;
  font-weight: 600;
}

.mip-modal__body p {
  margin: 0;
}

.mip-modal__list {
  margin: var(--mip-space-3) 0 0;
  padding-left: 1.25rem;
  font-weight: 400;
  font-size: 0.9rem;
}

.mip-modal__footer {
  background: var(--mip-color-modal-footer);
  padding: var(--mip-space-4) var(--mip-space-5);
  display: flex;
  justify-content: flex-end;
  gap: var(--mip-space-3);
  border-radius: 0 0 var(--mip-radius-lg) var(--mip-radius-lg);
}

/* The dialog-panel presentation reuses .mip-panel--form's own heading, so it just
   needs a close button anchored top-right of that same padded box. */
.mip-dialog-panel__close {
  position: absolute;
  top: var(--mip-space-4);
  right: var(--mip-space-4);
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: var(--mip-radius-sm);
  background: transparent;
  color: var(--mip-color-text-placeholder);
  font-size: 1rem;
  cursor: pointer;
}

.mip-dialog-panel__close:hover {
  background: var(--mip-color-surface-muted);
  color: var(--mip-text);
}

/* Reusable "Data Table" template (Loop 18, SRS §III), modernized: row separators
   instead of a full cell grid, a muted uppercase header, zebra striping, and a hover
   highlight on data rows - the contemporary "clean table" look instead of the original
   raw <table border="1"> replacement's plain ruled grid. */
.mip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--mip-font-size-body);   /* GNRL001 #5: table body text is 1rem */
}

.mip-table th,
.mip-table td {
  padding: var(--mip-space-3) var(--mip-space-4);
  text-align: left;
  border-bottom: 1px solid var(--mip-border-subtle);
}

.mip-table th {
  background: var(--mip-color-surface);
  color: var(--mip-text);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--mip-border);
}

/* Editable table-row inputs (repeating expense-itemization grids etc.) previously fell
   back to bare browser-default styling - no border radius, no focus ring, inconsistent
   padding - since .mip-form-field's own input/select/textarea rules only ever targeted
   that one wrapper class. Same visual language as .mip-form-field's own controls, just
   with tighter padding/font-size that actually fits inside a table row. */
.mip-table td input,
.mip-table td select,
.mip-table td textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  font-size: var(--mip-font-size-body);
  background: var(--mip-surface);
  transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast);
}

.mip-table td input::placeholder,
.mip-table td textarea::placeholder {
  color: var(--mip-color-text-placeholder);
}

.mip-table td input:focus-visible,
.mip-table td select:focus-visible,
.mip-table td textarea:focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: var(--mip-focus-ring);
}

.mip-table tbody tr:nth-child(even) {
  background: var(--mip-row-stripe);
}

.mip-table tbody tr:hover {
  background: var(--mip-selected-bg);
}

.mip-table tbody tr:last-child td {
  border-bottom: none;
}

.mip-table tbody tr[hidden] {
  display: none;
}

/* Standardized Data Grid alignment (Phase 2 Loop 4, SRS §14): set data-align on a <th>
   (and its matching <td>s) rather than a bespoke per-page class, so every future grid
   column - status, action, numeric/currency/date once those columns exist - follows one
   convention. Left is the unset default (names/codes/descriptions/text). */
.mip-table [data-align="center"] {
  text-align: center;
}

.mip-table [data-align="right"] {
  text-align: right;
}

/* Status badge (Phase 2 Loop 4) - replaces plain "Active"/"Disabled" text in a Status
   column. Reuses the existing success/danger tint tokens rather than inventing new
   colors for what is functionally the same active/inactive state shown elsewhere. */
.mip-badge {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  border-radius: var(--mip-radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  /* ADR-190: a badge is never plain text - neutral unless a tone says otherwise. */
  background: var(--mip-badge-neutral-bg);
  color: var(--mip-badge-neutral-text);
}

/* ADR-190: status tones (Common/StatusTone.cs maps each status to one). The text is always shown. */
.mip-badge--success { background: var(--mip-color-success-tint); color: var(--mip-color-success); }
.mip-badge--info { background: var(--mip-color-info-tint); color: var(--mip-color-info); }
.mip-badge--warning { background: var(--mip-color-warning-tint); color: var(--mip-color-warning); }
.mip-badge--danger { background: var(--mip-color-danger-tint); color: var(--mip-color-danger); }
.mip-badge--neutral { background: var(--mip-badge-neutral-bg); color: var(--mip-badge-neutral-text); }
/* ADR-796 (QA TTS-024): the Material Request's line TYPE and FULFILLMENT chips. */
.mip-badge--blue-soft { background: var(--mip-chip-blue-soft-bg); color: var(--mip-chip-blue-soft-text); }
.mip-badge--blue { background: var(--mip-chip-blue-bg); color: var(--mip-chip-blue-text); }
.mip-badge--purple-soft { background: var(--mip-chip-purple-soft-bg); color: var(--mip-chip-purple-soft-text); }
.mip-badge--purple { background: var(--mip-chip-purple-bg); color: var(--mip-chip-purple-text); }
.mip-badge--indigo-soft { background: var(--mip-chip-indigo-soft-bg); color: var(--mip-chip-indigo-soft-text); }
.mip-badge--indigo { background: var(--mip-chip-indigo-bg); color: var(--mip-chip-indigo-text); }
.mip-badge--teal { background: var(--mip-chip-teal-bg); color: var(--mip-chip-teal-text); }

/* MR DEFECT 021: the item picker / line cell - code on top, description below in muted text. */
.mip-searchable-select__option-sub { display: block; font-size: 0.75rem; color: var(--mip-color-text-muted); }
.mip-searchable-select__option .mip-badge { margin-left: var(--mip-space-1); font-size: 0.65rem; padding: 0.05rem 0.4rem; }

/* An (i) help icon in a table heading takes the heading's colours. */
.mip-table th .mip-help { background: transparent; color: inherit; border-color: currentColor; }
/* MR DEFECT 010: the list's filtered grand total stays in view. */
.mip-table tfoot.mip-table-foot--sticky th, .mip-table tfoot.mip-table-foot--sticky td { position: sticky; bottom: 0; background: var(--mip-surface-raised); border-top: 2px solid var(--mip-border); font-weight: 700; }

.mip-badge--active {
  background: var(--mip-color-success-tint);
  color: var(--mip-color-success);
}

.mip-badge--inactive {
  background: var(--mip-color-danger-tint);
  color: var(--mip-color-danger);
}

/* Grid empty state (Phase 2 Loop 4) - the genuine "zero rows returned" case, distinct
   from enhanceTable()'s "filtered to zero" pager message below. Rendered server-side so
   it's correct even with JS disabled. */
.mip-table-empty {
  padding: var(--mip-space-6) var(--mip-space-4);
  text-align: center;
  color: var(--mip-color-text-placeholder);
  font-size: 0.85rem;
}

/* Controlled horizontal scroll (SRS §84 "Grid may use controlled horizontal scrolling
   where required") instead of letting a wide grid overflow the panel or wrap awkwardly. */
.mip-table-scroll {
  overflow-x: auto;
}

.mip-table-scroll .mip-table {
  min-width: 32rem;
}

/* Repeating-lines form editor (site.js's enhanceRepeatingLines(), first built for
   Transaction Books' Account Mapping table, Phase 3 Loop 8) - a <table> of editable rows
   with an "+ Add ..." button beneath it. Wrap the table itself in .mip-table-scroll
   (below) when its column count risks overflowing the form panel, as Bank Accounts'
   6-column Check Booklets table does (Phase 3 Loop 12) - Transaction Books' own 3-column
   table never needed it. The gap here is what previously came from nothing but browser
   default table margins, which read as cramped once a scroll wrapper and taller button
   row are in the mix. */
.mip-repeating-lines-table {
  margin-bottom: var(--mip-space-3);
  table-layout: fixed;
}

/* The line-editor's own inputs were plain unstyled <input>s - fine when the table
   fit in the old 32rem panel by accident, but visually inconsistent with every other
   control on the page once .mip-panel--form widened. Compact rather than the full
   .mip-form-field padding (a table row of them needs to stay a table row, not grow
   into a stack of cards), and width:100% so each column uses exactly the space
   table-layout:fixed already gave it - the reason a wide .mip-panel--form no longer
   needs .mip-table-scroll's horizontal scrollbar for a 7-8 column line table like
   Customer's Shipping Addresses. */
.mip-repeating-lines-table input,
.mip-repeating-lines-table select {
  width: 100%;
  padding: var(--mip-space-2);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  font-size: var(--mip-font-size-body);
  background: var(--mip-surface);
}

.mip-repeating-lines-table input:focus-visible,
.mip-repeating-lines-table select:focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: 0 0 0 2px rgba(21, 29, 168, 0.15);
}

[data-mip-repeating-lines] [data-mip-add-line] {
  margin-top: var(--mip-space-2);
  margin-bottom: var(--mip-space-4);
}

[data-mip-repeating-lines] .mip-table td[data-align="center"] [data-mip-remove-line] {
  white-space: nowrap;
}

/* Phase 6 Loop 5 (Universal Journal Entry Form/Grid) - the Accounting Entries Grid's live
   Total Debit/Total Credit/Difference footer row (site.js's enhanceAccountingEntriesGrid).
   Reuses the existing success/danger tint tokens for "balanced"/"out of balance" rather
   than inventing new colors for what is functionally the same good/bad state shown
   elsewhere (Phase 2 Loop 4's own Status badge). */

[data-mip-entries-difference] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mip-color-danger);
  background: var(--mip-color-danger-tint);
}

[data-mip-entries-difference]::before {
  content: "\26A0";
}

/* Phase 6 Loop 5 - both the payee-picker panels (.mip-form-field's own `display: flex`)
   and the difference tag above (`display: inline-block`) are author rules with the same
   specificity as the UA [hidden] rule, so author wins regardless of source order and
   [hidden] alone silently does nothing on either. These two compound selectors restore
   [hidden]'s effect by out-specificity-ing the plain-class/attribute rule above, rather
   than reaching for !important. */
/* MIP-099: !important after all - the field layouts below outrank this selector
   (.mip-form-field:has(> label + .mip-help) is 0,2,1), so since every field got its (i) (MIP-095) a hidden field showed:
   Privilege / ID No and the child's fields with no Statutory Category, and the like on every screen. */
.mip-form-field[hidden] {
  display: none !important;
}

[data-mip-entries-difference][hidden] {
  display: none;
}

/* Interactive Data Table pattern (progressive enhancement via wwwroot/js/site.js's
   enhanceTable()) - filter + client-side pagination, generic over any table's column
   shape. Wrap a .mip-table in <div class="mip-table-wrap" data-mip-table
   data-page-size="10"> and the toolbar/pager below are injected automatically; with no
   JS, the wrapped table still renders and works, just unfiltered/unpaginated. This is
   the reusable pattern future Phase 2 list pages should build on rather than each
   inventing their own filter/pagination markup. */
.mip-table-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--mip-space-3);
}

.mip-table-toolbar__filter {
  flex: 0 1 18rem;
  padding: var(--mip-space-2) var(--mip-space-3);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  font-size: 0.85rem;
  background: var(--mip-surface)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2320476e' stroke-width='1.6'><circle cx='8.5' cy='8.5' r='5.5'/><line x1='16' y1='16' x2='12.6' y2='12.6' stroke-linecap='round'/></svg>")
    no-repeat left var(--mip-space-2) center;
  background-size: 1rem;
  padding-left: var(--mip-space-6);
  transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast);
}

.mip-table-toolbar__filter:focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: var(--mip-focus-ring);
}

.mip-table-pager {
  display: flex;
  align-items: center;
  gap: var(--mip-space-3);
}

.mip-table-pager__info {
  font-size: 0.78rem;
  color: var(--mip-color-text-muted); /* ADR-196: readable secondary text (was the placeholder grey) */
}

.mip-table-pager__empty {
  font-size: 0.85rem;
  color: var(--mip-color-text-placeholder);
  margin: 0;
  padding: var(--mip-space-4) 0;
  text-align: center;
}

/* Searchable Dropdown pattern (progressive enhancement via site.js's
   enhanceSearchableSelect()) - a type-to-filter combobox layered over a real <select>
   (kept in the DOM, visually hidden, still submitted with the form) so it degrades to
   an ordinary dropdown with no JS. Mark any <select> with data-mip-searchable to opt
   in - this is the reusable pattern for Phase 2's inevitable long option lists
   (customers, items, accounts, ...), first proven here on the 49-entry Feature picker. */
.mip-searchable-select {
  position: relative;
}

/* MIP-095 (QA TTS-036 Cycle 8 CIS 072): the searchable multi-select dropdown (multiselect.js) - chips in a field the size of a select,
   a panel with a search box and one checkbox per option. Theme tokens only. */
.mip-multiselect { position: relative; }
.mip-multiselect__control {
  display: flex; align-items: center; gap: var(--mip-space-2); min-height: 2.6rem; padding: 0.3rem var(--mip-space-3);
  border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface); cursor: pointer;
}
.mip-multiselect__control:focus-visible { outline: none; border-color: var(--mip-color-primary-blue); box-shadow: var(--mip-focus-ring); }
.mip-multiselect__chips { display: flex; flex-wrap: wrap; gap: 0.3rem; flex: 1 1 auto; min-width: 0; }
.mip-multiselect__placeholder { color: var(--mip-color-text-muted); }
.mip-multiselect__chip {
  display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; padding: 0.1rem 0.25rem 0.1rem 0.55rem; border-radius: 999px;
  background: var(--mip-bg-subtle, var(--mip-color-surface-muted)); border: 1px solid var(--mip-border); font-size: 0.85rem; color: var(--mip-text);
}
.mip-multiselect__chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mip-multiselect__chip-remove { border: 0; background: none; color: var(--mip-color-text-muted); cursor: pointer; padding: 0 0.2rem; font-size: 0.75rem; line-height: 1; }
.mip-multiselect__chip-remove:hover { color: var(--mip-color-danger); }
/* MIP-117 (QA TTS-036 Cycle 12 CIS 104): a list the page fills (the item's Privilege Discount, from its Item Class) - read only. */
.mip-multiselect--locked .mip-multiselect__control { background: var(--mip-color-btn-disabled-fill); cursor: not-allowed; }
.mip-multiselect__caret { flex: 0 0 auto; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--mip-color-text-muted); }
.mip-multiselect__panel {
  position: absolute; z-index: 30; top: calc(100% + 2px); left: 0; right: 0; padding: var(--mip-space-2); border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm); background: var(--mip-surface-raised, var(--mip-surface)); box-shadow: var(--mip-shadow-lg);
}
.mip-multiselect__search { width: 100%; padding: var(--mip-space-2); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface); font-size: 0.95rem; }
.mip-multiselect__list { max-height: 15rem; overflow-y: auto; margin-top: var(--mip-space-2); }
.mip-multiselect__group { padding: 0.35rem 0.3rem 0.15rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--mip-color-text-muted); }
.mip-multiselect__option { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.3rem; border-radius: var(--mip-radius-sm); cursor: pointer; color: var(--mip-text); }
.mip-multiselect__option:hover { background: var(--mip-hover-bg); }
.mip-multiselect__option[hidden], .mip-multiselect__group[hidden], .mip-multiselect__empty[hidden] { display: none; }
.mip-multiselect__panel[hidden] { display: none !important; }   /* a form-field rule lays its divs out as flex */
.mip-multiselect__panel:not([hidden]) { display: block !important; }
.mip-multiselect__empty { margin: var(--mip-space-2) 0 0; font-size: 0.85rem; color: var(--mip-color-text-muted); }

.mip-searchable-select__input {
  width: 100%;
  padding: var(--mip-space-3);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  /* Matches .mip-form-field select's own 1rem (not this component's original 0.85rem) -
     a plain <select> and a searchable one sitting in adjacent fields on the same form
     (e.g. Bank Accounts' Currency next to its Linked Account, Phase 3 Loop 12) must read
     as the same control family, not two different sizes. */
  font-size: 1rem;
  background: var(--mip-surface);
  transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast);
}

.mip-searchable-select__input:focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: var(--mip-focus-ring);
}

/* MIP-116 (QA TTS-036 Cycle 11 CIS 096): a searchable dropdown looks like one - a chevron on the right and a hover state - so "Select an
   item..." in the invoice grid no longer reads as a plain text box. The chevron is a neutral grey that reads on both themes. */
.mip-searchable-select__input:not(:disabled) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%237b8794' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 0.75rem;
  padding-right: 2rem;
  cursor: pointer;
}
.mip-searchable-select__input:not(:disabled):hover { border-color: var(--mip-color-primary-blue); }
.mip-searchable-select__input:not(:disabled):focus { cursor: text; }

/* enhanceSearchableSelect (site.js) mirrors the real, hidden <select>'s own disabled
   state onto this visible proxy input - without this rule the proxy looked and acted
   fully editable even when the underlying select was disabled (a real, user-reported
   bug on a locked/Posted entry's ATC Code field: the dropdown looked clickable/typable
   but the selection could never actually submit). Matches the plain
   .mip-form-field input:disabled treatment used everywhere else in this app. */
.mip-searchable-select__input:disabled {
  background: var(--mip-color-surface-muted);
  color: var(--mip-color-text-disabled);
  cursor: not-allowed;
}

.mip-searchable-select__list {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  margin: var(--mip-space-1) 0 0;
  padding: var(--mip-space-1) 0;
  max-height: 14rem;
  overflow-y: auto;
  list-style: none;
  background: var(--mip-surface);
  border-radius: var(--mip-radius-sm);
  box-shadow: var(--mip-shadow-lg);
}

.mip-searchable-select__option {
  padding: var(--mip-space-2) var(--mip-space-3);
  font-size: 0.85rem;
  color: var(--mip-text);
  cursor: pointer;
}

.mip-searchable-select__option--active {
  background: var(--mip-selected-bg);
  color: var(--mip-color-link-blue);
}

.mip-searchable-select__empty {
  padding: var(--mip-space-2) var(--mip-space-3);
  font-size: 0.85rem;
  color: var(--mip-color-text-placeholder);
}

/* Phase 2 Loop 2 (Administration Navigation & Tab Framework, SRS §I). Colors are the
   SRS's literal spec (#0078D7 active tab/link, #1C61A1 active-tab underline, #D5ECFF
   active-subnav fill - all colors already in the palette from Phase 1, reused
   here). Type sizes are NOT the SRS's literal 20pt - matching the same deliberate
   density reduction the rest of the shell chrome already went through (see
   .mip-primary-nav__tab's own note); the SRS's literal size reads oversized against
   the shell this now lives inside. */
.mip-admin-header {
  display: flex;
  align-items: baseline;
  gap: var(--mip-space-5);
  padding: var(--mip-space-4) var(--mip-space-5) 0;
}

.mip-admin-header__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--mip-text);
}

.mip-admin-tabs {
  display: flex;
  gap: var(--mip-space-5);
}

.mip-admin-tab {
  padding-bottom: var(--mip-space-2);
  font-size: 0.9rem;
  color: var(--mip-text); /* #20476E */
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--mip-transition-fast), border-color var(--mip-transition-fast);
}

.mip-admin-tab:hover {
  color: var(--mip-color-link-blue); /* #0078D7 */
}

.mip-admin-tab--active {
  color: var(--mip-color-link-blue); /* #0078D7 */
  border-bottom-color: var(--mip-color-company-selector); /* #1C61A1 */
}

.mip-admin-body {
  display: flex;
  align-items: flex-start;
  gap: var(--mip-space-5);
  padding: var(--mip-space-4) var(--mip-space-5) var(--mip-space-5);
}

.mip-admin-subnav {
  display: flex;
  flex-direction: column;
  flex: 0 0 12rem;
  gap: var(--mip-space-1);
}

.mip-admin-subnav__item {
  padding: var(--mip-space-2) var(--mip-space-3);
  border-radius: var(--mip-radius-sm);
  font-size: 0.85rem;
  color: var(--mip-text); /* #20476E */
  text-decoration: none;
  transition: background var(--mip-transition-fast), color var(--mip-transition-fast);
}

.mip-admin-subnav__item:hover {
  background: var(--mip-selected-bg-hover);
}

.mip-admin-subnav__item--active {
  color: var(--mip-color-link-blue); /* #0078D7 */
  background: var(--mip-selected-bg); /* #D5ECFF */
  font-weight: 600;
}

.mip-admin-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Reusable Action Bar (Phase 2 Loop 3, SRS §I "Action Buttons & Search") - one bar every
   Administration list page composes via Views/Shared/_ActionBar.cshtml, rather than each
   page inventing its own button row (Loop 13's ad hoc "Create Role"/"Manage Roles"
   buttons are what this replaces). Colors are the SRS's exact hex; sizing follows the
   same density the rest of the modernized shell already uses, not the SRS's literal
   inch/pt values (same reasoning as .mip-admin-tab). */
.mip-action-bar {
  display: flex;
  align-items: center;
  gap: var(--mip-space-3);
  margin-bottom: var(--mip-space-4);
}

.mip-action-bar__spacer {
  flex: 1 1 auto;
}

/* Phase 2 Loop 5 - the search field is now a real GET form (server-side search), but
   it must still lay out as a plain flex item of .mip-action-bar, not a block that
   pushes everything else onto its own line. */
.mip-action-bar__search-form {
  display: contents;
}

.mip-action-bar__search {
  flex: 0 1 16rem;
  padding: var(--mip-space-2) var(--mip-space-3) var(--mip-space-2) var(--mip-space-6);
  border: 1px solid var(--mip-color-company-selector); /* #1C61A1 per SRS */
  border-radius: var(--mip-radius-pill);
  font-family: var(--mip-font-family);
  font-size: 0.85rem;
  background: var(--mip-surface)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%231c61a1' stroke-width='1.6'><circle cx='8.5' cy='8.5' r='5.5'/><line x1='16' y1='16' x2='12.6' y2='12.6' stroke-linecap='round'/></svg>")
    no-repeat left var(--mip-space-2) center;
  background-size: 1rem;
  transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast);
}

/* Post-Phase-17 filter-bar alignment: the search box takes the row's height, so it lines up
   with Add / How To / the overflow button (38px) instead of sitting 8px shorter between them. */
.mip-action-bar__search {
  box-sizing: border-box;
  align-self: stretch;
}

.mip-action-bar__search:focus-visible {
  outline: none;
  border-color: var(--mip-color-primary-blue);
  box-shadow: var(--mip-focus-ring);
}

.mip-action-bar__add {
  /* Padding/border-box now match .mip-btn--primary/.mip-action-bar__howto/__overflow's
     own height exactly (a 1px transparent border keeps the same box height as their own
     real 1px border, even though this control has no visible outline) - this sat at 29px
     next to How To/overflow's own now-39.5px on the exact same toolbar row, a user-
     reported inconsistency. Color deliberately left unchanged (--mip-color-action-red)
     - unlike How To/overflow, this class is shared app-wide (every module's own "Add"
     button, not just Financial Ledger's new Phase 07 screens), so recoloring it is a much
     bigger blast radius than what was actually asked for here; a real Reject-red-collision
     concern for a FUTURE loop to weigh deliberately, not a height-consistency fix. Border
     width matches .mip-btn's own 1px (a later user-directed reduction from the SRS's
     literal 2pt spec - see .mip-btn's own comment). */
  padding: var(--mip-space-3) var(--mip-space-5);
  border: 1px solid transparent;
  box-sizing: border-box;
  border-radius: var(--mip-radius-sm);
  background: var(--mip-color-action-red);
  color: var(--mip-color-white);
  font-family: var(--mip-font-family);
  font-size: 0.95rem; /* ADR-198: the same label size as .mip-btn */
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--mip-transition-fast);
}

.mip-action-bar__add:hover:not(:disabled) {
  filter: brightness(1.08);
}

.mip-action-bar__add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Phase 2 Loop 15 - the Href variant (navigates to a full page instead of revealing a
   same-page panel/dialog) is an <a>/<span>, not a <button>, so it needs its own
   display/decoration + disabled-state rule instead of relying on :disabled. */
.mip-action-bar__add--link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

span.mip-action-bar__add--link {
  opacity: 0.5;
  cursor: not-allowed;
}

.mip-action-bar__howto {
  /* Padding now matches .mip-btn--secondary's own exactly (var(--mip-space-3)
     vertical) - a user-reported inconsistency: this control used to sit at 31px tall
     next to Save/Submit/Close's own 39.5px. Border width stays 1px, matching
     .mip-btn's own (a later user-directed reduction from the SRS's literal 2pt spec
     - see .mip-btn's own comment; an earlier pass in this same session mistakenly
     thickened this rule to 2px, the wrong direction - corrected here). */
  padding: var(--mip-space-3) var(--mip-space-5);
  /* Was --mip-color-action-red (#C32F2F) - a leftover from before Phase 07 Loop A
     gave that exact hex a new, real meaning ("Reject"/danger). A neutral help icon
     and this overflow trigger reading in the same red as a real Reject button read
     as alarming/inconsistent once both existed on the same action bar (a user-
     reported issue) - moved to the same neutral blue every other secondary/tertiary
     action in this app already uses. */
  border: 1px solid var(--mip-action-text);
  border-radius: var(--mip-radius-sm);
  color: var(--mip-action-text);
  font-family: var(--mip-font-family);
  font-size: 0.95rem; /* ADR-198: the same label size as .mip-btn */
  font-weight: 600;
  box-sizing: border-box;
}

.mip-action-bar__overflow-wrap {
  position: relative;
  display: flex;
}

.mip-action-bar__overflow {
  width: 2.25rem;
  /* Padding/line-height now match .mip-action-bar__howto/.mip-btn--secondary's own
     exactly - a user-reported inconsistency: this trigger used to sit at 28px tall
     (line-height: 1 cropped it even shorter than howto's own height at the time),
     visibly the odd one out next to Save/Submit/Close/How To. Border stays 1px,
     matching .mip-btn's own (a later user-directed reduction from the SRS's literal
     2pt spec - see .mip-btn's own comment). */
  padding: var(--mip-space-3) 0;
  box-sizing: border-box;
  /* Same "no longer meant as danger-red" fix as .mip-action-bar__howto above. */
  border: 1px solid var(--mip-action-text);
  border-radius: var(--mip-radius-sm);
  background: none;
  color: var(--mip-action-text);
  font-size: 1rem;
  /* Explicit px, not "normal" - "normal" resolves to a slightly different line box at
     this control's own 1rem than .mip-btn--primary/secondary's 0.95rem does, which
     was still leaving this one 1px shorter than the other 3 action-bar buttons after
     matching their padding/border. 16px is what .mip-btn--primary's own "normal"
     line-height actually measures as - pinned here so the match holds regardless of
     either control's own font-size. */
  line-height: 16px;
  cursor: pointer;
  transition: background var(--mip-transition-fast);
}

.mip-action-bar__overflow:hover {
  background: var(--mip-color-btn-tint-hover);
}

.mip-action-bar__overflow-wrap:hover > .mip-dropdown,
.mip-action-bar__overflow-wrap:focus-within > .mip-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.mip-action-bar__overflow-menu {
  right: 0;
  left: auto;
}

.mip-dropdown__item--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mip-dropdown__item--disabled:hover {
  background: none;
  color: var(--mip-text);
}

/* Phase 2 Loop 10 - a real <button disabled> (the "requires selection" overflow items),
   distinct from the always-inert .mip-dropdown__item--disabled <span> above. */
.mip-dropdown__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mip-dropdown__item:disabled:hover {
  background: none;
  color: var(--mip-text);
}

/* Post-Phase-6 UI/UX pass - the entry-form action bar's own Delete/Cancel Entry overflow
   items are destructive (delete a Draft permanently / cancel a Submitted-or-Posted entry's
   own lifecycle) but previously looked identical to Copy/Recurring/Refresh - the user's
   own "is the action bar's destructive weighting clear" concern. Text-color-only (not a
   filled background) so it still reads as "a menu item", just visually flagged, the same
   restraint .mip-btn--danger already applies to its own outlined (not filled) button. */
.mip-dropdown__item--danger {
  color: var(--mip-color-danger);
}

.mip-dropdown__item--danger:hover {
  background: var(--mip-color-danger-tint);
  color: var(--mip-color-danger);
}

/* Phase 6 Loop 6 (Universal Action Bar) - the entry-form's own action bar reuses every
   .mip-action-bar/.mip-dropdown class above verbatim (same overflow menu component, no
   fork); this is only the new History icon button. */
.mip-journal-action-bar {
  margin-bottom: var(--mip-space-4);
}

.mip-action-bar__history {
  /* ADR-480: the one Timeline button of every record screen (the General Journal's), last in the action group. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--mip-color-border);
  border-radius: var(--mip-radius-sm);
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--mip-transition-fast);
}

.mip-action-bar__history:hover {
  background: var(--mip-color-surface-muted);
}

/* Phase 10 Loop F/G UI/UX pass - the Remove/Attach Receipt controls in a repeating
   expense-itemization row (Fund Liquidations, and any future per-line grid that follows
   the same pattern) used full-width text buttons that made every row a different height
   and ate most of the row's own horizontal space. Same fixed-square icon-button treatment
   as .mip-action-bar__history above, so both controls read as compact row-level actions
   rather than competing with the row's own data fields for width. */
.mip-line-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--mip-color-border);
  border-radius: var(--mip-radius-sm);
  background: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--mip-transition-fast), border-color var(--mip-transition-fast);
}

.mip-line-icon-btn:hover {
  background: var(--mip-color-surface-muted);
}

.mip-line-icon-btn--danger:hover {
  border-color: var(--mip-color-danger, #d92d20);
  color: var(--mip-color-danger, #d92d20);
}

.mip-tabs__tab--active {
  color: var(--mip-text);
  border-bottom-color: #0078d7;
}

/* Phase 4 Loop 9 (Customer Master List report, ADR-039) - the first print view in the
   codebase. A browser-native print (window.print() against @media print rules), not a
   reporting library - see ADR-039 for why. .mip-col-hidden is a plain (non-media) rule:
   toggling a report column hides it from the on-screen preview AND the print output
   identically, since print renders the same live DOM - there's no separate print-only
   markup to keep in sync. .mip-print-only is the opposite: content that exists only for
   the printed page (the header/footer block matching the SRS's own typography spec),
   hidden on screen and revealed only inside @media print. */
.mip-col-hidden {
  display: none !important;
}

/* On-screen-only report controls (search + column checklist + Print) - a lighter-weight
   sibling of .mip-action-bar for report pages that have no Add/Delete/overflow menu,
   just the column-selection toolbar the SRS's own "user-selectable columns" asks for. */
.mip-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  /* Top-aligned: the filter fields and the export/print group both start with a label row,
     so their controls share one line even when a date hint sits under an input. */
  align-items: flex-start;
  gap: var(--mip-space-3);
  margin-bottom: var(--mip-space-4);
}

/* Filter columns keep their content width (auto tracks would otherwise stretch to fill the
   row and push the Generate/Open button away from the fields it applies). */
.mip-report-toolbar > .mip-form-grid {
  justify-content: start;
}

.mip-report-toolbar__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mip-space-3);
}

/* Toolbar buttons are exactly as tall as the inputs and dropdowns beside them. */
.mip-report-toolbar .mip-form-field input {
  box-sizing: border-box;
  min-height: 3.125rem;
}

.mip-report-toolbar .mip-btn {
  box-sizing: border-box;
  min-height: 3.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mip-report-toolbar .mip-checklist {
  flex: 1 1 auto;
}

.mip-print-only {
  display: none;
}

.mip-print-header {
  text-align: center;
  margin-bottom: var(--mip-space-4);
}

.mip-print-header__title {
  font-size: 12pt;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mip-text);
}

@media print {
  .mip-shell-header,
  .mip-shell-nav,
  .mip-admin-header,
  .mip-admin-subnav,
  .mip-back-link,
  .mip-report-toolbar,
  .mip-field-note {
    display: none !important;
  }

  .mip-print-only {
    display: block;
  }

  body {
    background: var(--mip-surface);
  }

  .mip-panel {
    box-shadow: none;
    border: none;
  }

  @page {
    size: A4 landscape;
    margin: 12mm;
  }
}

/* Phase 13 (Financial / Audit) - SRS 3a Action Taken badges (Green = Create, Blue = Edit,
   Red = Delete), severity tags, the SRS 3c high-contrast "Critical" row, and the drill-down
   side drawer. Severity is data on the row; these classes are only its presentation. */
.mip-audit-badge { display: inline-block; padding: 0.12rem 0.55rem; border-radius: var(--mip-radius-sm); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; background: var(--mip-badge-neutral-bg); color: var(--mip-badge-neutral-text); }
.mip-audit-badge--create { background: var(--mip-color-success-tint); color: var(--mip-color-success); }
.mip-audit-badge--edit { background: var(--mip-color-btn-tint-hover); color: var(--mip-color-primary-blue); }
.mip-audit-badge--delete { background: var(--mip-color-danger-tint); color: var(--mip-color-danger); }
.mip-audit-badge--login, .mip-audit-badge--logout, .mip-audit-badge--view { background: var(--mip-badge-neutral-bg); color: var(--mip-badge-neutral-text); }
.mip-audit-badge--low { background: var(--mip-badge-neutral-bg); color: var(--mip-badge-neutral-text); }
.mip-audit-badge--medium { background: var(--mip-color-warning-tint); color: var(--mip-color-warning); }
.mip-audit-badge--high { background: var(--mip-color-danger-tint); color: var(--mip-color-danger); }
.mip-audit-badge--critical { background: #ffffff; color: #7a1712; border: 2px solid #ffffff; }
.mip-table tr.mip-audit-row--critical > td { background: #7a1712; color: #ffffff; font-weight: 700; border-color: #5c100c; }
.mip-table tr.mip-audit-row--critical > td:first-child { box-shadow: inset 6px 0 0 #ffd400; }
.mip-table tr.mip-audit-row--critical a { color: #ffffff; text-decoration: underline; }
/* Post-Phase-17 filter-bar alignment: top-aligned so the MM-DD-YYYY hint under a date input
   never lifts it above the dropdowns beside it (bottom alignment did); one wrapping row; inputs,
   dropdowns and buttons share one height. */
.mip-audit-filters { display: flex; flex-wrap: wrap; gap: var(--mip-space-3); align-items: flex-start; margin-bottom: var(--mip-space-3); }
.mip-audit-filters > .mip-form-field { flex: 0 1 11rem; min-width: 9rem; margin-bottom: 0; }
.mip-audit-filters > .mip-audit-filters__actions { flex: 0 0 auto; min-width: 0; }
.mip-audit-filters__buttons { display: flex; gap: var(--mip-space-2); }
@media (max-width: 480px) { .mip-bir-body .mip-audit-filters > .mip-form-field { flex: 1 1 100%; } }   /* MIP-105: phone width */
.mip-audit-filters input, .mip-audit-filters select, .mip-audit-filters .mip-btn { box-sizing: border-box; min-height: 3.125rem; }
.mip-audit-filters .mip-btn { display: inline-flex; align-items: center; justify-content: center; }
.mip-audit-value { white-space: pre-wrap; word-break: break-word; }
.mip-audit-row-link { background: none; border: 0; padding: 0; color: var(--mip-action-text); cursor: pointer; font: inherit; text-decoration: underline; }
.mip-audit-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--mip-surface-raised); color: var(--mip-text); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18); z-index: 1200; display: flex; flex-direction: column; }
.mip-audit-drawer[hidden] { display: none; }
.mip-audit-drawer__head { display: flex; justify-content: space-between; align-items: center; padding: var(--mip-space-3) var(--mip-space-4); border-bottom: 1px solid var(--mip-border-subtle); }
.mip-audit-drawer__body { overflow: auto; padding: var(--mip-space-4); }
.mip-audit-drawer dl { display: grid; grid-template-columns: 140px 1fr; gap: 0.25rem 0.75rem; margin: 0 0 var(--mip-space-4); font-size: 0.85rem; }
.mip-audit-drawer dt { color: var(--mip-color-text-muted); }
.mip-audit-drawer dd { margin: 0; word-break: break-word; }
.mip-audit-drawer pre { background: var(--mip-bg-subtle); border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-sm); padding: var(--mip-space-3); font-size: 0.78rem; white-space: pre-wrap; word-break: break-word; }

/* Phase 14-15 (ADR-125): the shared import wizard (import.js). Same modal chrome as every
   system message (SRS P15 §5 header #102338 / body #FFFFFF / footer #F0F0F0), widened for
   the staging grid. SRS P15 §4.2 alignment: checkbox, row no, key, reference and status
   centred; entity, account and details left; amounts right. Badges carry text, not only
   colour. */
dialog.mip-import {
  width: min(1200px, 96vw);
  max-width: 96vw;
}

.mip-import .mip-modal__header {
  gap: var(--mip-space-3);
}

.mip-import__title {
  color: var(--mip-color-white);
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
}

.mip-import__body {
  font-weight: 400;
  max-height: 70vh;
  overflow: auto;
}

.mip-import__lead {
  margin-bottom: var(--mip-space-3) !important;
}

.mip-import__file-label {
  display: flex;
  gap: var(--mip-space-3);
  align-items: center;
  margin: var(--mip-space-3) 0;
  font-weight: 600;
}

.mip-import__howto {
  margin-top: var(--mip-space-4);
  font-size: 0.85rem;
}

.mip-import__howto p {
  margin-bottom: var(--mip-space-3) !important;
}

.mip-import__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--mip-space-3);
  margin-bottom: var(--mip-space-3);
  flex-wrap: wrap;
}

.mip-import__summary {
  display: flex;
  gap: var(--mip-space-4);
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 600;
}

.mip-import__ok { color: var(--mip-color-success); }
.mip-import__bad { color: var(--mip-color-danger); }

.mip-import__grid .mip-table { font-size: 0.8rem; }
.mip-import__grid td, .mip-import__grid th { vertical-align: middle; }
.mip-import__c { text-align: center; }

.mip-import__row--blocked td { background: var(--mip-row-blocked); }

.mip-import__messages {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.78rem;
  color: var(--mip-color-danger);
}

.mip-import__messages .mip-import__warn { color: var(--mip-color-warning); }

.mip-import__pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--mip-space-3);
  margin-top: var(--mip-space-3);
  font-size: 0.8rem;
}

.mip-import-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--mip-radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.mip-import-badge--valid, .mip-import-badge--imported { background: var(--mip-color-success-tint); color: var(--mip-color-success); }
.mip-import-badge--warning, .mip-import-badge--skipped { background: var(--mip-color-warning-tint); color: var(--mip-color-warning); }
.mip-import-badge--unbalanced, .mip-import-badge--invalid-account, .mip-import-badge--duplicate,
.mip-import-badge--invalid, .mip-import-badge--failed { background: var(--mip-color-danger-tint); color: var(--mip-color-danger); }

/* Phase 15 Dynamic Column Mapper (SRS P15 §4.1): preset + row indexes, then one row per myinvoiceph
   target field - source header dropdown (+ date format), default fallback value, live sample. */
.mip-import__mapper-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mip-space-4);
  align-items: flex-end;
  margin-bottom: var(--mip-space-4);
  font-size: 0.85rem;
  font-weight: 600;
}

.mip-import__mapper-controls label {
  display: flex;
  flex-direction: column;
  gap: var(--mip-space-2);
}

.mip-import__mapper-controls input[type="number"], .mip-import__mapper-controls input[data-mip-numeric] { width: 6rem; }
.mip-import__grid select, .mip-import__grid input[type="text"] { max-width: 16rem; width: 100%; }
.mip-import__grid td > select + select { margin-top: var(--mip-space-2); }
.mip-import__sample { color: var(--mip-color-text-placeholder); font-style: italic; }

/* Phase 17 Loop I (ADR-171, SRS 1.3 / 3.1): the SRS typography - Aptos 1.2 rem bold headers;
   1 rem body, grids and buttons (Primary / Approve / Reject / Generate bold, Secondary regular).
   Report prints keep their own point sizes (mip-fs-*, 9-12 pt). */
h1,
h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.mip-table,
.mip-table th {
  font-size: 1rem;
}

.mip-btn,
.mip-btn--report-generate {
  font-size: 1rem;
}

.mip-btn--primary,
.mip-btn--danger {
  font-weight: 700;
}

.mip-btn--secondary {
  font-weight: 400;
}

/* Post-Phase-17 (ADR-175): modules with no screen yet - visible so the roadmap reads, but
   greyed out and not clickable. */
.mip-dropdown__item--disabled,
.mip-dropdown__item--disabled:hover {
  color: var(--mip-color-text-placeholder);
  background: none;
  cursor: not-allowed;
}

.mip-primary-nav__tab--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Post-Phase-17 (ADR-175): a module tab / sub-item with no screen yet renders with no href. */
a.mip-admin-tab:not([href]),
a.mip-admin-subnav__item:not([href]),
a.mip-treasury-tab:not([href]),
a.mip-dropdown__item:not([href]),
a.mip-dropdown__item:not([href]):hover {
  background: none;
  color: var(--mip-color-text-placeholder);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Post-Phase-17 (ADR-182): How To drawer content (the drawer itself is the Audit drawer). */
.mip-action-bar__howto { background: none; cursor: pointer; }
.mip-howto__purpose { margin: 0 0 var(--mip-space-3); }
.mip-howto__heading { margin: var(--mip-space-4) 0 var(--mip-space-2); font-size: 1rem; }
.mip-howto__steps, .mip-howto__tips { margin: 0; padding-left: 1.4rem; }
.mip-howto__steps li, .mip-howto__tips li { margin-bottom: var(--mip-space-2); }
.mip-howto__sample { display: grid; grid-template-columns: 150px 1fr; gap: 0.3rem 0.75rem; margin: 0; font-size: 0.9rem; }
.mip-howto__sample dt { color: var(--mip-color-text-muted); }
.mip-howto__sample dd { margin: 0; font-weight: 600; }
.mip-howto__shot { margin: var(--mip-space-4) 0 0; }
.mip-howto__shot img { width: 100%; border: 1px solid #e3e6ea; border-radius: var(--mip-radius-sm); display: block; }
.mip-howto__shot figcaption { font-size: 0.8rem; color: var(--mip-color-text-muted); margin-top: var(--mip-space-1); }
/* ADR-198: a wider drawer so the screenshots' numbered boxes read; the description under the
   purpose; a step drawn on a screenshot carries the same orange number badge as its box. */
.mip-howto-drawer { width: min(46rem, 100vw); }
.mip-howto__purpose { font-weight: 600; }
.mip-howto__description { margin: 0 0 var(--mip-space-3); color: var(--mip-text); line-height: 1.55; }
.mip-howto__steps { list-style: none; padding-left: 0; counter-reset: none; }
.mip-howto__steps li { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.6rem; align-items: start; line-height: 1.5; }
.mip-howto__step-no { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; border: 2px solid var(--mip-border-strong, #8a94a3); color: var(--mip-text); }
.mip-howto__step-no--marked { background: #E8590C; border-color: #E8590C; color: #fff; }
.mip-howto__step-ref { display: block; font-size: 0.78rem; color: var(--mip-color-text-muted); }
/* ADR-198: How To always sits at the right end of the screen's action row. Entry headers and list
   action bars already end with it; the journal and Treasury form bars now right-align their whole
   group (Save, Submit, Close, How To, ...) like the entry header; on report and audit filter rows
   it is pushed to the far right; a screen with neither gets it at the right of its heading. */
.mip-journal-action-bar,
.mip-form-toolbar--sticky { justify-content: flex-end; }
.mip-report-toolbar > .mip-howto-trigger--end,
.mip-audit-filters > .mip-howto-trigger--end { margin-left: auto; }
.mip-audit-filters > .mip-howto-trigger--end { align-self: flex-end; }
/* ADR-334: How To sits at the right end of a report toolbar's top row (the search pill row, or its
   own row when there is no search), so it never wraps alone and the filter row keeps the export
   buttons. A toolbar button wrapped in a disabled-reason span gets the loose buttons' spacer. */
.mip-report-toolbar > .mip-why { margin-top: 18.25px; }
.mip-report-toolbar > .mip-report-toolbar__howto-row { flex: 1 0 100%; display: flex; }
.mip-report-toolbar > .mip-report-search--howto { flex-direction: row; align-items: center; }
.mip-report-search--howto > .mip-howto-trigger--end { margin-left: auto; }
.mip-howto-corner { float: right; margin: 0 0 var(--mip-space-2) var(--mip-space-3); display: flex; gap: var(--mip-space-2); }
/* MIP-095 (QA TTS-036 Cycle 8 CIS 070): the Tour button (Play icon) immediately left of How To. */
.mip-tour-button { display: inline-flex; align-items: center; gap: 0.35rem; }
/* MIP-095 (CIS 073): How To's "Using this list" / "The fields on this form" - what the screen in view has. */
.mip-howto__context { display: grid; grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr); gap: 0.35rem 0.75rem; margin: 0 0 0.75rem; font-size: 0.88rem; }
.mip-howto__context dt { font-weight: 600; color: var(--mip-text); }
.mip-howto__context dd { margin: 0; color: var(--mip-color-text-muted); }
.mip-howto__subheading { margin: 0.6rem 0 0.3rem; font-size: 0.85rem; color: var(--mip-text); }
@media (max-width: 420px) { .mip-howto__context { grid-template-columns: minmax(0, 1fr); } .mip-howto__context dd { margin-bottom: 0.35rem; } }
.mip-report-search--howto > .mip-tour-button { margin-left: auto; }
.mip-report-search--howto > .mip-tour-button + .mip-howto-trigger--end { margin-left: 0; }

/* Post-Phase-17 (ADR-183) UI consistency pass. */
/* The action bar's Add is a primary action: the primary button's blue, not the Reject red. */
.mip-action-bar__add {
  background: var(--mip-color-accent-blue);
}
.mip-action-bar__add:hover:not(:disabled) {
  filter: none;
  background: var(--mip-color-btn-hover-blue);
}
/* A report toolbar's own buttons (Print, How To, export links) sit on the input row: the filter
   fields start with a label row (label + gap), which loose buttons lack. */
.mip-report-toolbar > .mip-btn,
.mip-report-toolbar > a.mip-btn,
.mip-report-toolbar > button {
  margin-top: 18.25px;
}
/* The Search box report and register screens get (site.js enhanceReportSearch). */
.mip-report-search input { min-width: 11rem; }
/* A toolbar's filter form takes the width its fields need (several views give it flex:1 1 auto
   inline), so Print / How To / Search stay on the same row instead of wrapping below. */
.mip-report-toolbar > form { flex: 0 1 auto !important; }
.mip-report-toolbar > .mip-report-toolbar__actions .mip-report-toolbar__buttons { flex-wrap: nowrap; }
/* Master lists: the column choices under the action bar. */
.mip-checklist--columns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mip-space-2) var(--mip-space-4); margin-bottom: var(--mip-space-4); }

/* TTS-SETUP001..006 (ADR-184): Setup entry forms and lists. */
/* The entry form's header: title left; Save, Close, How To, [...] in the upper right. */
/* TTS-GNRL001 #6 (ADR-451): a Table List's header is the entry form's - title left, action group upper right;
   the list's action bar below keeps only the search (and disappears when the list has none). */
.mip-action-bar--search-only:not(:has(.mip-action-bar__search-form)) {
  display: none;
}
.mip-entry-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mip-space-3);
  margin-bottom: var(--mip-space-4);
}
.mip-entry-header__title {
  flex: 1 1 auto;
  min-width: 12rem;
  margin: 0;
}
.mip-entry-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mip-space-3);
  margin-left: auto; /* stays on the right when it wraps under a long title */
}
/* The secondary buttons (Close, How To, [...]) carry the same 1px outline as every other
   secondary button in the app (ADR-198: the 2pt outline this header alone kept read heavier than
   the list, report, journal and Treasury bars). Fill, outline and font per state come from
   .mip-btn--primary / .mip-btn--secondary. */
.mip-entry-header__actions .mip-btn {
  box-sizing: border-box;
}
/* ADR-198: the entry form's panel spans the header row, so Save, Close, How To and [...] end at
   the panel's right edge on every entry form (Customer's wide panel did; the others were a
   narrower centred panel under a full-width header). */
.mip-entry-header ~ .mip-panel--form:not(dialog),
.mip-entry-header ~ form > .mip-panel--form:not(dialog) {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.mip-entry-header__actions .mip-btn--secondary:focus-visible {
  border-color: var(--mip-color-primary-blue); /* #151DA8 */
  outline: none;
}
.mip-entry-header__actions .mip-btn--primary:focus-visible {
  outline: 2px solid var(--mip-color-primary-blue); /* #151DA8 */
  outline-offset: 0;
}
.mip-entry-header__actions a.mip-btn[aria-disabled="true"] {
  border-color: var(--mip-color-btn-disabled-fill);
  color: var(--mip-color-text-disabled);
  opacity: 1;
  pointer-events: none;
}
/* Icon-only button (the record Timeline beside How To): the same square as the "..." menu. */
.mip-btn.mip-btn--icon {
  min-width: 2.75rem;
  padding-left: 0;
  padding-right: 0;
}
.mip-btn--icon svg,
.mip-action-bar__history svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
/* Purchase Order lines: the Tax Code dropdown shows its code (VAT12) instead of a clipped blank. */
.mip-table select[data-mip-taxcode] {
  min-width: 8.5rem;
}
.mip-action-bar__history {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--mip-action-text);
}
.mip-entry-header__more {
  min-width: 2.75rem;
  padding-left: 0;
  padding-right: 0;
}

/* The Branch-only filter bar sits on one short row. */
.mip-standard-filter-bar[data-mip-auto-submit] .mip-form-field {
  max-width: 22rem;
}

/* ---- TTS-CONFIG001..011 (ADR-186) -------------------------------------------------- */
/* Secondary Destructive button (Transaction Book "Remove", CONFIG002 #4): #C32F2F outline - 1px like every secondary button
   (ADR-507; the SRS 2pt read heavier than the rest, as ADR-198 found for the secondary buttons). */
.mip-btn--secondary-danger {
  background: transparent;
  border: 1px solid var(--mip-color-action-red); /* #C32F2F */
  color: var(--mip-color-action-red);
}
.mip-btn--secondary-danger:hover:not(:disabled) {
  background: var(--mip-danger-hover-bg);
  border-color: var(--mip-color-reject-hover); /* #F54E4E */
  color: var(--mip-color-reject-hover);
}
.mip-btn--secondary-danger:active:not(:disabled) {
  background: var(--mip-danger-pressed-bg);
  border-color: var(--mip-color-reject-pressed); /* #AA0000 */
  color: var(--mip-color-reject-pressed);
}
.mip-btn--secondary-danger:focus-visible {
  background: transparent;
  outline: none;
  border-color: var(--mip-color-reject-focus-outline); /* #A80000 */
  color: var(--mip-color-action-red);
}
.mip-btn--secondary-danger:disabled {
  background: transparent;
  border-color: var(--mip-color-btn-disabled-fill); /* #E9ECF0 */
  color: var(--mip-color-text-disabled); /* #9CA2AB */
  opacity: 1;
}
/* Account Mapping: the Account selection reads at the Remove button's size (CONFIG002 #2). */
.mip-table.mip-account-mapping-lines td input,
.mip-table.mip-account-mapping-lines td select,
.mip-table.mip-account-mapping-lines td .mip-searchable-select__input {
  font-size: 1rem; /* the Remove button's computed size */
}

/* A field filled in from another one and not editable (CONFIG001 #1, CONFIG010 #1/#3). */
.mip-field-locked,
.mip-form-field input[readonly],
.mip-form-field select:disabled {
  background: var(--mip-color-btn-disabled-fill);
  cursor: not-allowed;
}

/* A fieldset that only groups controls (to disable them together). */
.mip-plain-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* TTS-SALE001 #17 (ADR-187): the Customer entry form - Customer Info on the left, Credit
   Management with Sub-Ledger Integration below it on the right, Shipping Addresses across the
   full width underneath. One column on narrow screens. */
.mip-panel--wide-form {
  max-width: min(96vw, 92rem);
}

/* ADR-771 (QA TTS-019 CUS DEFECT 019-022): the Customer form - full-width sections on a 12-column grid (each field spans s2..s12),
   Credit & Commercial Management in a card, Shipping Addresses with its Add button in the section header. One column on a phone. */
.mip-customer-form { display: flex; flex-direction: column; gap: var(--mip-space-4); }
/* ADR-919 (QA TTS-019 CUS DEFECT 026): a 6-column grid - a field is one column (1/6 of the row) unless widened (__c2..__c6). */
.mip-customer-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--mip-space-3) var(--mip-space-4); align-items: start; }
.mip-customer-grid__c1 { grid-column: span 1; }
.mip-customer-grid__c2 { grid-column: span 2; }

.mip-customer-grid__c4 { grid-column: span 4; }

.mip-customer-grid > .mip-form-field { min-width: 0; }
/* A conditional field stays a visible (greyed) box while disabled - e.g. an Individual's names, an Unlimited Credit Limit. */
.mip-customer-form input:disabled, .mip-customer-form select:disabled, .mip-customer-form textarea:disabled { background: var(--mip-bg-subtle); border-color: var(--mip-border); color: var(--mip-color-text-muted); cursor: not-allowed; }
.mip-customer-grid > .mip-form-field > input, .mip-customer-grid > .mip-form-field > select, .mip-customer-grid > .mip-form-field > textarea { width: 100%; min-width: 0; }

.mip-required { color: var(--mip-color-danger); }

.mip-checklist--lines { flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 0; height: 14rem; overflow-y: auto; margin-top: var(--mip-space-2); }

.mip-checklist--lines > .mip-field-note { padding: var(--mip-space-3); }
.mip-customer-grid__toggle { align-self: end; padding-bottom: var(--mip-space-2); display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--mip-space-1); }
.mip-customer-grid__toggle > .mip-toggle-field { width: auto; margin: 0; }
/* A field label with its (?) help keeps the help on the label's line. */
.mip-form-field:has(> label + .mip-help) { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 0; }
.mip-form-field:has(> label + .mip-help) > label + .mip-help { justify-self: start; }
.mip-form-field:has(> label + .mip-help) > :not(label):not(.mip-help) { grid-column: 1 / -1; }

.mip-customer-form [data-mip-credit-unlimited] { background: var(--mip-bg-subtle); color: var(--mip-color-text-muted); font-style: italic; }
.mip-chip-input { border-radius: 999px; background: var(--mip-bg-subtle); font-weight: 600; }
.mip-form-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--mip-space-3); }
.mip-form-section__head .mip-form-section__title { margin-bottom: 0; }

.mip-checklist--two-line { flex-direction: column; flex-wrap: nowrap; max-height: 16rem; overflow-y: auto; gap: var(--mip-space-2); }

@media (max-width: 60rem) {
  .mip-customer-grid > [class*="mip-customer-grid__c"] { grid-column: 1 / -1; }
}

dialog.mip-dialog-panel.mip-dialog-panel--wide.mip-dialog-panel--report { width: min(90vw, 80rem); max-width: 90vw; }

/* ADR-774 (QA TTS-019 CUS DEFECTS 003 / 005): the import preview - NEW (green) / UPDATE (amber) badges; a cell with a problem in red;
   a row with errors corrected in place. */
.mip-import-action { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; }
.mip-import-action--new { background: var(--mip-color-success-tint); color: var(--mip-color-success); }
.mip-import-action--update { background: var(--mip-color-warning-tint, #fff4d6); color: var(--mip-color-warning, #8a5a00); }
.mip-import__cell--bad { background: var(--mip-color-danger-tint, #fdecec); color: var(--mip-color-danger); font-weight: 600; }
.mip-import__cell--edit { cursor: pointer; }
.mip-import__cell--edit:hover { outline: 1px dashed var(--mip-border); outline-offset: -2px; }
.mip-import__cell-input { width: 100%; min-width: 8rem; font: inherit; }
/* MIP-095 (user, 2026-11-19): every dropdown of the import window - Correct To in the conflict window, a cell, Show rows, the mapping -
   has the form dropdown's chevron (a cell's own rule had dropped it, so Correct To read as a text box). */
.mip-import select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--mip-surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2320476e' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  padding-right: 2rem;
  cursor: pointer;
}
/* TTS-036 CIS 016: Import Verification & Conflict Resolution - one row per unmatched value, corrected in place. */
dialog.mip-import-conflicts { width: min(64rem, 96vw); }
dialog.mip-import-conflicts .mip-import__cell-input { min-width: 14rem; width: auto; max-width: 26rem; }   /* "Register as new: <value>" fits beside the chevron */
.mip-import__conflict-note { color: var(--mip-text-muted, inherit); margin-top: 0; }
.mip-import__conflict-action { display: inline-flex; align-items: center; gap: var(--mip-space-2, 0.5rem); margin-right: auto; }

/* TTS-SALE001 #6 (ADR-187): wide enough Shipping Address columns to read what was typed;
   the grid scrolls sideways rather than squeezing them. */
.mip-table.mip-shipping-lines {
  table-layout: fixed;
  width: max(100%, 92rem);
}

/* TTS-SALE001 #3 (ADR-187): a list whose search needs room (twice the standard width). */
.mip-action-bar__search--wide {
  flex-basis: 32rem;
}

/* TTS-SALE002..004 (ADR-187): the read-only customer pop-ups - label/value pairs in a grid. */
dialog.mip-dialog-panel--wide {
  max-width: 56rem;
}

.mip-readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--mip-space-2) var(--mip-space-4);
  margin: 0 0 var(--mip-space-4);
}

.mip-readonly-grid dt {
  font-size: 0.75rem;
  color: var(--mip-color-text-muted, #5f6b7a);
}

.mip-readonly-grid dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ADR-189: a small segmented choice (My Profile > Appearance: Light / Dark / System). */
.mip-segmented {
  display: inline-flex;
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  overflow: hidden;
  background: var(--mip-surface);
}

.mip-segmented__option {
  position: relative;
  cursor: pointer;
}

.mip-segmented__option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.mip-segmented__option span {
  display: block;
  padding: var(--mip-space-2) var(--mip-space-4);
  color: var(--mip-text);
  transition: background var(--mip-transition-fast), color var(--mip-transition-fast);
}

.mip-segmented__option + .mip-segmented__option span {
  border-left: 1px solid var(--mip-border);
}

.mip-segmented__option:hover span {
  background: var(--mip-color-btn-tint-hover);
}

.mip-segmented__option input:checked + span {
  background: var(--mip-color-accent-blue);
  color: var(--mip-text-on-fill);
}

.mip-segmented__option input:focus-visible + span {
  box-shadow: var(--mip-focus-ring);
}

/* ============================================================================================
   ADR-190 (UI/UX Primitives) - native controls and field states that follow the theme.
   ============================================================================================ */

/* Checkboxes, radios and range inputs take the action blue in both themes. */
input[type="checkbox"],
input[type="radio"],
input[type="range"] {
  accent-color: var(--mip-color-accent-blue);
}

/* Read-only values (generated numbers, Posted By, computed totals) read as information, not as
   unavailable controls: full-contrast text on a quiet fill, no focus invitation. Disabled controls
   keep the dimmed treatment. */
.mip-form-field input[readonly]:not([type="checkbox"]):not([type="radio"]),
.mip-form-field textarea[readonly],
.mip-table td input[readonly] {
  background: var(--mip-bg-subtle);
  color: var(--mip-text);
  border-style: dashed;
  cursor: default;
}

/* Amounts typed into a grid line align like the amounts printed around them. */
.mip-table td input[type="number"],
.mip-table td input[data-mip-numeric],
input.mip-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Dark theme: the inline SVG icons drawn in brand navy get a light stroke. */
@media screen {
  /* A disabled select has no chevron in either theme (its muted background shorthand resets the repeat). */
  :root[data-theme="dark"] .mip-form-field select:not([multiple]):not(:disabled),
  :root[data-theme="dark"] .mip-repeating-lines-table select:not([multiple]):not(:disabled) {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23c9c6bc' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  }
  :root[data-theme="dark"] .mip-table-toolbar__filter,
  :root[data-theme="dark"] .mip-action-bar__search {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23c9c6bc' stroke-width='1.6'><circle cx='8.5' cy='8.5' r='5.5'/><line x1='16' y1='16' x2='12.6' y2='12.6' stroke-linecap='round'/></svg>");
  }
}

/* ============================================================================================
   ADR-191 (UI/UX Composites) - one modal identity, table states, totals, empty states.
   ============================================================================================ */

/* Modal shell: the form-panel dialogs (Create User / Role / Company, customer pop-ups, aging
   detail, journal history, exchange-rate prompt) get the same #102338 title band and orange
   close button as the SRS system modal. Their first <h2> is the band; no markup change. */
dialog.mip-dialog-panel > h2:first-of-type {
  margin: calc(-1 * var(--mip-space-5)) calc(-1 * var(--mip-space-5)) var(--mip-space-5);
  padding: var(--mip-space-4) calc(var(--mip-space-5) + 2.75rem) var(--mip-space-4) var(--mip-space-5);
  background: var(--mip-color-modal-header);
  color: var(--mip-color-white);
  font-size: 1.1rem;
  border-radius: var(--mip-radius-lg) var(--mip-radius-lg) 0 0;
}

dialog.mip-dialog-panel > .mip-dialog-panel__close {
  top: 0.8rem;
  right: var(--mip-space-4);
  width: 2rem;
  height: 2rem;
  z-index: 1;
  background: var(--mip-color-modal-close);
  color: var(--mip-color-white);
}

dialog.mip-dialog-panel > .mip-dialog-panel__close:hover {
  background: var(--mip-color-modal-close);
  color: var(--mip-color-white);
  filter: brightness(1.1);
}

dialog.mip-dialog-panel {
  background: var(--mip-surface);
  color: var(--mip-text);
}

/* Modal sizes from one scale; long dialogs scroll inside the viewport instead of off it. */
dialog.mip-modal--sm { max-width: var(--mip-modal-sm); }
dialog.mip-modal--md { max-width: var(--mip-modal-md); }
dialog.mip-modal--lg,
dialog.mip-dialog-panel--wide { max-width: var(--mip-modal-lg); }
dialog.mip-modal--xl { max-width: var(--mip-modal-xl); }

dialog.mip-modal,
dialog.mip-dialog-panel {
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

/* Table states: hover follows the pointer; a checked row stays marked (different from hover). */
.mip-table tbody tr:hover {
  background: var(--mip-row-hover);
}

.mip-table tbody tr:has(> td > input[data-mip-row-select]:checked),
.mip-table tbody tr[aria-selected="true"] {
  background: var(--mip-row-selected);
  box-shadow: inset 3px 0 0 var(--mip-color-accent-blue);
}

/* Totals rows: a rule above, bold figures, a quiet fill - hierarchy without bright colour. */
.mip-table tfoot th,
.mip-table tfoot td {
  border-top: 2px solid var(--mip-border-strong);
  font-weight: 700;
  background: var(--mip-bg-subtle);
  color: var(--mip-text);
}

/* Long tables can keep their header in view (opt-in: the scroll box gets a height). */
.mip-table-scroll--sticky {
  max-height: 70vh;
  overflow: auto;
}

.mip-table-scroll--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--mip-bg-subtle);
}

/* Empty state: readable text with a quiet icon (was the 3.2:1 placeholder grey). */
.mip-table-empty {
  color: var(--mip-color-text-muted);
}

.mip-table-empty::before {
  content: "";
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 auto var(--mip-space-2);
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M3 13l2.5-7h13L21 13'/><path d='M3 13v5a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h-5.5l-1.5 2h-4l-1.5-2z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M3 13l2.5-7h13L21 13'/><path d='M3 13v5a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-5h-5.5l-1.5 2h-4l-1.5-2z'/></svg>") center / contain no-repeat;
}

/* Inline alerts (persistent notices on a page; transient results stay the ADR-168 system modal). */
.mip-alert-warning {
  background: var(--mip-color-warning-tint);
  color: var(--mip-color-warning);
  border-left-color: var(--mip-color-warning);
}

/* ============================================================================================
   ADR-192 (UI/UX Navigation) - the shell on tablets and phones. Same views, same links, same
   permissions: only the arrangement changes. Breakpoints from tokens.css: md 60rem, sm 40rem.
   ============================================================================================ */
@media (max-width: 60rem) {
  .mip-shell-header {
    padding: var(--mip-space-2) var(--mip-space-3);
    gap: var(--mip-space-2);
    min-height: 3.5rem;
    flex-wrap: wrap;
  }

  .mip-shell-nav {
    padding: 0 var(--mip-space-3);
  }

  /* Module tabs wrap onto a second line instead of pushing the page sideways; a tap opens a
     tab's menu (the dropdown already opens on focus). */
  .mip-primary-nav {
    flex-wrap: wrap;
    row-gap: var(--mip-space-1);
    padding: var(--mip-space-1) 0;
    position: relative;
  }

  /* ADR-493: once the menu wraps, any module (not only the last two) can sit at the right edge, and its
     closed menu - hidden, but still laid out - pushed the page wider than the phone (every page scrolled
     sideways). Each module menu now opens the full width of the menu bar, under it. */
  .mip-primary-nav__item {
    position: static;
  }

  .mip-primary-nav__item > .mip-dropdown,
  .mip-primary-nav__item:nth-last-child(-n+2) > .mip-dropdown {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .mip-shell-main {
    padding: var(--mip-space-3);
  }

  /* Module title + its tabs wrap. */
  .mip-admin-header {
    flex-wrap: wrap;
    row-gap: var(--mip-space-2);
    padding: var(--mip-space-3) var(--mip-space-3) 0;
  }

  .mip-admin-tabs {
    flex-wrap: wrap;
    row-gap: var(--mip-space-2);
    gap: var(--mip-space-4);
  }

  /* The side menu becomes a swipeable strip above the content (every item still reachable). */
  .mip-admin-body {
    flex-direction: column;
    align-items: stretch;
    gap: var(--mip-space-3);
    padding: var(--mip-space-3);
  }

  .mip-admin-subnav {
    flex: none;
    flex-direction: row;
    overflow-x: auto;
    gap: var(--mip-space-2);
    padding-bottom: var(--mip-space-1);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .mip-admin-subnav > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .mip-action-bar {
    flex-wrap: wrap;
  }

  .mip-panel--form {
    padding: var(--mip-space-4);
  }

  /* Filter / report parameter bars with a fixed column list (--mip-grid-cols) wrap like every
     other form grid (ADR-195: the list is a variable now, so no !important is needed). */
  .mip-form-grid[style*="--mip-grid-cols"] {
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    max-width: 100%;
  }

  /* A grid placed straight in a form section (no .mip-table-scroll wrapper, e.g. the Claim
     lines) scrolls inside the section instead of widening the page. */
  .mip-form-section > table.mip-table,
  .mip-panel > table.mip-table {
    display: block;
    position: relative; /* keeps the searchable selects' hidden native <select> inside */
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 40rem) {
  /* Touch: comfortable hit areas for buttons, fields and menu items. */
  .mip-btn,
  .mip-action-bar__add,
  .mip-action-bar__howto,
  .mip-action-bar__overflow,
  .mip-form-field input:not([type="checkbox"]):not([type="radio"]),
  .mip-form-field select,
  .mip-dropdown__item,
  .mip-admin-subnav__item {
    min-height: 2.5rem;
  }

  .mip-action-bar__search {
    flex: 1 1 100%;
  }

  /* Dialogs use the screen width. */
  dialog.mip-modal,
  dialog.mip-dialog-panel {
    width: calc(100vw - 1rem);
    max-width: none;
  }

  .mip-entry-header__title {
    min-width: 100%;
  }
}

/* ============================================================================================
   ADR-193 (UI/UX representative screens).
   ============================================================================================ */

.mip-journal-action-bar,
.mip-form-toolbar--sticky {
  position: sticky;
  bottom: 0;
  /* 26: the bar is a stacking context (sticky, or a flex item in the entry header), so its [...] menu can only rise as high as the
     bar - above the guided step rail (20) and the status bar (25), under the page popups (30+). */
  z-index: 26;
  margin: var(--mip-space-4) calc(-1 * var(--mip-space-6)) calc(-1 * var(--mip-space-5));
  padding: var(--mip-space-3) var(--mip-space-6);
  background: var(--mip-surface);
  border-top: 1px solid var(--mip-border);
  border-radius: 0 0 var(--mip-radius-lg) var(--mip-radius-lg);
  box-shadow: 0 -6px 12px -10px rgba(0, 0, 0, 0.35);
}

@media (max-width: 60rem) {
  .mip-journal-action-bar,
  .mip-form-toolbar--sticky {
    margin: var(--mip-space-4) calc(-1 * var(--mip-space-4)) calc(-1 * var(--mip-space-4));
    padding: var(--mip-space-3) var(--mip-space-4);
  }
}

/* Empty state with the first action (shown only when the user may create). */
.mip-empty-state {
  padding: var(--mip-space-6) var(--mip-space-4);
  text-align: center;
}

.mip-empty-state .mip-table-empty {
  padding: 0 0 var(--mip-space-2);
}

.mip-empty-state__hint {
  margin: 0 0 var(--mip-space-4);
  color: var(--mip-color-text-muted);
  font-size: 0.85rem;
}

/* Import wizard step indicator (Upload > Map Columns > Review > Import). */
.mip-import__steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mip-space-2) var(--mip-space-4);
  margin: 0;
  padding: var(--mip-space-3) var(--mip-space-5);
  list-style: none;
  background: var(--mip-bg-subtle);
  border-bottom: 1px solid var(--mip-border-subtle);
  font-size: 0.85rem;
  color: var(--mip-color-text-muted);
}

.mip-import__step {
  display: inline-flex;
  align-items: center;
  gap: var(--mip-space-2);
}

.mip-import__step-number {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid var(--mip-border-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.mip-import__step--current {
  color: var(--mip-text);
  font-weight: 700;
}

.mip-import__step--current .mip-import__step-number {
  background: var(--mip-color-accent-blue);
  border-color: var(--mip-color-accent-blue);
  color: var(--mip-text-on-fill);
}

.mip-import__step--done .mip-import__step-number {
  background: var(--mip-color-success-tint);
  border-color: var(--mip-color-success);
  color: var(--mip-color-success);
}

/* ADR-194: a tapped shell menu stays open (setup.js toggles .mip-menu-open), and menus sit on
   a raised surface with a clear edge so they stand out from the header in both themes. */
.mip-utility-icon.mip-menu-open > .mip-dropdown,
.mip-primary-nav__item.mip-menu-open > .mip-dropdown,
.mip-tier-badge.mip-menu-open > .mip-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--mip-transition), transform var(--mip-transition);
}

.mip-dropdown {
  background: var(--mip-surface-raised);
  border: 1px solid var(--mip-border);
}

@media (max-width: 40rem) {
  /* On a phone the Settings / Profile menus open under the header, kept inside the screen. MIP-116 (QA TTS-036 Cycle 11 CIS 101): the
     header wraps on a phone, so an icon can sit at the left - a menu hung from the icon's right edge ran off the screen (the Profile menu
     started 123px left of it at 375px). It now spans the screen's width under the header, whatever the icon's place. */
  .mip-utility-icons .mip-dropdown {
    position: fixed;
    top: var(--mip-shell-header-h, 4.5rem);
    left: 0.5rem;
    right: 0.5rem;
    min-width: 0;
    max-width: none;
    width: auto;
    max-height: calc(100vh - var(--mip-shell-header-h, 4.5rem) - 1rem);
    overflow-y: auto;
  }
}

/* ADR-197 (motion polish): drawers (How To, audit detail) slide in from the right and dialog
   backdrops fade - short, transform/opacity only, and switched off by prefers-reduced-motion
   (tokens.css). Nothing loops or moves on its own. */
.mip-audit-drawer:not([hidden]) {
  animation: mip-drawer-in var(--mip-transition-slow);
}

@keyframes mip-drawer-in {
  from {
    opacity: 0;
    transform: translateX(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

dialog.mip-modal[open]::backdrop,
dialog.mip-dialog-panel[open]::backdrop {
  animation: mip-backdrop-in var(--mip-transition);
}

@keyframes mip-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ADR-200 (Productivity Pack 1): Global Search - the header's Search button and the Ctrl+K
   palette. Colours are theme tokens, so it follows Light / Dark (the header is dark in both). */
.mip-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--mip-space-2);
  min-height: 2.25rem;
  padding: 0 var(--mip-space-3);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--mip-radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--mip-transition-fast), border-color var(--mip-transition-fast);
}
.mip-search-trigger:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.45); }
.mip-search-trigger:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.9); outline-offset: 2px; }
.mip-search-trigger__text { min-width: 8rem; text-align: left; }
.mip-search-trigger__kbd {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--mip-radius-sm);
  opacity: 0.85;
}
@media (max-width: 60rem) {
  .mip-search-trigger__text, .mip-search-trigger__kbd { display: none; }
}

.mip-palette { position: fixed; inset: 0; z-index: 1300; }
.mip-palette[hidden] { display: none; }
.mip-palette__backdrop { position: absolute; inset: 0; background: var(--mip-overlay); animation: mip-backdrop-in 180ms ease-out; }
.mip-palette__panel {
  position: relative;
  width: min(44rem, calc(100vw - 2rem));
  max-height: min(36rem, calc(100vh - 6rem));
  margin: 10vh auto 0;
  display: flex;
  flex-direction: column;
  background: var(--mip-surface-raised);
  color: var(--mip-text);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-lg);
  box-shadow: var(--mip-shadow-lg);
  overflow: hidden;
  animation: mip-panel-in 180ms ease-out;
}
.mip-palette__input-row {
  display: flex;
  align-items: center;
  gap: var(--mip-space-3);
  padding: var(--mip-space-3) var(--mip-space-4);
  border-bottom: 1px solid var(--mip-border-subtle);
  color: var(--mip-color-text-muted);
}
.mip-palette__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--mip-text);
  font: inherit;
  font-size: 1.05rem;
  padding: var(--mip-space-2) 0;
}
.mip-palette kbd, .mip-palette__kbd {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  color: var(--mip-color-text-muted);
  background: var(--mip-bg-subtle);
}
.mip-palette__results { overflow-y: auto; padding: var(--mip-space-2) 0; }
.mip-palette__group + .mip-palette__group { margin-top: var(--mip-space-2); }
.mip-palette__group-label {
  padding: var(--mip-space-2) var(--mip-space-4) var(--mip-space-1);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mip-color-text-muted);
}
.mip-palette__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main status" "sub status";
  column-gap: var(--mip-space-3);
  padding: var(--mip-space-2) var(--mip-space-4);
  color: var(--mip-text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.mip-palette__item[aria-selected="true"] { background: var(--mip-selected-bg); border-left-color: var(--mip-action-text); }
.mip-palette__item-main { grid-area: main; display: flex; gap: var(--mip-space-2); align-items: baseline; min-width: 0; }
.mip-palette__item-number { font-weight: 700; white-space: nowrap; }
.mip-palette__item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mip-palette__item-sub { grid-area: sub; font-size: 0.8rem; color: var(--mip-color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mip-palette__item-status {
  grid-area: status;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: var(--mip-radius-pill);
  background: var(--mip-badge-neutral-bg);
  color: var(--mip-badge-neutral-text);
  white-space: nowrap;
}
.mip-palette__message { margin: 0; padding: var(--mip-space-4); color: var(--mip-color-text-muted); }
.mip-palette__message--note { font-size: 0.8rem; padding-top: var(--mip-space-2); }
.mip-palette__footer {
  display: flex;
  gap: var(--mip-space-4);
  padding: var(--mip-space-2) var(--mip-space-4);
  border-top: 1px solid var(--mip-border-subtle);
  font-size: 0.75rem;
  color: var(--mip-color-text-muted);
}
html.mip-palette-open { overflow: hidden; }
@media (max-width: 40rem) {
  .mip-palette__panel { margin-top: var(--mip-space-3); max-height: calc(100vh - 1.5rem); }
  .mip-palette__footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mip-palette__backdrop, .mip-palette__panel { animation: none; }
}
/* The palette's own input is the panel's search line, not a boxed form field. */
.mip-palette .mip-palette__input,
.mip-palette .mip-palette__input:focus,
.mip-palette .mip-palette__input:focus-visible {
  border: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
  min-height: 0;
}

/* ADR-201 (Productivity Pack 1, Loop 2): the header Favorites menu. */
.mip-favorites__menu { min-width: 18rem; max-width: min(24rem, calc(100vw - 1rem)); }
/* Opens under the star, right-aligned like the Settings / Profile menus: a closed (hidden) menu
   still counts toward the page width, so it must never reach past the right edge. */
.mip-favorites > .mip-dropdown { left: auto; right: 0; }
.mip-favorites__item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.mip-favorites__path { font-size: 0.75rem; color: var(--mip-color-text-muted); }
.mip-favorites__toggle { font-weight: 600; }
.mip-dropdown__divider { height: 1px; margin: var(--mip-space-1) 0; background: var(--mip-border-subtle); }
.mip-dropdown__note { display: block; padding: var(--mip-space-2) var(--mip-space-3); font-size: 0.85rem; color: var(--mip-color-text-muted); }

/* ADR-201: a report / list filter row with a fixed column list (--mip-grid-cols) wraps whenever
   its fields do not fit - at any width, not only on phones - so a long dropdown (e.g. the Detailed
   Transaction Ledger's Account list) never pushes the page sideways. A filter dropdown is capped
   so one long option cannot make the whole row wide; its text is still shown in full when open. */
@media (min-width: 60.0625rem) {
  /* (Below 60rem the ADR-195 rule already turns these rows into equal-width wrapping cells.) */
  .mip-report-toolbar > form.mip-form-grid[style*="--mip-grid-cols"],
  form[data-mip-search-bar].mip-form-grid[style*="--mip-grid-cols"] {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    min-width: 0;
  }
  .mip-report-toolbar > form.mip-form-grid[style*="--mip-grid-cols"] > .mip-form-field,
  form[data-mip-search-bar].mip-form-grid[style*="--mip-grid-cols"] > .mip-form-field {
    min-width: 0;
  }
}
.mip-form-grid[style*="--mip-grid-cols"] .mip-form-field select {
  max-width: 20rem;
}

/* A button that reads as a link - e.g. the Aging report's counterparty name, which opens its
   detail dialog. Same colour and underline as table links; keyboard focus ring kept. */
.mip-link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--mip-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.mip-link-button:hover { text-decoration-thickness: 2px; }
.mip-link-button:focus-visible { outline: 2px solid var(--mip-color-primary-blue); outline-offset: 2px; border-radius: 2px; }

[data-mip-aging-detail-table] th, [data-mip-aging-detail-table] td { white-space: nowrap; }
[data-mip-aging-detail-table] td:nth-child(3) { white-space: normal; min-width: 14rem; }

/* ADR-202 (Productivity Pack 1, Loop 3): the Views menu on list screens - saved views, columns
   (show / hide, order, width), rows per page, reset. views.js builds it into the action bar. */
.mip-views { position: relative; display: inline-flex; }
.mip-views__panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 40;
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100vh - 8rem));
  overflow-y: auto;
  padding: var(--mip-space-3);
  background: var(--mip-surface-raised);
  color: var(--mip-text);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-md);
  box-shadow: var(--mip-shadow-lg);
  text-align: left;
}
.mip-views__panel[hidden] { display: none; }
.mip-views__section + .mip-views__section { margin-top: var(--mip-space-3); padding-top: var(--mip-space-3); border-top: 1px solid var(--mip-border-subtle); }
.mip-views__heading { margin: 0 0 var(--mip-space-2); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mip-color-text-muted); }
.mip-views__list { list-style: none; margin: 0; padding: 0; }
.mip-views__row { display: flex; align-items: center; gap: var(--mip-space-2); padding: 0.2rem 0; }
.mip-views__row > .mip-views__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mip-views__name--current { font-weight: 700; }
.mip-views__badge { font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: var(--mip-radius-pill); background: var(--mip-badge-neutral-bg); color: var(--mip-badge-neutral-text); white-space: nowrap; }
.mip-views__icon {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--mip-radius-sm);
  background: none;
  color: var(--mip-color-text-muted);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.mip-views__icon:hover { color: var(--mip-text); border-color: var(--mip-border); background: var(--mip-hover-bg); }
.mip-views__icon[aria-pressed="true"] { color: var(--mip-action-text); }
.mip-views__icon:disabled { opacity: 0.35; cursor: default; }
.mip-views__icon--danger:hover { color: var(--mip-color-danger); border-color: var(--mip-color-danger); }
.mip-views__save { display: flex; flex-wrap: wrap; gap: var(--mip-space-2); align-items: center; }
.mip-views__save input[type="text"] { flex: 1 1 10rem; min-width: 0; padding: 0.4rem 0.6rem; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface); color: var(--mip-text); font: inherit; }
.mip-views__save label { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.mip-views__note { margin: var(--mip-space-1) 0 0; font-size: 0.78rem; color: var(--mip-color-text-muted); }
.mip-views__error { margin: var(--mip-space-1) 0 0; font-size: 0.8rem; color: var(--mip-color-danger); }
.mip-views__columns .mip-views__row label { flex: 1 1 auto; display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; cursor: pointer; }
.mip-views__columns .mip-views__row label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mip-views__pagesize { display: flex; align-items: center; gap: var(--mip-space-2); }
.mip-views__pagesize select { padding: 0.35rem 0.5rem; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface); color: var(--mip-text); font: inherit; }
.mip-views__footer { display: flex; justify-content: space-between; align-items: center; gap: var(--mip-space-2); }
.mip-views__status { font-size: 0.78rem; color: var(--mip-color-text-muted); }

/* Column resize handle on list headers (views.js). The header cell is the handle's anchor. */
.mip-table th[data-mip-col-label] { position: relative; }
.mip-th-resize {
  position: absolute;
  top: 0;
  right: 0; /* inside the cell: a handle past the last header would widen the grid and show a scroll bar */
  width: 0.5rem;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}
.mip-th-resize:hover, .mip-th-resize--active { background: linear-gradient(to right, transparent 40%, var(--mip-action-text) 40%, var(--mip-action-text) 60%, transparent 60%); }
.mip-table--resizing { cursor: col-resize; user-select: none; }
/* Until the user's layout is applied, the grid is rendered but held briefly to avoid a column flash. */
.mip-grid-pending table.mip-table { visibility: hidden; }
@media (max-width: 40rem) {
  .mip-views__panel { right: auto; left: 0; }
}

/* ADR-203 (Productivity Pack 1, Loop 4): the header bell, the Notification Center and toasts. */
.mip-bell { position: relative; text-decoration: none; }
.mip-bell__count {
  position: absolute;
  top: 0.15rem;
  right: 0.1rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: var(--mip-radius-pill);
  background: var(--mip-color-danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}
.mip-bell__count[hidden] { display: none; }

.mip-notif-tabs { display: flex; gap: var(--mip-space-2); margin: 0 0 var(--mip-space-3); border-bottom: 1px solid var(--mip-border-subtle); }
.mip-notif-tabs__tab { padding: var(--mip-space-2) var(--mip-space-3); color: var(--mip-color-text-muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; }
.mip-notif-tabs__tab:hover { color: var(--mip-text); }
.mip-notif-tabs__tab[aria-current="page"] { color: var(--mip-action-text); border-bottom-color: var(--mip-action-text); }
.mip-inline-form { display: inline; margin: 0; }

.mip-notif-list { list-style: none; margin: 0; padding: 0; }
.mip-notif { display: grid; grid-template-columns: 0.75rem minmax(0, 1fr) auto; gap: var(--mip-space-3); align-items: start; padding: var(--mip-space-3) var(--mip-space-2); border-bottom: 1px solid var(--mip-border-subtle); }
.mip-notif:last-child { border-bottom: 0; }
.mip-notif--unread { background: var(--mip-selected-bg); }
.mip-notif__dot { width: 0.6rem; height: 0.6rem; margin-top: 0.45rem; border-radius: 50%; background: var(--mip-color-info); }
.mip-notif__dot--warning { background: var(--mip-color-warning); }
.mip-notif__dot--critical { background: var(--mip-color-danger); }
.mip-notif__body { min-width: 0; }
.mip-notif__title { font-weight: 600; color: var(--mip-text); text-decoration: none; }
.mip-notif__title:hover { text-decoration: underline; }
.mip-notif--unread .mip-notif__title { font-weight: 700; }
.mip-notif__message { margin: 0.15rem 0 0; color: var(--mip-text); }
.mip-notif__meta { margin: 0.2rem 0 0; display: flex; flex-wrap: wrap; gap: var(--mip-space-3); font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-notif__note { font-style: italic; }
.mip-notif-empty { padding: var(--mip-space-6) var(--mip-space-4); text-align: center; }
/* ADR-523: the Archived tab's note (theme tokens - light and dark). */
.mip-notif-archived-note { margin: 0 0 var(--mip-space-3); font-size: 0.85rem; color: var(--mip-color-text-muted); }

/* ADR-525: the alert boxes set display, which would override [hidden] - a hidden alert stays hidden (Report Designer address note,
   the Treasury create pages' error lines). */
.mip-alert-error[hidden], .mip-alert-success[hidden], .mip-alert-warning[hidden], .mip-alert-info[hidden] { display: none; }

.mip-toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1400; display: flex; flex-direction: column; gap: var(--mip-space-2); width: min(22rem, calc(100vw - 2rem)); }
.mip-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--mip-space-2);
  padding: var(--mip-space-3) var(--mip-space-3) var(--mip-space-3) var(--mip-space-4);
  background: var(--mip-surface-raised);
  color: var(--mip-text);
  border: 1px solid var(--mip-border);
  border-left: 4px solid var(--mip-color-info);
  border-radius: var(--mip-radius-md);
  box-shadow: var(--mip-shadow-lg);
  animation: mip-panel-in 180ms ease-out;
}
.mip-toast--warning { border-left-color: var(--mip-color-warning); }
.mip-toast--critical { border-left-color: var(--mip-color-danger); }
.mip-toast--out { opacity: 0; transition: opacity 200ms ease-out; }
/* ADR-539: an Inbox message - the accent edge and a "New message" label; clicking docks the conversation. */
.mip-toast--message { border-left-color: var(--mip-color-accent-blue); cursor: pointer; }
.mip-toast--message:hover { background: var(--mip-hover-bg); }
.mip-toast__title { font-weight: 600; color: var(--mip-text); text-decoration: none; }
.mip-toast__title:hover { text-decoration: underline; }
.mip-toast__message { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--mip-color-text-muted); }
.mip-toast__close { align-self: start; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: var(--mip-radius-sm); background: none; color: var(--mip-color-text-muted); font: inherit; cursor: pointer; }
.mip-toast__close:hover { color: var(--mip-text); background: var(--mip-hover-bg); }
@media (prefers-reduced-motion: reduce) { .mip-toast { animation: none; } }
@media (max-width: 40rem) { .mip-notif { grid-template-columns: 0.75rem minmax(0, 1fr); } .mip-notif > .mip-inline-form { grid-column: 2; } }

/* ADR-206 (Productivity Pack 2, Loop 1): the record drawer - timeline, attachments, related. */
.mip-record-tabs { display: flex; gap: var(--mip-space-1); padding: 0 var(--mip-space-4); border-bottom: 1px solid var(--mip-border-subtle); }
.mip-record-tabs__tab { padding: var(--mip-space-2) var(--mip-space-3); border: 0; border-bottom: 2px solid transparent; background: none; color: var(--mip-color-text-muted); font: inherit; font-weight: 600; cursor: pointer; }
.mip-record-tabs__tab[aria-selected="true"] { color: var(--mip-action-text); border-bottom-color: var(--mip-action-text); }
.mip-record-loading { color: var(--mip-color-text-muted); }
.mip-record-day { margin: var(--mip-space-3) 0 var(--mip-space-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mip-color-text-muted); }
.mip-record-day:first-child { margin-top: 0; }
.mip-record-timeline { list-style: none; margin: 0; padding: 0 0 0 0.35rem; border-left: 2px solid var(--mip-border-subtle); }
.mip-record-event { position: relative; display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--mip-space-2); padding: 0 0 var(--mip-space-3) var(--mip-space-3); }
.mip-record-event::before { content: ""; position: absolute; left: -0.45rem; top: 0.35rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--mip-action-text); border: 2px solid var(--mip-surface-raised); }
.mip-record-event--failed::before { background: var(--mip-color-danger); }
.mip-record-event__time { color: var(--mip-color-text-muted); font-size: 0.85rem; padding-top: 0.1rem; }
.mip-record-event__title { font-weight: 600; }
.mip-record-event__by { font-size: 0.85rem; color: var(--mip-color-text-muted); }
.mip-record-event__changes { margin: 0.25rem 0 0; padding-left: 1rem; font-size: 0.82rem; color: var(--mip-color-text-muted); }
.mip-record-related { list-style: none; margin: 0; padding: 0; }
.mip-record-rel__meta { font-size: 0.82rem; color: var(--mip-color-text-muted); }
.mip-record-rel { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0 var(--mip-space-3); padding: var(--mip-space-2) 0; border-bottom: 1px solid var(--mip-border-subtle); }
.mip-record-rel__relation { font-size: 0.82rem; color: var(--mip-color-text-muted); padding-top: 0.1rem; }
.mip-record-rel__doc { font-weight: 600; }
.mip-record-rel__doc--plain { color: var(--mip-text); }
.mip-record-rel__meta { grid-column: 2; }
dialog.mip-record-preview { width: min(960px, calc(100vw - 2rem)); height: min(90vh, 1100px); padding: 0; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md); background: var(--mip-surface-raised); color: var(--mip-text); box-shadow: var(--mip-shadow-lg); display: flex; flex-direction: column; }
dialog.mip-record-preview:not([open]) { display: none; }
dialog.mip-record-preview::backdrop { background: rgba(0, 0, 0, 0.45); }

/* ADR-219: the e-mail digest strip of the Notifications screen. */
.mip-notif-digest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mip-space-2); margin-bottom: var(--mip-space-3); font-size: 0.88rem; }
.mip-notif-digest__text { display: inline-flex; align-items: center; gap: var(--mip-space-1); margin-right: auto; color: var(--mip-color-text-muted); }
.mip-notif-digest__text strong { color: var(--mip-text); }

/* ADR-216: frozen grid columns (views.js). The cell needs an opaque background, so the row's
   translucent stripe / hover / selected tint is repainted on top of the surface colour. */
.mip-table--frozen .mip-col-frozen { position: sticky !important; z-index: 1; background-color: var(--mip-surface); }
/* ADR-699 (QA TTS-001 GJ 009/015/016/018): a frozen header cell keeps the header's own colours. */
.mip-table--frozen thead .mip-col-frozen { z-index: 3; background-color: var(--mip-grid-head-bg); color: var(--mip-grid-head-text); }
.mip-table--frozen tbody tr:nth-child(even) > .mip-col-frozen { background-image: linear-gradient(var(--mip-row-stripe), var(--mip-row-stripe)); }
.mip-table--frozen tbody tr:hover > .mip-col-frozen { background-image: linear-gradient(var(--mip-row-hover), var(--mip-row-hover)); }
.mip-table--frozen tbody tr:has(> td > input[data-mip-row-select]:checked) > .mip-col-frozen,
.mip-table--frozen tbody tr[aria-selected="true"] > .mip-col-frozen { background-image: linear-gradient(var(--mip-row-selected), var(--mip-row-selected)); }
.mip-table--frozen .mip-col-frozen--edge { box-shadow: inset -2px 0 0 var(--mip-border); }
.mip-views__freeze { margin-top: var(--mip-space-2); }
/* ADR-213: a disabled action says why (explain.js). */
.mip-why { display: inline-flex; vertical-align: middle; }
.mip-dropdown .mip-why { display: block; }
.mip-why--on { cursor: not-allowed; }
.mip-why--on > :disabled { pointer-events: none; }
.mip-why--on:focus-visible, .mip-help:focus-visible { outline: 2px solid var(--mip-color-primary-blue); outline-offset: 2px; border-radius: var(--mip-radius-sm); }
.mip-why-tip { position: fixed; z-index: 4000; max-width: 20rem; padding: var(--mip-space-2) var(--mip-space-3); background: var(--mip-header-bg); color: var(--mip-text-on-fill); font-size: 0.8rem; line-height: 1.35; border-radius: var(--mip-radius-md); box-shadow: var(--mip-shadow-lg); pointer-events: none; white-space: pre-line; text-align: left; }   /* ADR-757: an info icon's list keeps its lines */
.mip-why-tip[hidden] { display: none; }
.mip-help { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; margin-left: var(--mip-space-1); padding: 0; border: 1px solid var(--mip-border); border-radius: 50%; background: var(--mip-surface-raised); color: var(--mip-color-text-muted); font-size: 0.7rem; font-weight: 600; line-height: 1; cursor: help; vertical-align: middle; }
.mip-help:hover { color: var(--mip-text); border-color: var(--mip-color-text-muted); }

/* ---- ADR-222 (TTS-FNCE001..004: General Journal Voucher, Report, Book, Summary) ---------- */
/* Dates read "October 01, 2026" in the box itself (setup.js); no hint below the field. */
.mip-longdate { position: relative; display: block; }
.mip-longdate > input[type="date"] { width: 100%; box-sizing: border-box; }
.mip-longdate > input[type="date"]:not(:focus) { color: transparent; }
.mip-longdate > input[type="date"]:not(:focus)::-webkit-datetime-edit { color: transparent; }
.mip-longdate__text {
  position: absolute;
  right: 2.4rem;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--mip-text-body);
  cursor: pointer;
}
.mip-longdate--empty .mip-longdate__text { color: var(--mip-color-text-placeholder); }
.mip-longdate:focus-within .mip-longdate__text { visibility: hidden; }
.mip-longdate > input[type="date"]:disabled ~ .mip-longdate__text { cursor: default; }
.mip-longdate-field [data-mip-date-display] { display: none !important; }
.mip-longdate-field { min-width: 12.5rem; }
/* Inside the entry form's column grid the date keeps to its own column (it overlapped Trx No). */
.mip-form-grid .mip-longdate-field { min-width: 0; }

/* Journal lists: the search spans the filter bar below it (FNCE001 #1). */
/* The search and the filter bar share one width, so their right edges line up. */
.mip-action-bar__search--wide[data-mip-table-search-for$="j-table"] { flex: 0 1 54rem; max-width: 54rem; }
/* ADR-228: every dated list (journals, Treasury lists) - the wide search matches the filter bar under it. */
.mip-action-bar:has(~ form.mip-voucher-filter) .mip-action-bar__search--wide { flex: 0 1 54rem; max-width: 54rem; }
form.mip-voucher-filter { width: 54rem; max-width: 100%; }
/* ADR-228: the wide search gives way, never the buttons beside it ("How To" stays on one line). */
.mip-action-bar > .mip-action-bar__add, .mip-action-bar > .mip-action-bar__howto, .mip-action-bar > .mip-action-bar__overflow-wrap { flex-shrink: 0; white-space: nowrap; }
@media (min-width: 60.0625rem) {
  form[data-mip-search-bar].mip-form-grid.mip-voucher-filter[style*="--mip-grid-cols"] > .mip-form-field { flex: 1 1 0; min-width: 0; }
}

/* The General Journal's four rows (FNCE001 #11): five equal columns, sequence set by CSS order. */
/* The first column holds the Transaction Date: wide enough for "September 30, 2026" in the box. */
/* ADR-569: the SRS journal rows hold six fields (Transaction Date | Ref No | Trx No | Payee Type | Payee | TIN). */
.mip-form-grid.mip-gj-grid { grid-template-columns: minmax(11rem, 1fr) repeat(5, minmax(0, 1fr)); }

@media (max-width: 60rem) {
  .mip-form-grid.mip-gj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.mip-form-field--required > label::after {
  content: " *";
  color: var(--mip-color-danger);
}

/* Accounting Entries (FNCE001 #8-#10): the account box reads at the Remove button's size and height;
   + Add Line is a Secondary Action and Remove a Secondary Destructive button, both 2pt outlines. */
[data-mip-accounting-entries-grid] .mip-repeating-lines-table td select,
[data-mip-accounting-entries-grid] .mip-repeating-lines-table td input,
[data-mip-accounting-entries-grid] .mip-repeating-lines-table td .mip-searchable-select__input {
  font-size: 0.95rem;
  min-height: 2.5rem;
}
[data-mip-accounting-entries-grid] [data-mip-add-line].mip-btn--secondary { border: 1px solid var(--mip-action-text); }   /* ADR-507: 1px like every secondary button */
[data-mip-accounting-entries-grid] [data-mip-add-line].mip-btn--secondary:hover:not(:disabled) { border-color: var(--mip-color-btn-hover-blue); }
[data-mip-accounting-entries-grid] [data-mip-add-line].mip-btn--secondary:active:not(:disabled) { border-color: var(--mip-color-btn-pressed-blue); }
[data-mip-accounting-entries-grid] [data-mip-add-line].mip-btn--secondary:focus-visible {
  outline: none;
  background: transparent;
  border-color: var(--mip-color-primary-blue);
  color: var(--mip-action-text);
}
[data-mip-accounting-entries-grid] [data-mip-add-line].mip-btn--secondary:disabled { border-color: var(--mip-color-btn-disabled-fill); }

/* Report / Book / Summary toolbar (FNCE002..004 #3/#4): Search over Start and End Date, then the
   filters and Generate, then Print / How To / [...] on the left above the grid. */
.mip-report-toolbar.mip-jr-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--mip-space-3);
  margin-bottom: var(--mip-space-4);
}
.mip-jr-toolbar__filters {
  display: grid;
  grid-template-columns: 14rem 14rem auto;
  gap: var(--mip-space-2) var(--mip-space-3);
  align-items: end;
}
.mip-jr-toolbar__filters--branch { grid-template-columns: 14rem 14rem 14rem auto; }
.mip-jr-toolbar__search { grid-column: 1 / span 2; grid-row: 1; }
.mip-jr-toolbar__search .mip-action-bar__search { width: 100%; min-height: 2.4rem; }
.mip-jr-toolbar__filters > .mip-form-field { grid-row: 2; margin: 0; }
.mip-jr-toolbar__actions { display: flex; align-items: center; gap: var(--mip-space-2); }
@media (max-width: 40rem) {
  .mip-jr-toolbar__filters,
  .mip-jr-toolbar__filters--branch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mip-jr-toolbar__search { grid-column: 1 / -1; }
  .mip-jr-toolbar__filters > .mip-form-field { grid-row: auto; }
}

/* The read-only voucher pop-up (FNCE002 #5, FNCE003 #5). */
.mip-voucher-popup__title { margin: 0 0 var(--mip-space-3); font-size: 1.1rem; }
.mip-voucher-popup .mip-table-scroll { margin: var(--mip-space-3) 0; }
.mip-readonly-grid__wide { grid-column: 1 / -1; }
.mip-voucher-dialog__footer { display: flex; justify-content: flex-end; margin-top: var(--mip-space-3); }

/* The printed report (FNCE004 #5; also the Report and Book): centred logo, 12 pt / 11 pt bold Aptos
   title and period, 10 pt headers, 9 pt rows, 9 pt bold totals, 6 pt footer, A4 landscape. */
.mip-jr-print-header { text-align: center; margin-bottom: 10pt; font-family: Aptos, "Segoe UI", Arial, sans-serif; color: #000; }
.mip-jr-print-header__logo { display: block; max-height: 60px; max-width: 220px; margin: 0 auto 6pt; }
.mip-jr-print-header__title { font-size: 12pt; font-weight: 700; text-transform: uppercase; }
.mip-jr-print-header__subtitle { font-size: 11pt; font-weight: 700; text-transform: uppercase; margin-top: 2pt; }
/* MIP-039: the period's dates read Month Day, Year as written (not in capitals). */
.mip-jr-print-header__subtitle--period { text-transform: none; }
@media print {
  body:has(.mip-jr-print-header) h1 { display: none; }
}

/* ADR-223: Documentation. */
.mip-doc { min-width: 0; }
.mip-doc-section { padding: var(--mip-space-4) var(--mip-space-5); margin-bottom: var(--mip-space-4); }
.mip-doc-section h2 { font-size: 1.1rem; color: var(--mip-text); margin: 0 0 var(--mip-space-3); }
.mip-doc-section h3 { font-size: 1rem; color: var(--mip-text); margin: var(--mip-space-3) 0 var(--mip-space-2); }
.mip-doc-section h4 { font-size: 0.9rem; color: var(--mip-text); margin: var(--mip-space-3) 0 var(--mip-space-1); }
.mip-doc-section p, .mip-doc-section li { line-height: 1.55; color: var(--mip-text-body); }
.mip-doc-section ul, .mip-doc-section ol { padding-left: 1.4rem; }
.mip-doc-chapter { font-size: 1.25rem; color: var(--mip-text); margin: var(--mip-space-6) 0 var(--mip-space-3); padding-bottom: var(--mip-space-2); border-bottom: 2px solid var(--mip-border); }
.mip-doc-muted { color: var(--mip-color-text-muted); font-size: 0.85rem; }
.mip-doc-purpose { font-weight: 600; }
.mip-doc code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.85em; }
.mip-doc p code, .mip-doc td code, .mip-doc li code { background: var(--mip-bg-subtle); padding: 0 0.3em; border-radius: var(--mip-radius-sm); overflow-wrap: anywhere; }

.mip-doc-table { width: 100%; }
.mip-doc-table th { text-align: left; vertical-align: top; white-space: nowrap; }
.mip-doc-table td, .mip-doc-table th { padding: var(--mip-space-2) var(--mip-space-3); }
.mip-admin-body .mip-table.mip-doc-table td, .mip-table.mip-doc-table td { white-space: normal; overflow-wrap: anywhere; }   /* MIP-105: long text wraps */
.mip-doc-table--compact { width: auto; max-width: 100%; font-size: 0.85rem; }
.mip-doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--mip-space-3); margin-bottom: var(--mip-space-4); }
.mip-doc-card { display: flex; flex-direction: column; gap: var(--mip-space-1); padding: var(--mip-space-4); background: var(--mip-surface); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md); text-decoration: none; color: var(--mip-text-body); transition: border-color var(--mip-transition-fast), box-shadow var(--mip-transition-fast); }
.mip-doc-card strong { color: var(--mip-text); font-size: 1rem; }
.mip-doc-card span { font-size: 0.85rem; }
.mip-doc-card:hover, .mip-doc-card:focus-visible { border-color: var(--mip-color-primary-blue); box-shadow: var(--mip-shadow-sm); }

.mip-doc-home { text-decoration: none; color: inherit; }
.mip-doc-home:hover { text-decoration: underline; }
.mip-doc-arch { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--mip-space-2); margin-bottom: var(--mip-space-3); }
.mip-doc-arch > div:not(.mip-doc-arch__arrow) { flex: 1 1 10rem; display: flex; flex-direction: column; gap: var(--mip-space-1); padding: var(--mip-space-3); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md); background: var(--mip-bg-subtle); }
.mip-doc-arch strong { color: var(--mip-text); }
.mip-doc-arch span { font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-doc-arch__arrow { align-self: center; color: var(--mip-color-text-muted); font-size: 1.2rem; }
.mip-doc-search { margin-bottom: var(--mip-space-3); }
/* ADR-509: Documentation > System Flow - flowcharts of boxes and arrows; each chart's accent is a chart token
   (--flow-accent, themed for dark mode). Rows wrap; under 48rem the arrows turn downward. */
.mip-flow-intro { color: var(--mip-text-body); line-height: 1.55; margin: 0 0 var(--mip-space-3); max-width: 60rem; }
.mip-flow-jump { display: flex; flex-wrap: wrap; gap: var(--mip-space-2); margin-bottom: var(--mip-space-4); }
.mip-flow-jump a { padding: var(--mip-space-1) var(--mip-space-3); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-pill); background: var(--mip-surface); color: var(--mip-text-body); text-decoration: none; font-size: 0.85rem; }
.mip-flow-jump a:hover, .mip-flow-jump a:focus-visible { border-color: var(--mip-color-primary-blue); color: var(--mip-text); }
.mip-flow-section { border-top: 3px solid var(--flow-accent, var(--mip-border)); scroll-margin-top: var(--mip-space-4); }
.mip-flow-section h2 { color: var(--mip-text); }
.mip-flow { list-style: none; margin: var(--mip-space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--mip-space-3) 0; }
.mip-flow__step { display: flex; align-items: stretch; flex: 1 1 14rem; max-width: 20rem; min-width: 13rem; }
.mip-flow--map .mip-flow__step, .mip-flow--tech .mip-flow__step { max-width: none; }
.mip-flow__step + .mip-flow__step::before { content: "\2192"; align-self: center; flex: 0 0 auto; padding: 0 var(--mip-space-2); color: var(--flow-accent, var(--mip-color-text-muted)); font-size: 1.25rem; font-weight: 700; }
.mip-flow__box { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--mip-space-1); min-width: 0; padding: var(--mip-space-3); background: var(--mip-surface); border: 1px solid var(--mip-border); border-left: 4px solid var(--flow-accent, var(--mip-border)); border-radius: var(--mip-radius-md); color: var(--mip-text-body); text-decoration: none; }
.mip-flow__box--group { background: var(--mip-bg-subtle); }
.mip-flow__box--link { transition: box-shadow var(--mip-transition-fast), border-color var(--mip-transition-fast); }
.mip-flow__box--link:hover, .mip-flow__box--link:focus-visible { box-shadow: var(--mip-shadow-md); border-color: var(--flow-accent); }
.mip-flow__no { position: absolute; top: calc(-1 * var(--mip-space-2)); right: var(--mip-space-2); min-width: 1.4rem; height: 1.4rem; padding: 0 0.3rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--mip-radius-pill); background: var(--flow-accent); color: var(--mip-surface); font-size: 0.75rem; font-weight: 700; }
.mip-flow__title { color: var(--mip-text); font-size: 0.95rem; }
.mip-flow__text { font-size: 0.82rem; line-height: 1.45; }
.mip-flow__posts { display: block; margin-top: auto; padding: var(--mip-space-1) var(--mip-space-2); border-radius: var(--mip-radius-sm); background: var(--mip-bg-subtle); color: var(--mip-text-body); font-size: 0.76rem; line-height: 1.4; }
.mip-flow__posts--legend { display: inline; margin: 0; }
.mip-flow__open { font-size: 0.78rem; font-weight: 600; color: var(--mip-link); }
.mip-flow__chips { display: flex; flex-wrap: wrap; gap: var(--mip-space-1); list-style: none; margin: 0; padding: 0; }
.mip-flow__chips > span, .mip-flow__chips > li { padding: 0.1rem var(--mip-space-2); border-radius: var(--mip-radius-pill); background: var(--mip-surface); border: 1px solid var(--mip-border); font-size: 0.78rem; color: var(--mip-text-body); }
.mip-flow__branches { display: flex; flex-direction: column; gap: var(--mip-space-3); margin-top: var(--mip-space-4); padding-top: var(--mip-space-3); border-top: 1px dashed var(--mip-border); }
.mip-flow__branch { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--mip-space-2) var(--mip-space-3); }
.mip-flow__branch-label { flex: 0 0 11rem; padding-top: var(--mip-space-3); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--mip-color-text-muted); }
.mip-flow__branch .mip-flow, .mip-flow__branch .mip-flow__chips--wide { flex: 1 1 24rem; margin-top: 0; }
.mip-flow--small .mip-flow__step { flex-basis: 13rem; max-width: 18rem; min-width: 12rem; }
.mip-flow--small .mip-flow__box { border-left-width: 2px; border-style: dashed; border-left-style: solid; }
.mip-flow__note { margin: var(--mip-space-3) 0 0; font-size: 0.85rem; color: var(--mip-color-text-muted); }
@media (max-width: 48rem) {
  .mip-flow { flex-direction: column; }
  .mip-flow__step, .mip-flow--small .mip-flow__step { flex: 0 0 auto; flex-direction: column; max-width: none; min-width: 0; }
  .mip-flow__step + .mip-flow__step::before { content: "\2193"; align-self: center; padding: var(--mip-space-1) 0; }
  .mip-flow__branch-label { flex-basis: 100%; padding-top: 0; }
}
@media print {
  .mip-flow-jump, .mip-entry-header__actions { display: none !important; }
  .mip-flow-section { break-inside: avoid; }
  .mip-flow__open { display: none; }
}
.mip-doc-search .mip-action-bar__search { flex: 1 1 24rem; width: 100%; max-width: 40rem; min-height: 2.2rem; }
.mip-doc-search--bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mip-space-3); }
.mip-doc-toc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--mip-space-2) var(--mip-space-5); }
.mip-doc-toc__grid h3 { margin-top: 0; font-size: 0.95rem; }
.mip-doc-toc__grid ul { list-style: none; padding: 0; margin: 0 0 var(--mip-space-3); }
.mip-doc-toc__grid li { font-size: 0.85rem; line-height: 1.7; }
.mip-doc-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--mip-space-3); }
.mip-doc-shots figure { margin: 0; }
.mip-doc-shots img { width: 100%; height: auto; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); }
.mip-doc-shots figcaption { font-size: 0.8rem; color: var(--mip-color-text-muted); text-align: center; margin-top: var(--mip-space-1); }

.mip-doc-change { padding: var(--mip-space-2) 0; border-bottom: 1px solid var(--mip-border-subtle); overflow-wrap: anywhere; }
.mip-doc-change:last-child { border-bottom: 0; }
.mip-doc-change h3 { margin: 0 0 var(--mip-space-1); font-size: 0.95rem; }
.mip-doc-change p { margin: 0; font-size: 0.9rem; }
@media (max-width: 48rem) {
  .mip-doc-section { padding: var(--mip-space-3); }
}

/* ADR-228: one filter / search look across the modules (the Financial journal design).
   The reports' search is the oblong pill on its own row above the filters; JS sizes it to reach the
   End Date (or As of date). */
.mip-report-toolbar > .mip-report-search--pill { flex: 1 0 100%; margin: 0; }
.mip-report-toolbar > .mip-report-search--pill .mip-action-bar__search { flex: none; align-self: flex-start; height: 2.95rem; min-height: 2.95rem; max-width: 100%; min-width: 16rem; }
/* Report filters keep room for "September 30, 2026" in the box (their columns size to content). */
.mip-report-toolbar form.mip-form-grid .mip-form-field.mip-longdate-field,
.mip-audit-filters .mip-form-field.mip-longdate-field { min-width: 11.5rem; }

/* ADR-228: one search box across all modules - the oblong pill with the magnifier wherever it sits
   (action bar, report toolbar, Audit filters, Advances Aging...). The form-field input rules are more
   specific than .mip-action-bar__search, so outside the action bar they turned it into a rectangle. */
.mip-form-field input.mip-action-bar__search,
.mip-report-toolbar .mip-form-field input.mip-action-bar__search,
.mip-audit-filters input.mip-action-bar__search {
  box-sizing: border-box;
  flex: none;
  align-self: flex-start;
  height: 2.95rem;
  min-height: 2.95rem; /* the action bar's 38px */
  padding: var(--mip-space-2) var(--mip-space-3) var(--mip-space-2) var(--mip-space-6);
  border: 1px solid var(--mip-color-company-selector);
  border-radius: var(--mip-radius-pill);
  font-size: 0.85rem;
  background: var(--mip-surface)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%231c61a1' stroke-width='1.6'><circle cx='8.5' cy='8.5' r='5.5'/><line x1='16' y1='16' x2='12.6' y2='12.6' stroke-linecap='round'/></svg>")
    no-repeat left var(--mip-space-2) center;
  background-size: 1rem;
}
.mip-audit-filters .mip-form-field:has(> input.mip-action-bar__search) { justify-content: flex-end; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mip-form-field input.mip-action-bar__search,
  :root:not([data-theme="light"]) .mip-audit-filters input.mip-action-bar__search {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23c9c6bc' stroke-width='1.6'><circle cx='8.5' cy='8.5' r='5.5'/><line x1='16' y1='16' x2='12.6' y2='12.6' stroke-linecap='round'/></svg>");
  }
}
:root[data-theme="dark"] .mip-form-field input.mip-action-bar__search,
:root[data-theme="dark"] .mip-audit-filters input.mip-action-bar__search {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23c9c6bc' stroke-width='1.6'><circle cx='8.5' cy='8.5' r='5.5'/><line x1='16' y1='16' x2='12.6' y2='12.6' stroke-linecap='round'/></svg>");
}

/* ADR-229: Background Job Center - the export / import dialogs' "Run in the background" checkbox
   and the Job Center list. Theme tokens only (light and dark). */
.mip-modal__check { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.85rem; cursor: pointer; }
.mip-modal__check input { width: 1rem; height: 1rem; margin: 0; }

/* ADR-230: the signed-in user in the header (initials, name, role) and the status bar at the foot
   of every page. Theme tokens only. */
.mip-user-chip { display: inline-flex; align-items: center; gap: 0.55rem; width: auto; padding: 2px 6px 2px 2px; border-radius: var(--mip-radius-pill); }
.mip-user-chip__avatar {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: color-mix(in srgb, var(--mip-color-white) 22%, transparent); color: var(--mip-color-white);
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em;
}
.mip-user-chip__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.mip-user-chip__name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.mip-user-chip__role { font-size: 0.75rem; opacity: 0.8; white-space: nowrap; }
.mip-user-chip__caret { opacity: 0.8; }
@media (max-width: 60rem) { .mip-user-chip__text, .mip-user-chip__caret { display: none; } }

body:has(> .mip-statusbar) { display: flex; flex-direction: column; min-height: 100vh; }
body:has(> .mip-statusbar) > .mip-shell-main { flex: 1 0 auto; }
.mip-statusbar {
  /* z-index 25: above the page (sticky toolbars are 20) but under every popup (menus, selects, pickers are 30+), so a long [...] menu
     near the bottom of the screen is never covered by the status bar. */
  position: sticky; bottom: 0; z-index: 25;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
  padding: 0.45rem var(--mip-space-5);
  background: var(--mip-header-bg); color: color-mix(in srgb, var(--mip-color-white) 88%, transparent);
  font-size: 0.82rem;
}
/* ADR-748: three chips (where you are / for you / system), each opening a small panel above it. */
.mip-statusbar__item { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.mip-statusbar__spacer { flex: 1; }
.mip-statusbar__group { position: relative; display: inline-flex; }
.mip-statusbar__group[hidden] { display: none; }
.mip-statusbar__chip {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; max-width: 100%;
  padding: 0.2rem 0.6rem; border-radius: var(--mip-radius-sm); cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--mip-color-white) 22%, transparent); background: transparent;
  color: inherit; font: inherit;
}
.mip-statusbar__chip:hover, .mip-statusbar__chip[aria-expanded="true"] { background: color-mix(in srgb, var(--mip-color-white) 12%, transparent); }
.mip-statusbar__chip:focus-visible { outline: 2px solid var(--mip-color-white); outline-offset: 1px; }
.mip-statusbar__company { overflow: hidden; text-overflow: ellipsis; max-width: 18rem; }
.mip-statusbar__sep { opacity: 0.6; }
.mip-statusbar__pill { padding: 0.05rem 0.5rem; border-radius: var(--mip-radius-pill); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
.mip-statusbar__pill[data-state="Test"] { background: var(--mip-color-warning-tint); color: var(--mip-color-warning); }
.mip-statusbar__count { min-width: 1.25rem; padding: 0 0.4rem; border-radius: var(--mip-radius-pill); text-align: center; font-size: 0.72rem; font-weight: 600;
  background: var(--mip-color-accent-blue); color: var(--mip-color-white); }
.mip-statusbar__dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--mip-color-warning); }
.mip-statusbar__live[data-mip-live="on"] .mip-statusbar__dot { background: var(--mip-color-success); }
.mip-statusbar__live[data-mip-live="off"] .mip-statusbar__dot { background: var(--mip-color-text-disabled); }
.mip-statusbar__version { opacity: 0.85; }
.mip-statusbar__panel {
  position: absolute; bottom: calc(100% + 0.5rem); left: 0; z-index: 40; min-width: 18rem; max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.35rem 0; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md);
  background: var(--mip-surface-raised); color: var(--mip-text); box-shadow: var(--mip-shadow-lg); font-size: 0.85rem;
}
.mip-statusbar__panel[hidden] { display: none; }
.mip-statusbar__panel--end { left: auto; right: 0; }
.mip-statusbar__row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: 0.4rem 0.9rem;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none;
}
.mip-statusbar__row[hidden] { display: none; }
.mip-statusbar__row + .mip-statusbar__row { border-top: 1px solid var(--mip-border-subtle); }
.mip-statusbar__row > span:first-child { color: var(--mip-color-text-muted); }
.mip-statusbar__row > span:last-child { text-align: right; }
.mip-statusbar__row--link { cursor: pointer; }
.mip-statusbar__row--link:hover { background: var(--mip-color-surface-muted); }
.mip-statusbar__link { border: 0; background: transparent; padding: 0; font: inherit; color: var(--mip-color-accent-blue); cursor: pointer; }
.mip-statusbar__warn { color: var(--mip-color-warning); font-weight: 600; }
.mip-statusbar__toast {
  position: absolute; bottom: calc(100% + 0.5rem); right: var(--mip-space-5); z-index: 40; max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.5rem 0.85rem; border-radius: var(--mip-radius-md); border: 1px solid var(--mip-border);
  background: var(--mip-surface-raised); color: var(--mip-text); box-shadow: var(--mip-shadow-md); font-size: 0.85rem;
}
.mip-statusbar__toast[hidden] { display: none; }
.mip-statusbar__toast[data-state="error"] { border-color: var(--mip-color-danger); }
@media (max-width: 60rem) { .mip-statusbar__wide { display: none; } }
@media print { .mip-statusbar { display: none !important; } }
@media (max-width: 40rem) { .mip-statusbar { position: static; } }

/* ADR-231 (Intelligence Pack): the assistant - a header button and a panel docked on the right.
   Theme tokens only (light and dark). */
.mip-assistant-trigger {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-right: 0.25rem;
  /* ADR-486: the same light icon colour as the other header icons (it inherited the dark text colour on the blue bar). */
  border: none; border-radius: 50%; background: transparent; color: var(--mip-color-highlight-blue); cursor: pointer;
}
.mip-assistant-trigger:hover, .mip-assistant-trigger:focus-visible { background: color-mix(in srgb, var(--mip-color-white) 14%, transparent); }
.mip-assistant {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 900; width: min(26rem, 100vw);
  display: flex; flex-direction: column; background: var(--mip-surface); color: var(--mip-text);
  border-left: 1px solid var(--mip-border); box-shadow: var(--mip-shadow-lg);
}
.mip-assistant[hidden] { display: none; }
.mip-assistant__head {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--mip-border-subtle);
}
.mip-assistant__badge {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--mip-color-primary-blue) 12%, var(--mip-surface)); color: var(--mip-color-primary-blue);
}
.mip-assistant__heading { flex: 1; min-width: 0; }
.mip-assistant__heading h2 { margin: 0; font-size: 1.05rem; }
.mip-assistant__heading p { margin: 0; font-size: 0.78rem; color: var(--mip-color-text-muted); }
.mip-assistant__icon {
  border: none; background: none; cursor: pointer; color: var(--mip-color-text-muted);
  width: 2rem; height: 2rem; border-radius: var(--mip-radius-sm); font-size: 0.95rem;
}
.mip-assistant__icon:hover { background: var(--mip-hover-bg); color: var(--mip-text); }
.mip-assistant__log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.mip-assistant__msg { max-width: 92%; font-size: 0.9rem; line-height: 1.4; }
.mip-assistant__msg--me {
  align-self: flex-end; padding: 0.55rem 0.8rem; border-radius: 14px 14px 4px 14px;
  background: var(--mip-color-primary-blue); color: var(--mip-color-white);
}
.mip-assistant__msg--bot {
  align-self: flex-start; padding: 0.7rem 0.85rem; border-radius: 14px 14px 14px 4px;
  background: var(--mip-bg-subtle); border: 1px solid var(--mip-border-subtle);
}
.mip-assistant__msg--thinking { color: var(--mip-color-text-muted); font-style: italic; }
.mip-assistant__text { margin: 0; }
.mip-assistant__text + .mip-assistant__text { margin-top: 0.45rem; }
/* ADR-247: supporting facts and steps under an answer. */
.mip-assistant__points { margin: 0.5rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.mip-assistant__points li { overflow-wrap: anywhere; }
.mip-assistant__items { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.mip-assistant__item {
  --tone: var(--mip-border);
  display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.5rem; padding: 0.45rem 0.6rem;
  border-left: 3px solid var(--tone); border-radius: var(--mip-radius-sm); background: var(--mip-surface);
}
.mip-assistant__item--critical { --tone: var(--mip-color-danger); }
.mip-assistant__item--warning { --tone: var(--mip-color-warning); }
.mip-assistant__item--good { --tone: var(--mip-color-success); }
.mip-assistant__item--info { --tone: var(--mip-color-info); }
.mip-assistant__item-title { font-weight: 600; color: var(--mip-text); text-decoration: none; overflow-wrap: anywhere; }
a.mip-assistant__item-title { color: var(--mip-color-link-blue); }
a.mip-assistant__item-title:hover { text-decoration: underline; }
.mip-assistant__item-status { font-size: 0.75rem; font-weight: 600; color: var(--mip-color-text-muted); white-space: nowrap; }
.mip-assistant__item-sub { grid-column: 1 / -1; font-size: 0.78rem; color: var(--mip-color-text-muted); }
.mip-assistant__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.mip-assistant__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.mip-assistant__chip {
  border: 1px solid color-mix(in srgb, var(--mip-color-primary-blue) 35%, transparent); border-radius: var(--mip-radius-pill);
  background: var(--mip-surface); color: var(--mip-color-primary-blue); font: inherit; font-size: 0.78rem;
  padding: 0.25rem 0.65rem; cursor: pointer;
}
.mip-assistant__chip:hover { background: color-mix(in srgb, var(--mip-color-primary-blue) 9%, var(--mip-surface)); }
.mip-assistant__engine { display: block; margin-top: 0.4rem; font-size: 0.7rem; color: var(--mip-color-text-muted); }
.mip-assistant__context {
  margin: 0 1rem 0.5rem; padding: 0.4rem 0.6rem; font-size: 0.78rem; border-radius: var(--mip-radius-sm);
  background: color-mix(in srgb, var(--mip-color-info) 10%, var(--mip-surface)); color: var(--mip-text);
}
.mip-assistant__ask { display: flex; gap: 0.5rem; padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--mip-border-subtle); }
.mip-assistant__ask input {
  flex: 1; min-width: 0; min-height: 2.5rem; padding: 0 0.85rem; font: inherit; font-size: 0.9rem;
  border: 1px solid var(--mip-color-company-selector); border-radius: var(--mip-radius-pill);
  background: var(--mip-surface); color: var(--mip-text);
}
.mip-assistant__ask .mip-btn { border-radius: var(--mip-radius-pill); min-width: 2.75rem; }
/* ADR-536: the Platform console (option B) - the header search, the grouped side menu, the Overview cards, the state filters, a
   tenant's summary and tabs. Theme tokens only (light and dark). */

.mip-platform-search { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.mip-platform-search input {
  min-width: min(20rem, 60vw); min-height: 2.4rem; padding: 0 0.85rem; font: inherit; font-size: 0.9rem; color: var(--mip-text);
  background: var(--mip-surface); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-pill);
}
.mip-platform-nav { display: flex; flex-direction: column; gap: 1rem; }
/* The side menu stays in view while the page scrolls (below the 58px sticky header, above the status bar). */
.mip-platform-nav { position: sticky; top: 4.75rem; align-self: flex-start; max-height: calc(100vh - 8rem); overflow-y: auto; }
.mip-platform-nav__group { display: flex; flex-direction: column; gap: 0.15rem; }
.mip-platform-nav__title {
  padding: 0 0.75rem 0.2rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mip-color-text-muted);
}
.mip-platform-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.mip-platform-kpi {
  display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 1.1rem; text-decoration: none; color: var(--mip-text);
  background: var(--mip-surface); border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-md);
}
.mip-platform-kpi:hover, .mip-platform-kpi:focus-visible { border-color: var(--mip-color-primary-blue); }
.mip-platform-kpi__label { font-size: 0.82rem; color: var(--mip-color-text-muted); }
.mip-platform-kpi__value { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mip-platform-kpi__note { font-size: 0.78rem; color: var(--mip-color-text-muted); }

.mip-platform-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 64rem) { .mip-platform-columns { grid-template-columns: minmax(0, 1fr); } }
/* MIP-055 (QA TTS-036 Cycle 6 CIS 056 1): the Provider Home widgets. */
.mip-platform-columns + .mip-platform-columns { margin-top: 1rem; }
.mip-home-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 64rem) { .mip-home-columns { grid-template-columns: minmax(0, 1fr); } }
.mip-home-gateway__dot { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.5rem; border-radius: 50%; vertical-align: middle; background: var(--mip-color-text-muted); }
.mip-home-gateway--up .mip-home-gateway__dot { background: var(--mip-color-success); box-shadow: 0 0 0 0.25rem var(--mip-color-success-tint); }
.mip-home-gateway--down .mip-home-gateway__dot { background: var(--mip-color-danger); box-shadow: 0 0 0 0.25rem var(--mip-color-danger-tint); }
.mip-home-gateway--down .mip-platform-kpi__value { color: var(--mip-color-danger); }
.mip-home-pie { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.mip-home-pie svg { width: 9rem; height: 9rem; flex: none; }
.mip-home-pie__legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.88rem; }
.mip-home-pie__legend strong { margin-left: 0.35rem; font-variant-numeric: tabular-nums; }
/* MIP-086: the Provider Home's chart and pipeline panels had no inner padding (their titles sat on the border), and a section heading
   right after a form (Onboarding's Attachments) touched the form's Save button. */
.mip-home-columns > .mip-panel:not(.mip-panel--table) { padding: var(--mip-space-5); }
.mip-panel--form form + .mip-form-section__title { margin-top: var(--mip-space-6); }
.mip-table-scroll + form { margin-top: var(--mip-space-4); }   /* an add row under its table (Configurations) */
.mip-home-pie__swatch { display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.45rem; border-radius: 0.15rem; vertical-align: middle; }
.mip-home-pie__ok { fill: var(--mip-color-success); background: var(--mip-color-success); }
.mip-home-pie__pending { fill: var(--mip-color-warning); background: var(--mip-color-warning); }
.mip-home-pie__failed { fill: var(--mip-color-danger); background: var(--mip-color-danger); }
.mip-home-pie__empty { fill: none; stroke: var(--mip-color-border); stroke-width: 6; }
.mip-home-pipeline { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.mip-home-pipeline a { display: flex; flex-direction: column; min-width: 7rem; padding: 0.6rem 0.8rem; text-decoration: none; color: var(--mip-text);
  border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-md); }
.mip-home-pipeline a:hover, .mip-home-pipeline a:focus-visible { border-color: var(--mip-color-primary-blue); }
.mip-home-pipeline strong { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mip-home-pipeline span { font-size: 0.78rem; color: var(--mip-color-text-muted); }

.mip-home-feed { max-height: 22rem; overflow-y: auto; }
/* MIP-057: the Company Logo on the provider's tab. */
.mip-platform-logo { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mip-platform-logo__img { max-height: 5rem; max-width: 14rem; border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-md); padding: 0.25rem; background: #fff; }
.mip-home-alert--over strong { color: var(--mip-color-danger); }
.mip-platform-feed { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.88rem; }
.mip-platform-feed li { display: flex; flex-direction: column; gap: 0.1rem; }
.mip-platform-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.85rem; }
.mip-platform-chip {
  padding: 0.3rem 0.85rem; font-size: 0.82rem; text-decoration: none; color: var(--mip-text);
  border: 1px solid var(--mip-border); border-radius: var(--mip-radius-pill); background: var(--mip-surface);
}
.mip-platform-chip:hover { background: var(--mip-hover-bg); }
.mip-platform-chip--on {
  font-weight: 600; color: var(--mip-color-primary-blue); border-color: var(--mip-color-primary-blue);
  background: color-mix(in srgb, var(--mip-color-primary-blue) 10%, var(--mip-surface));
}
.mip-platform-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin: 0 0 1rem; padding: 0.9rem 1.1rem;
  background: var(--mip-surface); border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-md);
}
.mip-platform-summary div { display: flex; flex-direction: column; gap: 0.15rem; }
.mip-platform-summary span { font-size: 0.78rem; color: var(--mip-color-text-muted); }
.mip-platform-tabs { margin-bottom: 1rem; }
[data-mip-tab-panel][hidden] { display: none; }

/* ADR-535: entry layout on every entry screen - A guided sections (numbered sections, a step strip, actions only at the top)
   and C spreadsheet line grids. entry-layout.js adds these classes; theme tokens only (light and dark). */
.mip-guided-num {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: 0.55rem; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; vertical-align: middle; flex: none;
  background: color-mix(in srgb, var(--mip-color-primary-blue) 14%, var(--mip-surface)); color: var(--mip-color-primary-blue);
}
.mip-guided-title { display: flex; align-items: center; }
.mip-guided-title--added { margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; }
.mip-guided-section { scroll-margin-top: 7rem; }
.mip-guided-section .mip-form-field:has(:required:not([type=hidden]):not([type=checkbox]):not([type=radio])) > label:not(:has(input))::after { content: " *"; color: var(--mip-color-danger); }
.mip-guided-rail {
  position: sticky; top: var(--mip-shell-top, 0px); z-index: 20; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin: 0 0 1rem; padding: 0.5rem 0.6rem; border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-md);
  background: var(--mip-surface); box-shadow: 0 2px 8px color-mix(in srgb, var(--mip-text) 8%, transparent);
}
.mip-guided-rail__list { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; flex: 1; min-width: 0; }
.mip-guided-rail__item {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.7rem 0.35rem 0.4rem; border-radius: var(--mip-radius-pill);
  color: var(--mip-text); text-decoration: none; font-size: 0.85rem; min-height: 2.25rem; box-sizing: border-box;
}
.mip-guided-rail__item:hover, .mip-guided-rail__item:focus-visible { background: var(--mip-hover-bg); }
.mip-guided-rail__num {
  display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none; font-size: 0.75rem; font-weight: 700;
  border: 2px solid var(--mip-border); color: var(--mip-color-text-muted); box-sizing: border-box;
}
.mip-guided-rail__item[data-state="done"] .mip-guided-rail__num { background: var(--mip-color-success); border-color: var(--mip-color-success); color: var(--mip-surface); }
.mip-guided-rail__item[data-state="error"] .mip-guided-rail__num { background: var(--mip-color-danger); border-color: var(--mip-color-danger); color: var(--mip-surface); }
.mip-guided-rail__text { display: flex; flex-direction: column; line-height: 1.15; }
.mip-guided-rail__text strong { font-weight: 600; }
.mip-guided-rail__state { font-size: 0.72rem; color: var(--mip-color-text-muted); }
.mip-guided-rail__item[data-state="error"] .mip-guided-rail__state { color: var(--mip-color-danger); }

/* One place for actions (the header): the originals stay in place, hidden; a toolbar left empty is hidden too. */
.mip-action-moved, .mip-action-empty { display: none !important; }

.mip-guided-rail__fix { font-size: 0.8rem; font-weight: 600; color: var(--mip-color-danger); white-space: nowrap; }
.mip-guided-rail__fix[hidden] { display: none; }
.mip-line-grid { border-collapse: collapse; }
.mip-line-grid th { position: sticky; top: 0; z-index: 1; background: var(--mip-bg-subtle); font-size: 0.78rem; }
.mip-line-grid th, .mip-line-grid td { border: 1px solid var(--mip-border-subtle); }
.mip-line-grid td { padding: 2px 4px; vertical-align: middle; }
.mip-line-grid td input:not([type=checkbox]):not([type=radio]), .mip-line-grid td select, .mip-line-grid td textarea,
.mip-line-grid td .mip-searchable-select__input {
  border-color: transparent; background-color: transparent; border-radius: 4px; min-height: 2.1rem; box-shadow: none;
}
.mip-line-grid td:focus-within { outline: 2px solid var(--mip-color-primary-blue); outline-offset: -2px; background: color-mix(in srgb, var(--mip-color-primary-blue) 6%, var(--mip-surface)); }
.mip-line-grid td input[type=number], .mip-line-grid td input[inputmode=decimal], .mip-line-grid td input[data-mip-numeric] { text-align: right; font-variant-numeric: tabular-nums; }
.mip-line-grid tbody tr:hover td { background: var(--mip-hover-bg); }
.mip-line-grid tfoot td { font-weight: 600; background: var(--mip-bg-subtle); }
/* ADR-796 (QA TTS-024 MR DEFECT 019): the keyboard hints are one subtle Shortcuts button (rail: right end; else over the grid). */
.mip-line-grid-keys { display: flex; justify-content: flex-end; margin: 0 0 0.5rem; }
.mip-guided-rail .mip-shortcuts-btn { margin-left: auto; }
.mip-shortcuts-btn { font-weight: 500; color: var(--mip-color-text-muted); }
.mip-line-grid-keys kbd {
  font: inherit; font-size: 0.72rem; font-weight: 600; padding: 0.05rem 0.4rem; border-radius: 4px;
  border: 1px solid var(--mip-border); background: var(--mip-surface); color: var(--mip-text);
}
@media (max-width: 48rem) { .mip-line-grid-keys, .mip-shortcuts-btn { display: none; } .mip-guided-rail { position: static; } }
@media print { .mip-guided-rail, .mip-line-grid-keys, .mip-guided-num { display: none !important; } }
/* ADR-796: a field whose label carries an (i) help icon stays at the top of a taller grid row, level with its neighbours. */
.mip-form-field:has(> label + .mip-help) { align-content: start; }
/* ADR-802: a field that is only a switch (Active, Allow ...) sits on the input line of its row, not at label height - every form. */
.mip-form-grid > .mip-form-field:has(> label.mip-form-field__toggle:only-child),
.mip-form-grid > .mip-form-field:has(> label.mip-toggle-field:only-child) { justify-content: flex-start; padding-top: 1.14rem; }
.mip-form-grid > .mip-form-field > label.mip-form-field__toggle:only-child,
.mip-form-grid > .mip-form-field > label.mip-toggle-field:only-child { min-height: 2.4rem; display: flex; align-items: center; gap: var(--mip-space-2); margin: 0; }

/* ADR-534: autocomplete, the "as of" line, and the new-form confirm card. Tokens only. */
.mip-assistant__ask { position: relative; }
.mip-assistant__suggest {
  position: absolute; left: 1rem; right: 1rem; bottom: calc(100% - 0.25rem); z-index: 2; margin: 0; padding: 0.25rem 0; list-style: none;
  max-height: 16rem; overflow-y: auto; background: var(--mip-surface); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md);
  box-shadow: var(--mip-shadow-lg);
}
.mip-assistant__suggest[hidden] { display: none; }
.mip-assistant__suggest-item { padding: 0.45rem 0.8rem; font-size: 0.85rem; cursor: pointer; color: var(--mip-text); }
.mip-assistant__suggest-item:hover, .mip-assistant__suggest-item[aria-selected="true"] { background: var(--mip-hover-bg); }
.mip-assistant__asof { display: block; margin-top: 0.45rem; font-size: 0.72rem; color: var(--mip-color-text-muted); }
.mip-assistant__prefill {
  margin-top: 0.6rem; padding: 0.6rem 0.75rem; border-radius: var(--mip-radius-md); background: var(--mip-surface);
  border: 1px solid color-mix(in srgb, var(--mip-color-primary-blue) 35%, transparent);
}
.mip-assistant__prefill-title { display: block; font-size: 0.88rem; }
.mip-assistant__prefill-list { margin: 0.35rem 0 0.5rem; padding-left: 1.1rem; font-size: 0.82rem; }
.mip-assistant__prefill-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
@media print { .mip-assistant, .mip-assistant-trigger { display: none !important; } }

/* ADR-232: compare two versions of a record in the record drawer. Theme tokens only. */
.mip-record-compare__open, .mip-record-compare__back { margin-bottom: 0.75rem; }
.mip-record-compare__pickers { display: grid; grid-template-columns: 1fr; gap: 0.5rem; margin-bottom: 0.75rem; }
.mip-record-compare__picker { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-record-compare__picker select {
  min-height: 2.3rem; padding: 0 0.6rem; font: inherit; font-size: 0.85rem; color: var(--mip-text);
  border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background-color: var(--mip-surface);
}
.mip-record-compare__summary { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--mip-color-text-muted); }
.mip-record-compare__table { font-size: 0.82rem; }
.mip-record-compare__table td { vertical-align: top; overflow-wrap: anywhere; }
.mip-record-compare__field { font-weight: 600; }
.mip-record-compare__old { color: var(--mip-color-danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mip-color-danger) 50%, transparent); }
.mip-record-compare__new { color: var(--mip-color-success); font-weight: 600; }
.mip-record-compare__by { color: var(--mip-color-text-muted); white-space: nowrap; }

/* ADR-236: where a record is used - the edit screen's notice and the drawer's section. Tokens only. */
.mip-usage-notice { margin: 0 0 var(--mip-space-3); padding: 0.6rem 0.9rem; border-left: 3px solid var(--mip-color-info); border-radius: var(--mip-radius-sm);
  background: var(--mip-color-info-tint); color: var(--mip-text); font-size: 0.875rem; }
.mip-usage-notice--unused { border-left-color: var(--mip-border); background: transparent; color: var(--mip-color-text-muted); padding-top: 0.2rem; padding-bottom: 0.2rem; }
.mip-usage-notice__line { margin: 0; }
.mip-usage-notice__line strong { color: var(--mip-color-info); }
.mip-usage-notice__toggle { padding: 0; border: 0; background: none; font: inherit; color: var(--mip-color-info); text-decoration: underline; cursor: pointer; }
.mip-usage-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.mip-usage-list__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--mip-space-3); padding: 0.3rem 0; border-top: 1px solid var(--mip-border-subtle); }
.mip-usage-list__label { font-weight: 600; }
.mip-usage-list__count { text-align: right; white-space: nowrap; }
.mip-usage-list__samples { grid-column: 1 / -1; font-size: 0.8rem; color: var(--mip-color-text-muted); overflow-wrap: anywhere; }

/* ADR-723 (QA TTS-006 BRC DEFECTS 011 / 015): Section 1's four fields in one row; Section 2's two summary rows (2 fields, then 6), the
   Bank Statement Entries and Book Entries as wide as each other with Match History below; the attachments with Preview / Download. */
.mip-form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 64rem) { .mip-form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ADR-723 (DEFECT 007): a setting the user may not change - gray fill #E9ECF0, gray text #9CA2AB (the existing tokens). */
.mip-form-field--locked input:disabled,
.mip-form-field--locked select:disabled {
  background: var(--mip-color-btn-disabled-fill);
  color: var(--mip-color-text-disabled);
  cursor: not-allowed;
}

/* Phases 19-20 (ADR-279..292): the line grids of the inventory documents keep the item, account and unit
   pickers wide enough to read the code and name; the grid scrolls inside its panel (ADR-201). */
.mip-table td.mip-cell-item { min-width: 15rem; }
.mip-table td.mip-cell-account { min-width: 14rem; }
.mip-table td.mip-cell-uom { min-width: 6.5rem; }
.mip-table td.mip-cell-qty { min-width: 6rem; }
/* Phase 28 (ADR-365): a free-text cell (work scope, delivered work) stays wide enough to read. */
.mip-table td.mip-cell-text { min-width: 16rem; }
.mip-table td.mip-cell-text input { width: 100%; }
.mip-table td.mip-cell-text select { width: 100%; }
/* Phases 33-34 (ADR-431): a read-only item cell - the code with its description under it, one column instead of two. */
.mip-table td.mip-cell-itemtext { min-width: 10rem; }
/* ADR-506: the direct (no source document) lines of a Purchase Order / Sales Invoice - readable pickers and amounts. */
[data-mip-po-lines] select[data-mip-po-item], [data-mip-si-direct] select[data-mip-si-item] { width: 100%; min-width: 14rem; }
[data-mip-po-lines] select[data-mip-po-uom] { min-width: 5.5rem; }
[data-mip-po-lines] input[data-mip-price], [data-mip-si-direct] input[type="number"], [data-mip-si-direct] input[data-mip-numeric] { min-width: 6.5rem; }
[data-mip-si-direct] input[data-mip-si-desc] { width: 100%; min-width: 12rem; }
.mip-cell-note { display: block; color: var(--mip-color-text-muted); font-size: 0.78rem; }
/* ADR-580: the Vendor Bill lines - document numbers and dates on one line, a readable tax code. */
[data-mip-bill-lines] td.mip-cell-docno { white-space: nowrap; }
[data-mip-bill-lines] select[data-mip-tax-code] { min-width: 8.5rem; }

/* Phase 24 (ADR-336): a form's action buttons in one row; a requisition line's Available Stock opens its
   per-warehouse breakdown in place (display only - nothing is reserved). */
.mip-form-actions { display: flex; flex-wrap: wrap; gap: var(--mip-space-3); align-items: center; }

/* ADR-481: the Platform console (provider operators). ADR-750: a module tab / side-menu screen the user may not open is locked. */
.mip-primary-nav__tab--locked, .mip-dropdown__item--locked, .mip-nav-noaccess { cursor: not-allowed; }
.mip-primary-nav__tab--locked::after, .mip-dropdown__item--locked::after, .mip-nav-noaccess::after {
  content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-left: 0.35rem; vertical-align: -0.05rem; opacity: 0.75;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mip-platform-inline-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--mip-space-3); margin-bottom: var(--mip-space-3); }
.mip-platform-inline-form .mip-form-field { min-width: 12rem; }

/* ============================================================================================
   ADR-492: one modal shell for every dialog, in every module.
   Before: form dialogs (Create User / Role / Company, customer and supplier pop-ups, aging detail,
   exchange-rate prompt) also matched the entry-form page rule, so they lost their width and centring
   and stuck to the top-left corner almost full width; some dialogs had their own look (Approval
   Inbox reject, attachment preview). Now every dialog: centred, sized from the modal scale, the
   navy title band with the orange close, a body that scrolls inside the dialog, and a right-aligned
   footer for the buttons.
   ============================================================================================ */
dialog.mip-modal,
dialog.mip-dialog-panel,
dialog.mip-record-preview {
  position: fixed;
  inset: 0;
  margin: auto;
  width: calc(100vw - 2rem);
  height: fit-content;
  max-height: calc(100vh - 2rem);
  border: none;
  border-radius: var(--mip-radius-lg);
  box-shadow: var(--mip-shadow-lg);
  background: var(--mip-surface);
  color: var(--mip-text);
}
dialog.mip-modal::backdrop,
dialog.mip-dialog-panel::backdrop,
dialog.mip-record-preview::backdrop {
  background: var(--mip-overlay);
}

/* Sizes: a message or a confirmation is small; a form is medium; a pop-up with a table is large. */
dialog.mip-modal { max-width: var(--mip-modal-sm); }
dialog.mip-dialog-panel { max-width: var(--mip-modal-md); }
dialog.mip-modal.mip-modal--md { max-width: var(--mip-modal-md); }
dialog.mip-modal.mip-modal--lg,
dialog.mip-dialog-panel.mip-dialog-panel--wide { max-width: var(--mip-modal-lg); }
dialog.mip-modal.mip-modal--xl,
dialog.mip-record-preview { max-width: var(--mip-modal-xl); }
/* Modals that hold a form or a table (batch collect / pay, reference lines, check print / void,
   bank-statement mapping, reconciliation adjustment, quick create) get the form width. */
dialog#sj-collect-dialog,
dialog#pj-pay-dialog,
dialog#mip-gj-ref-lines-dialog,
dialog#mip-print-check-dialog,
dialog#mip-void-check-dialog,
dialog#mip-recurring-dialog,
dialog#mip-reject-dialog,
dialog#adjustment-modal { max-width: var(--mip-modal-md); }
/* The dashboard's quick create embeds a whole entry form: it stays wide (dashboard.css, ADR-183). */
dialog.mip-modal.mip-quick-create { width: min(1100px, calc(100vw - 2rem)); max-width: none; max-height: 94vh; padding: 0; }
dialog#mapping-modal,
dialog#mip-gj-ref-lines-dialog { max-width: var(--mip-modal-lg); }
/* ADR-504: the import wizard (every module's Import) previews the staged rows in a wide grid - it takes the screen's width (up to
   1600px) and most of its height, after the shared sizes above, which had shrunk it to the message size. */
dialog.mip-modal.mip-import {
  width: calc(100vw - 2rem);
  max-width: min(1600px, calc(100vw - 2rem));
}
dialog.mip-modal.mip-import .mip-import__body { max-height: calc(100vh - 13rem); }

/* Title band: a heading inside the header is white on the navy band, next to the icon. */
.mip-modal__header .mip-modal__title {
  flex: 1;
  margin: 0;
  color: var(--mip-color-white);
  font-size: 1.1rem;
  font-weight: 600;
}

/* The body reads as normal text; only the message line is bold (form labels and inputs were bold). */
.mip-modal__body { font-weight: 400; }
.mip-modal__body .mip-modal__message { font-weight: 600; }
.mip-modal__body > * + * { margin-top: var(--mip-space-3); }
.mip-modal__body h3 { margin: 0 0 var(--mip-space-2); font-size: 1rem; }
.mip-modal__body .mip-form-field textarea,
.mip-modal__body .mip-form-field input,
.mip-modal__body .mip-form-field select { width: 100%; box-sizing: border-box; }

/* Form dialogs: the fields sit two to a row; a wide field, a table or a list takes the whole row;
   Save (the form's own submit) ends the dialog on the right. */
dialog.mip-dialog-panel > form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: var(--mip-space-3) var(--mip-space-4);
  align-items: start;
}
dialog.mip-dialog-panel > form > :not(.mip-form-field),
dialog.mip-dialog-panel > form > .mip-form-field--full,
dialog.mip-dialog-panel > form > .mip-form-field:has(textarea, table) {
  grid-column: 1 / -1;
}
dialog.mip-dialog-panel > form > .mip-form-field { margin: 0; }
/* A short form (one or two fields) is one column in the small size. */
dialog.mip-dialog-panel:not(.mip-dialog-panel--wide):not(.mip-dialog-panel--md):has(> form):not(:has(> form > .mip-form-field ~ .mip-form-field ~ .mip-form-field)) { max-width: var(--mip-modal-sm); }
dialog.mip-dialog-panel > form:not(:has(> .mip-form-field ~ .mip-form-field ~ .mip-form-field)) { grid-template-columns: 1fr; }

dialog.mip-dialog-panel .mip-form-field input:not([type="checkbox"]):not([type="radio"]),
dialog.mip-dialog-panel .mip-form-field select,
dialog.mip-dialog-panel .mip-form-field textarea { width: 100%; box-sizing: border-box; }
dialog.mip-dialog-panel > form > button[type="submit"],
dialog.mip-dialog-panel > form > .mip-form-actions {
  justify-self: end;
  margin-top: var(--mip-space-2);
}
dialog.mip-dialog-panel > form > .mip-form-actions {
  display: flex;
  gap: var(--mip-space-3);
}

/* The attachment preview: the same band, a tall body for the document. */
dialog.mip-record-preview { height: min(90vh, 1100px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
dialog.mip-record-preview:not([open]) { display: none; }
dialog.mip-record-preview .mip-modal__header { flex: 0 0 auto; }

@media (max-width: 40rem) {
  dialog.mip-modal,
  dialog.mip-dialog-panel,
  dialog.mip-record-preview {
    width: calc(100vw - 1rem);
    max-width: none;
    max-height: calc(100vh - 1rem);
    /* Pinned to the screen's left gutter: a page wider than the phone must not push the dialog off it. */
    inset: 0 auto 0 0.5rem;
    margin: auto 0;
  }
}

/* ST Cycle 1 G&A (ADR-526): the one look for a field the user cannot change because it is filled in for them
   (the active company, a personnel's e-mail / designation / TIN / department, an item's category and type codes):
   #E9ECF0 fill, #9CA2AB text and border. Put .mip-field-locked on the input or select itself; a locked select
   still submits (it is made inert with pointer-events, not disabled). Declared last so it wins over the generic
   read-only rules above. Dark mode: both tokens are redefined there. */
.mip-form-field .mip-field-locked,
.mip-form-field .mip-field-locked:read-only,
.mip-form-field input.mip-field-locked[readonly]:not([type="checkbox"]):not([type="radio"]),
.mip-field-locked {
  background: var(--mip-color-btn-disabled-fill);
  color: var(--mip-color-text-disabled);
  border: 1px solid var(--mip-color-text-disabled);
  border-style: solid;
  padding-left: var(--mip-space-3);
  cursor: not-allowed;
}
select.mip-field-locked {
  pointer-events: none;
}

/* ST Cycle 1 G&A #23 (ADR-526): Item Mastery. The SKU box: the locked [CATEGORY][TYPE]- prefix, then the number typed. */
.mip-sku {
  display: flex;
  gap: var(--mip-space-2, 0.5rem);
  align-items: stretch;
}
.mip-sku__prefix {
  flex: 1 1 55%;
  min-width: 0;
}
.mip-sku__number {
  flex: 1 1 45%;
  min-width: 5rem;
}
/* The promotion options: one column; each option's inputs on its own row beside it, three across on a wide screen. */
/* ADR-911 (QA TTS-018 Cycle 2 ITM DEFECT 028): the Item Mastery form's fields are one width in every section - the Item Category
   form's 15rem column; auto-fill keeps a short row's fields that width instead of stretching them across the row. */
.mip-item-form .mip-form-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

/* Pricing matrix dates read "October 08, 2026": room for the month's name. */
.mip-table td .mip-longdate:has(.mip-matrix-date),
.mip-table td input.mip-matrix-date {
  min-width: 11.5rem;
}
/* ST Cycle 1 G&A #10 (ADR-526): the standard filter bar's Start / End dates show the whole "October 01, 2026". */
.mip-standard-filter-bar .mip-form-field:has(> .mip-longdate),
.mip-standard-filter-bar .mip-form-field:has(input[type="date"]) {
  min-width: 12.5rem;
}

/* ST Cycle 1 Financial - Ledger (ADR-527): report grids - Date, Doc No and amounts never wrap; Payee and Particulars wrap to at
   most 2 lines (the full text on hover and in print). */
.mip-table td.mip-nowrap,
.mip-table th.mip-nowrap {
  white-space: nowrap;
}

/* A paged report grid prints every row, without its pager. */
@media print {
  [data-mip-print-all] tbody tr[hidden] { display: table-row !important; }
  [data-mip-print-all] .mip-table-pager { display: none !important; }
}

.mip-form-field--half > select,
.mip-form-field--half > input { max-width: 50%; min-width: 6rem; }
@media (max-width: 40rem) {
  .mip-form-field--half > select,
  .mip-form-field--half > input { max-width: none; }
}

/* ADR-530: two-step sign-in - the code box, the set-up (QR + key), the recovery codes. */
.mip-2fa-code { font-size: 1.4rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.mip-2fa-alt { margin: var(--mip-space-2) 0 0; text-align: center; }
.mip-2fa-setup__body { display: flex; flex-wrap: wrap; gap: var(--mip-space-4); align-items: flex-start; }
/* The QR keeps a white quiet zone in both themes - phones cannot scan a dark one. */
.mip-2fa-qr { width: 220px; height: 220px; padding: 8px; background: #ffffff; border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-sm); }
.mip-2fa-key code, .mip-2fa-codes__list code { font-size: 1rem; letter-spacing: 0.08em; user-select: all; }
.mip-2fa-steps { margin: 0 0 var(--mip-space-3); padding-left: 1.25rem; }
.mip-2fa-confirm { max-width: 18rem; }
.mip-2fa-codes__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--mip-space-2); padding-left: 1.5rem; }
.mip-2fa-actions { display: flex; flex-wrap: wrap; gap: var(--mip-space-4); align-items: flex-end; }
.mip-2fa-inline { display: flex; gap: var(--mip-space-2); align-items: flex-end; }
.mip-2fa-inline .mip-form-field { margin: 0; max-width: 10rem; }
/* Printing the recovery codes prints only them - on the 2FA page alone (a bare "body *" here blanked every other page's print). */
@media print { body:has(#recovery-codes) * { visibility: hidden; } body:has(#recovery-codes) #recovery-codes, body:has(#recovery-codes) #recovery-codes * { visibility: visible; } #recovery-codes { position: absolute; top: 0; left: 0; } #recovery-codes button, #recovery-codes a { display: none; } }

/* ==== ST Cycle 1 Financial - Statements (ADR-537): the statement screens ==================================================
   Search on the upper left of the filters; an interactive table list; amounts in #3640F5 (no underline) that open their
   breakdown in-page; grand totals single-ruled above and double-ruled below; Print lays out the plain report. */
.mip-fs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--mip-space-2) var(--mip-space-3);
}
/* ADR-541: the Search is a row of its own (as on the Sales Journal Report), as wide as two filter fields; every filter and
   Generate sit on the row below. The cap is on the box, not the row, so a filter never wraps up beside it. */
.mip-fs-filters__search { flex: 0 0 100%; }
.mip-fs-filters__search .mip-action-bar__search { width: 100%; max-width: calc(28rem + var(--mip-space-3)); min-height: 2.4rem; }
.mip-fs-filters > .mip-form-field { margin: 0; width: 14rem; }
.mip-fs-filters > .mip-fs-filters__generate { width: auto; }
@media (max-width: 40rem) {
  .mip-fs-filters > .mip-form-field { width: calc(50% - var(--mip-space-3)); }
  .mip-fs-filters__search .mip-action-bar__search { max-width: none; }
}

table.mip-fs-table td a.mip-fs-link {
  color: var(--mip-fs-drill);
  text-decoration: none;
  cursor: pointer;
}
table.mip-fs-table td a.mip-fs-link:hover,
table.mip-fs-table td a.mip-fs-link:focus-visible { text-decoration: none; background: var(--mip-hover-bg); border-radius: 2px; }
table.mip-fs-table th[data-align="left"] { text-align: left; }
table.mip-fs-table td.mip-fs-indent { padding-left: 24px; }
table.mip-fs-table tr.mip-fs-detail-row td,
table.mip-fs-table tr.mip-fs-subtotal-row td { white-space: nowrap; }
table.mip-fs-table tfoot tr.mip-fs-grand-total td { border-top: none; }
table.mip-fs-table tfoot tr.mip-fs-grand-total td[data-align="right"] {
  border-top: 1px solid var(--mip-fs-rule);
  border-bottom: 3px double var(--mip-fs-rule);
}
table.mip-fs-table tfoot tr.mip-fs-grand-total + tr.mip-fs-grand-total td[data-align="right"] { border-top: none; }
.mip-fs-note { margin-top: var(--mip-space-2); }

/* The in-page breakdown / ratio computation. */
dialog.mip-modal.mip-fs-modal { max-width: min(76rem, 96vw); width: 96vw; }

.mip-modal__body.mip-fs-modal__body { font-weight: 400; font-size: 0.9rem; max-height: 72vh; overflow: auto; }

@media print {
  table.mip-fs-table td a.mip-fs-link { color: inherit !important; text-decoration: none !important; }
  table.mip-fs-table tfoot tr.mip-fs-grand-total td[data-align="right"] { border-bottom: 3px double #000 !important; border-top: 1px solid #000 !important; }
  .mip-fs-filters, .mip-fs-note { display: none !important; }
}

/* ==== ADR-538: the bell's notification panel (option C) and the loading modal (option L1) ===================================== */
/* The bell is a link: it keeps the header icons' own colour and hover (outline), never the link-hover blue. */
.mip-bell,
.mip-bell:hover,
.mip-bell:focus-visible,
.mip-bell:visited { color: var(--mip-color-highlight-blue); }

.mip-spinner {
  display: inline-block;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 4px solid var(--mip-color-highlight-blue);
  border-top-color: var(--mip-color-accent-blue);
  animation: mip-spin 0.8s linear infinite;
  box-sizing: border-box;
  flex: none;
}
.mip-spinner--sm { width: 0.9rem; height: 0.9rem; border-width: 2px; vertical-align: -0.15rem; }
@keyframes mip-spin { to { transform: rotate(360deg); } }
/* A spinner's turning is the message ("still working"), so it keeps turning - slower - under reduced motion, which otherwise stops
   every animation after a frame (tokens.css, ADR-189). */
@media (prefers-reduced-motion: reduce) {
  .mip-spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

.mip-loading {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--mip-overlay, rgba(15, 23, 42, 0.38));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--mip-space-4);
  cursor: progress;
}
.mip-loading[hidden] { display: none; }
.mip-loading__card {
  min-width: 16rem;
  max-width: 22rem;
  background: var(--mip-surface);
  color: var(--mip-text);
  border-radius: var(--mip-radius-lg);
  box-shadow: var(--mip-shadow-md);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.mip-loading__text { font-size: 1rem; font-weight: 700; color: var(--mip-color-brand-navy); }
:root[data-theme="dark"] .mip-loading__text { color: var(--mip-text); }
.mip-loading__hint { font-size: 0.8rem; color: var(--mip-color-text-muted); }

.mip-bell-wrap { position: relative; display: flex; align-items: center; }
/* Opened, it is moved to <body> and placed under the bell (notification-panel.js): the header is its own stacking layer, so inside
   it the panel would sit under sticky headers, drawers and panels of the page. Above every page layer, below the loading window. */
.mip-notif-panel {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 2900;
  width: min(25rem, calc(100vw - 2rem));
  background: var(--mip-surface);
  color: var(--mip-text);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-lg);
  box-shadow: var(--mip-shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mip-notif-panel[hidden] { display: none; }
.mip-notif-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1rem 0.75rem; border-bottom: 1px solid var(--mip-border-subtle); }
.mip-notif-panel__title { margin: 0; font-size: 1rem; font-weight: 700; }
.mip-notif-panel__read-all { border: none; background: none; padding: 0.25rem; color: var(--mip-action-text, var(--mip-color-accent-blue)); font-weight: 600; font-size: 0.82rem; cursor: pointer; }
.mip-notif-panel__read-all:hover { text-decoration: underline; }
.mip-notif-panel__list { max-height: min(26rem, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.mip-notif-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 1rem 0.7rem calc(1rem - 3px);
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--mip-border-subtle);
  color: var(--mip-text);
  text-decoration: none;
}
.mip-notif-item:hover { background: var(--mip-hover-bg); color: var(--mip-text); }
.mip-notif-item--unread { border-left-color: var(--mip-color-accent-blue); }
.mip-notif-item__top { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; }
.mip-notif-item__label { font-weight: 700; color: var(--mip-color-brand-navy); text-transform: uppercase; letter-spacing: 0.03em; }
:root[data-theme="dark"] .mip-notif-item__label { color: var(--mip-link); }
.mip-notif-item__time { color: var(--mip-color-text-muted); white-space: nowrap; }
.mip-notif-item__title { font-size: 0.85rem; font-weight: 500; }
.mip-notif-item--unread .mip-notif-item__title { font-weight: 700; }
.mip-notif-item__message { font-size: 0.78rem; color: var(--mip-color-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mip-notif-panel__status { display: flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.9rem; font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-notif-panel__sentinel { height: 1px; }
.mip-notif-panel__more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem;
  border-top: 1px solid var(--mip-border-subtle);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--mip-action-text, var(--mip-color-accent-blue));
}
.mip-notif-panel__more:hover { background: var(--mip-hover-bg); }
@media print { .mip-loading, .mip-notif-panel { display: none !important; } }

/* ==== ADR-541: report screens show the table list only; the document header and footer are for print ======================
   On screen a report reads like the Sales Journal Report: title, Print / Views / How To / [...], the filters and the table.
   The company logo + report title + period block (.mip-fs-header: statements, BIR books, audit reports) and the system
   footer appear only on paper; their warnings and hints stay visible on screen. In print the page heading gives way to it. */
@media screen {
  main .mip-fs-header > :not(.mip-fs-warning):not(.mip-field-hint) { display: none; }
  main .mip-fs-header { margin-bottom: 0; }
  main .mip-report-footer { display: none; }
}
@media print {
  body:has(main .mip-fs-header) main h1 { display: none; }
}
/* ADR-541: the audit screens' filter form takes the same 14rem filters under the Search row. */
.mip-audit-filters.mip-fs-filters > .mip-form-field { flex: 0 0 14rem; min-width: 0; }
.mip-audit-filters.mip-fs-filters > .mip-fs-filters__generate { flex: 0 0 auto; }
.mip-audit-filters.mip-fs-filters { align-items: flex-end; }

.mip-einv-qr svg { width: 120px; height: 120px; display: block; border-radius: 4px; }
 /* ADR-575: the callback address wraps instead of running under the next field */

/* ADR-561: a long text cell in a list (journal Particulars) shows one line; the full text is its tooltip. */
.mip-table td.mip-cell-clip { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ADR-562 (SRS P02-S04): the pager - "Showing items" in italics; Previous / Next #3640F5, #9CA2AB when disabled; numbered
   pages, the current one #232AAD on #E8E9FC (tokens, so dark mode keeps its contrast). */
.mip-table-pager { flex-wrap: wrap; justify-content: space-between; }
.mip-table-pager__showing { font-style: italic; }
.mip-pager-pages { display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.mip-pager-nav, .mip-pager-page { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; padding: 0 0.5rem;
  border-radius: 6px; font-size: 0.82rem; font-weight: 600; color: var(--mip-action-text); text-decoration: none; }
a.mip-pager-nav:hover, a.mip-pager-page:hover, button.mip-pager-nav:not(:disabled):hover, button.mip-pager-page:hover { background: var(--mip-color-btn-tint-hover); }
.mip-pager-nav[aria-disabled="true"] { color: var(--mip-color-text-disabled); cursor: default; }
.mip-pager-page--active { color: var(--mip-pager-active-text); background: var(--mip-color-btn-tint-pressed); }
.mip-pager-gap { color: var(--mip-color-text-muted); padding: 0 0.15rem; }
button.mip-pager-nav, button.mip-pager-page { border: 0; background: transparent; cursor: pointer; font-family: inherit; }
button.mip-pager-nav:disabled { color: var(--mip-color-text-disabled); cursor: default; }
button.mip-pager-page.mip-pager-page--active { background: var(--mip-color-btn-tint-pressed); }

/* ADR-625: the shared document viewer (Views/Shared/_DocumentViewer.cshtml, js/viewer.js) - one large modal for printable forms,
   report prints, PDFs, label sheets and attachments: title and Print / Download / Open in New Tab / Close above, the page below. */
dialog.mip-viewer { width: min(1100px, calc(100vw - 2rem)); height: min(92vh, 1200px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md); background: var(--mip-surface-raised); color: var(--mip-text); box-shadow: var(--mip-shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
dialog.mip-viewer:not([open]) { display: none; }
dialog.mip-viewer::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog.mip-viewer .mip-modal__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mip-viewer__toolbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--mip-space-2); padding: var(--mip-space-2) var(--mip-space-4); border-bottom: 1px solid var(--mip-border-subtle); background: var(--mip-surface); }
.mip-viewer__toolbar [hidden] { display: none; }
.mip-viewer__body { position: relative; flex: 1; min-height: 0; background: var(--mip-bg-subtle); }
.mip-viewer__frame { display: block; width: 100%; height: 100%; border: 0; background: var(--mip-surface); }
.mip-viewer__loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: var(--mip-color-text-muted); pointer-events: none; }
.mip-viewer__loading[hidden] { display: none; }
@media (max-width: 40rem) { dialog.mip-viewer { width: 100vw; height: 100vh; border-radius: 0; } }

   @media (min-width: 40rem) {
  body:not(.mip-embed) > .mip-shell-header { position: sticky; top: 0; z-index: 28; }
  body:not(.mip-embed) > .mip-shell-nav { position: sticky; top: var(--mip-shell-header-h, 4.5rem); z-index: 27; }
}

/* =============================================================================================================
   ADR-664 (SRS Phase 45 - Global Master Table List UI/UX Component): every list's grid, header buttons and footer
   follow one look. Colours come from tokens.css (--mip-grid-*, --mip-list-*) so the dark theme has its own.
   ============================================================================================================= */
/* §2.D wrapper: a bordered, rounded, scrollable grid on its own surface. */
.mip-table-wrap {
  border: 1px solid var(--mip-grid-border);
  border-radius: 4px;
  background: var(--mip-grid-bg);
  overflow-x: auto;
}
.mip-table-wrap .mip-table-scroll { overflow-x: auto; }
/* §2.D header row: corporate blue, white uppercase 12px, faint white dividers. */
.mip-table th,
.mip-table thead th {
  background: var(--mip-grid-head-bg);
  color: var(--mip-grid-head-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: none;
  border-right: 1px solid var(--mip-grid-head-divider);
}
.mip-table th a,
.mip-table th button { color: inherit; }
/* §2.D data rows: compact, a full visible grid, 12px brand-navy text. */
.mip-table td {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--mip-grid-text);
  border-bottom: 1px solid var(--mip-grid-border);
  border-right: 1px solid var(--mip-grid-border);
}
.mip-table th:last-child,
.mip-table td:last-child { border-right: none; }
.mip-table,
.mip-table th { font-size: 12px; }
.mip-table tbody tr:nth-child(even) { background: transparent; }
.mip-table tbody tr:hover { background: var(--mip-grid-hover); }
/* §2.D hyperlinks: the document ids in the accent blue, never underlined. */
.mip-table td a:not(.mip-btn) { color: var(--mip-grid-link); text-decoration: none; }
.mip-table td a:not(.mip-btn):hover { text-decoration: none; filter: brightness(1.15); }
/* §2.D selection column: exactly 40px, centred; the header cell holds the Select All box. */
.mip-table th:has(> input[data-mip-select-all]),
.mip-table td:has(> input[data-mip-row-select]) {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
/* §2.B top action bar: [Add] / [Print] solid blue; [Views], [How To], [...] outlined. */
.mip-list-header .mip-entry-header__actions,
.mip-report-header .mip-entry-header__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.mip-list-header .mip-action-bar__add,
.mip-report-header [data-mip-print] {
  background: var(--mip-list-primary-bg);
  color: var(--mip-list-primary-text);
  border: 1px solid var(--mip-list-primary-bg);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
}
.mip-list-header .mip-action-bar__add:hover:not(:disabled),
.mip-report-header [data-mip-print]:hover:not(:disabled) { filter: brightness(1.08); }
.mip-list-header .mip-action-bar__howto,
.mip-list-header .mip-action-bar__overflow,
.mip-report-header .mip-action-bar__howto,
.mip-report-header .mip-action-bar__overflow {
  background: var(--mip-list-secondary-bg);
  color: var(--mip-list-secondary-text);
  border: 1px solid var(--mip-list-secondary-border);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
}
/* ADR-715: one header button on every initial screen (lists, landing screens, reports) - the same height, padding, type and
   corners for Add / Print / Views / How To / [...] and the screen's own extra actions (Approval Inbox, Mark all as read,
   Download DAT...): primary actions solid, the rest outlined; Approve / Reject keep their colours. Entry forms keep theirs. */
.mip-list-header .mip-entry-header__actions .mip-btn,
.mip-report-header .mip-entry-header__actions .mip-btn {
  min-height: 0;
  height: auto;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.mip-list-header .mip-entry-header__actions .mip-btn--primary,
.mip-report-header .mip-entry-header__actions .mip-btn--primary {
  background: var(--mip-list-primary-bg);
  color: var(--mip-list-primary-text);
  border: 1px solid var(--mip-list-primary-bg);
}
.mip-list-header .mip-entry-header__actions .mip-btn--secondary,
.mip-report-header .mip-entry-header__actions .mip-btn--secondary {
  background: var(--mip-list-secondary-bg);
  color: var(--mip-list-secondary-text);
  border: 1px solid var(--mip-list-secondary-border);
}
/* Every header button the same 32px tall, whatever its element or class (the list header's own Add / Views / How To / [...]). */
.mip-list-header .mip-entry-header__actions :is(.mip-btn, .mip-action-bar__add, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger),
.mip-report-header .mip-entry-header__actions :is(.mip-btn, .mip-action-bar__add, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger) {
  height: 32px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* §2.B on reports: [How To], [...] and the moved buttons are outlined; §2.C: [Generate] at the end of the parameters row, solid #2563EB. */
.mip-report-header .mip-entry-header__actions > .mip-btn--secondary,
.mip-report-header .mip-entry-header__actions .mip-entry-header__more {
  background: var(--mip-list-secondary-bg);
  color: var(--mip-list-secondary-text);
  border: 1px solid var(--mip-list-secondary-border);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
}
.mip-btn--report-generate {
  background: var(--mip-list-primary-bg);
  border-color: var(--mip-list-primary-bg);
  color: var(--mip-list-primary-text);
  border-radius: 4px;
}
.mip-btn--report-generate:hover:not(:disabled) { background: var(--mip-list-primary-bg); filter: brightness(1.08); }
/* §2.E footer: record counter (italic 10px) on the left, segmented pages on the right. */
.mip-table-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--mip-grid-footer-border);
  background: var(--mip-grid-bg);
}
.mip-table-pager__info,
.mip-table-pager__showing {
  color: var(--mip-grid-text);
  font-size: 10px;
  font-style: italic;
}
.mip-pager-pages { display: inline-flex; }
.mip-pager-pages .mip-pager-nav,
.mip-pager-pages .mip-pager-page,
.mip-pager-pages .mip-pager-gap {
  border: 1px solid var(--mip-grid-footer-border);
  margin-left: -1px;
  padding: 4px 10px;
  min-width: 2rem;
  text-align: center;
  color: var(--mip-grid-text);
  text-decoration: none;
  background: var(--mip-grid-bg);
  font-size: 12px;
}
.mip-pager-pages > :first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.mip-pager-pages > :last-child { border-radius: 0 4px 4px 0; }
.mip-pager-pages a:hover { background: var(--mip-grid-page-hover); }
.mip-pager-pages .mip-pager-page--active { background: var(--mip-grid-page-active); font-weight: 600; }
.mip-pager-pages [aria-disabled="true"] { opacity: 0.45; }

/* ADR-674 (one look, P5 - QA 2026-10-20: misaligned buttons, inconsistent dropdowns). ------------------------------------------------------
   1. A button field in a form grid sits on the inputs' line, not the labels': .mip-form-field--actions (used by the add forms and
      parameter rows) aligns its button to the bottom of the cell. */
.mip-form-field--actions { display: flex; flex-direction: column; justify-content: flex-end; align-self: end; }
.mip-form-field--actions > .mip-btn, .mip-form-field > .mip-btn { align-self: flex-start; }
.mip-form-grid > .mip-form-field:has(> .mip-btn:only-child), .mip-form-grid > .mip-form-field:has(> label[aria-hidden="true"] + .mip-btn) { align-self: end; }
/* 2. Every dropdown in a screen has the same chevron - form fields, filter rows, tool rows and line grids alike (the line grid's is
      compact). A multi-select list keeps the native box. */
main select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2320476e' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1rem;
  padding-right: 2.1rem;
  cursor: pointer;
}
main .mip-table td select:not([multiple]):not([size]) { background-position: right 0.4rem center; padding-right: 1.75rem; }
main select:disabled { cursor: not-allowed; }
:root[data-theme="dark"] main select:not([multiple]):not([size]):not(:disabled) { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23c9c6bc' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
/* Tool rows (the Exception Center's module filter, Document Templates, statement mapping): the same control height and type as
   a form field. */
main :is(.mip-exc-module, .mip-template-tools__form) :is(select, input:not([type="checkbox"]):not([type="radio"]):not([type="file"])),
main select.mapping-select {
  min-height: 3.125rem;
  box-sizing: border-box;
  padding-left: var(--mip-space-3);
  border: 1px solid var(--mip-border);
  border-radius: var(--mip-radius-sm);
  font-family: var(--mip-font-family);
  font-size: var(--mip-font-size-body);
  color: var(--mip-text);
  background-color: var(--mip-surface);
}
/* 3. A button inside a table row is the compact size, whatever class the view gave it. */
.mip-table td .mip-btn:not(.mip-btn--sm):not(.mip-icon-btn) { padding: var(--mip-space-1) var(--mip-space-3); font-size: 0.8rem; min-width: 0; }

/* ADR-675 (performance pass P4): the screen body is shown once its scripts have arranged it - no table / header jumping after the first
   paint (_Layout adds .mip-booting in the head and removes it after DOMContentLoaded, 1.5 s at most). */
.mip-booting main { visibility: hidden; }

/* ADR-685: the document viewer's settings - zoom, paper, full size (the dialog fills the window). */
.mip-viewer__settings { display: flex; align-items: center; gap: var(--mip-space-2); margin-right: auto; flex-wrap: wrap; }
.mip-viewer__zoom { display: inline-flex; align-items: center; gap: var(--mip-space-1); }
.mip-viewer__zoom-value { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; color: var(--mip-text); }
.mip-viewer__paper { display: inline-flex; align-items: center; gap: var(--mip-space-1); color: var(--mip-text); font-size: 0.9rem; }
.mip-viewer__paper[hidden] { display: none; }
.mip-viewer__paper select { min-height: 2rem; padding: 0 1.9rem 0 0.5rem; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background-color: var(--mip-surface); color: var(--mip-text); }
/* The viewer opens over the whole window and uses most of it. */
dialog.mip-viewer { width: min(1280px, calc(100vw - 2rem)); height: calc(100vh - 2rem); }
dialog.mip-viewer [data-mip-viewer-fit][aria-pressed="true"] { border-color: var(--mip-color-accent-blue); color: var(--mip-color-accent-blue); }

/* ADR-688: the Platform console's filter row - the subscription-state chips and the tenant search on one line. */
.mip-platform-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--mip-space-3); margin-bottom: var(--mip-space-3); }
.mip-platform-filter .mip-platform-chips { margin: 0; }
.mip-platform-filter .mip-platform-search { display: flex; flex-wrap: wrap; max-width: 100%; gap: var(--mip-space-2); align-items: center; margin: 0; }
.mip-platform-filter .mip-platform-search input { min-width: 16rem; min-height: 2.4rem; padding: 0 var(--mip-space-3); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface); color: var(--mip-text); }

.mip-panel--table .mip-table-scroll:has(> .mip-tier-matrix) { max-height: calc(100vh - 18rem); overflow: auto; }

/* ADR-691: why the last session ended (sign-in page), and the inactivity warning. */
.mip-login-info { margin: 0 0 var(--mip-space-3); padding: var(--mip-space-2) var(--mip-space-3); border-radius: var(--mip-radius-sm); background: color-mix(in srgb, var(--mip-color-info, #2563eb) 12%, transparent); color: var(--mip-text); font-size: 0.9rem; }

dialog.mip-modal.mip-idle-dialog { max-width: 26rem; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md, 8px); background: var(--mip-surface); color: var(--mip-text); padding: var(--mip-space-4); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); }
.mip-idle-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.mip-idle-dialog h2 { margin: 0 0 var(--mip-space-2); font-size: 1.1rem; }
.mip-idle-dialog__actions { display: flex; justify-content: flex-end; gap: var(--mip-space-2); margin-top: var(--mip-space-3); }

/* ADR-697: the shared Send by E-mail window. */
dialog.mip-email-dialog { width: min(640px, calc(100vw - 32px)); }
.mip-email-dialog__form { margin: 0; }
.mip-email-dialog .mip-modal__body { display: flex; flex-direction: column; gap: var(--mip-space-2); }
.mip-email-dialog textarea { width: 100%; resize: vertical; font-family: inherit; }
.mip-email-dialog__attachment { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface-muted, var(--mip-surface)); color: var(--mip-text); font-size: 0.85rem; }
.mip-email-dialog__attachment-label { font-weight: 700; color: var(--mip-color-text-muted); }
.mip-email-dialog__loading { color: var(--mip-color-text-muted); }

/* ADR-700 (QA TTS-001 GJ DEFECTS 002 / 004): the General Journal's Schedule of Transactions; the old header fields give way to it. */
[data-mip-gj-schedule-mode] [data-mip-gj-legacy="true"] { display: none !important; }

/* ADR-727 (QA TTS-009 EFT Disbursement): five filters in a row (Branch, Bank Account, Start / End Date, Status); a TOTAL row kept in
   view at the bottom of a scrolling grid (DEFECT 003); a Doc No that opens the entry read-only in a popup is #3640F5, no underline. */
.mip-form-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 64rem) { .mip-form-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mip-table-scroll--sticky tfoot.mip-table__sticky-foot td { position: sticky; bottom: 0; z-index: 1; background: var(--mip-bg-subtle); }

/* ADR-731 (QA TTS-011): six filters in a row (Branch, Bank Account, Payment Method, Start / End Date, Grouping). */
.mip-form-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 72rem) { .mip-form-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .mip-form-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ADR-738 (QA TTS-015 Mandatory BIR Books, BIR DEFECTS 001 / 043): the book's Search runs from the first date to the Branch field. */
.mip-jr-toolbar__filters--branch > .mip-jr-toolbar__search--to-branch { grid-column: 1 / span 3; }
/* ADR-754 (QA TTS-015 BIR DEFECT 054): the Privilege Sales Journal's Privilege Type after Branch; the Search reaches it. */
.mip-jr-toolbar__filters--branch.mip-jr-toolbar__filters--privilege { grid-template-columns: 14rem 14rem 14rem 14rem auto; }
.mip-jr-toolbar__filters--privilege > .mip-jr-toolbar__search--to-branch { grid-column: 1 / span 4; }
@media (max-width: 60rem) {
  .mip-jr-toolbar__filters--branch.mip-jr-toolbar__filters--privilege { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mip-jr-toolbar__filters--privilege > .mip-jr-toolbar__search--to-branch { grid-column: 1 / -1; }
}
.mip-bir-warnings summary { cursor: pointer; font-weight: 600; }
.mip-bir-warnings ul { margin: var(--mip-space-2) 0 0; padding-left: 1.2rem; }
@media (max-width: 40rem) { .mip-jr-toolbar__filters--branch > .mip-jr-toolbar__search--to-branch { grid-column: 1 / -1; } }

/* ADR-739 (uniform UI 2): a permission matrix's Search sits above its frame. */
.mip-table-search-pill { margin: 0 0 var(--mip-space-3); max-width: 32rem; }
.mip-table-search-pill .mip-action-bar__search { width: 100%; min-height: 2.4rem; }

/* ADR-743 (uniform required fields, every screen): a field still missing its value, or in a wrong format, is outlined in red with
   a light tint and its message under it ("Customer Name is required."); a line-grid cell gets the same mark. */
.mip-form-field--invalid input:not([type="checkbox"]):not([type="radio"]),
.mip-form-field--invalid select,
.mip-form-field--invalid textarea,
td.mip-form-field--invalid input:not([type="checkbox"]):not([type="radio"]),
td.mip-form-field--invalid select {
  border-color: var(--mip-color-danger);
  background-color: var(--mip-color-danger-tint);
}
.mip-form-field--invalid .mip-field-error,
td.mip-form-field--invalid .mip-field-error { margin: 4px 0 0; font-weight: 600; }

/* ADR-753 (QA TTS-012 Revolving Fund, System Test Cycle 2). DEFECT 048, every module (the user, 2026-10-27: "apply the button
   states to all modules"): the secondary buttons of every list / report header - Views, How To, [...] and a screen's own secondary
   actions - follow the system's states: Default no fill, outline and text #3640F5; Hover #F2F2FC / #5666F9; Pressed #E8E9FC /
   #232AAD; Focus outline #151DA8; Disabled #E9ECF0 outline, #9CA2AB text (1px outline as every secondary button, the user's ADR-198
   choice) - was the table lists' grey (SRS Phase 45). DEFECT 052, every module (the user: "apply the primary button too"): the primary
   buttons there - Add, Preview / View / Print, the screen's own primary actions and Generate - are the system's primary (#3640F5
   through --mip-list-primary-bg; hover #5666F9, pressed #232AAD, focus outline #151DA8, disabled #E9ECF0 / #9CA2AB). */
:root :is(.mip-list-header, .mip-report-header) :is(.mip-btn--secondary, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger, .mip-entry-header__more) {
  background: transparent;
  color: var(--mip-action-text);
  border: 1px solid var(--mip-action-text);
}
:root :is(.mip-list-header, .mip-report-header) :is(.mip-btn--secondary, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger, .mip-entry-header__more):hover:not(:disabled) {
  background: var(--mip-color-btn-tint-hover);
  border-color: var(--mip-color-btn-hover-blue);
  color: var(--mip-color-btn-hover-blue);
}
:root :is(.mip-list-header, .mip-report-header) :is(.mip-btn--secondary, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger, .mip-entry-header__more):active:not(:disabled) {
  background: var(--mip-color-btn-tint-pressed);
  border-color: var(--mip-color-btn-pressed-blue);
  color: var(--mip-color-btn-pressed-blue);
}
:root :is(.mip-list-header, .mip-report-header) :is(.mip-btn--secondary, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger, .mip-entry-header__more):focus-visible {
  background: transparent;
  border-color: var(--mip-color-primary-blue);
  outline: 1px solid var(--mip-color-primary-blue);
  outline-offset: 0;
  color: var(--mip-action-text);
}
:root :is(.mip-list-header, .mip-report-header) :is(.mip-btn--secondary, .mip-action-bar__howto, .mip-action-bar__overflow, .mip-views-trigger, .mip-entry-header__more):is(:disabled, [aria-disabled="true"]) {
  background: transparent;
  border-color: var(--mip-color-btn-disabled-fill);
  color: var(--mip-color-text-disabled);
}
:root :is(.mip-list-header .mip-action-bar__add, .mip-report-header [data-mip-print], .mip-report-header .mip-report-header__print, :is(.mip-list-header, .mip-report-header) .mip-entry-header__actions .mip-btn--primary, .mip-btn--report-generate):hover:not(:disabled) {
  background: var(--mip-color-btn-hover-blue);
  border-color: var(--mip-color-btn-hover-blue);
  filter: none;
}
:root :is(.mip-list-header .mip-action-bar__add, .mip-report-header [data-mip-print], .mip-report-header .mip-report-header__print, :is(.mip-list-header, .mip-report-header) .mip-entry-header__actions .mip-btn--primary, .mip-btn--report-generate):active:not(:disabled) {
  background: var(--mip-color-btn-pressed-blue);
  border-color: var(--mip-color-btn-pressed-blue);
}
:root :is(.mip-list-header .mip-action-bar__add, .mip-report-header [data-mip-print], .mip-report-header .mip-report-header__print, :is(.mip-list-header, .mip-report-header) .mip-entry-header__actions .mip-btn--primary, .mip-btn--report-generate):focus-visible {
  outline: 2px solid var(--mip-color-primary-blue);
  outline-offset: 0;
}
:root :is(.mip-list-header .mip-action-bar__add, .mip-report-header [data-mip-print], .mip-report-header .mip-report-header__print, :is(.mip-list-header, .mip-report-header) .mip-entry-header__actions .mip-btn--primary, .mip-btn--report-generate):is(:disabled, [aria-disabled="true"]) {
  background: var(--mip-color-btn-disabled-fill);
  border-color: var(--mip-color-btn-disabled-fill);
  color: var(--mip-color-text-disabled);
  filter: none;
}
/* DEFECT 065: the filters span the page; the Search reaches to the last one (setup.js, [data-mip-search-to]). */
.mip-report-toolbar > form.mip-form-grid.mip-rf-filters[style] { flex: 1 1 100% !important; }   /* over the toolbar's "0 1 auto !important" */
.mip-report-toolbar > form.mip-form-grid.mip-rf-filters[style] > .mip-form-field { flex: 1 1 0; min-width: 9rem; }
.mip-report-toolbar > form.mip-form-grid.mip-rf-filters[style] > .mip-form-field:last-child { flex: 0 0 auto; min-width: 0; }
.mip-report-toolbar > form.mip-rf-filters .mip-form-field select { max-width: none; width: 100%; }

.mip-table tr.mip-rf-opening td { font-style: italic; background: var(--mip-bg-subtle); }
/* DEFECT 072: the Expenses Analysis drill-down. */
dialog.mip-modal#rf-lines-dialog { max-width: min(64rem, 96vw); width: 64rem; }

.mip-table tfoot tr.mip-ea-total td { font-weight: 700; border-top: 3px double var(--mip-border-strong, currentColor); border-bottom: 3px double var(--mip-border-strong, currentColor); }

dialog#ea-aging-dialog { max-width: min(56rem, 96vw); width: 56rem; }
dialog#ea-aging-dialog td.mip-ea-overdue { color: var(--mip-color-danger); }

.mip-item-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--mip-space-3); margin: var(--mip-space-3) 0 var(--mip-space-2); color: var(--mip-color-text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.mip-item-divider::after { content: ""; flex: 1 1 auto; border-top: 1px solid var(--mip-border); }

/* ADR-763 (provider console P2): a client user's actions and the one-time temporary password. QA TTS-036 CIS 006: the actions are
   icons in the row's Actions cell (Edit, Reset Password, Remove / Make Super Admin, Unlock) - no [...] menu. */
.mip-platform-user-actions { white-space: nowrap; }
.mip-platform-user-actions > .mip-line-icon-btn, .mip-platform-user-actions > form { display: inline-flex; vertical-align: middle; margin: 0 2px; }

/* QA TTS-036 CIS 024: a tenant's tab panels (Company, Data) span the page like the summary (Plan, Since, Users, Last sign-in) and the
   tabs above them - the entry form is not the centred, capped .mip-panel--form - so their left and right edges line up flush. */
.mip-platform-tabs ~ [data-mip-tab-panel] > .mip-panel--form:not(dialog) { max-width: none; margin: 0; }
.mip-platform-tabs ~ [data-mip-tab-panel] > .mip-panel ~ .mip-panel:not(dialog) { margin-top: var(--mip-space-4); }

.mip-platform-temp-password code { font-size: 1rem; padding: 2px 6px; background: var(--mip-surface); border-radius: var(--mip-radius-sm); user-select: all; }

/* ADR-805 (QA TTS-025 PR DEFECTS 008 / 012 / 015 / 016): the Purchase Requisition's purple Direct PO decision and the Budget Health
   widget. Tokens only (dark theme too). */
.mip-btn--route-po { background: var(--mip-color-route-po); border-color: transparent; color: var(--mip-color-white); }
.mip-btn--route-po:hover:not(:disabled) { background: var(--mip-color-route-po-hover); box-shadow: var(--mip-shadow-sm); }
.mip-btn--route-po:active:not(:disabled) { background: var(--mip-color-route-po-pressed); }
.mip-btn--route-po:focus-visible { outline: var(--mip-border-width-focus) solid var(--mip-color-route-po-pressed); outline-offset: 2px; }
.mip-btn--route-po:disabled { background: var(--mip-color-btn-disabled-fill); color: var(--mip-color-text-disabled); opacity: 1; }

/* ADR-816 (QA TTS-028 QUO DEFECT 004 / 005): the quotation Items grid - read-only / computed cells shaded #E9ECF0 (the existing token),
   the Item Description wrapping, Net of VAT only when Amount: VAT Inclusive, and the totals outside the grid's horizontal scroll. */
.mip-cell-computed { background: var(--mip-color-btn-disabled-fill); }
.mip-qt-items-head { display: flex; align-items: center; justify-content: space-between; gap: var(--mip-space-3); margin-top: var(--mip-space-3); }
.mip-qt-items-head h2 { margin: 0; }

.mip-qt-totals { display: grid; grid-template-columns: auto minmax(9rem, auto); gap: var(--mip-space-1) var(--mip-space-4); width: max-content; margin: var(--mip-space-3) 0 0 auto; }
.mip-qt-totals dt { text-align: right; color: var(--mip-color-text-muted); }
.mip-qt-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mip-qt-totals .mip-qt-totals__grand { font-weight: 700; color: var(--mip-text); border-top: 1px solid var(--mip-color-border); padding-top: var(--mip-space-1); }
/* ADR-817 (QA TTS-028 QUO DEFECT 014-017): the chosen branch printed under a report's period, in regular type; the headers' (i) never print. */
.mip-jr-print-header__branch { text-align: center; font-size: 11pt; font-weight: 400; margin: -4pt 0 8pt; }
.mip-help--th { margin-left: 2px; }
@media print { .mip-help--th { display: none !important; } }
/* ADR-822 (QA TTS-021 Cycle 2 GLOBAL DEFECT 012): the Save / Submit success toast. */
.mip-toast--success { border-left-color: var(--mip-color-success); }
/* QA 2026-11-09: a card on a module page keeps a space below it before whatever follows (a search row, another card) - they ran
   together on several screens. */
.mip-admin-content > .mip-panel:not(:last-child),
.mip-admin-content > [style*="display: contents"] > .mip-panel:not(:last-child) { margin-bottom: var(--mip-space-5); }
/* ...and so does a page-level note, warning, report header or filter bar before the next block (SOA Directory, Asset Tagging,
   Changes in Equity, the SLS / User Activity reports). */
.mip-admin-content > :is(.mip-fs-header, .mip-fs-warning, .mip-field-note, form.mip-voucher-filter):not(:last-child),
.mip-admin-content > [style*="display: contents"] > :is(.mip-fs-header, .mip-fs-warning, .mip-field-note, form.mip-voucher-filter):not(:last-child) { margin-bottom: var(--mip-space-4); }

/* ADR-834 (QA TTS-029 SO DEFECTS 003 / 004): a field locked by its source (an approved quotation) or not applicable (a service-only
   order's Fulfillment Warehouse) keeps its box, shaded #E9ECF0 and not modifiable, so the grid stays aligned - its value still posts. */
.mip-form-field--locked input,
.mip-form-field--locked select,
.mip-form-field--locked .mip-searchable-select__input,
.mip-form-field--locked textarea {
  background: var(--mip-color-btn-disabled-fill);
  pointer-events: none;
  cursor: default;
}

/* ADR-834: a field two columns wide in a 4 / 5 column form grid (Delivery Address, Fulfillment Warehouse). */
.mip-form-field--span-2 { grid-column: span 2; }
@media (max-width: 40rem) { .mip-form-field--span-2 { grid-column: auto; } }
/* ADR-835 (QA TTS-029 SO DEFECT 015): a three-column filter / form grid whose last field ends flush with the panel (and the table) below. */
.mip-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 48rem) { .mip-form-grid--3 { grid-template-columns: minmax(0, 1fr); } }

/* ADR-893 (QA TTS-030 FLM DEFECT 001 / 010 / 016): the fulfillment documents' status badges in Proper Case with QA's colours -
   document status, dispatch status, fulfillment (invoicing) status and the Dispatch Trip status. Draft is the page surface with a border
   (white in light mode) so it stays legible in dark mode. */
.mip-badge[class*="mip-badge--fl-"] { text-transform: none; font-weight: 600; }
.mip-badge--fl-draft { background: var(--mip-surface); color: var(--mip-text); box-shadow: inset 0 0 0 1px var(--mip-border); }
.mip-badge--fl-submitted { background: #FFCC99; color: #000000; }
.mip-badge--fl-checked { background: #FFA500; color: #FFFFFF; }
.mip-badge--fl-approved, .mip-badge--fl-completed { background: #208B22; color: #FFFFFF; }
.mip-badge--fl-cancelled { background: #BC0000; color: #FFFFFF; }
.mip-badge--fl-disapproved { background: #FF4500; color: #FFFFFF; }
.mip-badge--fl-invoiced { background: #4682B4; color: #FFFFFF; }
.mip-badge--fl-uninvoiced { background: #F0F2F5; color: #495057; }
.mip-badge--fl-partially-invoiced { background: #FFF3CD; color: #856404; }
.mip-badge--fl-pending-dispatch, .mip-badge--fl-scheduled { background: #DBEEF4; color: #0B5394; }
.mip-badge--fl-dispatched, .mip-badge--fl-departed { background: #66A2D8; color: #FFFFFF; }
.mip-badge--fl-delivered { background: #7895AE; color: #FFFFFF; }
/* ADR-893 (FLM DEFECT 004): the Delivery Receipt Items grid - descriptions wrap, read-only cells shaded (#E9ECF0). */
.mip-dr-items td.mip-dr-desc { min-width: 14rem; white-space: normal; overflow-wrap: anywhere; }
.mip-dr-items td.mip-cell-computed { white-space: nowrap; }

/* ADR-895 (QA TTS-030 FLM DEFECT 017): a 4-column field (Particulars beside the Vehicle Capacity) and the live load-weight banner. */
.mip-form-field--span-4 { grid-column: span 4; }
@media (max-width: 64rem) { .mip-form-field--span-4 { grid-column: 1 / -1; } }

/* ADR-897 (QA TTS-031 INV DEFECT 001): the invoices' Posted and collection badges in QA's colours. */
.mip-badge--fl-posted { background: #7895AE; color: #FFFFFF; }
.mip-badge--fl-collected { background: #4682B4; color: #FFFFFF; }
.mip-badge--fl-unpaid { background: #F0F2F5; color: #495057; }
.mip-badge--fl-partially-collected { background: #66A2D8; color: #FFFFFF; }
.mip-badge--fl-overdue { background: #FFF3CD; color: #856404; }
/* ADR-898 (QA TTS-031 INV DEFECT 002): the invoice's Ref No - a multi-select of the customer's unbilled documents (Confirm opens Select Items for Invoice). */
.mip-si-refs { position: relative; }
.mip-si-refs > summary { list-style: none; cursor: pointer; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); padding: 0.45rem 0.6rem; background: var(--mip-surface); color: var(--mip-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mip-si-refs > summary::-webkit-details-marker { display: none; }
.mip-si-refs__panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 16rem; max-height: 18rem; overflow-y: auto; padding: var(--mip-space-2); display: grid; gap: var(--mip-space-1); background: var(--mip-surface); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.mip-si-refs__item { display: flex; gap: var(--mip-space-2); align-items: center; cursor: pointer; }
.mip-si-items td.mip-cell-computed select { pointer-events: none; }
/* ADR-899 (QA TTS-031 answer 3): a source line's price / discount override (Configure) - marked once it differs from the source. */
.mip-si-items td.mip-cell-overridden input { border-color: var(--mip-warning, #F0AD4E); }
.mip-si-pct { display: inline-flex; align-items: center; gap: 4px; }
.mip-si-pct input { width: 72px; }

/* ADR-904 (QA TTS-031 Cycle 3 INV DEFECT 020): the editable Due Date - typed as Month Day, Year or picked. */
.mip-si-due { display: flex; gap: 4px; align-items: center; }
.mip-si-due input[data-mip-si-due] { flex: 1; min-width: 0; }
.mip-si-due__pick { width: 36px; padding-inline: 4px; }

/* ADR-918 (QA TTS-034 ORG DEFECT 001-005): the Organization screens - full-width stacked sections, a 5-column field, a read-only group
   without a frame, the section bar (title + its action), the signatories' empty state and the logo drop zone. */
.mip-form-field--span-5 { grid-column: span 5; }
.mip-form-field--span-3 { grid-column: span 3; }

/* MIP-095 (CIS 069): a 3-wide field (the Company Profile's Registered Address) takes the whole row on a narrow screen. */
@media (max-width: 64rem) { .mip-form-field--span-3 { grid-column: 1 / -1; } }
@media (max-width: 72rem) { .mip-form-field--span-5 { grid-column: 1 / -1; } }

.mip-section-bar { display: flex; align-items: center; gap: var(--mip-space-2); flex-wrap: wrap; }
.mip-section-bar__action { margin-left: auto; }

/* ADR-925 (QA TTS-033 SUP DEFECT 002-004): the supplier form - half-row fields, the four checklists side by side (1.5 of the 6 columns
   each) with their filter, Select all / Clear and one line per item (code bold, description muted); a Payment Term's Default. */
.mip-form-field--half { grid-column: span 3; }
@media (max-width: 72rem) { .mip-form-field--half { grid-column: 1 / -1; } }

.mip-checklist--box { height: 14rem; max-height: none; border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); padding: var(--mip-space-2);
  background: var(--mip-surface); }

/* A conditional field that does not apply stays a (disabled, shaded) box so the rows line up - the read-only rule would otherwise
   flatten it (a disabled input is also :read-only). */
[data-mip-supplier-section] .mip-form-field input:disabled { background: var(--mip-color-surface-muted); border-color: var(--mip-border);
  padding-left: var(--mip-space-3); cursor: not-allowed; }
[data-mip-supplier-section] textarea[data-mip-autogrow] { min-height: 0; }

/* ADR-929 (QA TTS-032 COL DEFECT 002, answer 2): the lifecycle badges (Draft, Submitted, Checked, Approved, Posted, Cancelled, Disapproved)
   in every module - StatusTone.For maps them here. Draft: the page surface with a border and black text (the text token in dark mode). */
.mip-badge--fl-draft { color: var(--mip-badge-draft-text); }

/* ==================================================================================================================================
   MIP-071 (QA TTS-036 Cycle 6 CIS 057 1. HOME): the User Console Home - Quick Actions, Invoice Snapshot, EIS Transmission and the
   Document Sequence Tracker. Theme tokens only (light and dark).
   ================================================================================================================================== */
.mip-cc { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem 1.5rem 2rem; }
.mip-cc__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.mip-cc__head > div:first-child { flex: 1 1 22rem; min-width: 0; }   /* the greeting keeps one line beside How To / Branch */
.mip-cc__date { margin: 0; font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-cc__title { margin: 0.1rem 0 0; font-size: 1.5rem; color: var(--mip-text); }
.mip-cc__sub { margin: 0.2rem 0 0; color: var(--mip-color-text-muted); }
.mip-cc__branch { display: flex; align-items: center; gap: 0.5rem; }
/* MIP-095: Home's Branch - a form field as wide as a list's Branch filter. */
.mip-cc__branch .mip-form-field { width: 14rem; max-width: 100%; margin: 0; }
.mip-cc__branch .mip-form-field select { width: 100%; }
.mip-cc__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.mip-cc__actions:empty { display: none; }
.mip-cc__action { padding: 0.7rem 1.4rem; font-size: 1rem; font-weight: 600; }
.mip-cc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); gap: 0.9rem; }
.mip-cc__panel {
  display: flex; flex-direction: column; gap: 0.7rem; padding: 1.1rem 1.2rem; border: 1px solid var(--mip-border); border-radius: 0.85rem;
  background: var(--mip-surface-raised, var(--mip-surface)); min-width: 0;
  /* MIP-095 (CIS 070): raised cards - a soft shadow, rounded corners and a distinct border. */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.08);
}
/* CIS 070: the EIS Transmission donut beside its counters; the Recent Invoices feed (full width, rows open the invoice preview). */
.mip-cc__eis { display: flex; align-items: center; gap: 1rem; }
.mip-cc__eis .mip-cc__legend { flex: 1 1 auto; min-width: 0; }
.mip-cc__donut {
  --mip-cc-ok: 0deg; --mip-cc-pending: 0deg;
  flex: 0 0 auto; display: grid; place-items: center; width: 6.5rem; height: 6.5rem; border-radius: 50%;
  background: conic-gradient(var(--mip-color-success) 0 var(--mip-cc-ok), var(--mip-color-warning) var(--mip-cc-ok) var(--mip-cc-pending),
                             var(--mip-color-danger) var(--mip-cc-pending) 360deg);
}
.mip-cc__donut--empty { background: var(--mip-bg-subtle, var(--mip-color-surface-muted)); }
.mip-cc__donut-hole {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.3rem; height: 4.3rem; border-radius: 50%;
  background: var(--mip-surface-raised, var(--mip-surface)); line-height: 1.1;
}
.mip-cc__donut-hole strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--mip-text); }
.mip-cc__donut-hole small { font-size: 0.68rem; color: var(--mip-color-text-muted); }
.mip-cc__feed-row { cursor: pointer; }
.mip-cc__feed-row:hover > td { background: var(--mip-bg-subtle, var(--mip-color-surface-muted)); }
@media (max-width: 420px) { .mip-cc__eis { flex-direction: column; align-items: stretch; } .mip-cc__donut { align-self: center; } }
.mip-cc__panel h2 { margin: 0; font-size: 1rem; color: var(--mip-text); }
.mip-cc__panel h2 a { color: inherit; text-decoration: none; }
.mip-cc__panel h2 a:hover { text-decoration: underline; }
.mip-cc__snapshot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.mip-cc__snapshot div { display: flex; flex-direction: column; gap: 0.25rem; }
.mip-cc__label { font-size: 0.75rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--mip-color-text-muted); }
.mip-cc__value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--mip-text); }
.mip-cc__status { display: flex; height: 0.9rem; border-radius: 999px; overflow: hidden; background: var(--mip-bg-subtle, var(--mip-color-surface-muted)); }
.mip-cc__status-seg { display: block; height: 100%; }
.mip-cc__status-seg--ok, .mip-cc__dot--ok { background: var(--mip-color-success); }
.mip-cc__status-seg--pending, .mip-cc__dot--pending { background: var(--mip-color-warning); }
.mip-cc__status-seg--failed, .mip-cc__dot--failed { background: var(--mip-color-danger); }
.mip-cc__legend { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; padding: 0; list-style: none; font-size: 0.88rem; }
.mip-cc__legend li { display: grid; grid-template-columns: 0.75rem minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; color: var(--mip-text); }
.mip-cc__legend strong { font-variant-numeric: tabular-nums; }
.mip-cc__dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.mip-cc__stat--alert strong { color: var(--mip-color-danger); }
.mip-cc__list { display: flex; flex-direction: column; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.mip-cc__list--compact li { display: flex; justify-content: space-between; gap: 0.75rem; color: var(--mip-text); }
.mip-cc__list strong { font-variant-numeric: tabular-nums; }
.mip-cc__list small, .mip-cc__hint { font-size: 0.78rem; color: var(--mip-color-text-muted); margin: 0; }
@media (max-width: 640px) {
  .mip-cc { padding: 1rem; }
  .mip-cc__grid { grid-template-columns: minmax(0, 1fr); }
}

/* MIP-019 (QA TTS-031 INV DEFECT 014): the invoice retrieval credentials (Print > Close > Generate). */
.mip-pe-credentials { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.mip-pe-credentials .mip-qt-totals { flex: 1 1 240px; margin: 0; }
.mip-pe-qr svg { width: 160px; height: 160px; display: block; }

/* QA 2026-11-18 (SLS): a report screen opened by its Preview stays hidden in the viewer until it is laid out as paper (report-letterhead.js). */
html.mip-print-preview-loading body { visibility: hidden; }

/* MIP-046 (QA TTS-036 Cycle 6 CIS 056 2.2): a tenant's tabs locked until Activate Tenant - shown, not clickable. */
.mip-admin-tab--locked { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
/* MIP-050: a list's Add button in the row of its fields (Currencies, Payment Methods & Terms), level with the inputs. */
.mip-form-field--button { align-self: end; }

/* ==================================================================================================================================
   MIP-078 / MIP-079: the BIR Console (read only) - spacing between sections, padded panels, the KPI row, label / value lists and wide
   tables that scroll instead of wrapping. Theme tokens only (light and dark).
   ================================================================================================================================== */
.mip-bir-body .mip-admin-content { display: flex; flex-direction: column; gap: var(--mip-space-5); padding-bottom: var(--mip-space-6, 2rem); }
.mip-bir-body .mip-admin-content > .mip-panel:not(:last-child) { margin-bottom: 0; }
.mip-bir-body .mip-admin-content > h1 { margin: 0; }
.mip-bir-body .mip-admin-content > p { margin: 0; }
.mip-bir-body .mip-panel:not(.mip-panel--table) { padding: var(--mip-space-5); }
.mip-bir-body .mip-panel > .mip-form-section__title { margin: 0 0 var(--mip-space-3); }
.mip-bir-body .mip-panel > .mip-field-hint { margin: 0 0 var(--mip-space-3); }
.mip-bir-body .mip-audit-filters { margin: 0; }
.mip-bir-body .mip-table th, .mip-bir-body .mip-table td { white-space: nowrap; }
.mip-bir-body .mip-table td small { white-space: normal; display: inline-block; min-width: 16rem; max-width: 32rem; }
.bir-hint { font-size: 0.82rem; color: var(--mip-color-text-muted); }
.bir-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--mip-space-4, 0.9rem); }
.bir-kpis .mip-cc__panel { padding: var(--mip-space-4, 1rem) var(--mip-space-5); }
.bir-detail { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr); gap: 0.5rem 1.5rem; margin: 0; }
.bir-detail dt { margin: 0; font-weight: 600; color: var(--mip-color-text-muted); }
.bir-detail dd { margin: 0; color: var(--mip-text); overflow-wrap: anywhere; }
.bir-json { margin: 0; padding: var(--mip-space-4, 1rem); border-radius: var(--mip-radius-md, 6px); background: var(--mip-bg-subtle, var(--mip-color-surface-muted));
  white-space: pre-wrap; overflow: auto; font-size: 0.8rem; }
.bir-feed { margin: 0; padding: 0; list-style: none; max-height: 18rem; overflow-y: auto; }
.bir-feed li { padding: 0.5rem 0; border-bottom: 1px solid var(--mip-border-subtle); }
.bir-feed li:last-child { border-bottom: 0; }
@media (max-width: 640px) {
  .bir-detail { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .bir-detail dd { margin-bottom: 0.5rem; }
}
.mip-bir-body .mip-audit-filters input[type="date"] { min-width: 11.5rem; }
.mip-bir-body .mip-audit-filters input[type="search"] { min-width: 16rem; }

/* Layout pass (2026-11-19): the side-menu screens (Reports, Audit Trail, provider and BIR consoles) - a list or report row stays on one line
   and the table scrolls sideways, instead of a date or TIN breaking over three lines; long text cells (subjects, remarks) still wrap. */
.mip-admin-body .mip-table th, .mip-admin-body .mip-table td { white-space: nowrap; }
.mip-admin-body .mip-table td:has(> small), .mip-admin-body .mip-table td.mip-wrap { white-space: normal; min-width: 14rem; }
.mip-admin-body .mip-table-scroll { overflow-x: auto; }
/* Home's Document Sequence Tracker: the series name above its last / next numbers (no mid-word wrapping in a narrow panel). */
.mip-cc__list--compact li[data-cc="sequence"] { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.mip-cc__list--compact li[data-cc="sequence"] > span:first-child { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--mip-color-text-muted); }

/* MIP-089 (QA TTS-036 Cycle 7 CIS 059): the consoles told apart by their header and footer - Provider #1C61A1, User #20476E (the
   default), BIR #0D6EBF. Light theme only: the dark theme keeps its own dark bar. */
:root:not([data-theme="dark"]) body.mip-console-provider { --mip-header-bg: var(--mip-console-provider-bg); }
:root:not([data-theme="dark"]) body.mip-console-bir { --mip-header-bg: var(--mip-console-bir-bg); }

/* MIP-089 (QA TTS-036 Cycle 7 CIS 061): the Provider Console's module bar (the User Console's .mip-primary-nav) and, under it, the open
   module's sub-tabs - Tenants keeps the clients opened lately as tabs to switch between. No side menu: the page takes the full width. */
.mip-shell-nav--platform { flex-direction: column; align-items: stretch; padding-bottom: 0; }
.mip-shell-nav--platform > .mip-primary-nav { min-height: 3rem; }
.mip-platform-subtabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.35rem 0 0.5rem; border-top: 1px solid var(--mip-border-subtle); }
.mip-platform-subtabs__tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.85rem;
  color: var(--mip-text-muted, var(--mip-color-text-muted)); text-decoration: none; border: 1px solid transparent; }
.mip-platform-subtabs__tab:hover { background: var(--mip-bg-subtle); color: var(--mip-text); }
.mip-platform-subtabs__tab--active { background: var(--mip-color-brand-tint, var(--mip-bg-subtle)); color: var(--mip-link); border-color: var(--mip-border-subtle); font-weight: 600; }
.mip-platform-subtabs__recent { display: contents; }
.mip-platform-subtabs__close { border: 0; background: none; padding: 0 0.1rem; line-height: 1; cursor: pointer; color: inherit; font-size: 1rem; }
.mip-platform-body--top { display: block; }

/* MIP-089 (QA TTS-036 Cycle 7 CIS 062): the Provider Home - the greeting and date, cards with a shadow, rounded corners and a border, bold
   key numbers, the transmission ring with its total, chevron pipeline steps and an icon per activity. */
.mip-home-greeting__date { margin: 0 0 0.15rem; font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-platform-body .mip-platform-kpi, .mip-platform-body .mip-home-columns > .mip-panel {
  border: 1px solid var(--mip-border-subtle); border-radius: var(--mip-radius-lg); box-shadow: 0 1px 2px rgb(16 35 56 / 6%), 0 4px 12px rgb(16 35 56 / 6%); }
.mip-platform-kpi__value, .mip-home-pipeline strong { font-weight: 700; letter-spacing: -0.01em; }
.mip-home-pie__slice { stroke: var(--mip-surface); stroke-width: 1.2; }
.mip-home-pie__hole { fill: var(--mip-surface); }
.mip-home-pie__total { font-size: 14px; font-weight: 700; fill: var(--mip-text); }
.mip-home-pie__caption { font-size: 6px; fill: var(--mip-color-text-muted); }
.mip-home-pipeline--chevrons { gap: 0; flex-wrap: nowrap; }
.mip-home-pipeline--chevrons li { flex: 1 1 0; min-width: 0; }
.mip-home-pipeline--chevrons a { height: 100%; min-width: 0; padding: 0.7rem 1.4rem 0.7rem 1.6rem; border: 0; border-radius: 0; background: var(--mip-bg-subtle);
  clip-path: polygon(0 0, calc(100% - 0.9rem) 0, 100% 50%, calc(100% - 0.9rem) 100%, 0 100%, 0.9rem 50%); }
.mip-home-pipeline--chevrons li:first-child a { clip-path: polygon(0 0, calc(100% - 0.9rem) 0, 100% 50%, calc(100% - 0.9rem) 100%, 0 100%); padding-left: 0.9rem; }
.mip-home-pipeline--chevrons li:last-child a { background: var(--mip-color-success-tint, var(--mip-bg-subtle)); }
.mip-home-pipeline--chevrons a:hover, .mip-home-pipeline--chevrons a:focus-visible { background: var(--mip-color-brand-tint, #e3edf7); }
.mip-home-feed__item { display: flex; align-items: flex-start; gap: 0.6rem; }
.mip-home-feed__icon { flex: none; display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--mip-bg-subtle); color: var(--mip-link); }
.mip-home-feed__icon svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mip-home-feed__icon--delete { color: var(--mip-color-danger); }
.mip-home-feed__icon--user { color: var(--mip-color-success); }
.mip-home-feed__text { display: flex; flex-direction: column; }

/* MIP-089 (QA TTS-036 Cycle 7 CIS 064-067): a Provider Console form's title with its buttons at the upper right (Save, Activate Tenant,
   Add, Cancel), and a saved verification's "Provided on" note. */
.mip-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--mip-space-3); flex-wrap: wrap; margin-bottom: var(--mip-space-3); }
.mip-panel-head > .mip-form-section__title { margin: 0; }
.mip-panel-head__actions { display: flex; align-items: center; gap: var(--mip-space-2); flex-wrap: wrap; margin-left: auto; }
.mip-field-note { display: block; margin-top: 0.25rem; font-size: 0.8rem; color: var(--mip-color-text-muted); }

/* MIP-089 (QA TTS-036 Cycle 7 CIS 065): a multi-select list - a dropdown box naming what is ticked, the ticks in a panel under it. */
.mip-multiselect { position: relative; }
.mip-multiselect__summary { list-style: none; display: flex; align-items: center; min-height: 2.5rem; padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); background: var(--mip-surface); color: var(--mip-text); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mip-multiselect__summary::-webkit-details-marker { display: none; }
.mip-multiselect__summary::after { content: ""; position: absolute; right: 0.8rem; top: 1.1rem; width: 0.45rem; height: 0.45rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0.6; }
.mip-multiselect[open] > .mip-multiselect__summary { border-color: var(--mip-link); }
.mip-multiselect__panel { position: absolute; z-index: 30; left: 0; right: 0; min-width: 12rem; margin-top: 0.25rem; padding: 0.4rem 0.6rem;
  display: flex; flex-direction: column; gap: 0.35rem; max-height: 16rem; overflow-y: auto;
  background: var(--mip-surface); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-sm); box-shadow: 0 6px 18px rgb(16 35 56 / 14%); }
.mip-multiselect[data-locked] > .mip-multiselect__summary { background: var(--mip-bg-subtle); color: var(--mip-color-text-muted); }
[data-mip-user-edit] .mip-panel-head { margin-top: var(--mip-space-2); }

/* MIP-089 (CIS 066): the Invoicing Settings sections - a rule and space above each section after the first. */
.mip-panel-head--section { margin-top: var(--mip-space-6); padding-top: var(--mip-space-4); border-top: 1px solid var(--mip-border-subtle); }

/* MIP-089 (QA TTS-036 Cycle 7 CIS 059): the How To drawer's Show Me How beside Close, and the screen tour banner. */
.mip-howto-drawer__actions { display: inline-flex; gap: var(--mip-space-2); }
  background: var(--mip-color-brand-tint, var(--mip-bg-subtle)); font-weight: 600; }

/* MIP-096 (QA TTS-036 Cycle 9 CIS 074): a document opened from its list's Document No shows its entry form read-only - each value in a
   non-modifiable field box (#E9ECF0 fill, #9CA2AB border), as a locked field (.mip-field-locked) looks. */
.mip-form--readonly .mip-form-field > span:not(.mip-badge),
.mip-form--readonly .mip-form-field > input.mip-field-locked,
.mip-form--readonly .mip-form-field > textarea.mip-field-locked {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.25rem;
  padding: 0.4rem var(--mip-space-3);
  background: var(--mip-color-btn-disabled-fill);
  color: inherit;
  border: 1px solid var(--mip-color-text-disabled);
  border-radius: var(--mip-radius-sm, 4px);
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mip-form--readonly .mip-form-field > textarea.mip-field-locked { resize: none; white-space: pre-wrap; }
/* MIP-096 (CIS 075): Amount: VAT Inclusive sits directly under the Item's Selling Price. */
.mip-item-vatinc { margin-top: var(--mip-space-2, 0.5rem); }

/* MIP-096 (QA TTS-036 Cycle 9 CIS 074, grid alignment): every value of an invoice line on one line ("pantay-pantay"). The WTAX code and a
   privilege discount's rate carry their amount under them (.mip-cell-note); in the flow it doubled the cell's height, so its dropdown
   (or, read-only, its code) sat about 7px above the row's other fields. The note now hangs at the bottom of its cell, out of the flow. */
.mip-si-items td { position: relative; }
/* every line the same height, with room for the hanging amount under the dropdown */
.mip-si-items tbody tr { height: 4.65rem; }
.mip-si-items td:has(> select:not([hidden])) > .mip-cell-note,
.mip-si-items td.mip-cell-computed > .mip-cell-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  padding-left: inherit;
  padding-right: inherit;
  line-height: 1.1;
  white-space: nowrap;
}

/* MIP-117 (QA TTS-036 Cycle 12 CIS 105 / 106): fixed field rows - the Credit Memo's header (6 equal field widths; Justification Notes
   spans 4) and its Transmission Logs (4). Below ~60rem they fall back to the responsive grid. */
.mip-form-grid.mip-grid-6 { --mip-grid-cols: repeat(6, minmax(0, 1fr)); }
.mip-form-grid.mip-grid-4 { --mip-grid-cols: repeat(4, minmax(0, 1fr)); }
.mip-form-grid > .mip-span-2 { grid-column: span 2; }
.mip-form-grid > .mip-span-4 { grid-column: span 4; }
.mip-form-grid.mip-grid-6 > .mip-form-field > select,
.mip-form-grid.mip-grid-6 > .mip-form-field > input,
.mip-form-grid.mip-grid-6 .mip-searchable { min-width: 0; max-width: 100%; width: 100%; }
.mip-form-grid.mip-grid-6 > .mip-form-field { min-width: 0; }
/* A control that explains why it is off sits in a flex span (explain.js): it still fills its field. */
.mip-form-grid.mip-grid-6 > .mip-form-field > .mip-why { display: flex; width: 100%; }
.mip-form-grid.mip-grid-6 > .mip-form-field > .mip-why > select { flex: 1 1 auto; width: 100%; min-width: 0; }
@media (max-width: 60rem) {
  .mip-form-grid.mip-grid-6, .mip-form-grid.mip-grid-4 { --mip-grid-cols: repeat(auto-fit, minmax(15rem, 1fr)); }
  .mip-form-grid > .mip-span-2, .mip-form-grid > .mip-span-4 { grid-column: 1 / -1; }
}

/* MIP-117 (CIS 107): the Item Class list is wider than the screen (a column per privilege discount) - its Edit form stays in the visible
   part of the scrolling list, so Save / Cancel are in view. */
.mip-table-scroll:has(> table[data-mip-item-class-list]) { container-type: inline-size; }
table[data-mip-item-class-list] tr[data-mip-user-edit] > td > form { position: sticky; left: var(--mip-space-3, 0.75rem); width: calc(100cqw - 2 * var(--mip-space-3, 0.75rem)); box-sizing: border-box; }

/* ===== MIP-118 (QA TTS-036 Cycle 13 CIS 111): the blocking pop-up and the floating toast ============================================ */
/* The system pop-up: a white card with rounded corners and a soft shadow over a dimmed, slightly blurred page; the icon centered on top
   (#1C61A1), a bold question title and a regular body in #20476E; a click outside shakes the card. 90% wide on a phone. */
dialog.mip-modal.mip-sysmodal { width: 90vw; max-width: 28rem; background: #ffffff; border-radius: 14px; box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28), 0 8px 16px -8px rgba(15, 23, 42, 0.12); overflow: visible; }
dialog.mip-modal.mip-sysmodal::backdrop { background: rgba(15, 23, 42, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.mip-sysmodal .mip-modal__header { position: relative; flex-direction: column; justify-content: center; gap: 0.6rem; padding: 1.75rem 1.5rem 0.25rem; background: transparent; border-radius: 14px 14px 0 0; text-align: center; }
.mip-sysmodal .mip-modal__icon { width: 3.25rem; height: 3.25rem; border: 0; border-radius: 50%; background: #eaf2fa; color: #1c61a1; }
.mip-sysmodal .mip-modal__icon svg { width: 1.7rem; height: 1.7rem; }
.mip-sysmodal .mip-modal__icon--warning, .mip-sysmodal .mip-modal__icon--validation, .mip-sysmodal .mip-modal__icon--dangerous { background: #fef3c7; color: #d97706; }
.mip-sysmodal .mip-modal__icon--error { background: #fee2e2; color: #b91c1c; }
.mip-sysmodal .mip-modal__icon--success { background: #e6f0f9; color: #1c5d99; }
.mip-sysmodal .mip-modal__header .mip-modal__title { flex: none; color: #20476e; font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
.mip-sysmodal .mip-modal__close { position: absolute; top: 0.75rem; right: 0.75rem; width: 1.9rem; height: 1.9rem; background: transparent; border: 1px solid #cbd5e1; border-radius: 6px; color: #64748b; }
.mip-sysmodal .mip-modal__close:hover { background: #f1f5f9; filter: none; }
.mip-sysmodal .mip-modal__close svg { width: 1rem; height: 1rem; }
.mip-sysmodal .mip-modal__body { padding: 0.75rem 1.75rem 0.5rem; background: transparent; color: #20476e; text-align: center; line-height: 1.5; }
.mip-sysmodal .mip-modal__body .mip-modal__message { font-weight: 400; }
.mip-sysmodal .mip-modal__header:has(.mip-modal__title[hidden]) + .mip-modal__body .mip-modal__message { font-weight: 600; font-size: 1.02rem; }
.mip-sysmodal .mip-modal__list { text-align: left; }
.mip-sysmodal .mip-modal__check { justify-content: center; }
.mip-sysmodal .mip-modal__footer { justify-content: center; flex-wrap: wrap; padding: 1rem 1.5rem 1.5rem; background: transparent; border-radius: 0 0 14px 14px; }
.mip-sysmodal .mip-modal__footer .mip-btn { min-width: 8.5rem; }
.mip-sysmodal--shake { animation: mip-sysmodal-shake 360ms ease-in-out !important; }
@keyframes mip-sysmodal-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* The floating toast: bottom right, white, 1px #E2E8F0 border, rounded, soft shadow; icon | title + body | a square close. */
.mip-toast.mip-toast--std { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 0.75rem; padding: 0.9rem 0.85rem 0.9rem 1rem; background: #ffffff; color: #20476e; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.22); animation: mip-toast-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.mip-toast--std .mip-toast__icon { display: flex; color: #1c5d99; }
.mip-toast--std.mip-toast--warning .mip-toast__icon { color: #d97706; }
.mip-toast--std .mip-toast__icon svg { width: 1.4rem; height: 1.4rem; }
.mip-toast--std .mip-toast__title { display: block; color: #20476e; font-weight: 700; }
.mip-toast--std .mip-toast__title:hover { text-decoration: none; }
.mip-toast--std .mip-toast__message { margin-top: 0.2rem; color: #20476e; font-size: 0.875rem; line-height: 1.45; }
.mip-toast--std .mip-toast__close { display: flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border: 1px solid #cbd5e1; border-radius: 5px; background: #ffffff; color: #64748b; }
.mip-toast--std .mip-toast__close:hover { background: #f1f5f9; color: #334155; }
.mip-toast--std .mip-toast__close svg { width: 0.85rem; height: 0.85rem; }
.mip-toast--std.mip-toast--out { animation: mip-toast-out 240ms ease-in both; }
.mip-toast-stack { width: min(24rem, calc(100vw - 2rem)); }
@keyframes mip-toast-in { from { opacity: 0; transform: translateX(110%); } to { opacity: 1; transform: none; } }
@keyframes mip-toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(60%); } }
@media (prefers-reduced-motion: reduce) { .mip-toast--std, .mip-toast--std.mip-toast--out, .mip-sysmodal--shake { animation: none !important; } }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 109 / 110): on scroll the entry form's action bar (Submit, Close, Tour, How To) stays at the top, just
   under the header and the module menu - the step rail (1 Details / 2 Items) scrolls away with the form. */
.mip-entry-header { position: sticky; top: var(--mip-shell-top, 0px); z-index: 22; margin-top: calc(-1 * var(--mip-space-2, 0.5rem)); padding: var(--mip-space-2, 0.5rem) 0; background: var(--mip-bg); }
.mip-guided-rail { position: relative; top: auto; }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 109 / 110): the list filter bar's fields are one width - Start Date, End Date and Branch alike, the box
   filling its field. */
form.mip-voucher-filter.mip-form-grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)) !important; }
form.mip-voucher-filter > .mip-form-field { min-width: 0; }
form.mip-voucher-filter > .mip-form-field > select,
form.mip-voucher-filter > .mip-form-field > input:not([type=hidden]),
form.mip-voucher-filter > .mip-form-field > .mip-why,
form.mip-voucher-filter > .mip-form-field > .mip-why > select { width: 100%; box-sizing: border-box; }
html.mip-list-loading main .mip-panel--table { opacity: 0.6; transition: opacity 120ms; }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 108): the standard status badges (Common/TransmissionStatus) - Email, Portal and EIS everywhere. */
.mip-st { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; border: 1px solid transparent; }
.mip-st::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; flex: none; }
.mip-st--gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.mip-st--slate { background: #e8eef6; color: #33506f; border-color: #d3deeb; }
.mip-st--blue { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.mip-st--green { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.mip-st--yellow { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.mip-st--orange { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.mip-st--red { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.mip-st--darkred { background: #7f1d1d; color: #ffffff; border-color: #7f1d1d; }
:root[data-theme="dark"] .mip-st--gray { background: #33363b; color: #cbd5e1; border-color: #3f444b; }

/* ==================================================================================================================================
   MIP-118 (QA TTS-036 Cycle 13 CIS 108): the User Console Home in four tiers. The header stays in view just under the top bar and the
   module menu (it never slides beneath them); KPI cards are one height; the trend takes 65% beside the health card's 35%.
   ================================================================================================================================== */
.mip-hd { gap: 1rem; padding-top: 0; }
.mip-hd__head { position: sticky; top: var(--mip-shell-top, 0px); z-index: 21; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  margin: 0 -1.5rem; padding: 0.9rem 1.5rem 0.75rem; background: var(--mip-bg); border-bottom: 1px solid transparent; }
.mip-hd__hello { min-width: 0; }
.mip-hd__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin: 0.25rem 0 0; color: var(--mip-color-text-muted); font-size: 0.9rem; }
.mip-hd__meta > * + *::before { content: "·"; margin-right: 0.9rem; color: var(--mip-color-text-muted); }
.mip-hd__meta > form::before { margin-right: 0.6rem; }
.mip-hd__branch { display: inline-flex; align-items: center; margin: 0; }
.mip-hd__branch select { padding: 0.3rem 0.5rem; min-width: 12rem; }
.mip-hd__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.mip-hd__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; align-items: stretch; }
.mip-hd__kpi { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem; border: 1px solid var(--mip-border); border-radius: 0.85rem;
  background: var(--mip-surface-raised, var(--mip-surface)); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.08); min-width: 0; }
.mip-hd__kpi-label { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--mip-color-text-muted); }
.mip-hd__kpi-value { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--mip-text); overflow-wrap: anywhere; }
.mip-hd__kpi-note { margin: auto 0 0; font-size: 0.78rem; color: var(--mip-color-text-muted); }
.mip-hd__kpi-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
.mip-hd__kpi-split div { min-width: 0; }
.mip-hd__kpi-split dt { font-size: 0.72rem; color: var(--mip-color-text-muted); }
.mip-hd__kpi-split dd { margin: 0.1rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--mip-text); overflow-wrap: anywhere; }
.mip-hd__kpi-split--seq dd { font-size: 1.05rem; }
.mip-hd__split { display: grid; grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); gap: 0.9rem; align-items: stretch; }
.mip-hd__panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.mip-hd__panel-head h2 small { font-weight: 400; font-size: 0.8rem; color: var(--mip-color-text-muted); margin-left: 0.35rem; }
.mip-hd__seg, .mip-hd__tabs { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border-radius: 0.55rem; background: var(--mip-bg-subtle, var(--mip-color-surface-muted)); }
.mip-hd__seg button, .mip-hd__tabs button { position: relative; padding: 0.3rem 0.8rem; border: 0; border-radius: 0.4rem; background: transparent; color: var(--mip-color-text-muted); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.mip-hd__seg button[aria-selected="true"], .mip-hd__tabs button[aria-selected="true"] { background: var(--mip-surface); color: var(--mip-text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.mip-hd__alert-dot { position: absolute; top: 0.2rem; right: 0.2rem; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #dc2626; }
.mip-hd__trend-svg, .mip-hd-trend__svg { display: block; width: 100%; height: 14rem; }
.mip-hd-trend__grid { stroke: var(--mip-border); stroke-width: 1; }
.mip-hd-trend__axis { fill: var(--mip-color-text-muted); font-size: 11px; }
.mip-hd-trend__vatable, .mip-hd__key--vatable { fill: #1c61a1; background: #1c61a1; }
.mip-hd-trend__exempt, .mip-hd__key--exempt { fill: #f59e0b; background: #f59e0b; }
.mip-hd-trend__zero, .mip-hd__key--zero { fill: #14b8a6; background: #14b8a6; }
.mip-hd__legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--mip-text); }
.mip-hd__legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.mip-hd__key { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; }
.mip-hd__health-pane { display: flex; align-items: center; gap: 1.1rem; }
.mip-hd__health-pane[hidden] { display: none; }
.mip-hd__health-list { display: flex; flex-direction: column; gap: 0.45rem; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; list-style: none; }
.mip-hd__health-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.mip-hd__count { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mip-text); }
a.mip-hd__count--alert { color: #b91c1c; text-decoration: underline; }
.mip-hd__view-all { font-weight: 600; text-decoration: none; }
.mip-hd__view-all:hover { text-decoration: underline; }
.mip-hd__doc { display: inline-block; min-width: 1.9rem; padding: 0.05rem 0.35rem; border-radius: 0.3rem; font-size: 0.7rem; font-weight: 700; text-align: center; }
.mip-hd__doc--si { background: #dbeafe; color: #1d4ed8; }
.mip-hd__doc--cm { background: #f3e8ff; color: #7e22ce; }
.mip-hd__table td { vertical-align: middle; }
.mip-hd__icons { white-space: nowrap; }
.mip-hd__icons .mip-line-icon-btn + .mip-line-icon-btn { margin-left: 0.25rem; }
@media (max-width: 75rem) { .mip-hd__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 60rem) { .mip-hd__split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .mip-hd__kpis { grid-template-columns: minmax(0, 1fr); } .mip-hd__head { margin: 0 -1rem; padding: 0.75rem 1rem; } .mip-hd__health-pane { flex-direction: column; align-items: stretch; } }

/* MIP-118 (CIS 108): the top bar's Help menu (Home) - Tour and How To. */
.mip-help-menu { position: relative; }
.mip-help-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.6rem; border-radius: var(--mip-radius-sm); cursor: pointer; color: inherit; font-weight: 600; }
.mip-help-menu > summary::-webkit-details-marker { display: none; }
.mip-help-menu > summary:hover { background: var(--mip-hover-bg); }
.mip-help-menu__list { position: absolute; right: 0; top: calc(100% + 0.3rem); z-index: 40; min-width: 11rem; margin: 0; padding: 0.3rem; list-style: none; background: var(--mip-surface); border: 1px solid var(--mip-border); border-radius: var(--mip-radius-md); box-shadow: var(--mip-shadow-lg); }
.mip-help-menu__list button { display: flex; width: 100%; align-items: center; gap: 0.5rem; padding: 0.5rem 0.65rem; border: 0; border-radius: var(--mip-radius-sm); background: none; color: var(--mip-text); font: inherit; text-align: left; cursor: pointer; }
.mip-help-menu__list button:hover { background: var(--mip-hover-bg); }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 113): a customer's Transactions - "[Doc No] - [Customer | TIN]" links, not underlined, #3640F5. */
a.mip-record-rel__doc { color: #3640f5; text-decoration: none; }
a.mip-record-rel__doc:hover { text-decoration: none; color: #2a31c4; }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 114): the Provider Console Home - four equal KPI cards, then two 50 / 50 rows of equal-height cards. */
.mip-pv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; align-items: stretch; }
.mip-pv-kpi { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem; border: 1px solid var(--mip-border); border-radius: 0.85rem;
  background: var(--mip-surface-raised, var(--mip-surface)); color: var(--mip-text); text-decoration: none; min-width: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.08); }
a.mip-pv-kpi:hover { border-color: var(--mip-color-primary-blue); }
.mip-pv-kpi__label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--mip-color-text-muted); }
.mip-pv-kpi__value { display: flex; align-items: baseline; gap: 0.4rem; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mip-pv-kpi__value small { font-size: 0.8rem; font-weight: 500; color: var(--mip-color-text-muted); }
.mip-pv-kpi__note { margin-top: auto; font-size: 0.8rem; color: var(--mip-color-text-muted); }
.mip-pv-kpi__note a.mip-st { text-decoration: none; }
.mip-pv-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.mip-pv-card { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; min-width: 0; }
.mip-pv-card .mip-form-section__title { margin: 0; }
.mip-pv-usage { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.mip-pv-usage__row { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.55rem 0.7rem; border-radius: 0.5rem; }
.mip-pv-usage__row--amber { background: #fffbeb; border: 1px solid #fde68a; }
.mip-pv-usage__row--red { background: #fef2f2; border: 1px solid #fecaca; }
.mip-pv-usage__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; font-size: 0.88rem; }
.mip-pv-usage__top a { font-weight: 600; text-decoration: none; }
.mip-pv-usage__bar { display: block; height: 0.4rem; border-radius: 999px; background: var(--mip-bg-subtle, #eef2f7); overflow: hidden; }
.mip-pv-usage__bar > span { display: block; height: 100%; border-radius: inherit; background: #1c61a1; }
.mip-pv-usage__row--amber .mip-pv-usage__bar > span { background: #d97706; }
.mip-pv-usage__row--red .mip-pv-usage__bar > span { background: #dc2626; }
.mip-pv-feed { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.mip-pv-feed__item { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: start; gap: 0.65rem; padding: 0.6rem 0; border-top: 1px solid var(--mip-border-subtle, var(--mip-border)); }
.mip-pv-feed__item:first-child { border-top: 0; }
.mip-pv-feed__icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.5rem; background: #eaf2fa; color: #1c61a1; }
.mip-pv-feed__icon--shield { background: #f3e8ff; color: #7e22ce; }
.mip-pv-feed__icon--building { background: #e0f2fe; color: #0369a1; }
.mip-pv-feed__icon svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mip-pv-feed__text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; font-size: 0.88rem; }
.mip-pv-feed__sub { font-size: 0.78rem; color: var(--mip-color-text-muted); }
.mip-pv-feed__time { font-size: 0.76rem; color: var(--mip-color-text-muted); white-space: nowrap; text-align: right; }
@media (max-width: 75rem) { .mip-pv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 64rem) { .mip-pv-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .mip-pv-kpis { grid-template-columns: minmax(0, 1fr); } .mip-pv-feed__item { grid-template-columns: 2rem minmax(0, 1fr); } .mip-pv-feed__time { grid-column: 2; text-align: left; } }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 115): the BIR Oversight Dashboard - the title with its Read-Only Mode pill, the dark-red Overdue card,
   the Overdue badge's reason and the feed's severity pills. */
.mip-bir-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-bottom: 1rem; }
.mip-bir-head h1 { margin: 0; }
.mip-bir-readonly { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 999px; background: #f8fafc;
  color: #334155; font-size: 0.8rem; font-weight: 600; cursor: help; }
.mip-pv-kpi--overdue { border-color: #7f1d1d; background: #fef2f2; }
.mip-pv-kpi--overdue .mip-pv-kpi__value { color: #7f1d1d; }
.mip-pv-kpi--overdue .mip-pv-kpi__label { color: #7f1d1d; }
.mip-bir-reason { display: block; margin-top: 0.15rem; font-size: 0.75rem; color: var(--mip-color-text-muted); }
.bir-feed2 .mip-pv-feed__item { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
.mip-bir-pill { justify-content: center; }

/* MIP-118 (QA TTS-036 Cycle 13 CIS 116): one size for the action buttons of every module - the list header and action bar, the entry
   form's action bar (Submit, Close, Tour, How To, [...]), a report's header and the pop-ups' buttons are all 2.6rem high; and an (i) sits
   right after its field label (never pushed to the far end of the label row). */
.mip-list-header .mip-btn:not(.mip-btn--sm),
.mip-action-bar > .mip-btn:not(.mip-btn--sm), .mip-action-bar .mip-action-bar__add, .mip-action-bar .mip-action-bar__howto,
.mip-entry-header__actions > .mip-btn:not(.mip-btn--sm), .mip-entry-header__actions > .mip-action-bar__overflow-wrap > .mip-btn,
.mip-hd__actions > .mip-btn, .mip-sysmodal .mip-modal__footer > .mip-btn {
  height: 2.6rem; min-height: 2.6rem; padding-top: 0; padding-bottom: 0; box-sizing: border-box; line-height: 1.2;
}
.mip-form-field > label:has(> .mip-help), .mip-form-field > label:has(.mip-help) { display: inline-flex; align-items: center; justify-content: flex-start; gap: 0.3rem; }
.mip-form-field > label > .mip-help, .mip-form-field > label .mip-help { margin-left: 0.3rem; flex: none; }
.mip-form-field:has(> label + .mip-help) > label { justify-self: start; }

/* MIP-118 (Cycle 13 dev check): Home's cards share one padding and one spacing - the KPI cards were tighter (13 x 14px) than the panels
   (14 x 16px) and the gaps differed; the Recent Transactions date and SI / CM badge stay on one line; the toasts sit above the status bar;
   the top bar's Help reads as clearly as its other icons. */
.mip-hd { gap: 1rem; }
.mip-hd__kpis, .mip-hd__split { gap: 1rem; }
.mip-hd__kpi, .mip-hd .mip-cc__panel { padding: 1.25rem 1.5rem; border-radius: 0.85rem; }
.mip-hd__kpi { gap: 0.5rem; min-height: 8.5rem; }
.mip-hd .mip-cc__panel { gap: 0.9rem; }
.mip-hd__kpi-split { margin-top: 0.15rem; }
.mip-hd__health-pane { padding: 0.25rem 0; }
.mip-hd__table td:nth-child(1), .mip-hd__table td:nth-child(2), .mip-hd__table td:nth-child(4) { white-space: nowrap; }
.mip-toast-stack { bottom: 3.25rem; }
.mip-shell-header .mip-help-menu > summary { color: #ffffff; }
.mip-shell-header .mip-help-menu > summary:hover { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 640px) { .mip-hd__kpi, .mip-hd .mip-cc__panel { padding: 1rem 1.1rem; } }

/* MIP-118 (Cycle 13 dev check): the Provider Home's cards have the same padding as its KPI cards (the panels had none in the console). */
.mip-pv-card.mip-panel { padding: 1.25rem 1.5rem; border-radius: 0.85rem; }
.mip-pv-kpi { padding: 1.25rem 1.5rem; min-height: 8.5rem; }
.mip-pv-feed__item:first-child { padding-top: 0; }

/* MIP-118 (Cycle 13 BIR check): the dark theme - the Overdue card, the Read-Only pill, the utilization alerts and the document badges keep
   their meaning without a light block on a dark page; the BIR examiner's footer chip. */
.mip-statusbar__chip--static { cursor: default; }
:root[data-theme="dark"] .mip-pv-kpi--overdue { background: #3b1414; border-color: #b91c1c; }
:root[data-theme="dark"] .mip-pv-kpi--overdue .mip-pv-kpi__value, :root[data-theme="dark"] .mip-pv-kpi--overdue .mip-pv-kpi__label { color: #fca5a5; }
:root[data-theme="dark"] .mip-bir-readonly { background: #262624; border-color: #4b5563; color: #e5e7eb; }
:root[data-theme="dark"] .mip-pv-usage__row--amber { background: #3a2a0a; border-color: #92400e; }
:root[data-theme="dark"] .mip-pv-usage__row--red { background: #3b1414; border-color: #b91c1c; }
:root[data-theme="dark"] .mip-hd__doc--si { background: #1e3a8a; color: #dbeafe; }
:root[data-theme="dark"] .mip-hd__doc--cm { background: #581c87; color: #f3e8ff; }
:root[data-theme="dark"] .mip-pv-feed__icon { background: #1e3a5f; color: #bfdbfe; }

/* MIP-120: Team & Audit > Reconciliation - five finding cards (a click filters the list), then the records. */
.mip-recon-note { margin: 4px 0 12px; font-size: 13px; color: var(--mip-text-muted); }
.mip-recon-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mip-recon-card { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--mip-border); border-left-width: 4px; border-radius: 8px;
  background: var(--mip-surface); color: var(--mip-text); text-decoration: none; }
.mip-recon-card:hover, .mip-recon-card:focus-visible { border-color: var(--mip-border-strong); }
.mip-recon-card[aria-current="true"] { background: var(--mip-bg-subtle); box-shadow: inset 0 0 0 1px var(--mip-border-strong); }
.mip-recon-card--clear { border-left-color: var(--mip-color-success); }
.mip-recon-card--low { border-left-color: var(--mip-color-warning); }
.mip-recon-card--high { border-left-color: var(--mip-color-danger); }
.mip-recon-card__label { font-size: 13px; font-weight: 600; color: var(--mip-text-muted); }
.mip-recon-card__count { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mip-recon-card--high .mip-recon-card__count { color: var(--mip-color-danger); }
.mip-recon-card__sub { font-size: 12px; color: var(--mip-text-muted); }
.mip-recon-card--clear .mip-recon-card__sub { color: var(--mip-color-success); }

/* MIP-121: Team & Audit > Releases. */
.mip-release-table td { vertical-align: top; }
.mip-release-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 132px; }
.mip-release-actions form { margin: 0; }
.mip-release-actions .mip-btn { width: 100%; justify-content: center; }
.mip-release-deploy { display: grid; gap: 4px; }
.mip-release-deploy input[type="date"] { font-size: 12px; padding: 3px 6px; }
.mip-release-class { margin: 6px 0 0; font-weight: 600; }
.mip-release-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; border: 1px solid var(--mip-border); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.mip-release-areas legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.mip-text-danger { color: var(--mip-color-danger); }
.mip-text-muted { color: var(--mip-text-muted); }
/* MIP-121: the remarks stay one line in the list (the release form and the exports show them in full). */
.mip-release-table small.mip-text-muted { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-style: italic; }

/* BIR Console filters: a field is as wide as its box (the search box's 16rem and the dates' 11.5rem spilled past their 11rem field
   and ran into the next field or the Generate button). */
.mip-bir-body .mip-audit-filters > .mip-form-field:has(input[type="search"]) { flex: 0 1 16rem; min-width: 16rem; }
.mip-bir-body .mip-audit-filters > .mip-form-field:has(input[type="date"]) { flex: 0 1 11.5rem; min-width: 11.5rem; }
.mip-bir-body .mip-audit-filters > .mip-form-field input[type="search"],
.mip-bir-body .mip-audit-filters > .mip-form-field input[type="date"] { width: 100%; box-sizing: border-box; }
@media (max-width: 480px) {
  .mip-bir-body .mip-audit-filters > .mip-form-field:has(input[type="search"]),
  .mip-bir-body .mip-audit-filters > .mip-form-field:has(input[type="date"]) { flex: 1 1 100%; min-width: 0; }
  .mip-bir-body .mip-audit-filters input[type="search"], .mip-bir-body .mip-audit-filters input[type="date"] { min-width: 0; }
}

/* MIP-126 (QA TTS-036 Cycle 14 CIS 117): the View Invoice pop-up - a wider window, five fields a row (one column on a phone). */
dialog.mip-dialog-panel.mip-dialog-panel--wide.mip-voucher-dialog:has(.mip-voucher-popup--five) { width: min(72rem, 96vw); max-width: 96vw; }
.mip-readonly-grid.mip-readonly-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mip-readonly-grid--five dd { overflow-wrap: anywhere; }
@media (max-width: 900px) { .mip-readonly-grid.mip-readonly-grid--five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .mip-readonly-grid.mip-readonly-grid--five { grid-template-columns: 1fr; } }

/* MIP-126 (QA TTS-036 Cycle 14 CIS 120): the Invoice's Add Item stays above an open item list (the list lay over it and took the click). */
[data-mip-si-add] { position: relative; z-index: 40; }
/* MIP-126 (CIS 122): a line's "Use privilege" switch-back - a small text button in the privilege cell. */
.mip-link-btn { background: none; border: 0; padding: 0; color: var(--mip-color-primary, #2f4bd8); font: inherit; text-decoration: underline; cursor: pointer; }
.mip-link-btn:focus-visible { outline: 2px solid var(--mip-color-primary, #2f4bd8); outline-offset: 2px; }
[data-mip-si-privoff] { display: block; white-space: normal; max-width: 14rem; }
/* MIP-129 (QA TTS-036 Cycle 15) ------------------------------------------------------------------------------------------------------- */
/* CIS 135: the taxpayer profile in three label / value columns. */
.bir-detail.bir-detail--grid { grid-template-columns: repeat(3, minmax(7rem, max-content) minmax(0, 1fr)); }
@media (max-width: 1100px) { .bir-detail.bir-detail--grid { grid-template-columns: repeat(2, minmax(7rem, max-content) minmax(0, 1fr)); } }
@media (max-width: 640px) { .bir-detail.bir-detail--grid { grid-template-columns: minmax(0, 1fr); } }
/* CIS 134 / 149 / 156: the real-time search box, as wide as the User Console's. */
.mip-bir-search input[type="search"], .mip-live-search input[type="search"] { width: min(26rem, 100%); }
/* CIS 140 / 149: Date To shows the whole date. */
.mip-bir-body .mip-audit-filters input[type="date"], .mip-platform-body .mip-audit-filters input[type="date"] { min-width: 12.5rem; }
/* CIS 139 / 149: Search on its own row above the filter row. */
.mip-audit-filters.mip-bir-filters { flex-wrap: wrap; }
.mip-audit-filters.mip-bir-filters > .mip-bir-search { flex: 1 0 100%; }
/* CIS 137 / 138: the BIR document preview pop-up. */
dialog.mip-bir-preview { width: min(64rem, 95vw); height: min(90vh, 60rem); padding: 0; border: 1px solid var(--mip-border-subtle, #dde2ea); border-radius: 10px; display: none; flex-direction: column; }
dialog.mip-bir-preview[open] { display: flex; }
dialog.mip-bir-preview::backdrop { background: rgba(15, 23, 42, 0.45); }
.mip-bir-preview__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--mip-border-subtle, #dde2ea); }
.mip-bir-preview__head h2 { margin: 0; font-size: 1.05rem; }
.mip-bir-preview__close { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 0.25rem; }
dialog.mip-bir-preview iframe { flex: 1; width: 100%; border: 0; background: #525659; }
/* CIS 151: Copy / Download beside the JSON payload; copy buttons beside an id. */
.mip-bir-json-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mip-copy-btn { margin-left: 0.4rem; padding: 0.05rem 0.5rem; border: 1px solid var(--mip-border-subtle, #cbd5e1); border-radius: 6px; background: none; color: inherit; font-size: 0.75rem; cursor: pointer; }
.mip-copy-btn:hover, .mip-copy-btn:focus-visible { border-color: var(--mip-color-primary, #2f4bd8); color: var(--mip-color-primary, #2f4bd8); }
/* CIS 142 / 145 / 158: a taxpayer's report or audit trail in a pop-up 95% wide over the BIR Console. */
dialog.mip-bir-preview.mip-bir-preview--wide { width: 95vw; height: 92vh; max-width: 95vw; }
.mip-bir-preview__spacer { flex: 1; }
.mip-bir-preview__head .mip-bir-readonly { flex: 0 0 auto; }
/* CIS 144: inside that pop-up the taxpayer's Tour, How To and Views are not offered. */
body.mip-embed.mip-console-bir .mip-views, body.mip-embed.mip-console-bir [data-mip-howto], body.mip-embed.mip-console-bir [data-mip-screen-tour] { display: none !important; }
body.mip-embed.mip-console-bir .mip-shell-main { padding-top: 0.75rem; }
/* CIS 161 / 214: Account Settings - the security actions spaced, the two-step status beside them. */
.mip-account-security { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
/* CIS 162 / 215: Mark all as read is off with nothing unread. */
.mip-notif-panel__read-all:disabled { color: var(--mip-color-text-muted, #94a3b8); cursor: default; text-decoration: none; }
/* CIS 164: the Provider Home greeting scrolls with the page (only the top bar stays). */
.mip-platform-body .mip-entry-header.mip-home-greeting { position: static; margin-top: 0; }
/* CIS 165: a light track behind each utilization bar, so 2% reads against 100%. */
.mip-pv-usage__bar { background: #e2e8f0; }
:root[data-theme="dark"] .mip-pv-usage__bar { background: #334155; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mip-pv-usage__bar { background: #334155; } }
/* CIS 200 / 210: Old Value and New Value wrap - a SHA-256 hash or a long detail never clips. */
.mip-table.mip-table--wrap-values td { overflow-wrap: anywhere; word-break: break-word; }
.mip-table.mip-table--wrap-values td:nth-last-child(-n+2) { min-width: 12rem; max-width: 28rem; white-space: normal; }
/* CIS 177 / 181 / 192: a styled file picker instead of the raw Choose File box. */
input[type="file"] { padding: 0.55rem; border: 1px dashed var(--mip-border-subtle, #cbd5e1); border-radius: 8px; background: var(--mip-bg-subtle, #f8fafc); width: 100%; max-width: 32rem; cursor: pointer; }
input[type="file"]:hover { border-color: var(--mip-color-primary, #2f4bd8); }
input[type="file"]::file-selector-button { margin-right: 0.75rem; padding: 0.4rem 0.9rem; border: 1px solid var(--mip-color-primary, #2f4bd8); border-radius: 6px; background: var(--mip-color-primary, #2f4bd8); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
/* CIS 184: the branch Address across three columns. */
.mip-form-grid > .mip-span-3 { grid-column: span 3; }
@media (max-width: 900px) { .mip-form-grid > .mip-span-3 { grid-column: 1 / -1; } }
/* CIS 187: a locked identity field reads as locked - muted, no focus ring. */
.mip-platform-body input[readonly]:not([type="date"]):not(.mip-field-locked) { background: var(--mip-bg-subtle, #f1f5f9); color: var(--mip-color-text-muted, #64748b); cursor: not-allowed; }
.mip-platform-body input[readonly]:focus { outline: none; box-shadow: none; border-color: var(--mip-border-subtle, #cbd5e1); }
/* CIS 188: the user's access under the level pill. */
.mip-user-access { display: block; margin-top: 0.25rem; }
.mip-operator-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
/* CIS 224: a form's heading stays clear of the sticky top bar when it is scrolled to. */
.mip-entry-header__title, .mip-shell-main h1 { scroll-margin-top: calc(var(--mip-shell-top, 0px) + 1rem); }
.mip-shell-main { scroll-padding-top: calc(var(--mip-shell-top, 0px) + 1rem); }
/* MIP-129 (CIS 139 / 140 / 149, checked on dev): Search on a row of its own; Start / End Date wide enough for "November 25, 2026". */
.mip-bir-body .mip-audit-filters.mip-bir-filters > .mip-form-field.mip-bir-search,
.mip-platform-body .mip-audit-filters.mip-bir-filters > .mip-form-field.mip-bir-search { flex: 1 0 100%; min-width: 0; max-width: none; }
.mip-bir-body .mip-audit-filters > .mip-form-field:has(input[type="date"]),
.mip-platform-body .mip-audit-filters > .mip-form-field:has(input[type="date"]) { flex: 0 0 13.5rem; min-width: 13.5rem; }
@media (max-width: 480px) {
  .mip-bir-body .mip-audit-filters > .mip-form-field:has(input[type="date"]),
  .mip-platform-body .mip-audit-filters > .mip-form-field:has(input[type="date"]) { flex: 1 1 100%; min-width: 0; }
}
/* CIS 233: the Item form's Category and Item Class read in full - two columns wide, and a long option wraps in the list. */
.mip-form-grid > .mip-form-field:has(select#CategoryId), .mip-form-grid > .mip-form-field:has(select[data-mip-item-class]) { grid-column: span 2; }
.mip-searchable-select__option { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) { .mip-form-grid > .mip-form-field:has(select#CategoryId), .mip-form-grid > .mip-form-field:has(select[data-mip-item-class]) { grid-column: 1 / -1; } }
/* CIS 163: the BIR lists' Views - rows shown, at the right above the table. */
.mip-bir-views { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; font-size: 0.85rem; }
.mip-bir-views select { width: auto; min-width: 5rem; }
