/*!
 * Oxia application theme for Bootstrap 5 (self-hosted font)
 * ------------------------------------------------------------
 * Application-wide look and feel. The palette, typography and
 * component rules below were first designed for Accounting -> Reports
 * (2026-09-08) and then promoted here so every module shares them.
 *
 * Sections:
 *   1) Font-face (self-hosted Source Sans 3)
 *   2) Design tokens (--au-*) and Bootstrap token mapping
 *   3) Global base (typography, links, numbers)
 *   4) Layout primitives: side navigation shell, headers, toolbars,
 *      filter bars, segmented controls, section labels
 *   5) Bootstrap components: cards, buttons, forms, tabs, badges,
 *      tables, modals, navbar, dropdowns, pagination
 *   6) Report / tree tables (.rpt-*) used by Accounting -> Reports and
 *      any other view that renders a hierarchical figures table
 *   7) Charts (.rpt-chart-*)
 *   8) Responsive system (breakpoints, overflow safety, datalist shell,
 *      touch targets, modals, navigation drawer)
 *   9) Print
 *  10) Gantt (.gantt-*) — Manufacturing schedule overview
 *  12) Left menu (personal choice) and phone menu (.sf-side, .sf-rail, .sf-panel, .sf-mbar, .sf-msheet)
 *
 * Usage: load Bootstrap 5 CSS first, then this file.
 * Font files expected next to this file: ./fonts/SourceSans3-{Regular,SemiBold,Bold}.woff2
 */

/* ============================================================
   1) Font-face (self-hosted Source Sans 3)
   ============================================================ */

@font-face{
  font-family: "Source Sans 3";
  src: url("./fonts/SourceSans3-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Source Sans 3";
  src: url("./fonts/SourceSans3-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Source Sans 3";
  src: url("./fonts/SourceSans3-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   2) Design tokens
   ============================================================ */

:root{
  --au-font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --au-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Ink */
  --au-ink-900: #0b1220;
  --au-ink-800: #111827;
  --au-ink-700: #1f2937;
  --au-ink-600: #374151;
  --au-muted:   #6b7280;   /* secondary text, labels, codes */
  --au-faint:   #9aa3ad;   /* zero values, hints */
  --au-faint-2: #c3c9d0;   /* "n/a" placeholders */

  /* Brand */
  --au-navy:        #0b3d5c;   /* headings, table header text, totals rule */
  --au-navy-700:    #083b5c;
  --au-primary:     #0b6aa2;   /* accent: active nav, links, chevrons, segmented buttons */
  --au-primary-600: #095a8a;
  --au-primary-soft:#e6f0f7;

  /* Surfaces & borders */
  --au-surface-0: #ffffff;
  --au-surface-1: #fbfcfd;   /* toolbars, sub-table backdrop */
  --au-surface-2: #f6f8fa;   /* side nav, table header, page body */
  --au-surface-3: #eef2f6;   /* section rows */
  --au-hover:     #f8fafc;   /* row hover, subtotal */
  --au-hover-2:   #eceff3;   /* nav item hover, neutral badge */
  --au-border:    #e3e7ec;   /* panel borders */
  --au-border-2:  #cfd6de;   /* control borders, header rule */
  --au-border-3:  #9aa6b2;   /* subtotal rule */
  --au-rule:      #eef0f3;   /* hairline row separators */

  /* Status */
  --au-success:      #198754;
  --au-success-ink:  #146c43;
  --au-success-soft: #d1f2df;
  --au-warning:      #d97706;
  --au-warning-ink:  #664d03;
  --au-warning-soft: #fff3cd;
  --au-danger:       #b02a37;
  --au-danger-ink:   #842029;
  --au-danger-soft:  #f8d7da;
  --au-info:         #0e7490;

  /* Shape & type scale */
  --au-radius-sm: .25rem;
  --au-radius: 6px;
  --au-radius-lg: .5rem;
  --au-fs-xs:  0.74rem;   /* nav group labels, badges */
  --au-fs-sm:  0.79rem;   /* field labels, sub-table headers, section labels */
  --au-fs-md:  0.875rem;   /* table headers, entry rows, notes */
  --au-fs:     0.93rem;   /* table body */
  --au-fs-ui:  0.94rem;   /* nav items, subtitles */
}

/* Bootstrap token mapping */
:root{
  --bs-body-font-family: var(--au-font-sans);
  --bs-font-monospace: var(--au-font-mono);
  --bs-body-bg: var(--au-surface-2);
  --bs-body-color: var(--au-ink-700);
  --bs-secondary-color: var(--au-muted);
  --bs-tertiary-bg: var(--au-surface-2);
  --bs-border-color: var(--au-border);
  --bs-link-color: var(--au-primary);
  --bs-link-hover-color: var(--au-navy-700);
  --bs-link-color-rgb: 11, 106, 162;
  --bs-link-hover-color-rgb: 8, 59, 92;
  --bs-primary: var(--au-primary);
  --bs-primary-rgb: 11, 106, 162;
  --bs-success: var(--au-success);
  --bs-success-rgb: 25, 135, 84;
  --bs-warning: var(--au-warning);
  --bs-warning-rgb: 217, 119, 6;
  --bs-danger: var(--au-danger);
  --bs-danger-rgb: 176, 42, 55;
  --bs-info: var(--au-info);
  --bs-info-rgb: 14, 116, 144;
  --bs-border-radius-sm: var(--au-radius-sm);
  --bs-border-radius: var(--au-radius);
  --bs-border-radius-lg: var(--au-radius-lg);
  --bs-focus-ring-color: rgba(11, 106, 162, 0.25);
}

/* ============================================================
   3) Global base
   ============================================================ */

body{
  letter-spacing: .05px;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4,h5,h6{
  font-weight: 700;
  color: var(--au-navy);
}
h1{ font-size: 1.5rem; }
h2{ font-size: 1.3rem; }
h3{ font-size: 1.25rem; }
h4{ font-size: 1.1rem; }
h5{ font-size: 1rem; }
h6{ font-size: 0.9rem; }

a{ color: var(--au-primary); }
a:hover{ color: var(--au-navy-700); }

.text-muted, .text-secondary{ color: var(--au-muted) !important; }

.money, .num, .table .money, .table .num{
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.num, .money{ text-align: right; }
.neg{ color: var(--au-danger); }
.zero{ color: var(--au-faint); }

/* Small uppercase label used above groups of things (side nav groups,
   chart sections, filter labels). */
.au-label, .au-section-label{
  display: block;
  font-size: var(--au-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--au-muted);
  font-weight: 600;
}

/* Inline "code" prefix in front of a label (account number, product id) */
.au-code{
  color: var(--au-muted);
  display: inline-block;
  min-width: 3.2rem;
  margin-right: 4px;
  font-size: var(--au-fs-md);
  font-variant-numeric: tabular-nums;
}

/* Dotted in-app link (opens another record) */
.au-link, .rpt-link{
  color: var(--au-primary);
  text-decoration: none;
  border-bottom: 1px dotted var(--au-primary);
}
.au-link:hover, .rpt-link:hover{ color: var(--au-navy-700); }

/* ============================================================
   4) Layout primitives
   ============================================================ */

/* Shell: white panel with a left side navigation and a main column.
   Generic aliases (.au-shell etc) plus the original .rpt-* names. */
.au-shell, .rpt-shell{
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
  background: var(--au-surface-0);
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
  overflow: hidden;
}
.au-nav, .rpt-nav{
  width: 230px;
  flex: 0 0 230px;
  background: var(--au-surface-2);
  border-right: 1px solid var(--au-border);
  padding: 10px 0;
}
.au-nav-group, .rpt-nav-group{
  font-size: var(--au-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--au-muted);
  padding: 12px 16px 4px 16px;
  font-weight: 600;
}
.au-nav-item, .rpt-nav-item{
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 16px;
  color: var(--au-ink-700);
  text-decoration: none;
  font-size: var(--au-fs-ui);
  border-left: 3px solid transparent;
}
.au-nav-item:hover, .rpt-nav-item:hover{ background: var(--au-hover-2); color: var(--au-navy); }
.au-nav-item.active, .rpt-nav-item.active{
  background: var(--au-surface-0);
  border-left-color: var(--au-primary);
  color: var(--au-navy);
  font-weight: 600;
}
.au-nav-item i, .rpt-nav-item i{ color: var(--au-muted); width: 16px; text-align: center; }
.au-nav-item.active i, .rpt-nav-item.active i{ color: var(--au-primary); }
.au-nav-select, .rpt-nav-select{ display: none; margin: 8px; width: auto; }
.au-main, .rpt-main{ flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* Settings page (sys/settings/entity_settings): one row per setting - what it is on the left,
   its control in a fixed-width column on the right. Masked = a secret shown as dots without
   being a password field (a password field makes the browser offer to save it). */
.au-settings .au-toolbar{ justify-content: space-between; }
.au-settings-search{ max-width: 26rem; }
.au-settings-body{ padding: 4px 18px 18px 18px; }
.au-settings-group{ margin: 18px 0 2px 0; }
/* an embedded editor view (two-factor policy) brings its own container/cards: drop its outer gutters */
.au-settings-panel{ padding-top: 8px; }
.au-settings-panel .container-fluid{ padding-left: 0; padding-right: 0; }
.au-settings-panel .col-xl-11{ flex: 0 0 100%; max-width: 100%; width: 100%; }
.au-setting{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem);
  gap: 6px 24px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--au-rule);
}
.au-setting:last-child{ border-bottom: 0; }
.au-setting.is-saving{ opacity: 0.6; }
.au-setting-title{ font-weight: 600; color: var(--au-navy); }
.au-setting-description{ color: var(--au-ink-700); font-size: var(--au-fs-ui); margin-top: 2px; max-width: 70ch; }
.au-setting-meta{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; font-size: var(--au-fs-sm); }
.au-setting-key{ color: var(--au-muted); background: transparent; padding: 0; font-size: inherit; user-select: all; }
.au-setting-history{ color: var(--au-muted); text-decoration: none; }
.au-setting-history:hover{ color: var(--au-primary); }
.au-setting-control{ justify-self: stretch; }
.au-setting-control .form-control, .au-setting-control .form-select{ font-size: var(--au-fs); }
.au-setting-switch{ display: flex; align-items: center; gap: 8px; padding-left: 0; min-height: 31px; }
.au-setting-switch .form-check-input{ float: none; margin: 0; width: 2.4em; height: 1.25em; cursor: pointer; }
.au-setting-switch .form-check-label{ color: var(--au-muted); font-size: var(--au-fs-ui); }
.au-setting-masked{ -webkit-text-security: disc; }
.au-setting-control sf-dialog > div > div.text-end{ text-align: left !important; }
/* denser rows (authorization switches: many per page, one line of help at most) */
.au-setting-compact{ padding: 7px 0; grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem); }
/* Authorizations view (sys/authorization_matrix): the same shell, embedded in an expanded list
   row / a tab / the New role dialog - so no viewport-high minimum */
.au-authz{ min-height: 0; }
.au-authz-id{ color: var(--au-ink-700); background: transparent; padding: 0; font-size: var(--au-fs-md); overflow-wrap: anywhere; }
.au-authz-note{ margin-top: 12px; padding: 10px 12px; background: var(--au-surface-1); border: 1px solid var(--au-rule); border-radius: var(--au-radius); color: var(--au-ink-700); font-size: var(--au-fs-ui); max-width: 90ch; }
.au-authz-count-on{ color: var(--au-primary); font-weight: 600; }
.au-setting-switch .form-check-input.border-danger{ border-color: var(--bs-danger) !important; }
.au-setting-history-panel{ grid-column: 1 / -1; background: var(--au-surface-1); border: 1px solid var(--au-rule); border-radius: var(--au-radius); padding: 8px 12px; }
/* Below lg the generic shell hides its side nav behind a select; a settings page is navigated by
   category all the time, so here the nav stays visible as a swipeable strip of chips instead. */
@media (max-width: 991.98px){
  .au-settings .au-nav{
    display: flex;
    flex: 0 0 auto;
    width: auto;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--au-border);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* fade the right edge: there is more to swipe to */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .au-settings .au-nav::-webkit-scrollbar{ display: none; }
  .au-settings .au-nav::after{ content: ""; flex: 0 0 20px; }
  .au-settings .au-nav-item{
    flex: 0 0 auto;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--au-border);
    border-radius: 999px;
    background: var(--au-surface-0);
    white-space: nowrap;
  }
  .au-settings .au-nav-item.active{ background: var(--au-primary); border-color: var(--au-primary); color: #fff; }
  .au-settings .au-nav-item.active i, .au-settings .au-nav-item.active small{ color: #fff !important; }
}
@media (max-width: 767.98px){
  .au-setting{ grid-template-columns: minmax(0, 1fr); }
  .au-settings-body{ padding: 4px 12px 12px 12px; }
  .au-settings-search{ max-width: none; }
}

/* Page header: title + subtitle on the left, actions on the right */
.au-header, .rpt-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 6px 18px;
}
.au-title, .rpt-title{ font-size: 1.25rem; font-weight: 700; color: var(--au-navy); margin: 0; }
.au-subtitle, .rpt-subtitle{ color: var(--au-muted); font-size: var(--au-fs-ui); margin-top: 2px; }
.au-actions, .rpt-actions{ display: flex; gap: 6px; align-items: center; }

/* Toolbar strip (period selectors, layout toggles) */
.au-toolbar, .rpt-toolbar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-top: 1px solid var(--au-rule);
  border-bottom: 1px solid var(--au-rule);
  background: var(--au-surface-1);
}

/* Filter bar (labelled selects) */
.au-filters, .rpt-filters{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--au-rule);
}
.au-filter, .rpt-filter{ min-width: 160px; }
.au-filter-wide, .rpt-filter-wide{ min-width: 260px; }
.au-filter sf-select strong, .rpt-filter sf-select strong{ font-size: var(--au-fs-sm); color: var(--au-muted); font-weight: 600; }
.au-filter sf-select small, .rpt-filter sf-select small{ display: none; }
.au-filter sf-select .ts-control, .au-filter sf-select .ts-wrapper,
.rpt-filter sf-select .ts-control, .rpt-filter sf-select .ts-wrapper{ font-size: var(--au-fs); }
.au-field-label, .rpt-label{
  display: block;
  font-size: var(--au-fs-sm);
  color: var(--au-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.au-toggles, .rpt-toggles{ display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding-bottom: 4px; }
.au-check, .rpt-check{
  font-size: 0.83rem;
  color: var(--au-ink-600);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}
.au-check input, .rpt-check input{ margin: 0; }
.au-spacer, .rpt-spacer{ flex: 1 1 auto; }

/* Segmented control */
.au-seg, .rpt-seg{
  display: inline-flex;
  border: 1px solid var(--au-border-2);
  border-radius: var(--au-radius);
  overflow: hidden;
  background: var(--au-surface-0);
}
.au-seg button, .rpt-seg button{
  border: 0;
  background: transparent;
  padding: 4px 12px;
  font-size: 0.83rem;
  color: var(--au-ink-600);
  border-right: 1px solid var(--au-border-2);
}
.au-seg button:last-child, .rpt-seg button:last-child{ border-right: 0; }
.au-seg button.active, .rpt-seg button.active{ background: var(--au-primary); color: #fff; font-weight: 600; }

.rpt-year, .rpt-month{ width: auto; min-width: 110px; }
.rpt-date{ width: 150px; }
.rpt-dash{ color: var(--au-muted); }
.rpt-stepper{ display: inline-flex; gap: 2px; }
.rpt-subtabs{ padding: 8px 18px 0 18px; }

/* Body area of the shell */
.au-body, .rpt-body{ padding: 10px 18px 18px 18px; flex: 1 1 auto; min-width: 0; }
.au-body sf-litloader, .au-body sf-litloader > *,
.rpt-body sf-litloader, .rpt-body sf-litloader > *{ display: block; min-width: 0; max-width: 100%; }
.au-loading, .rpt-loading{ padding: 40px; text-align: center; color: var(--au-muted); }
.rpt-body{ position: relative; }
/* report reload with data on screen (period / year / filter change): keep the old table visible but
   dimmed and blocked, with a spinner pill on top - the sfFetch progress bar is skipped for these */
.rpt-body.rpt-busy > *:not(.rpt-busy-overlay){ opacity: .45; pointer-events: none; transition: opacity .15s; }
.rpt-busy-overlay{ position: absolute; top: 16px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; z-index: 5; }
.rpt-busy-overlay > span{ display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--au-surface-0, #fff); color: inherit; border: 1px solid var(--au-border, #ddd); box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: var(--au-fs-md); }
.au-note, .rpt-note{ color: var(--au-muted); font-size: var(--au-fs-md); margin-top: 8px; }
.rpt-alert{ margin: 0 0 10px 0; }

/* Reports · Group result: company bar + setup dialog */
.rpt-companies{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--au-rule);
  background: var(--au-surface-1);
}
.rpt-companies .rpt-label{ margin: 0; }
.rpt-companies .rpt-check.off{ color: var(--au-muted); text-decoration: line-through; }
.rpt-group-table td, .rpt-group-table th{ vertical-align: middle; }
.rpt-group-table input.form-control-sm{ max-width: 200px; }
.rpt-group-table .sub, .rpt-rule .sub{ font-size: var(--au-fs-sm); color: var(--au-muted); }
.rpt-rule{ padding: 8px 0; border-top: 1px solid var(--au-rule); }
.rpt-rule .rpt-check{ font-weight: 600; }
.rpt-rule .rpt-rule-fields{ display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; padding-left: 24px; }
.rpt-rule .rpt-rule-fields label{ font-size: var(--au-fs-sm); color: var(--au-muted); display: block; }
.rpt-rule .rpt-rule-fields input{ min-width: 320px; }
.rpt th.company-col{ white-space: normal; }
.rpt-modal .modal-body{ max-height: 75vh; overflow: auto; }

/* ============================================================
   5) Bootstrap components
   ============================================================ */

/* Cards */
.card{
  background: var(--au-surface-0);
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
}
.card-header{
  background: var(--au-surface-2);
  border-bottom: 1px solid var(--au-border);
  font-weight: 600;
  color: var(--au-navy);
  padding: .5rem .9rem;
}
.card-title{ color: var(--au-navy); font-weight: 700; font-size: 1rem; }
.card-footer{ background: var(--au-surface-1); border-top: 1px solid var(--au-border); }

/* Buttons */
.btn{
  border-radius: var(--au-radius);
  font-weight: 600;
}
.btn-sm{ font-size: 0.875rem; }
.btn-primary{
  --bs-btn-bg: var(--au-primary);
  --bs-btn-border-color: var(--au-primary-600);
  --bs-btn-hover-bg: var(--au-primary-600);
  --bs-btn-hover-border-color: var(--au-navy);
  --bs-btn-active-bg: var(--au-navy);
  --bs-btn-active-border-color: var(--au-navy);
  --bs-btn-disabled-bg: var(--au-primary);
  --bs-btn-disabled-border-color: var(--au-primary);
}
.btn-outline-primary{
  --bs-btn-color: var(--au-primary);
  --bs-btn-border-color: var(--au-primary);
  --bs-btn-hover-bg: var(--au-primary);
  --bs-btn-hover-border-color: var(--au-primary);
  --bs-btn-active-bg: var(--au-primary-600);
  --bs-btn-active-border-color: var(--au-primary-600);
}
.btn-secondary{
  --bs-btn-bg: var(--au-muted);
  --bs-btn-border-color: var(--au-muted);
  --bs-btn-hover-bg: var(--au-ink-600);
  --bs-btn-hover-border-color: var(--au-ink-600);
}
.btn-outline-secondary{
  --bs-btn-color: var(--au-ink-600);
  --bs-btn-border-color: var(--au-border-2);
  --bs-btn-hover-color: var(--au-navy);
  --bs-btn-hover-bg: var(--au-hover-2);
  --bs-btn-hover-border-color: var(--au-border-2);
  --bs-btn-active-color: var(--au-navy);
  --bs-btn-active-bg: var(--au-hover-2);
  --bs-btn-active-border-color: var(--au-border-2);
}
.btn-success{
  --bs-btn-bg: var(--au-success);
  --bs-btn-border-color: var(--au-success);
  --bs-btn-hover-bg: var(--au-success-ink);
  --bs-btn-hover-border-color: var(--au-success-ink);
}
.btn-danger{
  --bs-btn-bg: var(--au-danger);
  --bs-btn-border-color: var(--au-danger);
  --bs-btn-hover-bg: var(--au-danger-ink);
  --bs-btn-hover-border-color: var(--au-danger-ink);
}
.btn-outline-danger{
  --bs-btn-color: var(--au-danger);
  --bs-btn-border-color: var(--au-danger);
  --bs-btn-hover-bg: var(--au-danger);
  --bs-btn-hover-border-color: var(--au-danger);
}
.btn-link{
  --bs-btn-color: var(--au-primary);
  --bs-btn-hover-color: var(--au-navy-700);
  text-decoration: none;
  font-weight: 600;
}
.btn-link:hover{ text-decoration: underline; }
.btn:focus-visible, .form-control:focus, .form-select:focus{
  box-shadow: 0 0 0 0.2rem rgba(11, 106, 162, 0.2);
}

/* Forms */
.form-label{
  font-weight: 600;
  color: var(--au-muted);
  font-size: var(--au-fs-sm);
  margin-bottom: 2px;
}
.form-label.small{ font-size: var(--au-fs-sm); }
.form-control, .form-select{
  border-color: var(--au-border-2);
  min-height: 2.5rem;
  font-size: var(--au-fs);
}
.form-control-sm, .form-select-sm{ min-height: calc(1.5em + .5rem + 2px); }
.form-control:focus, .form-select:focus{ border-color: var(--au-primary); }
.form-check-input:checked{ background-color: var(--au-primary); border-color: var(--au-primary); }
.form-check-input:focus{ border-color: var(--au-primary); box-shadow: 0 0 0 0.2rem rgba(11, 106, 162, 0.2); }
.form-text{ color: var(--au-muted); font-size: var(--au-fs-sm); }
.input-group-text{
  background: var(--au-surface-2);
  border-color: var(--au-border-2);
  color: var(--au-muted);
  font-size: var(--au-fs);
}

/* Tom-select (sf-select) controls follow form-control sizing */
.ts-wrapper .ts-control{ border-color: var(--au-border-2); font-size: var(--au-fs); }
.ts-wrapper.focus .ts-control{ border-color: var(--au-primary); box-shadow: 0 0 0 0.2rem rgba(11, 106, 162, 0.2); }
.ts-dropdown .active{ background: var(--au-primary-soft); color: var(--au-navy); }

/* Tabs */
.nav-tabs{ border-bottom: 1px solid var(--au-border); }
.nav-tabs .nav-link{
  color: var(--au-ink-600);
  font-size: var(--au-fs-ui);
  font-weight: 600;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .45rem .9rem;
  margin-bottom: -1px;
}
.nav-tabs .nav-link:hover{ color: var(--au-navy); border-bottom-color: var(--au-border-2); }
.nav-tabs .nav-link.active{
  color: var(--au-navy);
  background: transparent;
  border-bottom-color: var(--au-primary);
}
.nav-pills .nav-link{ color: var(--au-ink-600); font-size: var(--au-fs-ui); font-weight: 600; }
.nav-pills .nav-link.active{ background: var(--au-primary); }

/* Badges: quiet pill style like the report status badges */
.badge{
  font-size: var(--au-fs-xs);
  font-weight: 600;
  padding: .2em .6em;
  border-radius: 10px;
}
.badge.bg-success{ background: var(--au-success-soft) !important; color: var(--au-success-ink) !important; }
.badge.bg-warning{ background: var(--au-warning-soft) !important; color: var(--au-warning-ink) !important; }
.badge.bg-danger{ background: var(--au-danger-soft) !important; color: var(--au-danger-ink) !important; }
.badge.bg-secondary, .badge.bg-light{ background: var(--au-hover-2) !important; color: var(--au-ink-600) !important; }
.badge.bg-info{ background: var(--au-primary-soft) !important; color: var(--au-navy) !important; }
.badge.bg-primary{ background: var(--au-primary) !important; color: #fff !important; }

/* Alerts */
.alert{ border-radius: var(--au-radius); font-size: var(--au-fs); }
.alert-warning{ --bs-alert-bg: var(--au-warning-soft); --bs-alert-border-color: #f3dc9a; --bs-alert-color: var(--au-warning-ink); }
.alert-danger{ --bs-alert-bg: var(--au-danger-soft); --bs-alert-border-color: #f1b4ba; --bs-alert-color: var(--au-danger-ink); }
.alert-success{ --bs-alert-bg: var(--au-success-soft); --bs-alert-border-color: #a9e2c3; --bs-alert-color: var(--au-success-ink); }
.alert-info{ --bs-alert-bg: var(--au-primary-soft); --bs-alert-border-color: #b7d3e6; --bs-alert-color: var(--au-navy); }

/* Tables (ledger-first): compact, tabular numbers, sticky quiet header */
.table{
  font-size: var(--au-fs);
  font-variant-numeric: tabular-nums;
  --bs-table-border-color: var(--au-rule);
  --bs-table-striped-bg: var(--au-surface-1);
  --bs-table-hover-bg: var(--au-hover);
  --bs-table-active-bg: var(--au-primary-soft);
  color: var(--au-ink-700);
}
.table > :not(caption) > * > *{ padding: 5px 10px; border-bottom-color: var(--au-rule); }
.table-sm > :not(caption) > * > *{ padding: 4px 8px; }
.table thead th{
  background: var(--au-surface-2);
  border-bottom: 2px solid var(--au-border-2);
  font-weight: 600;
  color: var(--au-navy);
  font-size: var(--au-fs-md);
  white-space: nowrap;
}
.table-responsive thead th{ position: sticky; top: 0; z-index: 2; }
.table-light, .table > .table-light > *{ --bs-table-bg: var(--au-surface-2); --bs-table-color: var(--au-navy); }
.table tfoot th, .table tfoot td{
  font-weight: 700;
  border-top: 2px solid var(--au-navy);
  background: var(--au-surface-0);
}
.table tbody tr.section td, .table tbody tr.table-section td{
  background: var(--au-surface-3) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.76rem;
  color: var(--au-navy);
}
.table .code{ color: var(--au-muted); font-size: var(--au-fs-md); }
.table td.text-danger, .table .text-danger{ color: var(--au-danger) !important; }
.table td.text-success, .table .text-success{ color: var(--au-success) !important; }

/* Pagination */
.pagination{ --bs-pagination-font-size: var(--au-fs); --bs-pagination-color: var(--au-primary); --bs-pagination-active-bg: var(--au-primary); --bs-pagination-active-border-color: var(--au-primary); --bs-pagination-border-color: var(--au-border-2); --bs-pagination-hover-bg: var(--au-hover-2); --bs-pagination-hover-color: var(--au-navy); }

/* Modals */
.modal-content{ border: 1px solid var(--au-border); border-radius: var(--au-radius); }
.modal-header{ background: var(--au-surface-2); border-bottom: 1px solid var(--au-border); padding: .75rem 1rem; }
.modal-title{ color: var(--au-navy); font-size: 1.05rem; font-weight: 700; }
.modal-footer{ background: var(--au-surface-1); border-top: 1px solid var(--au-border); }

/* List groups, dropdowns, accordion */
.list-group-item{ border-color: var(--au-border); font-size: var(--au-fs); }
.list-group-item.active{ background: var(--au-primary); border-color: var(--au-primary); }
.dropdown-menu{ border-color: var(--au-border); border-radius: var(--au-radius); font-size: var(--au-fs-ui); box-shadow: 0 6px 18px rgba(11, 61, 92, 0.08); }
.dropdown-item{ color: var(--au-ink-700); }
.dropdown-item:hover, .dropdown-item:focus{ background: var(--au-hover-2); color: var(--au-navy); }
.dropdown-item.active, .dropdown-item:active{ background: var(--au-primary); color: #fff; }
.dropdown-header{ font-size: var(--au-fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--au-muted); font-weight: 600; }
.accordion-button{ color: var(--au-navy); font-weight: 600; font-size: var(--au-fs-ui); }
.accordion-button:not(.collapsed){ background: var(--au-surface-2); color: var(--au-navy); box-shadow: none; }
.accordion-item{ border-color: var(--au-border); }

/* Top navbar */
.navbar.bg-body-tertiary{
  --bs-tertiary-bg: var(--au-surface-0);
  background: var(--au-surface-0) !important;
  border-bottom: 1px solid var(--au-border);
}
.navbar .navbar-brand{ color: var(--au-navy); font-weight: 700; }
.navbar .nav-link{ color: var(--au-ink-700); font-size: var(--au-fs-ui); font-weight: 600; }
.navbar .nav-link:hover, .navbar .nav-link.show{ color: var(--au-primary); }
.navbar .nav-link.active{ color: var(--au-navy); }

/* Breadcrumb, progress, spinner, tooltip */
.breadcrumb{ font-size: var(--au-fs-ui); }
.breadcrumb-item.active{ color: var(--au-muted); }
.progress{ background: var(--au-hover-2); }
.progress-bar{ background: var(--au-primary); }
.spinner-border{ color: var(--au-primary); }

/* ============================================================
   6) Report / tree tables (.rpt-*)
   ============================================================ */

.rpt-tools{ display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 6px; }
.rpt-tools button{ font-size: 0.75rem; }
.rpt-wrap{ overflow: auto; border: 1px solid var(--au-border); border-radius: var(--au-radius); max-height: calc(100vh - 210px); }
table.rpt{ width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--au-fs); font-variant-numeric: tabular-nums; }
table.rpt thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--au-surface-2);
  border-bottom: 2px solid var(--au-border-2);
  padding: 8px 10px;
  font-weight: 600;
  color: var(--au-navy);
  white-space: nowrap;
  text-align: right;
  font-size: var(--au-fs-md);
}
table.rpt thead th:first-child{ text-align: left; min-width: 320px; }
table.rpt td{ padding: 5px 10px; border-bottom: 1px solid var(--au-rule); vertical-align: top; }
table.rpt td.n{ text-align: right; white-space: nowrap; }
table.rpt td.n.neg{ color: var(--au-danger); }
table.rpt td.n.zero{ color: var(--au-faint); }
table.rpt td .na{ color: var(--au-faint-2); }
table.rpt td.t{ color: var(--au-ink-600); }
table.rpt td.st{ white-space: nowrap; }
table.rpt td.l{ white-space: nowrap; }
table.rpt td.l .lbl{ white-space: normal; }
/* label cell spanning empty value columns (row.label_span): one line, ellipsis, full text in title */
table.rpt td.l.clip .lbl, table.rpt td.l.clip .sub{ display: inline-block; max-width: min(60vw, 640px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table.rpt td.l.clip .sub{ display: block; }
table.rpt td.l.clip:not([colspan]) .lbl, table.rpt td.l.clip[colspan="1"] .lbl{ max-width: 300px; }
table.rpt .code{ color: var(--au-muted); display: inline-block; min-width: 3.2rem; margin-right: 4px; font-size: var(--au-fs-md); }
table.rpt .sub{ color: var(--au-muted); font-size: var(--au-fs-sm); margin-left: 24px; white-space: normal; }
.rpt-chev{
  border: 0;
  background: transparent;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-right: 4px;
  color: var(--au-primary);
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rpt-chev i{ transition: transform 0.12s ease; display: inline-block; }
.rpt-chev.open i{ transform: rotate(90deg); }
.rpt-chev-space{ display: inline-block; width: 24px; }
.rpt-row.expandable{ cursor: pointer; }
.rpt-row.expandable:hover td{ background: var(--au-hover); }
.rpt-section td{
  background: var(--au-surface-3) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.76rem;
  color: var(--au-navy);
}
.rpt-group td, .bold td{ font-weight: 600; }
.rpt-subtotal td{ font-weight: 700; border-top: 1px solid var(--au-border-3); background: var(--au-hover); }
.rpt-total td{ font-weight: 700; border-top: 2px solid var(--au-navy); border-bottom: 3px double var(--au-navy) !important; background: var(--au-surface-0); }
.rpt-info td{ color: var(--au-muted); font-style: italic; font-weight: 400; }
.muted td{ color: var(--au-muted); font-weight: 400; }
.rpt-entry td{ font-size: var(--au-fs-md); }
.rpt-kpi td.l{ font-weight: 500; }
.rpt-status{ margin-left: 8px; font-size: var(--au-fs-md); }
.rpt-info-icon{ margin-left: 6px; color: var(--au-faint); font-size: 0.75rem; cursor: help; }
.rpt-status.ok{ color: var(--au-success); }
.rpt-status.warn{ color: var(--au-warning); }
.rpt-badge{
  display: inline-block;
  font-size: var(--au-fs-xs);
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--au-hover-2);
  color: var(--au-ink-600);
  text-transform: lowercase;
}
.rpt-badge-paid{ background: var(--au-success-soft); color: var(--au-success-ink); }
.rpt-badge-partially_paid{ background: var(--au-warning-soft); color: var(--au-warning-ink); }
.rpt-badge-none{ background: var(--au-hover-2); color: var(--au-ink-600); }
.rpt-badge-overpaid, .rpt-badge-creditloss{ background: var(--au-danger-soft); color: var(--au-danger-ink); }
.rpt-sub > td{ background: var(--au-surface-1); padding: 4px 10px 10px 10px; }
table.rpt-subtable{ width: 100%; border-collapse: collapse; font-size: var(--au-fs-md); background: var(--au-surface-0); border: 1px solid var(--au-border); }
table.rpt-subtable th{
  position: static;
  font-size: var(--au-fs-sm);
  color: var(--au-muted);
  font-weight: 600;
  background: var(--au-surface-2);
  padding: 4px 8px;
  border-bottom: 1px solid var(--au-border);
  text-align: right;
}
table.rpt-subtable th.l{ text-align: left; }
table.rpt-subtable td{ padding: 3px 8px; border-bottom: 1px solid #f1f3f5; }
table.rpt-subtable td.l{ padding-left: 8px !important; }
table.rpt-subtable.wide{ width: auto; min-width: min(50%, 720px); }
table.rpt-subtable.wide td.l, table.rpt-subtable.wide th.l{ white-space: nowrap; }
.rpt-empty{ color: var(--au-muted); font-size: var(--au-fs-md); font-style: italic; padding: 4px 0; }
.rpt-empty-report{ padding: 30px; text-align: center; color: var(--au-muted); }
/* only the grand total (last footer row) sticks to the bottom; subtotal rows above it (inventory
   split into raw materials / WIP / finished goods) scroll with the table - all footer rows sticky
   at bottom:0 stacked them on top of each other and only the last one showed */
table.rpt tfoot tr:last-child td{ position: sticky; bottom: 0; background: var(--au-surface-0); z-index: 1; }

/* ============================================================
   7) Charts (.rpt-chart-*)
   ============================================================ */

.rpt-chart-single{
  height: 320px;
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
  padding: 10px 12px 6px 12px;
  margin-bottom: 12px;
  background: var(--au-surface-0);
}
.rpt-chart-single .t{ font-size: 0.82rem; font-weight: 600; color: var(--au-navy); margin-bottom: 4px; }
.rpt-chart-single .cv{ height: 270px; position: relative; }
.rpt-chart-section{
  font-size: var(--au-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--au-muted);
  font-weight: 600;
  margin: 14px 0 6px 0;
}
.rpt-chart-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.rpt-chart-card{
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
  padding: 10px 12px 6px 12px;
  background: var(--au-surface-0);
}
.rpt-chart-card .t{ font-size: 0.82rem; font-weight: 600; color: var(--au-navy); }
.rpt-chart-card .s{ font-size: 0.7rem; color: var(--au-muted); margin-bottom: 4px; min-height: 1em; }
.rpt-chart-card .cv{ height: 190px; position: relative; }
/* charts flagged wide (many series / long category axis) take the full grid width and more height */
.rpt-chart-card.wide{ grid-column: 1 / -1; }
.rpt-chart-card.wide .cv{ height: 300px; }

/* ============================================================
   8) Responsive system
   ------------------------------------------------------------
   One breakpoint set for the whole app (Bootstrap's):
     phone     < 576px   (iPhone 12 mini = 360px wide)
     sm        576-767   (large phones)
     md        768-991   (tablet portrait: collapsed top nav, drawer)
     lg+       >= 992    (tablet landscape + desktop: full nav)
   Rules: no page-level horizontal scroll (each wide component scrolls
   inside its own .sf-scroll-x container), comfortable touch targets
   below lg, one-column forms on phones, near-full-screen modals on
   phones, drawer navigation below lg. Do not add per-view media rules
   when one of the primitives below solves it.
   ============================================================ */

/* 8.1 Overflow safety: the page must never scroll sideways. Layout
   children get min-width:0 so flex/grid items can shrink; anything
   wide scrolls inside .sf-scroll-x. */
html, body{ max-width: 100%; }
#main, #app_content, main-app{ min-width: 0; display: block; }
/* NOTE: no ".row > * { min-width:0 }" - Bootstrap columns never shrink (flex-shrink:0)
   and that rule would zero the min-content width of table cells holding a .row. */
img, svg:not(.rpt-chart-single svg), canvas, video, iframe{ max-width: 100%; }
sf-litloader, sf-datalist, sf-tabs, sf-tab-content, sf-input, sf-select, sf-datepicker, sf-textarea, sf-checkbox{ min-width: 0; }
sf-datalist, sf-tabs, sf-tab-content, sf-litloader{ display: block; }
pre{ max-width: 100%; overflow-x: auto; }
/* long unbreakable tokens (URLs, ids, hashes) wrap instead of pushing panels wide */
.card, .alert, .modal-body, .toast-body, .sf-dl-expand-wrap, .dropdown-item{ overflow-wrap: break-word; }

/* Any component that can be wider than its host scrolls here, not the page.
   Dropdown togglers inside get popper strategy "fixed" (sf-responsive.js) so
   their menus are not clipped by the scroll container. */
.sf-scroll-x{
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.sf-scroll-x > .table{ margin-bottom: 0; }
/* hide the scrollbar gutter on desktop when nothing overflows */
.sf-scroll-x::-webkit-scrollbar{ height: 8px; }
.sf-scroll-x::-webkit-scrollbar-thumb{ background: var(--au-border-2); border-radius: 4px; }

/* Sticky first column for wide grids that scroll sideways (week grids, matrices):
   <div class="table-responsive sf-sticky-first"><table>... */
.sf-sticky-first > .table > thead > tr > th:first-child,
.sf-sticky-first > .table > tbody > tr > td:first-child,
.sf-sticky-first > .table > tbody > tr > th:first-child,
.sf-sticky-first > .table > tfoot > tr > th:first-child,
.sf-sticky-first > .table > tfoot > tr > td:first-child{
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--au-surface-0);
  box-shadow: inset -1px 0 0 var(--au-border);
}
.sf-sticky-first > .table > thead > tr > th:first-child{ z-index: 3; background: var(--au-surface-2); }
.table-responsive{ -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* 8.2 Data list (sf-datalist) shell: head row, filters panel, table, pager */
.sf-dl{ min-width: 0; }
.sf-dl-head{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 6px 0;
  min-width: 0;
}
.sf-dl-title{ flex: 1 1 auto; min-width: 0; }
.sf-dl-title .sf-dl-label{ margin: 0; font-weight: 600; color: var(--au-navy); font-size: 1rem; }
.sf-dl-title .sf-dl-desc{ margin: 0; color: var(--au-muted); font-size: var(--au-fs-md); }
.sf-dl-title .sf-dl-desc:empty{ display: none; }
.sf-dl-search{ flex: 1 1 260px; min-width: 0; max-width: 420px; }
.sf-dl-search sf-input .row, .sf-dl-search sf-input [class*="col"]{ width: 100%; max-width: 100%; flex: 1 1 100%; }
.sf-dl-search sf-input small:empty{ display: none; }
.sf-dl-tools{ display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
.sf-dl-tools .btn{ white-space: nowrap; }
.sf-dl-filters{
  display: none;
  padding: 8px 10px;
  margin: 2px 0 8px 0;
  border: 1px solid var(--au-border);
  border-radius: var(--au-radius);
  background: var(--au-surface-1);
}
.sf-dl-filters.show{ display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-end; }
.sf-dl-filters > *{ display: block; flex: 1 1 240px; max-width: 420px; min-width: 0; }
.sf-dl-filters sf-input .row, .sf-dl-filters sf-select .row, .sf-dl-filters sf-datepicker .row, .sf-dl-filters sf-checkbox .row{ margin: 0; }
.sf-dl-filters sf-input .row > *, .sf-dl-filters sf-select .row > *, .sf-dl-filters sf-datepicker .row > *{ width: 100%; max-width: 100%; flex: 0 0 100%; padding: 0; }
.sf-dl-filters sf-input .row > * > [class*="col"], .sf-dl-filters sf-datepicker .row > * > [class*="col"]{ width: 100%; max-width: 100%; }
@media (max-width: 575.98px){
  .sf-dl-filters > *{ flex-basis: 100%; max-width: none; }
}
.sf-dl-table{ min-width: 0; }
.sf-dl-table .table{ margin-bottom: 0; }
.sf-dl-table .table > :not(caption) > * > *{ vertical-align: top; }
.sf-dl-table td, .sf-dl-table th{ min-width: 0; }
/* Inline editors in cells: flexible width with a floor, so a table with several
   click-to-edit columns shares the available width instead of forcing every
   editor to its 20-character intrinsic width (which pushed the Actions column
   off-screen even on desktop). */
.sf-dl-table td sf-input input, .sf-dl-table td sf-datepicker input, .sf-dl-table td sf-textarea textarea{ width: 100%; min-width: 6rem; }
.sf-dl-table td sf-input, .sf-dl-table td sf-datepicker, .sf-dl-table td sf-select, .sf-dl-table td sf-textarea{ display: block; min-width: 6rem; }
.sf-dl-table td sf-input .row, .sf-dl-table td sf-datepicker .row, .sf-dl-table td sf-select .row, .sf-dl-table td sf-checkbox .row{ margin: 0; }
.sf-dl-table td sf-input .row > *, .sf-dl-table td sf-datepicker .row > *, .sf-dl-table td sf-select .row > *, .sf-dl-table td sf-checkbox .row > *{ padding: 0; }
.sf-dl-expand{ padding: 0 !important; }
/* The expanded detail row is exactly as wide as the list's visible area
   (--sf-dl-vw, kept up to date by sf-datalist's ResizeObserver) and sticks to
   the left edge, so when the table itself scrolls sideways the detail panel
   stays in view and never widens the outer table. Falls back to the classic
   width:0 + min-width:100% cell trick until the variable is set. */
.sf-dl-expand-wrap{
  position: sticky;
  left: 0;
  width: var(--sf-dl-vw, 0);
  min-width: var(--sf-dl-vw, 100%);
  max-width: var(--sf-dl-vw, 100%);
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  /* horizontal padding = Bootstrap row gutter, so bare .row children (most
     detail views stack fields in .row without a .container) do not overflow */
  padding: 8px .75rem 12px .75rem;
  border-left: 3px solid var(--au-primary);
  background: var(--au-surface-1);
}
/* Bootstrap places the backdrop under body. A sticky expanded row creates a
   stacking context that traps its modal below that backdrop. Release stickiness
   only while a descendant modal is shown; closing/removing it restores the row. */
.sf-dl-expand-wrap:has(.modal.show){ position: static; }
/* secondary "more info" line under a row (additionalinfo_row_url / moreinfo_row) */
.sf-dl-expand-wrap.sf-dl-info{
  border-left: 0;
  background: transparent;
  padding: 0 .75rem 6px .75rem;
  font-size: var(--au-fs-md);
  text-align: right;
}
.sf-dl-pager{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 0 4px 0;
}
.sf-dl-pager-summary{ color: var(--au-muted); font-size: var(--au-fs-md); margin: 0; white-space: nowrap; }
/* list is fetching: dim the current rows, block clicks on stale data, spinner text in the pager */
.sf-dl-loading .sf-scroll-x{ opacity: .55; pointer-events: none; transition: opacity .15s ease-in .3s; }
.sf-dl-loading-text{ display: inline-flex; align-items: center; gap: .4rem; }
.sf-dl-pager-controls{ display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sf-dl-pager .pagination{ margin: 0; }
.sf-dl-pager .page-link{ cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; }
.sf-dl-pager .page-link.disabled{ color: var(--au-faint); pointer-events: none; }
.sf-dl-pager .page-link.sf-dl-pager-page{ pointer-events: none; color: var(--au-ink-600); background: var(--au-surface-2); }
.sf-dl-pager select.form-select{ width: auto; min-width: 4.5rem; padding-right: 2rem; }
.sf-dl-multiops{ margin-left: 0; }

/* Dashboard card grid: cards grow to fill each row (one per row on phones and
   tablet portrait, side by side on desktop) instead of a ragged flex-wrap of
   fixed-width cards. */
.dashboard-grid > sf-dashboard-card{ flex: 1 1 280px; min-width: 0; max-width: 100%; }
.dashboard-grid > sf-dashboard-card > .sf-dashboard-card{ min-width: 0 !important; }
@media (min-width: 1200px){
  /* desktop keeps the cards' natural widths */
  .dashboard-grid > sf-dashboard-card{ flex: 0 1 auto; }
}

/* 8.3 Tabs scroll sideways instead of wrapping into three rows on phones */
@media (max-width: 767.98px){
  .nav-tabs{
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar{ display: none; }
  .nav-tabs .nav-item{ flex: 0 0 auto; }
  .nav-tabs .nav-link{ white-space: nowrap; }
  /* fade hint while more tabs are hidden to the right (sf-tabs toggles the class) */
  .nav-tabs.sf-tabs-more{ -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
}

/* 8.4 Touch-friendly controls below lg (phones and tablets) */
@media (max-width: 991.98px){
  .btn{ min-height: 2.5rem; padding-top: .45rem; padding-bottom: .45rem; }
  .btn-sm{ min-height: 2.125rem; padding-top: .3rem; padding-bottom: .3rem; }
  .btn-close{ padding: .75rem; }
  .dropdown-item{ padding: .6rem 1rem; }
  .dropdown-menu{ max-width: calc(100vw - 1rem); }
  .dropdown-item{ white-space: normal; }
  .nav-tabs .nav-link{ padding: .6rem .9rem; }
  .form-check-input{ width: 1.15em; height: 1.15em; }
  .page-link{ min-height: 2.5rem; }
  .table .btn-sm{ min-height: 2rem; }
  .toast{ max-width: calc(100vw - 2rem); }
}

/* 8.5 Phones: text inputs at 16px so iOS Safari does not zoom on focus,
   one-column forms, tighter page gutters, stacked headers. */
@media (max-width: 575.98px){
  /* page gutter = Bootstrap row gutter, so a bare .row inside a px-0 container
     spans exactly the viewport (no 4px sideways scroll) and its columns keep
     12px of breathing room from the screen edge */
  #main{ padding-left: .75rem !important; padding-right: .75rem !important; }
  .form-control, .form-select, .ts-wrapper .ts-control, .ts-wrapper .ts-control input{ font-size: 1rem; }
  .form-control-sm, .form-select-sm{ font-size: .9rem; }
  input[size]{ max-width: 100%; }
  .modal-body .container-fluid{ padding-left: 0; padding-right: 0; }
  .card-body{ padding: .75rem; }
  .au-header, .rpt-header{ flex-direction: column; align-items: stretch; padding: 12px 12px 4px 12px; }
  .au-actions, .rpt-actions{ flex-wrap: wrap; }
  .au-toolbar, .rpt-toolbar, .au-filters, .rpt-filters{ padding: 8px 12px; }
  .au-body, .rpt-body{ padding: 8px 10px 14px 10px; }
  .au-filter, .rpt-filter, .au-filter-wide, .rpt-filter-wide{ min-width: 0; flex: 1 1 100%; }
  table.rpt thead th:first-child{ min-width: 180px; }
  .rpt-chart-grid{ grid-template-columns: 1fr; }
  .rpt-wrap{ max-height: none; }
  .sf-dl-search{ order: 3; flex-basis: 100%; max-width: none; }
  .sf-dl-pager-summary{ font-size: var(--au-fs-sm); }
  .sf-dl-pager .page-link{ padding-left: .5rem; padding-right: .5rem; }
  .sf-dl-expand-wrap{ padding: 6px .75rem 10px .75rem; }
  h1{ font-size: 1.3rem; }
  h2{ font-size: 1.2rem; }
  .toast-container{ left: 0; right: 0; padding: .5rem !important; }
  .toast{ max-width: 100%; width: 100%; }
}

/* 8.6 Modals: near-full-screen sheets on phones, internal scrolling always */
.modal-dialog{ max-width: min(var(--sf-modal-max, 500px), calc(100vw - 1rem)); }
.modal-dialog.modal-lg{ --sf-modal-max: 800px; }
.modal-dialog.modal-xl{ --sf-modal-max: 1140px; }
.modal-dialog.modal-sm{ --sf-modal-max: 300px; }
.modal-content{ max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; }
.modal-body{ overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; min-height: 0; }
.modal-footer{ flex-wrap: wrap; gap: .4rem; }
@media (max-width: 575.98px){
  /* bottom sheet: small dialogs sit within thumb reach at the bottom, large
     ones grow upwards until they fill the screen and scroll inside */
  .modal-dialog, .modal-dialog.modal-lg, .modal-dialog.modal-xl, .modal-dialog.modal-sm{
    max-width: none;
    width: auto;
    margin: .5rem;
    min-height: calc(100dvh - 1rem);
    display: flex;
    align-items: flex-end;
  }
  .modal-content{ max-height: calc(100dvh - 1rem); width: 100%; }
  .modal.fade .modal-dialog{ transform: translate(0, 24px); }
  .modal.show .modal-dialog{ transform: none; }
  .modal-footer .btn{ flex: 1 1 auto; }
  .modal-footer{ padding: .6rem .75rem; }
  .modal-header{ padding: .6rem .75rem; }
  .modal-body{ padding: .75rem; }
}

/* 8.7 Dropdown/popover overlays: never wider than the viewport, long
   labels wrap, popups parented to body (see sf-responsive.js) stay on top */
.dropdown-menu{ max-width: calc(100vw - 1rem); }
.ts-dropdown.sf-popup-body{ z-index: 1080; }
.datepicker.sf-popup-body{ z-index: 1080; }

/* 8.8 Top navigation: drawer below lg. The Bootstrap collapse still drives
   open/closed state (sf-responsive.js closes it on select/outside/escape/
   navigation and locks body scroll); this only restyles the open panel. */
.navbar.sticky-top{ z-index: 1030; }
.navbar .navbar-toggler{ min-width: 2.75rem; min-height: 2.75rem; padding: .35rem .6rem; }
.navbar .navbar-brand{ min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(100vw - 6rem); }
.navbar .nav-item.dropdown.active > .nav-link{ color: var(--au-primary); }
.navbar .dropdown-item.active, .navbar .dropdown-item:active{ background: var(--au-primary-soft); color: var(--au-navy); font-weight: 600; }
.sf-nav-backdrop{ display: none; }
@media (max-width: 991.98px){
  .navbar .navbar-collapse{
    position: fixed;
    top: var(--sf-navbar-h, 56px);
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    height: auto !important;
    background: var(--au-surface-0);
    border-right: 1px solid var(--au-border);
    box-shadow: 0 12px 32px rgba(11, 61, 92, 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: .5rem .75rem 2.5rem .75rem;
    z-index: 1035;
    transition: none;
  }
  .navbar .navbar-collapse.collapsing{ height: auto !important; transition: none; }
  .navbar .navbar-nav{ margin-bottom: .25rem !important; }
  .navbar .nav-item{ border-bottom: 1px solid var(--au-rule); }
  .navbar .nav-item:last-child{ border-bottom: 0; }
  .navbar .nav-link{
    display: flex;
    align-items: center;
    min-height: 2.9rem;
    padding: .5rem .5rem;
    font-size: 1rem;
  }
  .navbar .nav-link.dropdown-toggle::after{ margin-left: auto; transition: transform .15s ease; }
  .navbar .nav-link.dropdown-toggle.show::after{ transform: rotate(180deg); }
  .navbar .nav-item.dropdown.active > .nav-link{
    font-weight: 700;
    color: var(--au-navy);
    box-shadow: inset 3px 0 0 var(--au-primary);
    padding-left: .75rem;
  }
  .navbar .dropdown-menu{
    border: 0;
    box-shadow: none;
    background: var(--au-surface-2);
    border-radius: var(--au-radius);
    margin: 0 0 .5rem 0;
    padding: .25rem 0;
    width: 100%;
    max-width: none;
  }
  .navbar .dropdown-item{
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .5rem 1rem .5rem 1.5rem;
    font-size: var(--au-fs-ui);
    white-space: normal;
  }
  .navbar .dropdown-item-text{ padding-left: 1.5rem; }
  .navbar .dropdown-divider{ margin: .25rem 1rem; }
  .navbar #server-task-spinner-wrapper{ padding: .5rem; }
  body.sf-nav-open{ overflow: hidden; }
  body.sf-nav-open .sf-nav-backdrop{
    display: block;
    position: fixed;
    top: var(--sf-navbar-h, 56px);
    left: 0; right: 0; bottom: 0;
    background: rgba(11, 29, 45, 0.45);
    /* below the sticky navbar (1030): the drawer is fixed INSIDE the navbar's
       stacking context, so it can only be above the backdrop if the backdrop
       is below the navbar itself */
    z-index: 1029;
  }
}
@media (max-width: 575.98px){
  .navbar .navbar-collapse{ width: min(340px, 86vw); }
}

/* Side-navigation shells (.au-shell) fold to a select below lg */
@media (max-width: 991.98px){
  .au-shell, .rpt-shell{ flex-direction: column; min-height: 0; }
  .au-nav, .rpt-nav{ display: none; }
  .au-nav-select, .rpt-nav-select{ display: block; }
}

/* ============================================================
   10) Gantt (.gantt-*) — Manufacturing → Schedule overview
   (app_modules/manufacturing/views/schedule/schedule_overview.hbs.js)
   ============================================================ */
.gantt{ display: flex; border: 1px solid var(--au-border); border-radius: var(--au-radius); background: var(--au-surface-0); overflow: hidden; }
.gantt-side{ flex: 0 0 300px; max-width: 300px; border-right: 1px solid var(--au-border-2); background: var(--au-surface-1); }
.gantt-side-head{ height: 88px; border-bottom: 1px solid var(--au-border-2); background: var(--au-surface-2); display: flex; flex-direction: column; }
.gantt-side-head-row{ padding: 0 .6rem; display: flex; align-items: center; font-size: var(--au-fs-sm); color: var(--au-navy); font-weight: 600; white-space: nowrap; overflow: hidden; }
.gantt-h-month{ height: 24px; }
.gantt-h-week{ height: 18px; }
.gantt-h-day{ height: 26px; }
.gantt-h-load{ height: 20px; }
.gantt-side-row{ padding: .15rem .6rem; border-bottom: 1px solid var(--au-rule); cursor: pointer; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.gantt-side-row:hover{ background: var(--au-hover); }
.gantt-side-main{ display: flex; align-items: center; gap: .3rem; font-size: var(--au-fs-md); line-height: 1.2; white-space: nowrap; overflow: hidden; }
.gantt-side-number{ font-weight: 600; color: var(--au-ink-800); }
.gantt-side-sub{ font-size: var(--au-fs-xs); color: var(--au-muted); line-height: 1.2; }
.gantt-status-dot{ width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.gantt-status-dot--draft{ background: var(--au-faint); }
.gantt-status-dot--planned{ background: var(--au-info); }
.gantt-status-dot--production{ background: var(--au-warning); }
.gantt-status-dot--done{ background: var(--au-success); }
.gantt-main{ flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; }
.gantt-canvas{ position: relative; min-width: 100%; }
.gantt-head{ position: relative; height: 88px; border-bottom: 1px solid var(--au-border-2); background: var(--au-surface-2); }
.gantt-h-row{ position: relative; }
.gantt-h-cell{ position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: var(--au-fs-xs); color: var(--au-ink-600); border-left: 1px solid var(--au-rule); overflow: hidden; white-space: nowrap; }
.gantt-h-month .gantt-h-cell{ font-weight: 600; color: var(--au-navy); justify-content: flex-start; padding-left: .4rem; border-left-color: var(--au-border-2); }
.gantt-h-week .gantt-h-cell{ color: var(--au-muted); }
.gantt-h-daycell{ flex-direction: column; line-height: 1; gap: 2px; }
.gantt-h-daycell small{ font-size: .62rem; color: var(--au-faint); text-transform: uppercase; }
.gantt-h-daycell.gantt-today span{ background: var(--au-primary); color: #fff; border-radius: 999px; padding: 1px 5px; }
.gantt-load{ font-weight: 600; color: var(--au-ink-600); }
.gantt-load--1{ background: #e6f0f7; }
.gantt-load--2{ background: #c9def0; }
.gantt-load--3{ background: #a6c9e6; }
.gantt-load--4{ background: #6fa6d3; color: #fff; }
.gantt-body{ position: relative; }
.gantt-grid{ position: absolute; inset: 0; }
.gantt-col{ position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--au-rule); }
.gantt-weekend{ background: rgba(0, 0, 0, .035); }
.gantt-col.gantt-today{ background: var(--au-primary-soft); }
.gantt-today-line{ position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--au-primary); z-index: 3; pointer-events: none; }
.gantt-row{ position: relative; border-bottom: 1px solid var(--au-rule); }
.gantt-row--schedulable{ cursor: copy; }
.gantt-row--schedulable:hover{ background: rgba(11, 106, 162, .04); }
.gantt-bar{ position: absolute; top: 7px; height: 18px; border-radius: 4px; z-index: 2; display: flex; align-items: center; overflow: hidden; font-size: var(--au-fs-xs); color: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); user-select: none; touch-action: none; }
.gantt-bar--editable{ cursor: grab; }
.gantt-bar--dragging{ cursor: grabbing; opacity: .85; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.gantt-bar--draft{ background: var(--au-faint); color: var(--au-ink-800); }
.gantt-bar--planned{ background: var(--au-info); }
.gantt-bar--production{ background: var(--au-warning); }
.gantt-bar--done{ background: var(--au-success); opacity: .8; }
.gantt-bar--late{ outline: 2px solid var(--au-danger); outline-offset: -1px; }
.gantt-bar-text{ padding: 0 .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; flex: 1 1 auto; }
.gantt-bar-sub{ font-weight: 400; opacity: .9; }
.gantt-handle{ position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 3; }
.gantt-handle--l{ left: 0; }
.gantt-handle--r{ right: 0; }
.gantt-bar:hover .gantt-handle{ background: rgba(255, 255, 255, .35); }
.gantt-bar-actual{ position: absolute; top: 27px; height: 4px; border-radius: 2px; background: var(--au-ink-700); z-index: 2; pointer-events: none; }
.gantt-bar-late-tail{ position: absolute; top: 11px; height: 10px; z-index: 1; border-radius: 0 4px 4px 0; opacity: .85; pointer-events: none; background: repeating-linear-gradient(135deg, var(--au-danger-soft) 0 4px, var(--au-danger) 4px 6px); }
.gantt-legend .gantt-legend-swatch{ position: static; display: inline-block; width: 1.1rem; height: .7rem; border-radius: 3px; vertical-align: middle; margin-right: .2rem; opacity: 1; outline: 0; }
.gantt-legend .gantt-legend-actual{ background: var(--au-ink-700); height: .3rem; }
.gantt-search{ width: 11rem; }
.gantt-page .au-toolbar{ padding-left: 0; padding-right: 0; border-top: 0; background: transparent; }
sf-dialog[name="gantt-mfo-dialog"] > div > div.text-end{ display: none; }
@media (max-width: 767.98px){
  .gantt-side{ flex-basis: 160px; max-width: 160px; }
  .gantt-side-sub{ display: none; }
  .gantt-search{ width: 8rem; }
}

/* ============================================================
   11) Voucher quick entry (.qe-*) — Accounting → Vouchers → New voucher
   (app_modules/accounting/views/vouchers/voucher_quick_entry.hbs.js)
   Generated VAT / counter rows sit under their base row, slightly recessed.
   ============================================================ */
.qe-table tr.qe-auto > td{ background: var(--au-surface-1); }
.qe-table tr.qe-auto .form-control, .qe-table tr.qe-auto .form-select{ color: var(--au-muted); }
.qe-table tr.qe-auto > td:first-child{ box-shadow: inset 3px 0 0 var(--au-border-2); }

/* ============================================================
   9) Print
   ============================================================ */

@media print{
  body{ background:#fff !important; color:#000 !important; }
  .card{ box-shadow:none !important; }
  .au-nav, .au-toolbar, .au-filters, .au-actions, .au-nav-select,
  .rpt-nav, .rpt-toolbar, .rpt-filters, .rpt-actions, .rpt-subtabs, .rpt-nav-select{ display: none !important; }
  .au-shell, .rpt-shell{ border: 0; }
}

/* ===================================================================================================================
 * UI foundation (work package ux-foundation F1 / F4): the classes of the shared helpers in docroot/assets/sf/sf-ui.js
 * (sfField, sfPageTitle fallback, sfSegments, sfMainCell, sfRowMenu, sfStatusActions) and the grouped "mega" module
 * menu (.sf-mega*, D6). Same rules as accounting's acc-* classes (accounting_ui.js injects those itself, unchanged);
 * .acc-mega* is an alias here. Kept identical in accounting-bootstrap5-theme.css and -classic.css.
 * =================================================================================================================== */
.sf-page-title{display:flex;flex-wrap:wrap;align-items:baseline;gap:.25rem 1rem;margin:.25rem 0 .75rem 0}
.sf-page-title h5{margin:0;font-weight:600}
.sf-field-label{display:block;font-size:.8rem;font-weight:600;margin-bottom:.15rem;line-height:1.2rem;height:1.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sf-field-help{font-size:.75rem;line-height:1.1rem;margin-top:.15rem;color:var(--bs-secondary-color,#6c757d)}
.sf-field .ts-wrapper{min-width:0}
.sf-field .ts-control{flex-wrap:nowrap}
.sf-field .ts-control>.item{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:100%}
.sf-static{min-height:calc(1.5em + .5rem + 2px);background:var(--bs-secondary-bg,#e9ecef)}
.sf-field .ts-wrapper.single.form-control{padding:0!important;min-height:0;height:auto}
.sf-field .ts-wrapper.single .ts-control{min-height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;font-size:.875rem}
.sf-field .ts-wrapper.single.has-items:not(.focus) .ts-control>input{min-width:0!important;width:0!important;flex:0 0 0;padding:0}
.sf-seg{display:flex;gap:4px;margin:0 0 .6rem;overflow-x:auto;white-space:nowrap;scrollbar-width:thin}
.sf-seg-tab{border:0;background:none;border-radius:999px;padding:.3rem .85rem;font-size:.9rem;color:#374151;flex:0 0 auto}
.sf-seg-tab:hover{background:#f3f4f6}.sf-seg-tab.on{background:#111827;color:#fff}
.sf-seg-n{font-size:.75rem;opacity:.7;margin-left:.3rem}
/* ux-lists S1 (R-61 / R-62 / R-66): the list toolbar of sf-datalist (list_toolbar / .views): saved views, full-width
 * search, Filters button + panel (desktop popover, phone block), chips, Columns, Export; identifier column; selection
 * column. Kept identical in accounting-bootstrap5-theme.css and -classic.css. */
.sf-dl-tb{display:flex;flex-direction:column;gap:.5rem;margin:0 0 .5rem;min-width:0}
.sf-dl-views .sf-seg{margin:0;gap:6px;padding-bottom:2px}
.sf-dl-views .sf-seg-tab{border:1px solid var(--bs-border-color,#dee2e6);background:var(--bs-body-bg,#fff);padding:.3rem .8rem}
.sf-dl-views .sf-seg-tab.on{background:#111827;border-color:#111827;color:#fff}
.sf-dl-tb-row{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;min-width:0}
.sf-dl-tb-search{position:relative;flex:1 1 320px;min-width:0}
.sf-dl-tb-search > .bi-search{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);color:var(--bs-secondary-color,#6b7280);pointer-events:none;z-index:2}
.sf-dl-tb-search input.form-control,.sf-dl-tb-search sf-input input{padding-left:2.2rem;width:100%}
.sf-dl-tb-search sf-input .row,.sf-dl-tb-search sf-input [class*="col"]{width:100%;max-width:100%;flex:1 1 100%;margin:0;padding:0}
.sf-dl-tb-search sf-input small:empty{display:none}
.sf-dl-tb-spacer{flex:1 1 auto}
.sf-dl-tb-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-left:auto}
.sf-dl-tb-tools .btn{white-space:nowrap}
.sf-dl-nocaret::after{display:none}
.sf-dl-fbtn.active-f{border-color:var(--bs-primary,#0d6efd);color:var(--bs-primary,#0d6efd)}
.sf-dl-fcount{display:inline-block;min-width:1.25rem;padding:0 .35rem;border-radius:999px;background:var(--bs-primary,#0d6efd);color:#fff;font-size:.75rem;line-height:1.25rem;text-align:center}
.sf-dl-fp{position:absolute;right:0;top:calc(100% + 6px);z-index:1050;width:min(560px,calc(100vw - 1rem));background:var(--bs-body-bg,#fff);border:1px solid var(--bs-border-color,#dee2e6);border-radius:.6rem;box-shadow:0 10px 30px rgba(0,0,0,.12);padding:14px 16px}
.sf-dl-fp-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;align-items:end}
.sf-dl-fp-item{min-width:0}.sf-dl-fp-item.wide{grid-column:1 / -1}
.sf-dl-fp-label{font-size:.8rem;font-weight:600;margin-bottom:.2rem}
.sf-dl-fp-item sf-input .row,.sf-dl-fp-item sf-select .row,.sf-dl-fp-item sf-datepicker .row,.sf-dl-fp-item sf-checkbox .row{margin:0}
.sf-dl-fp-item sf-input .row > *,.sf-dl-fp-item sf-select .row > *,.sf-dl-fp-item sf-datepicker .row > *{width:100%;max-width:100%;flex:0 0 100%;padding:0}
.sf-dl-fp-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.sf-dl-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.sf-dl-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.15rem .35rem .15rem .65rem;border-radius:999px;background:var(--bs-primary-bg-subtle,#e7f0ff);color:var(--bs-primary-text-emphasis,#0a3a8c);font-size:.85rem}
.sf-dl-chip-x{border:0;background:none;padding:0 .25rem;line-height:1;color:inherit;opacity:.75}.sf-dl-chip-x:hover{opacity:1}
.sf-dl-chips-clear{padding:0 .25rem}
.sf-dl-cols{max-height:min(420px,70vh);overflow-y:auto;min-width:14rem}
.sf-dl-colitem{display:flex;align-items:center;cursor:pointer;white-space:nowrap}.sf-dl-colitem.locked{opacity:.65;cursor:default}
.sf-dl-ident{font-weight:600;white-space:nowrap}
/* sf-datalist header sorting (inventory-stock-analysis S1): the header label is the button */
.sf-dl-sort{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:.3rem;font-weight:inherit;white-space:nowrap}
.sf-dl-sort:hover,.sf-dl-sort.active{color:var(--bs-link-color,#0d6efd)}
.sf-dl-sort:focus-visible{outline:2px solid var(--bs-link-color,#0d6efd);outline-offset:2px;border-radius:2px}
.sf-dl-sort .bi{font-size:.8em}
.sf-dl-sort .sf-dl-sort-idle{opacity:0;transition:opacity .1s}
.sf-dl-sort:hover .sf-dl-sort-idle,.sf-dl-sort:focus-visible .sf-dl-sort-idle{opacity:.45}
a.sf-dl-ident-link{display:inline-flex;align-items:center;gap:.35rem;text-decoration:none;color:var(--bs-link-color,#0d6efd)}
a.sf-dl-ident-link:hover .sf-dl-ident-t{text-decoration:underline}
.sf-dl-chev{font-size:.75rem;transition:transform .12s ease;color:var(--bs-secondary-color,#6b7280)}
a.sf-dl-ident-link.open .sf-dl-chev{transform:rotate(90deg)}
.sf-dl-table td.sf-dl-sel,.sf-dl-table th.sf-dl-sel{width:1%;white-space:nowrap}
@media (max-width: 575.98px){
  .sf-dl-tb-search{flex-basis:100%}
  .sf-dl-tb-tools{margin-left:0}
  .sf-dl-fp{position:static;width:100%;flex:1 1 100%;box-shadow:none;margin-top:4px}
  .sf-dl-fp-grid{grid-template-columns:1fr}
}
.sf-main{min-width:0;line-height:1.25}.sf-main .t{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sf-main .s{font-size:.8rem;color:var(--bs-secondary-color,#6b7280);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sf-main .t a{color:inherit;text-decoration:none}.sf-main .t a:hover{text-decoration:underline}
.sf-rowmenu .dropdown-toggle::after{display:none}
sf-datalist.sf-list .sf-dl-title{display:none}sf-datalist.sf-list .sf-dl-search{flex:1 1 auto;max-width:none}
.dropdown-menu:has(> .sf-mega),.dropdown-menu:has(> .acc-mega){padding:.5rem .25rem}
/* Sized to its groups (navbar-menus S1): the groups sit side by side, each as wide as its longest item, and the menu is as
 * wide as its groups - no empty space for missing groups, no item running into the next group. In the expanded navbar
 * (lg, navbar-expand-lg) the menu is capped at the viewport, where the groups wrap to another row, and sf-ui.js keeps
 * it inside the viewport (shown.bs.dropdown: shifted left only as far as needed). In the collapsed navbar the groups
 * wrap inside the panel; on a phone they stack. */
@media (min-width: 992px){.navbar .dropdown-menu:has(> .sf-mega),.navbar .dropdown-menu:has(> .acc-mega){width:max-content;max-width:calc(100vw - 1rem)}}
.sf-mega-grid,.acc-mega-grid{display:flex;flex-wrap:wrap;gap:.25rem .5rem}
.sf-mega-col,.acc-mega-col{flex:0 0 auto;min-width:9rem}
.sf-mega-col:not(:has(a)),.acc-mega-col:not(:has(a)){display:none}
.nav-item.dropdown:has(> .dropdown-menu > .sf-mega):not(:has(.sf-mega-col a)){display:none} /* a module menu with no page the role may open (lifecycle review 2026-11-06, D-shell-1) */
.sf-mega-col .dropdown-header,.acc-mega-col .dropdown-header{font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;font-weight:600;color:#6b7280;padding:.35rem 1rem .25rem}
.sf-mega-col .dropdown-item,.acc-mega-col .dropdown-item{display:flex;align-items:center;gap:.5rem;padding:.35rem 1rem;white-space:nowrap}
.sf-mega-col .dropdown-item>.bi,.acc-mega-col .dropdown-item>.bi{color:#4b5563;width:1rem;text-align:center}
@media (max-width: 767.98px){.sf-mega-col,.acc-mega-col{flex-basis:100%}}

/* ===================================================================================================================
 * UX audit fixes slice B (decisions W5-W15, W21; owner-approved mockups tmp/ux-audit-fixes/mockups, 2026-11-01).
 * Kept identical in accounting-bootstrap5-theme.css and -classic.css.
 *   W6 / W21  one control height: --sf-ctl-h 32 px on desktop, 44 px below 576 px, for text / number / date / picker /
 *             select / textarea line, the list search box and the list toolbar buttons (--sf-tb-h); one border, radius,
 *             white background, focus ring; pickers and selects show the same caret.
 *   W5        no green "valid" state anywhere; red + one fix-it line (.invalid-feedback / .sf-field-error) only after
 *             the field was left or Save pressed (sf-input / sf-select / sf-datepicker / sf-checkbox decide when);
 *             "Saved" tick by the label (.sf-saved); read-only values as plain text (.sf-static); neutral checkbox.
 *   W7 / W8   dialog footer (.sf-dlg-foot), sf-confirm. W9 / W10 toasts (.sf-toast). W11 navbar More (.sf-nav-*).
 *   W12 / W13 phone card rows (.sf-cards), status column, empty state, tab fades. W14 upload area (.sf-upload).
 * =================================================================================================================== */
:root{
  --sf-ctl-h: 32px;
  --sf-ctl-fs: .875rem;
  --sf-ctl-px: .625rem;
  --sf-ctl-ring: 0 0 0 .2rem rgba(11, 106, 162, .2);
  --sf-tb-h: 32px;              /* list search box + list toolbar buttons (owner W21: the same 32 px) */
  --sf-tb-fs: .875rem;
  --sf-caret: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
@media (max-width: 575.98px){
  :root{ --sf-ctl-h: 44px; --sf-ctl-fs: 1rem; --sf-tb-h: 44px; --sf-tb-fs: 1rem; }
}

/* ---- W6: one control size and look (every form, dialog, filter panel and record tab) ---- */
input.form-control:not([type=file]):not([type=color]):not([type=range]):not(.form-control-lg),
select.form-control, .form-select:not(.form-select-lg),
.ts-wrapper.single .ts-control, .ts-wrapper.multi .ts-control,
.input-group > .input-group-text{
  min-height: var(--sf-ctl-h);
  font-size: var(--sf-ctl-fs);
  border-color: var(--au-border-2);
  border-radius: var(--au-radius);
}
input.form-control:not([type=file]):not([type=color]):not([type=range]):not(.form-control-lg),
select.form-control, .form-select:not(.form-select-lg), .input-group > .input-group-text{
  height: var(--sf-ctl-h);
  padding-top: 0; padding-bottom: 0;
  padding-left: var(--sf-ctl-px);
}
input.form-control:not([type=file]):not([type=color]):not([type=range]):not(.form-control-lg){ padding-right: var(--sf-ctl-px); background-color: #fff; }
.input-group > .input-group-text{ padding-right: var(--sf-ctl-px); background: var(--au-surface-2); color: var(--au-muted); }
textarea.form-control{ min-height: var(--sf-ctl-h); font-size: var(--sf-ctl-fs); padding: .3rem var(--sf-ctl-px); border-color: var(--au-border-2); border-radius: var(--au-radius); line-height: 1.4; background-color: #fff; }
/* a select shows the select caret (C3: <select class="form-control"> looked read-only) */
select.form-control:not([multiple]):not(.tomselected), .form-select{
  appearance: none; -webkit-appearance: none;
  background-color: #fff;
  background-image: var(--sf-caret); background-repeat: no-repeat; background-position: right .6rem center; background-size: 12px 12px;
  padding-right: 1.9rem;
}
/* TomSelect (sf-select): the same box as an input, the same caret, the same radius */
.ts-wrapper.single.form-control, .ts-wrapper.multi.form-control{ padding: 0 !important; border: 0; height: auto; min-height: 0; background: none; box-shadow: none; }
.ts-wrapper.single .ts-control{
  display: flex; align-items: center; flex-wrap: nowrap; height: var(--sf-ctl-h); box-sizing: border-box;
  padding: 0 1.9rem 0 var(--sf-ctl-px) !important;
  background-color: #fff !important;
  background-image: var(--sf-caret) !important; background-repeat: no-repeat !important; background-position: right .6rem center !important; background-size: 12px 12px !important;
  box-shadow: none;
}
.ts-wrapper.single .ts-control::after{ display: none !important; }
.ts-wrapper.single .ts-control > .item{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ts-wrapper.single.has-items:not(.focus) .ts-control > input{ width: 0 !important; min-width: 0 !important; padding: 0 !important; flex: 0 0 0; }
.ts-wrapper.single.focus .ts-control > input{ flex: 1 1 4px; min-width: 4px !important; }
.ts-wrapper .ts-control input{ font-size: var(--sf-ctl-fs); }
.ts-wrapper.plugin-clear_button .clear-button{ right: 1.7rem !important; opacity: 0; }
.ts-wrapper.plugin-clear_button:hover .clear-button, .ts-wrapper.plugin-clear_button.focus .clear-button{ opacity: .6; }
.ts-wrapper.disabled .ts-control, .ts-wrapper.disabled .ts-control *{ background-color: var(--au-surface-2) !important; }
/* the same focus ring for every kind */
input.form-control:focus, textarea.form-control:focus, select.form-control:focus, .form-select:focus, .ts-wrapper.focus .ts-control{
  border-color: var(--au-primary); box-shadow: var(--sf-ctl-ring); outline: 0;
}
/* numbers right-aligned, tabular figures (owner 2026-11-01); the input-group addon carries the unit / currency */
input[inputmode=decimal].form-control, input[data-sf-number].form-control{ text-align: right; font-variant-numeric: tabular-nums; }
/* click-to-edit cells (sf-input clicktoedit) open at the same height */
.kp-clicktoedit-link{ min-height: 1.5em; }

/* ---- W5: no green state; red + one line after touch / Save ---- */
.form-control.is-valid, .form-select.is-valid, .was-validated .form-control:valid, .is-valid .ts-control, .ts-wrapper.is-valid .ts-control{
  border-color: var(--au-border-2) !important; background-image: none; padding-right: var(--sf-ctl-px);
}
.form-control.is-valid:focus, .ts-wrapper.is-valid.focus .ts-control{ border-color: var(--au-primary) !important; box-shadow: var(--sf-ctl-ring); }
.form-check-input.is-valid, .was-validated .form-check-input:valid{ border-color: var(--au-border-3); }
.form-check-input.is-valid:checked{ background-color: var(--au-primary); border-color: var(--au-primary); }
.form-check-input.is-valid ~ .form-check-label{ color: inherit; }
.form-control.is-invalid, .form-select.is-invalid, .is-invalid > .ts-wrapper .ts-control, .is-invalid .ts-wrapper .ts-control, .ts-wrapper.is-invalid .ts-control{
  border-color: var(--au-danger) !important; background-image: none;
}
select.form-control.is-invalid:not(.tomselected), .form-select.is-invalid, .is-invalid .ts-wrapper.single .ts-control{ background-image: var(--sf-caret) !important; }
.form-control.is-invalid:focus{ box-shadow: 0 0 0 .2rem rgba(176, 42, 55, .18); }
.invalid-feedback.d-block, .sf-field-error{
  display: flex !important; gap: .3rem; align-items: flex-start;
  font-size: .75rem; line-height: 1.1rem; margin-top: .2rem; color: var(--au-danger-ink);
}
.invalid-feedback.d-block::before, .sf-field-error::before{ content: "\F332"; font-family: bootstrap-icons; font-size: .78rem; line-height: 1.1rem; }
.sf-req{ color: var(--au-danger); font-weight: 700; margin-left: .15rem; }
/* S1 (g1-25): in the phone / tablet drawer the right-hand navbar panels (notification bell) open in the drawer's flow,
   full width, instead of an absolute panel hanging off the left edge */
@media (max-width: 991.98px){
  #navbar .navbar-collapse .sf-nav-right .dropdown-menu.show{ position: static !important; min-width: 0 !important; max-width: none !important; width: 100%; }
}
/* S1 (G1): forms built as one `row g-2` per field lost the gap between fields (Bootstrap's negative row margin cancels
   the gutter between two rows): consecutive rows of sfField / accField fields are .5rem apart, whatever their gutter */
.row:has(> .sf-field, > .acc-field) + .row:has(> .sf-field, > .acc-field){ margin-top: calc(.5rem - var(--bs-gutter-y, 0px)); }
/* S1 (W6 "one style"): the stacked / column labels of sf-input, kp-input, sf-select, sf-datepicker and kp-textarea
   (<strong class="sf-lbl">, required star inside) use the sfField label type: .8rem / 600 */
.sf-lbl{ font-size: .8rem; font-weight: 600; line-height: 1.2rem; }
/* S1 (W21, R-121): phone touch targets - saved-view segment chips and the status column's next step / "..." 44 px */
@media (max-width: 575.98px){
  .sf-seg-tab, .acc-seg-tab{ min-height: 44px; display: inline-flex; align-items: center; }
  .sf-status-actions > .btn, .acc-status-actions > .btn,
  .sf-status-actions sf-action-button .dropdown-toggle, .acc-status-actions sf-action-button .dropdown-toggle{ min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  /* S1 (F2, W21 / R-121): small buttons in forms, dialogs, panels and toolbars are 44 px touch targets on phones too
     (text-like btn-link buttons and the navbar keep their size) */
  .btn-sm:not(.btn-link):not(.dropdown-item), .btn-group-sm > .btn:not(.btn-link){ min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .navbar .btn-sm{ min-height: 0; }
}
.sf-input-help{ display: block; font-size: .75rem; line-height: 1.1rem; margin-top: .15rem; color: var(--au-muted); font-style: normal; }
/* "Saved" by the label for ~2 s (sfMarkFieldSaved, sf-lit-element.js) */
.sf-saved{ display: inline-flex; align-items: center; gap: .2rem; margin-left: .5rem; font-size: .72rem; font-weight: 600; color: var(--au-success-ink); white-space: nowrap; animation: sf-saved-fade 2.2s ease forwards; }
.sf-field, .acc-field{ position: relative; }
.sf-saved.sf-saved-abs{ position: absolute; top: 0; right: calc(var(--bs-gutter-x, 1.5rem) * .5); margin: 0; line-height: 1.2rem; background: inherit; }
@keyframes sf-saved-fade{ 0%, 75%{ opacity: 1 } 100%{ opacity: 0 } }
/* read-only value (sfStatic / accStatic): plain text in the control row, no box (W7) */
.sf-static, .acc-static{
  height: var(--sf-ctl-h); min-height: var(--sf-ctl-h) !important; display: flex; align-items: center;
  padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important;
  font-size: var(--sf-ctl-fs); color: var(--au-ink-800);
}
/* checkbox: neutral box beside its text, never over it (sf-checkbox / kp-checkbox .sf-check) */
.sf-check{ display: inline-flex; align-items: center; gap: .5rem; min-height: var(--sf-ctl-h); margin: 0; font-size: var(--sf-ctl-fs); cursor: pointer; }
.sf-check > .form-check-input{ float: none; flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0; border-color: var(--au-border-3); }
.sf-check > .form-check-input:checked{ background-color: var(--au-primary); border-color: var(--au-primary); }
.sf-check > .form-check-input.is-invalid{ border-color: var(--au-danger); }
.sf-check > span{ min-width: 0; overflow-wrap: normal; }
/* a8-15: inside a view's flex row the checkbox keeps its own width (box + text never squeezed under each other) */
sf-checkbox, kp-checkbox{ flex: 0 0 auto; max-width: 100%; }
.sf-check-host{ min-width: 0; }
.sf-check-label{ font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
@media (max-width: 575.98px){ .sf-check > .form-check-input{ width: 1.25rem; height: 1.25rem; } }
/* record card header "Saved automatically" */
.sf-card-autosave{ font-size: .78rem; color: var(--au-muted); display: inline-flex; align-items: center; gap: .3rem; }

/* ---- W21: list search box + list toolbar buttons (one variable) ---- */
.sf-dl-tb-search input.form-control, .sf-dl-tb-search sf-input input{ height: var(--sf-tb-h); min-height: var(--sf-tb-h); font-size: var(--sf-tb-fs); }
.sf-dl-tb-search input.form-control, .sf-dl-tb-search sf-input input.form-control{ padding-left: 2.2rem !important; text-align: left; }
.sf-dl-tb-tools .btn{ height: var(--sf-tb-h); min-height: var(--sf-tb-h); font-size: var(--sf-tb-fs); padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; gap: .3rem; }

/* ---- W7: dialog footer ---- */
.modal-footer.sf-dlg-foot{ gap: .5rem; padding: .6rem 1rem; }
.modal-footer.sf-dlg-foot > *{ margin: 0; }
.sf-dlg-foot .sf-dlg-note{ margin-right: auto; font-size: .8rem; display: inline-flex; align-items: center; }
.btn-primary .sf-on-primary, .btn .spinner-border.sf-on-primary{ color: #fff; }
@media (max-width: 575.98px){
  .modal-footer.sf-dlg-foot .btn{ min-height: 44px; flex: 1 1 0; }
  .sf-dlg-foot .sf-dlg-note{ flex: 1 1 100%; }
}

/* ---- W8: sf-confirm (sf-confirm.js) ---- */
.sf-confirm .modal-header{ background: #fff; border-bottom: 0; padding: 1rem 1.25rem .25rem; }
.sf-confirm .modal-title{ font-size: 1.1rem; }
.sf-confirm .modal-body{ padding: .5rem 1.25rem 1rem; font-size: var(--au-fs); background: #fff; }
.sf-confirm .sf-confirm-list{ margin: .5rem 0 0; padding-left: 1.1rem; }
.sf-confirm .sf-confirm-list li{ margin-bottom: .2rem; }
.sf-confirm .sf-confirm-final, .sf-confirm .sf-confirm-out{ display: flex; gap: .5rem; align-items: flex-start; margin-top: .75rem; padding: .5rem .65rem; border-radius: var(--au-radius); font-size: .85rem; }
.sf-confirm .sf-confirm-final{ background: var(--au-danger-soft); color: var(--au-danger-ink); }
.sf-confirm .sf-confirm-out{ background: var(--au-primary-soft); color: var(--au-navy); }
.sf-confirm .modal-footer{ background: #fff; border-top: 0; padding: 0 1.25rem 1rem; gap: .5rem; }
.sf-confirm .modal-footer > *{ margin: 0; }
@media (max-width: 575.98px){ .sf-confirm .modal-footer .btn{ min-height: 44px; flex: 1 1 0; } }

/* ---- W9 / W10: one toast style (sf-toast.js) ---- */
.toast.sf-toast{ width: 380px; max-width: calc(100vw - 1.5rem); background: #fff; border: 1px solid var(--au-border); border-left: 4px solid var(--au-success); border-radius: var(--au-radius); box-shadow: 0 10px 28px rgba(11, 61, 92, .14); font-size: .9rem; color: var(--au-ink-800); }
.toast.sf-toast.sf-toast-error{ border-left-color: var(--au-danger); }
.toast.sf-toast.sf-toast-warn{ border-left-color: var(--au-warning); }
.toast.sf-toast.sf-toast-info{ border-left-color: var(--au-primary); }
.sf-toast-row{ display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .75rem; }
.sf-toast-icon{ font-size: 1.05rem; line-height: 1.3rem; color: var(--au-success); }
.sf-toast-error .sf-toast-icon{ color: var(--au-danger); }
.sf-toast-warn .sf-toast-icon{ color: var(--au-warning); }
.sf-toast-info .sf-toast-icon{ color: var(--au-primary); }
.sf-toast-body{ flex: 1 1 auto; min-width: 0; line-height: 1.3rem; overflow-wrap: anywhere; }
.sf-toast-title{ font-weight: 600; }
.sf-toast-text{ color: var(--au-ink-600); }
.sf-toast-actions{ display: flex; gap: .9rem; margin-top: .3rem; }
.sf-toast-actions .btn-link{ padding: 0; font-size: .875rem; }
.sf-toast .btn-close{ font-size: .65rem; margin-top: .3rem; flex: 0 0 auto; }
.sf-toast-details{ margin-top: .35rem; font-size: .78rem; color: var(--au-muted); }
.sf-toast-details summary{ cursor: pointer; color: var(--au-primary); font-weight: 600; list-style: none; }
.sf-toast-details summary::-webkit-details-marker{ display: none; }
.sf-toast-details summary::before{ content: "\F285"; font-family: bootstrap-icons; font-size: .65rem; margin-right: .3rem; display: inline-block; transition: transform .1s; }
.sf-toast-details[open] summary::before{ transform: rotate(90deg); }
.sf-toast-details pre{ margin: .3rem 0 0; padding: .4rem .5rem; background: var(--au-surface-2); border-radius: var(--au-radius-sm); white-space: pre-wrap; word-break: break-all; font-size: .72rem; color: var(--au-ink-600); max-height: 12rem; overflow: auto; }
@media (max-width: 575.98px){ .toast.sf-toast{ width: 100%; max-width: 100%; } }

/* ---- W11: navbar - modules that do not fit move into "More"; Settings / search / bell / user always visible ---- */
.navbar .sf-nav-more > .nav-link{ color: var(--au-ink-700); }
.navbar .sf-nav-more.active > .nav-link{ color: var(--au-primary); }
.sf-nav-more-menu{ width: 22rem; max-width: calc(100vw - 1rem); max-height: min(70vh, 640px); overflow-y: auto; padding: .35rem 0; }
.sf-nav-more-item{ display: flex; align-items: center; gap: .25rem; padding: 0 .5rem 0 0; }
.sf-nav-more-item > button.sf-nav-more-mod{ flex: 1 1 auto; display: flex; align-items: center; gap: .5rem; text-align: left; border: 0; background: none; padding: .45rem 1rem; font-weight: 600; color: var(--au-ink-700); border-radius: var(--au-radius-sm); }
.sf-nav-more-item > button.sf-nav-more-mod:hover{ background: var(--au-hover-2); color: var(--au-navy); }
.sf-nav-more-item > button.sf-nav-more-mod .bi-chevron-right{ margin-left: auto; font-size: .7rem; color: var(--au-muted); transition: transform .1s; }
.sf-nav-more-item.open > button.sf-nav-more-mod .bi-chevron-right{ transform: rotate(90deg); }
.sf-nav-pin{ border: 0; background: none; width: 2rem; height: 2rem; border-radius: var(--au-radius-sm); color: var(--au-faint); flex: 0 0 auto; }
.sf-nav-pin:hover{ background: var(--au-hover-2); color: var(--au-navy); }
.sf-nav-pin.on{ color: var(--au-primary); }
.sf-nav-more-pages{ display: none; padding: 0 0 .35rem 1rem; }
.sf-nav-more-item.open + .sf-nav-more-pages{ display: block; }
.sf-nav-more-pages .dropdown-header{ padding: .3rem 1rem .15rem; font-size: .68rem; }
.sf-nav-more-pages .dropdown-item{ display: flex; gap: .5rem; align-items: center; padding: .3rem 1rem; white-space: nowrap; }
.sf-nav-more-foot{ border-top: 1px solid var(--au-border); margin-top: .35rem; padding: .45rem 1rem 0; font-size: .75rem; color: var(--au-muted); }
.navbar .nav-item.sf-pinned > .nav-link::before{ content: "\F4D6"; font-family: bootstrap-icons; font-size: .6rem; margin-right: .2rem; color: var(--au-faint); vertical-align: .15em; }
@media (min-width: 992px){
  #navbar .navbar-brand{ display: inline-flex; align-items: center; max-width: 14rem; min-width: 2rem; flex: 0 1 auto; overflow: hidden; }
  #navbar .navbar-brand > i{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; min-width: 0; }
  #navbar .navbar-collapse{ min-width: 0; }
  #navbar .navbar-nav.sf-nav-left{ flex-wrap: nowrap; min-width: 0; }
  #navbar .navbar-nav.sf-nav-left > .nav-item > .nav-link{ white-space: nowrap; }
  #navbar .navbar-nav.sf-nav-right{ flex-wrap: nowrap; flex: 0 0 auto; }
  #navbar .navbar-nav.sf-nav-right .nav-link{ white-space: nowrap; }
}
@media (max-width: 991.98px){ #navbar .sf-nav-more{ display: none !important; } }

/* ---- W13: status column, "..." button, empty state ---- */
/* status pills everywhere (not only on desks: sf-desk.js injected them before), every glossary tone name in use:
   grey / draft (draft, closed), blue (open, sent, planned), wait / warn (needs review, waiting), ok / green (done,
   approved, paid), bad (late, rejected, failed - real risk only) - R-92 */
.sfd-pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.8rem;font-weight:500;margin-right:4px;white-space:nowrap;line-height:1.35}
.sfd-pill, .sfd-pill.draft, .sfd-pill.grey{background:#eceef1;color:#374151}
.sfd-pill.blue{background:#dbeafe;color:#1e40af}
.sfd-pill.wait, .sfd-pill.warn{background:#fef3c7;color:#92400e}
.sfd-pill.ok, .sfd-pill.green{background:#dcfce7;color:#166534}
.sfd-pill.bad{background:#fee2e2;color:#b91c1c}
.sf-status-cell{ display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.sf-dots{ width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
/* R-96: the row "..." menu is a fixed three-dots button (no caret, never the status) */
sf-action-button .dropdown-toggle:has([name=label] > .bi-three-dots)::after{ display: none; }
sf-action-button .dropdown-toggle:has([name=label] > .bi-three-dots){ min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.sf-empty{ text-align: center; padding: 2rem 1rem; color: var(--au-ink-600); border: 1px dashed var(--au-border-2); border-radius: var(--au-radius-lg); background: #fff; margin: .25rem 0; }
.sf-empty > .bi{ font-size: 1.8rem; color: var(--au-faint); }
.sf-empty-title{ font-weight: 600; margin-top: .4rem; color: var(--au-ink-800); }
.sf-empty-text{ font-size: .875rem; color: var(--au-muted); margin: .2rem auto .8rem; max-width: 36rem; }
.sf-empty-text:last-child{ margin-bottom: 0; }

/* ---- W12: phone card rows - sf-datalist rows drawn as cards below 576 px (.sf-dl-cards; one DOM, sf-datalist.js adds
   the classes): identifier (.sf-c-id) + status / "..." (.sf-c-last) on top, the main cell (.sf-c-main) under them,
   every other column as "label: value" (data-label); the expanded detail stays under its card ---- */
@media (max-width: 575.98px){
  .sf-dl-cards.sf-scroll-x{ overflow-x: visible; }
  .sf-dl-cards > table{ display: block; width: 100%; margin: 0 0 .5rem; }
  .sf-dl-cards > table > thead{ display: none; }
  .sf-dl-cards > table > tbody{ display: flex; flex-direction: column; gap: .5rem; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row{
    display: grid; grid-template-columns: auto minmax(5.5rem, 1fr) fit-content(50%) auto; align-items: center; column-gap: .5rem; /* X2: the identifier keeps >= 5.5rem, a wide status cell wraps */
    background: #fff; border: 1px solid var(--au-border) !important; border-radius: var(--au-radius-lg); padding: .3rem .25rem .5rem .75rem;
  }
  .sf-dl-cards > table > tbody > tr.sf-dl-row.sf-dl-row-open{ border-color: var(--au-primary) !important; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td{
    display: block; grid-column: 1 / -1; min-width: 0; border: 0 !important; padding: .1rem 0 !important;
    background: transparent !important; text-align: left; white-space: normal !important; width: auto !important;
  }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-dl-sel{ grid-column: 1; grid-row: 1; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-id{ grid-column: 1 / 3; grid-row: 1; min-height: 44px; display: flex; align-items: center; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-dl-sel + td.sf-c-id{ grid-column: 2; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-id .sf-dl-ident, .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-id .sf-dl-ident-t{ white-space: normal; min-width: 0; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-id .sf-main .s{ white-space: normal; } /* X2: a sub-line under the identifier wraps in the card */
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-status{ grid-column: 3; grid-row: 1; justify-self: end; text-align: right; white-space: normal !important; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last{ grid-column: 4; grid-row: 1; justify-self: end; white-space: nowrap !important; min-width: min-content; max-width: 48vw; text-align: right; } /* S1: min-content (was max-content, which beat max-width so two pills + "..." ran out of the card) */ /* X2: pills + "..." wrap instead of squeezing the identifier */
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last .btn, .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last .dropdown-toggle{ min-height: 44px; min-width: 44px; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-main{ padding-right: .5rem !important; }
  /* S1: a status cell with a next-step button (PO "Send to ...", inventory "Book", sfStatusActions next) does not fit
     beside the identifier on a phone: its wrappers dissolve into the card grid, pill + "..." stay on the top line and
     the next step gets its own line at the bottom of the card (right-aligned, 44 px) - the identifier is never covered */
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)), .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)) > span, .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)) > span > span:not(.sfd-pill){ display: contents !important; } /* beats .d-inline-flex !important */
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)) > span > *, .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)) > span > span > *{ grid-column: 4; grid-row: 1; justify-self: end; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)) .sfd-pill{ grid-column: 3; margin-right: 0; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td.sf-c-last:has(> span > .btn:not(.dropdown-toggle)) > span > .btn:not(.dropdown-toggle){ grid-column: 1 / -1; grid-row: 30; justify-self: end; margin-top: .4rem; display: inline-flex; align-items: center; }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td[data-label]:not([data-label=""]):not(.sf-c-id):not(.sf-c-main):not(.sf-c-last):not(.sf-c-status){
    display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: .85rem; padding-right: .75rem !important;
  }
  .sf-dl-cards > table > tbody > tr.sf-dl-row > td[data-label]:not([data-label=""]):not(.sf-c-id):not(.sf-c-main):not(.sf-c-last):not(.sf-c-status)::before{
    content: attr(data-label); color: var(--au-muted); font-weight: 400; flex: 0 0 auto; max-width: 50%;
  }
  .sf-dl-cards > table > tbody > tr:not(.sf-dl-row){ display: block; margin-top: -.5rem; }
  .sf-dl-cards > table > tbody > tr:not(.sf-dl-row) > td{ display: block; border: 0; padding: 0; }
  .sf-dl-cards > table > tbody > tr:not(.sf-dl-row) > td:empty{ display: none; }
}

/* ---- W12: tab bars on one line at every width, scroll sideways, fade (mask) at the edge where more tabs hide;
   sf-tabs.js toggles .sf-tabs-more (right) / .sf-tabs-more-left on every .nav-tabs strip ---- */
.nav-tabs{ flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar{ display: none; }
.nav-tabs .nav-item{ flex: 0 0 auto; }
.nav-tabs .nav-link{ white-space: nowrap; }
.nav-tabs.sf-tabs-more{ -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
.nav-tabs.sf-tabs-more-left{ -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); }
.nav-tabs.sf-tabs-more.sf-tabs-more-left{ -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent); }

/* ---- W14: upload area (sf-upload.js) ---- */
.sf-upload{ border: 1px dashed var(--au-border-3); border-radius: var(--au-radius-lg); background: var(--au-surface-1); padding: .9rem 1rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.sf-upload.drag{ border-color: var(--au-primary); background: var(--au-primary-soft); }
.sf-upload.disabled{ opacity: .6; }
.sf-upload-icon{ width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--au-border); display: flex; align-items: center; justify-content: center; color: var(--au-primary); font-size: 1.15rem; flex: 0 0 auto; }
.sf-upload-text{ flex: 1 1 14rem; min-width: 0; }
.sf-upload-text .t{ font-weight: 600; color: var(--au-ink-800); }
.sf-upload-text .s{ font-size: .8rem; color: var(--au-muted); }
.sf-upload-btns{ display: flex; gap: .5rem; flex-wrap: wrap; }
.sf-upload .sf-photo, .sf-upload .sf-touch-hint{ display: none; }
@media (pointer: coarse), (max-width: 575.98px){ .sf-upload .sf-photo{ display: inline-flex; } }
@media (max-width: 575.98px){
  .sf-upload{ flex-direction: column; align-items: stretch; }
  .sf-upload-icon, .sf-upload .sf-drop-hint{ display: none; }
  .sf-upload .sf-touch-hint{ display: inline; }
  .sf-upload-text{ flex: 0 0 auto; }
  .sf-upload-btns{ flex-direction: column; }
  .sf-upload-btns .btn{ min-height: 44px; justify-content: center; display: inline-flex; align-items: center; gap: .4rem; }
}

/* ---- W15: record header line (expanded row and record page) ---- */
.sf-rec-head{ display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; margin-bottom: .25rem; }
.sf-rec-head .sf-rec-meta{ font-size: .85rem; color: var(--au-muted); }
.sf-rec-head .sf-rec-actions{ margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* R1 (UX audit a5-25): a page that is its own shell (customer portal) hides the internal app navbar */
body.sf-no-app-shell #navbar { display: none !important; }

/* ============================================================
   12) Left menu and phone menu (work package side-navigation; sf-sidenav.js builds both from the navbar)
   ============================================================
   Left menu (a personal choice, computer >= 992 px): <html data-sf-nav-layout="left"> + #sf-side = module rail
   (.sf-rail) + the page list of one module (.sf-panel). <html data-sf-nav-dock="1"> = the page list is docked beside
   the page; "0" = rail only, the list opens as a flyout (html.sf-side-flyout). The navbar stays as the top bar without
   its module menus. Phone menu (< 992 px, everyone): html.sf-mnav = bottom bar #sf-mbar + full-screen sheet #sf-msheet.
   Colours are tokens: a style layer overrides the --sf-rail-* tokens (Dark does). */
:root{
  --sf-rail-w: 88px;
  --sf-panel-w: 248px;
  --sf-rail-bg: var(--au-navy);
  --sf-rail-fg: rgba(255,255,255,.80);
  --sf-rail-fg-on: #ffffff;
  --sf-rail-hover-bg: rgba(255,255,255,.08);
  --sf-rail-on-bg: rgba(255,255,255,.17);
  --sf-rail-mark: #7cc4f0;
  --sf-rail-sep: rgba(255,255,255,.15);
  --sf-mbar-h: 58px;
}
html[data-sf-nav-layout="left"]{ --sf-side-w: var(--sf-rail-w); }
html[data-sf-nav-layout="left"][data-sf-nav-dock="1"]{ --sf-side-w: calc(var(--sf-rail-w) + var(--sf-panel-w)); }

/* ---- left menu ---- */
.sf-side{ display: none; }
@media (min-width: 992px){
  html[data-sf-nav-layout="left"] body:has(#navbar nav.navbar):not(.sf-no-app-shell) #main{
    margin-left: var(--sf-side-w) !important; margin-right: 0 !important; padding-left: 1.5rem !important; padding-right: 1.5rem !important;
  }
  html[data-sf-nav-layout="left"] #navbar .sf-nav-left,
  html[data-sf-nav-layout="left"] #navbar li[data-sf-nav="settings"],
  html[data-sf-nav-layout="left"] #navbar .sf-nav-more{ display: none !important; }
  html[data-sf-nav-layout="left"] .sf-side{ display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 1035; }
}
body.sf-no-app-shell .sf-side, body.sf-no-app-shell .sf-mbar, body.sf-no-app-shell .sf-msheet{ display: none !important; }
.sf-rail{ width: var(--sf-rail-w); background: var(--sf-rail-bg); color: var(--sf-rail-fg); display: flex; flex-direction: column; padding: .4rem 0; min-height: 0; }
.sf-rail-list{ flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--sf-rail-sep) transparent;
  border-top: 1px solid var(--sf-rail-sep); margin-top: .3rem; padding-top: .3rem; }
.sf-rail-list.sf-more-below{ -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent); }
.sf-rail-list.sf-more-above{ -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 2.5rem), transparent); }
.sf-rail-list.sf-more-above.sf-more-below{ -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to bottom, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent); }
.sf-rail-foot{ border-top: 1px solid var(--sf-rail-sep); padding-top: .3rem; }
.sf-rail-item{
  display: flex; flex-direction: column; align-items: center; gap: .2rem; width: calc(100% - .75rem); margin: .1rem .375rem;
  padding: .38rem .15rem .34rem; border: 0; background: none; border-radius: .5rem; color: inherit; font-size: .72rem; font-weight: 500;
  line-height: 1.15; text-align: center; text-decoration: none; position: relative; hyphens: auto; overflow-wrap: break-word; word-break: normal;
}
.sf-rail-item .bi{ font-size: 1.15rem; line-height: 1; }
.sf-rail-item:hover, .sf-rail-item:focus{ background: var(--sf-rail-hover-bg); color: var(--sf-rail-fg-on); }
.sf-rail-item.on{ background: var(--sf-rail-on-bg); color: var(--sf-rail-fg-on); font-weight: 600; }
.sf-rail-item.cur::after{ content: ""; position: absolute; right: -.375rem; top: .6rem; bottom: .6rem; width: 3px; border-radius: 2px; background: var(--sf-rail-mark); }
.sf-rail-item:focus-visible{ outline: 2px solid var(--sf-rail-mark); outline-offset: -2px; }
.sf-rail-home{ color: var(--sf-rail-fg-on); }
.sf-panel{ width: var(--sf-panel-w); background: var(--au-surface-0); border-right: 1px solid var(--au-border); display: flex; flex-direction: column; min-height: 0; }
.sf-panel[hidden]{ display: none; }
html.sf-side-flyout .sf-panel{ box-shadow: 8px 0 24px rgba(11, 61, 92, .18); }
.sf-panel-head{ display: flex; align-items: center; gap: .5rem; padding: .85rem .75rem .35rem 1rem; }
.sf-panel-title{ font-size: 1.05rem; font-weight: 700; color: var(--au-navy); margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sf-panel-toggle{ border: 1px solid var(--au-border); background: var(--au-surface-0); color: var(--au-muted); width: 2rem; height: 2rem; border-radius: var(--au-radius);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0; }
.sf-panel-toggle:hover{ background: var(--au-hover-2); color: var(--au-navy); }
.sf-panel-toggle:focus-visible{ outline: 2px solid var(--au-primary); outline-offset: 1px; }
.sf-panel-body{ flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 0 1rem; scrollbar-width: thin; }
.sf-nav-group-h{ font-size: var(--au-fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--au-muted); font-weight: 600; padding: .75rem 1rem .2rem; }
.sf-panel-link{ display: flex; align-items: center; gap: .6rem; padding: .32rem 1rem .32rem calc(1rem - 3px); border-left: 3px solid transparent;
  color: var(--au-ink-600); text-decoration: none; font-size: .9rem; line-height: 1.25; }
.sf-panel-link .bi{ color: var(--au-muted); font-size: .95rem; flex: 0 0 auto; width: 1.1rem; text-align: center; }
.sf-panel-link:hover{ background: var(--au-hover-2); color: var(--au-navy); }
.sf-panel-link.active{ background: var(--au-primary-soft); border-left-color: var(--au-primary); color: var(--au-primary); font-weight: 600; }
.sf-panel-link.active .bi{ color: var(--au-primary); }
.sf-panel-link:focus-visible{ outline: 2px solid var(--au-primary); outline-offset: -2px; }
.sf-panel-hint{ font-size: .85rem; color: var(--au-muted); padding: .75rem 1rem; margin: 0; }

/* ---- phone menu ---- */
.sf-mtop-back{ display: none; }
.sf-mbar, .sf-msheet{ display: none; }
@media (max-width: 991.98px){
  html.sf-mnav #navbar .navbar-toggler, html.sf-mnav #navbar .navbar-collapse, html.sf-mnav #navbar [name="sf-palette-open-sm"]{ display: none !important; }
  html.sf-mnav #navbar .container-fluid{ flex-wrap: nowrap; gap: .25rem; }
  html.sf-mnav #navbar .navbar-brand{ flex: 1 1 auto; margin-right: 0; }
  html.sf-mnav .sf-mtop-back{ display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0;
    color: var(--au-ink-700); font-size: 1.2rem; }
  html.sf-mnav.sf-at-home .sf-mtop-back, html.sf-mnav.sf-no-back .sf-mtop-back{ display: none; }
  html.sf-mnav body:not(.sf-no-app-shell){ padding-bottom: calc(var(--sf-mbar-h) + env(safe-area-inset-bottom, 0px)); }
  html.sf-mnav #toast-container, html.sf-mnav #sls-undo-box{ bottom: calc(var(--sf-mbar-h) + env(safe-area-inset-bottom, 0px)) !important; }
  html.sf-mnav .sf-mbar{
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1032; background: var(--au-surface-0); border-top: 1px solid var(--au-border);
    padding: 0 .25rem env(safe-area-inset-bottom, 0px); height: calc(var(--sf-mbar-h) + env(safe-area-inset-bottom, 0px));
  }
  html.sf-mnav .sf-msheet{
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--sf-mbar-h) + env(safe-area-inset-bottom, 0px));
    z-index: 1040; background: var(--au-surface-0); padding-top: env(safe-area-inset-top, 0px);
  }
  html.sf-mnav .sf-msheet[hidden]{ display: none; }
  html.sf-msheet-open body{ overflow: hidden; }
}
.sf-mbar-item{ flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; border: 0; background: none;
  color: var(--au-muted); font-size: .72rem; text-decoration: none; min-height: 44px; min-width: 0; }
.sf-mbar-item .bi{ font-size: 1.3rem; line-height: 1; }
.sf-mbar-item:hover{ color: var(--au-navy); }
.sf-mbar-item.on{ color: var(--au-primary); font-weight: 600; }
.sf-mbar-item:focus-visible{ outline: 2px solid var(--au-primary); outline-offset: -3px; border-radius: .5rem; }
.sf-msheet-head{ display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-bottom: 1px solid var(--au-rule); min-height: 3.25rem; }
.sf-msheet-title{ font-size: 1.15rem; font-weight: 700; color: var(--au-navy); margin: 0; flex: 1 1 auto; min-width: 0; }
.sf-msheet-sub{ font-size: .85rem; color: var(--au-muted); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-msheet-back{ border: 0; background: none; color: var(--au-primary); font-size: 1.25rem; min-width: 2.75rem; min-height: 2.75rem; margin-left: -.75rem; padding: 0; }
.sf-msheet-body, .sf-msheet-me{ flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 1rem; }
.sf-msheet-body[hidden], .sf-msheet-me[hidden]{ display: none; }
.sf-msheet .sf-nav-group-h{ padding: 1rem 1rem .3rem; }
.sf-msheet-row{ display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 3rem; padding: .5rem 1rem; border: 0; border-bottom: 1px solid var(--au-rule);
  background: none; color: var(--au-ink-700); text-decoration: none; text-align: left; font-size: 1rem; line-height: 1.25; }
.sf-msheet-row > .bi:first-child{ color: var(--au-primary); font-size: 1.15rem; width: 1.4rem; text-align: center; flex: 0 0 auto; }
.sf-msheet-row.active, .sf-msheet-row.cur{ background: var(--au-primary-soft); color: var(--au-primary); font-weight: 600; }
.sf-msheet-row:focus-visible, .sf-msheet-chip:focus-visible, .sf-msheet-back:focus-visible{ outline: 2px solid var(--au-primary); outline-offset: -2px; }
.sf-msheet-mod-label{ flex: 1 1 auto; }
.sf-msheet-chev{ margin-left: auto; color: var(--au-faint); font-size: .85rem; }
.sf-msheet-chips{ display: flex; flex-wrap: wrap; gap: .5rem; padding: .25rem 1rem .5rem; }
.sf-msheet-chip{ display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--au-border-2); border-radius: 999px; padding: .35rem .8rem; min-height: 2.5rem;
  color: var(--au-ink-700); text-decoration: none; font-size: .9rem; background: var(--au-surface-0); }
.sf-msheet-chip .bi{ color: var(--au-primary); }
.sf-msheet-chip.active{ border-color: var(--au-primary); color: var(--au-primary); }
.sf-msheet-me > .dropdown-menu{ display: block; position: static !important; inset: auto !important; transform: none !important; border: 0; box-shadow: none; width: 100%;
  margin: 0; padding: .25rem 0; background: transparent; font-size: 1rem; }
.sf-msheet-me .dropdown-item{ min-height: 2.9rem; display: flex; align-items: center; padding: .5rem 1rem; white-space: normal; }
.sf-msheet-me .dropdown-item-text{ padding: .4rem 1rem; }
.sf-msheet-me .dropdown-item.active, .sf-msheet-me .dropdown-item:active{ background: var(--au-primary-soft); color: var(--au-primary); font-weight: 600; }

/* ---- the menu position chooser (sfNavLayoutChooser, sf-ui.js: My profile > Appearance, welcome page) ---- */
.sf-navch-title{ font-weight: 600; font-size: .9rem; color: var(--au-ink-800); }
.sf-navch-help{ font-size: .82rem; color: var(--au-muted); margin-bottom: .4rem; }
.sf-navch-cards{ display: flex; gap: .75rem; flex-wrap: wrap; }
.sf-navch-card{ position: relative; flex: 1 1 13rem; max-width: 22rem; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: .15rem;
  padding: .6rem; border: 2px solid var(--au-border); border-radius: var(--au-radius-lg); background: var(--au-surface-0); color: var(--au-ink-700); }
.sf-navch-card:hover{ border-color: var(--au-border-2); }
.sf-navch-card.on{ border-color: var(--au-primary); box-shadow: 0 0 0 3px var(--au-primary-soft); }
.sf-navch-card:focus-visible{ outline: 2px solid var(--au-primary); outline-offset: 2px; }
.sf-navch-card:disabled{ opacity: .6; }
.sf-navch-check{ position: absolute; top: .45rem; right: .5rem; color: var(--au-primary); font-size: 1.1rem; }
.sf-navch-label{ font-weight: 600; color: var(--au-ink-800); margin-top: .35rem; }
.sf-navch-desc{ font-size: .8rem; color: var(--au-muted); line-height: 1.3; }
.sf-navch-thumb{ display: flex; height: 5.5rem; border: 1px solid var(--au-border); border-radius: var(--au-radius); background: var(--au-surface-2); overflow: hidden; }
.sf-navch-thumb-top{ flex-direction: column; }
.sf-navch-topbar{ display: flex; gap: .3rem; align-items: center; height: .9rem; padding: 0 .4rem; background: var(--au-surface-0); border-bottom: 1px solid var(--au-border); }
.sf-navch-topbar > span{ width: 1.1rem; height: .25rem; border-radius: 2px; background: var(--au-border-2); }
.sf-navch-topbar > span.on{ background: var(--au-primary); }
.sf-navch-rail{ width: 1.2rem; background: var(--sf-rail-bg); display: flex; flex-direction: column; align-items: center; gap: .3rem; padding-top: .35rem; }
.sf-navch-rail > span{ width: .5rem; height: .5rem; border-radius: 2px; background: var(--sf-rail-sep); }
.sf-navch-rail > span.on{ background: var(--sf-rail-fg-on); }
.sf-navch-list{ width: 3.2rem; background: var(--au-surface-0); border-right: 1px solid var(--au-border); display: flex; flex-direction: column; gap: .28rem; padding: .4rem .35rem; }
.sf-navch-list > .sf-navch-line:nth-child(2){ background: var(--au-primary); }
.sf-navch-page{ flex: 1 1 auto; display: flex; flex-direction: column; gap: .3rem; padding: .45rem; }
.sf-navch-line{ display: block; height: .25rem; border-radius: 2px; background: var(--au-border-2); }
.sf-navch-page > .sf-navch-line:first-child{ width: 45%; height: .35rem; background: var(--au-border-3); }
.sf-navch-page > .sf-navch-line:nth-child(3){ width: 85%; }
.sf-navch-page > .sf-navch-line:nth-child(4){ width: 70%; }
.sf-navch-note{ display: flex; gap: .4rem; align-items: baseline; font-size: .8rem; color: var(--au-muted); margin-top: .45rem; }

@media print{
  .sf-side, .sf-mbar, .sf-msheet, .sf-mtop-back{ display: none !important; }
  html[data-sf-nav-layout="left"] body #main{ margin-left: 0 !important; }
  html.sf-mnav body{ padding-bottom: 0; }
}

/* ---- Accounting > VAT (vat_main.hbs.js, owner 2026-11-05 "proposal B"): the periods on the left, the chosen period's
   workspace on the right with its steps ---- */
.vat-periods{ border: 1px solid var(--au-border); border-radius: var(--au-radius-lg); overflow: hidden; }
.vat-periods-head{ display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px solid var(--au-border); }
.vat-periods-head select{ width: auto; margin-left: auto; }
.vat-periods-list{ max-height: calc(100vh - 260px); overflow-y: auto; }
.vat-period{ display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .75rem; text-align: left;
  background: var(--au-surface-0); border: 0; border-bottom: 1px solid var(--au-rule); border-left: 3px solid transparent; color: inherit; }
.vat-period:hover{ background: var(--au-hover); }
.vat-period.selected{ background: var(--au-primary-soft); border-left-color: var(--au-primary); }
.vat-period.vat-st-progress .vat-period-name, .vat-period.vat-st-cancelled .vat-period-name{ color: var(--au-muted); }
.vat-period.more{ justify-content: center; color: var(--au-primary); font-size: var(--au-fs-sm); }
.vat-period-name{ display: block; font-weight: 600; }
.vat-period-sub{ display: block; font-size: var(--au-fs-xs); color: var(--au-muted); }
.vat-workspace{ border: 1px solid var(--au-border); border-radius: var(--au-radius-lg); padding: 1rem; }
.vat-period-title{ font-size: 1.4rem; font-weight: 700; margin: 0; }
.vat-period-title .sfd-pill{ font-size: .75rem; vertical-align: middle; }
.vat-payable{ font-size: 1.6rem; font-weight: 700; white-space: nowrap; }
.vat-chooser{ margin-top: .5rem; }
.vat-steps{ display: flex; flex-wrap: wrap; gap: .25rem 0; list-style: none; padding: .5rem .75rem; margin: .5rem 0 1rem; background: var(--au-surface-1); border-radius: var(--au-radius); }
.vat-steps li{ display: flex; align-items: center; gap: .4rem; font-size: var(--au-fs-sm); color: var(--au-ink-600); flex: 1 1 auto; white-space: nowrap; }
.vat-steps li:not(:last-child)::after{ content: ""; flex: 1 1 auto; height: 2px; min-width: 12px; background: var(--au-border); margin: 0 .5rem; }
.vat-step-dot{ width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem;
  background: var(--au-surface-3); color: var(--au-ink-700); flex: none; }
.vat-steps li.done .vat-step-dot{ background: var(--au-success); color: #fff; }
.vat-steps li.now{ color: var(--au-ink-900); font-weight: 600; }
.vat-steps li.now .vat-step-dot{ background: var(--au-primary); color: #fff; }
.vat-steps li.bad .vat-step-dot{ background: var(--au-danger); color: #fff; }
@media (max-width: 991.98px){ .vat-periods-list{ max-height: 40vh; } }
