/* ============================================================
   eBrix UI — responsive layer over W3.CSS
   Loaded on every app page via Header.php.
   Keeps the existing amber/navy identity, modernised.

   This sheet fully owns the top navigation. css/ebrix.css (the legacy nav
   sheet) is no longer loaded: it set overflow:hidden on both .topnav and
   .dropdown, which clipped the dropdown panels, and it carried a 915px
   breakpoint that conflicted with the 1060px one used here.
   ============================================================ */

:root {
  /* brand */
  --ebx-navy:      #16265e;
  --ebx-navy-700:  #101b45;
  --ebx-navy-300:  #35479a;
  --ebx-amber:     #ffc107;
  --ebx-amber-600: #e8ac00;
  --ebx-amber-100: #fff3cd;

  /* neutrals */
  --ebx-ink:     #1b2130;
  --ebx-muted:   #5b6577;
  --ebx-bg:      #eef1f6;
  --ebx-surface: #ffffff;
  --ebx-line:    #dde3ec;

  /* status */
  --ebx-ok:     #12805c;
  --ebx-warn:   #b26a00;
  --ebx-danger: #c62828;
  --ebx-info:   #1565c0;

  /* chrome metrics — everything else derives from these */
  --ebx-topbar-h: 56px;
  --ebx-nav-h:    44px;
  --ebx-header-h: calc(var(--ebx-topbar-h) + var(--ebx-nav-h));

  --ebx-radius:   10px;
  --ebx-radius-s: 6px;
  --ebx-shadow:   0 1px 2px rgba(16,27,69,.06), 0 2px 8px rgba(16,27,69,.08);
  --ebx-shadow-l: 0 4px 16px rgba(16,27,69,.14);
  --ebx-maxw:     1680px;
}

@media screen and (max-width: 1060px) {
  :root { --ebx-topbar-h: 52px; --ebx-nav-h: 44px; }
}

/* ---------- base ---------- */

html { -webkit-text-size-adjust: 100%; }

/* body is a flex column so .footer2 is pushed to the bottom of the viewport on
   short pages instead of floating up under the content with dead space below it.
   .ebx-chrome is position:fixed and so contributes no height here.
   No height on <html> — min-height:100vh already measures the viewport, and
   constraining <html> only adds a box for scroll logic to trip over. */
body {
  margin: 0;
  background: var(--ebx-bg);
  color: var(--ebx-ink);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* min-height:100dvh where supported, so mobile browser chrome does not push the
   footer below the fold */
@supports (min-height: 100dvh) { body { min-height: 100dvh; } }

/* legacy pages set line-height:1.8 inline on body/html — too airy for data screens */
body, html { line-height: 1.5; }

* { box-sizing: border-box; }

img, svg, video { max-width: 100%; height: auto; }

/* never let a page scroll sideways as a whole; wide things scroll in their own box */
html, body { overflow-x: hidden; }

a { color: var(--ebx-navy-300); }
a:hover { color: var(--ebx-navy); }

/* ---------- app chrome ---------- */

.ebx-chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: var(--ebx-shadow);
}

/* w3.css ships .w3-modal at z-index:3, far below the fixed chrome above —
   every w3-modal dialog on every page (not just one screen) rendered with its
   top edge hidden underneath the nav bar instead of over it. Raised above the
   chrome and its dropdown (z-index:1200), kept below the "wait" loading
   overlay (z-index:1500 in Footer.php) so a save-in-progress spinner still
   reads as on top of an open dialog. */
.w3-modal { z-index: 1300; }

/* w3.css centers .w3-modal-content on desktop via margin:auto against a fixed
   width, but at <=600px it switches to margin:0 10px (a FIXED gutter, not an
   auto one) plus width:auto!important. That's fine as long as nothing else
   caps the width — but most modals on this site also set their own inline
   style="max-width:...px" (350–600px, sized for a comfortable dialog). Once
   the viewport is wider than that cap + 20px, the box stops filling the
   available space, and a fixed 10px/10px margin doesn't redistribute the
   leftover — it just sits empty on the right, pinning the dialog to the left
   edge instead of centering it. Forcing an auto margin here fixes it for
   every modal regardless of what width/max-width each page sets, without
   touching every page individually. */
@media screen and (max-width: 600px) {
  .w3-modal-content {
    max-width: calc(100% - 20px) !important;
    margin: 0 auto !important;
  }
}

/* Pin a modal's header/footer and let only its body scroll, so neither a
   long message nor a keyboard-triggered scroll-into-view can carry the
   header off screen. Opt in per modal with class="... ebx-modalfix" on the
   .w3-modal-content div — shared here rather than copy-pasted per page
   (vehicleRates.php, RateList.php, EditItem.php use it). */
.ebx-modalfix { display: flex; flex-direction: column; max-height: 85vh; }
.ebx-modalfix > header,
.ebx-modalfix > footer { flex: 0 0 auto; }
.ebx-modalfix > .w3-container { flex: 1 1 auto; overflow-y: auto; }

.ebx-topbar {
  height: var(--ebx-topbar-h);
  background: linear-gradient(180deg, var(--ebx-amber) 0%, var(--ebx-amber-600) 100%);
  color: #3a2c00;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}

.ebx-topbar__logo { display: flex; align-items: center; flex: 0 0 auto; }
.ebx-topbar__logo img { height: 30px; width: auto; display: block; }

.ebx-topbar__org {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ebx-topbar__user {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  max-width: 30%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ebx-topbar__user .fa { opacity: .75; }

@media screen and (max-width: 1060px) {
  .ebx-topbar { padding: 0 10px; gap: 8px; }
  .ebx-topbar__logo img { height: 26px; }
  .ebx-topbar__org { font-size: 15px; text-align: left; }
  /* the name is the least useful thing on a phone — drop the label, keep the icon */
  .ebx-topbar__user span { display: none; }
}

/* ---------- top navigation ---------- */

.topnav {
  background: var(--ebx-navy);
  min-height: var(--ebx-nav-h);
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  position: relative;
  overflow: visible;          /* legacy rule was overflow:hidden — killed the dropdowns */
}

.topnav > a {
  float: none;
  display: flex;
  align-items: center;
  color: #e8ecf7;
  padding: 0 13px;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
}

.topnav > a:hover { background: var(--ebx-navy-700); color: #fff; }

.topnav .active { background: rgba(255,255,255,.14); color: #fff; }

/* overflow must be reset: ebrix.css sets .dropdown{overflow:hidden}, which clips
   the absolutely-positioned panel to the 44px button box and makes every menu
   item invisible and unclickable on desktop. */
.dropdown { float: none; position: relative; display: flex; overflow: visible; }

.dropdown .dropbtn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  font-size: 13.5px;
  font-family: inherit;
  color: #e8ecf7;
  background: transparent;
  border: 0;
  outline: none;
  padding: 0 12px;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}

.topnav a:hover, .dropdown:hover .dropbtn { background: var(--ebx-navy-700); color: #fff; }

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 216px;
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-radius: 0 0 var(--ebx-radius-s) var(--ebx-radius-s);
  box-shadow: var(--ebx-shadow-l);
  padding: 5px 0;
  z-index: 1200;
}

.dropdown-content a {
  float: none;
  display: block;
  color: var(--ebx-ink);
  text-align: left;
  padding: 8px 14px;
  font-size: 13.5px;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.dropdown-content a:hover {
  background: var(--ebx-amber-100);
  border-left-color: var(--ebx-amber);
  color: var(--ebx-ink);
}

/* menus near the right edge open leftwards — ebrix-ui.js measures and flips them */
.dropdown.ebx-flip .dropdown-content { left: auto; right: 0; }

.topnav .icon { display: none; }

/* hover only where hover actually exists — touch uses the click handler */
@media (hover: hover) and (min-width: 1061px) {
  .dropdown:hover .dropdown-content { display: block; }
}

.dropdown.ebx-open .dropdown-content { display: block; }

/* ---------- mobile navigation ---------- */

@media screen and (max-width: 1060px) {

  .topnav {
    display: block;
    height: var(--ebx-nav-h);
    overflow: visible;
  }

  /* the hamburger */
  .topnav a.icon {
    display: flex !important;
    align-items: center;
    position: absolute;
    right: 0; top: 0;
    height: var(--ebx-nav-h);
    padding: 0 16px;
    font-size: 20px !important;
    color: #fff;
  }

  /* everything else hides until the drawer is opened */
  .topnav > a:not(.icon), .topnav .dropdown { display: none; }

  .topnav.responsive {
    position: relative;
    height: auto;
  }

  .topnav.responsive .ebx-drawer-scroll,
  .topnav.responsive > a:not(.icon),
  .topnav.responsive .dropdown {
    display: block;
  }

  /* drawer overlays the page instead of pushing it, so the header height stays fixed */
  .topnav.responsive > a:not(.icon),
  .topnav.responsive .dropdown {
    position: relative;
  }

  .topnav.responsive {
    max-height: calc(100vh - var(--ebx-topbar-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--ebx-shadow-l);
  }

  .topnav.responsive > a:not(.icon) {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.09);
    font-size: 15px;
  }

  .topnav.responsive .dropdown { width: 100%; }

  /* ebrix.css hides .dropbtn below 915px; the drawer has to put it back */
  .topnav.responsive .dropdown .dropbtn {
    display: flex !important;
    width: 100%;
    text-align: left;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 15px;
    border-top: 1px solid rgba(255,255,255,.09);
  }

  /* accordion: no hover on touch, so JS toggles .ebx-open */
  .topnav.responsive .dropdown-content {
    position: static;
    display: none;
    min-width: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--ebx-navy-700);
    padding: 0;
  }

  .topnav.responsive .dropdown.ebx-open .dropdown-content { display: block; }

  .topnav.responsive .dropdown-content a {
    color: #d9e0f2;
    padding: 11px 16px 11px 32px;
    font-size: 14px;
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.06);
  }

  .topnav.responsive .dropdown-content a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
  }

  .topnav.responsive .dropbtn .fa-caret-down { transition: transform .18s ease; }
  .topnav.responsive .dropdown.ebx-open .dropbtn .fa-caret-down { transform: rotate(180deg); }
}

/* ---------- page container ---------- */

#cc, .ebx-page {
  max-width: var(--ebx-maxw);
  margin: 0 auto;
  padding: calc(var(--ebx-header-h) + 12px) 16px 14px !important;
  /* keep the natural content height — .footer2 does the pushing, see below, so
     the end-of-page action bar stays directly under the content instead of
     being stranded above a stretched container */
  flex: 0 0 auto;
  width: 100%;
}

@media screen and (max-width: 1060px) {
  #cc, .ebx-page { padding: calc(var(--ebx-header-h) + 12px) 10px 20px !important; }
}

/* ---------- tables ----------
   ~450 tables in the app, only 21 marked w3-responsive.
   js/ebrix-ui.js wraps every one of them in .ebx-tablewrap. */

.ebx-tablewrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  margin-bottom: 14px;
}

.ebx-tablewrap > table { margin: 0; min-width: 100%; }

.ebx-tablewrap > table th,
.ebx-tablewrap > table td { white-space: nowrap; }

/* let genuinely long text wrap rather than stretch the table forever */
.ebx-tablewrap > table td.ebx-wrap,
.ebx-tablewrap > table td[colspan] { white-space: normal; }

.w3-table th, .w3-table-all th { font-weight: 600; }

.ebx-tablewrap > table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ebx-navy);
  color: #fff;
}

/* nested layout tables (used for forms) must not get the card treatment */
.ebx-tablewrap .ebx-tablewrap {
  border: 0; box-shadow: none; background: transparent; margin-bottom: 0;
}

/* a subtle hint that a table scrolls sideways */
.ebx-tablewrap.ebx-scrollable { position: relative; }
.ebx-tablewrap.ebx-scrollable::after {
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 22px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(22,38,94,.10));
  border-radius: 0 var(--ebx-radius) var(--ebx-radius) 0;
}

@media screen and (max-width: 1060px) {
  .w3-table td, .w3-table th,
  .w3-table-all td, .w3-table-all th { padding: 7px 8px; font-size: 13px; }
}

/* #tk (46 pages) and #tx (24 pages) were styled in Header.php's inline <style>.
   Kept here so those pages render exactly as before. */
#tk td, #tk th { padding: 1px; }

/* ---------- legacy grid ----------
   Ported from css/bst.css, which Header.php used to pull in via ../css/.
   1386 uses of col-1/2/3/5 across 51 pages lay out "label + field" pairs
   inside a .w3-row — without these rules those divs are plain blocks and
   every form field stacks vertically. Percentages and the 768px breakpoint
   match the original exactly; floats are kept (not flex) because .w3-row
   already provides the clearfix these pages depend on. */

[class*="col-"] {
  float: left;
  padding: 0;
  width: 100%;          /* stacked on small screens, as the original did */
}

@media only screen and (min-width: 768px) {
  .col-1  { width: 8.33%; }
  .col-2  { width: 16.66%; }
  .col-3  { width: 25%; }
  .col-4  { width: 33.33%; }
  .col-5  { width: 41.66%; }
  .col-6  { width: 50%; }
  .col-7  { width: 58.33%; }
  .col-8  { width: 66.66%; }
  .col-9  { width: 75%; }
  .col-10 { width: 83.33%; }
  .col-11 { width: 91.66%; }
  .col-12 { width: 100%; }
}

.row::after { content: ""; clear: both; display: table; }

/* ---------- forms & controls ---------- */

input[type=text], input[type=number], input[type=date], input[type=password],
input[type=email], input[type=tel], input[type=search], select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ebx-ink);
  background: var(--ebx-surface);
  border: 1px solid #c6cede;
  border-radius: var(--ebx-radius-s);
  padding: 8px 10px;
  max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}

/* Legacy forms sized controls to fill their grid column (css/input.css set
   width:95% on exactly these three selectors). Without it a <select> in a
   col-3 renders at its content width and the form looks ragged. */
input[type=text], select, textarea { width: 95%; }

/* components added in the 2026 redesign manage their own widths */
.ebx-daterange input, .ebx-daterange select,
.ebx-pagehead input, .ebx-pagehead select { width: auto; }
.ebx-status input[type=text], .ebx-status select, .ebx-status textarea { width: 100%; }

input[type=text]:focus, input[type=number]:focus, input[type=date]:focus,
input[type=password]:focus, input[type=email]:focus, input[type=tel]:focus,
input[type=search]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ebx-navy-300);
  box-shadow: 0 0 0 3px rgba(53,71,154,.15);
}

/* iOS zooms the page when a focused field is under 16px */
@media screen and (max-width: 1060px) {
  input, select, textarea, button { font-size: 16px !important; }
  input[type=text], input[type=number], input[type=date], input[type=password],
  input[type=email], input[type=tel], input[type=search], select, textarea {
    width: 100%;
    min-height: 42px;
  }
}

button, .w3-button, input[type=submit], input[type=button] {
  border-radius: var(--ebx-radius-s);
  font-family: inherit;
  cursor: pointer;
}

@media screen and (max-width: 1060px) {
  /* comfortable touch targets */
  button, .w3-button, input[type=submit], input[type=button] { min-height: 42px; }
}

/* jQuery UI's datepicker (Header.php initializes #datepicker / #datepickera /
   #datepickers on every page that has one — ClientLedger.php, LabourerList.php,
   Sales.php, etc.) sizes everything in em off its own font-size, which Header.php
   never sets, so it inherits whatever small body font-size the current page
   happens to use — many set body{font-size:12px} — and renders day cells around
   29x21px, a hard target to tap accurately on a phone. One override here fixes
   every date field in the app at once, the same leverage point as the rest of
   this file. */
@media screen and (max-width: 1060px) {
  #ui-datepicker-div { font-size: 16px; }
  #ui-datepicker-div td span,
  #ui-datepicker-div td a { padding: .5em .35em; }
}

/* ---------- form layout ----------
   Used by redesigned data-entry screens. Columns reflow by available width,
   so the same markup works on a phone and a wide desktop. */

.ebx-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px 16px;
  /* start, not end: every field is label + one control of equal height, so
     tops line up. Bottom-aligning made any field with extra content below its
     control drag its label out of line with the rest of the row. */
  align-items: start;
}

.ebx-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.ebx-field > label,
.ebx-field__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--ebx-muted);
}

/* beat the legacy width:95% rule without touching it */
.ebx-form .ebx-field input[type=text],
.ebx-form .ebx-field input[type=number],
.ebx-form .ebx-field input[type=date],
.ebx-form .ebx-field select,
.ebx-form .ebx-field textarea { width: 100%; }

.ebx-field--wide { grid-column: span 2; }
@media screen and (max-width: 700px) { .ebx-field--wide { grid-column: span 1; } }

/* An action field has no label, so with align-items:start its button floated to
   the top of the row instead of lining up with the other controls. Stretch it
   to the row height and pin the button to the bottom, which stays correct even
   if a neighbouring label wraps to two lines. */
.ebx-field--action { align-self: stretch; justify-content: flex-end; }

.ebx-field--action .w3-button,
.ebx-field--action button { width: 100%; min-height: 40px; }

/* <itemname> is a bogus element used only as a JS write target for a hidden
   input. Left inline it contributes a line box that made its field 3px taller
   than the rest of the row. */
itemname { display: none; }

/* read-only value slot (also an AJAX mount point on some screens) */
.ebx-static {
  display: flex;
  align-items: center;
  /* must match the rendered height of an input so that, with align-items:end,
     its label lines up with the labels either side of it */
  min-height: 42px;
  padding: 8px 10px;
  background: #f7f9fc;
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius-s);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* #rate and #total are containers whose innerHTML is replaced by AJAX; the
   injected control carries no class, so target it through the container */
#rate input, #total input { width: 100%; }

/* ---------- compact variant ----------
   For dense entry screens that should fit a 768px-tall laptop without
   scrolling. Opt-in, so ordinary forms elsewhere keep the roomier sizing.
   Touch targets are untouched: the <=1060px rules still set min-height 42px. */

.ebx-form--compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px 12px;
}

.ebx-form--compact .ebx-field { gap: 3px; }

.ebx-form--compact .ebx-field > label,
.ebx-form--compact .ebx-field__label { font-size: 10.5px; letter-spacing: .3px; line-height: 1.3; }

.ebx-form--compact .ebx-field input[type=text],
.ebx-form--compact .ebx-field input[type=number],
.ebx-form--compact .ebx-field input[type=date],
.ebx-form--compact .ebx-field select,
.ebx-form--compact #rate input,
.ebx-form--compact #total input { padding: 6px 8px; font-size: 13.5px; }

.ebx-form--compact .ebx-static { min-height: 34px; padding: 6px 8px; font-size: 13px; }

.ebx-form--compact .ebx-field--action .w3-button,
.ebx-form--compact .ebx-field--action button { min-height: 34px; padding: 4px 10px; }

.ebx-panel--tight > .ebx-panel__head { padding: 6px 12px; }
.ebx-panel--tight > .ebx-panel__body { padding: 10px 12px; }

/* Base .ebx-chip must come before its --total/--ok modifiers below: they share
   its (0,1,0) specificity, so whichever is LAST in source order wins the
   cascade — and .ebx-chip previously sat after both, silently overriding
   their background/color back to the plain neutral chip (confirmed live on
   Sales.php: .ebx-chip--total rendered white/grey, not navy/white). */
.ebx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ebx-muted);
  white-space: nowrap;
}

.ebx-panel--tight > .ebx-panel__head .ebx-chip { padding: 2px 9px; font-size: 11.5px; }

/* the order total now lives in the cart panel header instead of its own band */
.ebx-headmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ebx-chip--total {
  background: var(--ebx-navy);
  border-color: var(--ebx-navy);
  color: #fff;
  font-size: 13px !important;
  padding: 3px 12px !important;
}

.ebx-chip--total b { font-size: 15px; }

/* A solid, filled chip for a figure that should stand out as a positive/
   available quantity (e.g. BrickSorting.php's Current Exited Stock) —
   same shape as .ebx-chip--total, green instead of navy. */
.ebx-chip--ok {
  background: var(--ebx-ok);
  border-color: var(--ebx-ok);
  color: #fff;
}
.ebx-chip--ok b { font-size: 15px; }

/* Clickable status-filter chips (ChamberStatus.php) — a plain .ebx-chip
   rendered as a <button> so it can double as both the status count display
   and the filter control, rather than needing two separate pieces of UI for
   the same five numbers. */
.ebx-chip--filter { cursor: pointer; font: inherit; }
.ebx-chip--filter.is-active {
  background: var(--ebx-navy);
  border-color: var(--ebx-navy);
  color: #fff;
}
.ebx-chip--filter.is-active b { color: #fff; }
.ebx-panel--tight .ebx-totalbar { padding: 6px 12px; }
.ebx-panel--tight .ebx-totalbar__value { font-size: 18px; }
.ebx-panel--tight .ebx-formactions { padding: 8px 12px; }
.ebx-panel--tight .ebx-formactions .ebx-chip { padding: 3px 10px; }
/* The cart is the only part that grows, so it absorbs the slack: its height is
   whatever the viewport has left once the rest of the order UI is placed
   (measured at ~674px). That keeps the whole screen — footer included — inside
   one desktop viewport, and gives a tall monitor a much longer cart. */
.ebx-panel--tight .ebx-cart { max-height: 130px; }

@media screen and (min-width: 1061px) {
  .ebx-panel--tight .ebx-cart {
    /* 553px is the measured height of everything else on the order screen with
       both field grids on a single row and the total in the cart header.
       Re-measure if a field row is added back. */
    max-height: calc(100vh - 553px);
    min-height: 120px;
  }
}

/* Narrower desktops fit fewer columns, which pushed the field rows onto a second
   line. A 104px track gives 11 columns at 1366px, enough for Add Item (9 units)
   and Customer & Payment (11 units) to each occupy a single row. auto-fit
   collapses the tracks Add Item does not use, so its fields still stretch. */
@media screen and (min-width: 1061px) and (max-width: 1400px) {
  .ebx-form--compact { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
}
.ebx-panel--tight .ebx-custnote { margin-top: 7px; }

/* stack of panels on a compact screen */
.ebx-stack > .ebx-panel { margin-bottom: 12px; }
.ebx-stack > .ebx-panel:last-child { margin-bottom: 0; }

@media screen and (max-width: 1060px) {
  /* No fold to fit on a phone, so give the fields their room back. Without the
     wider track the compact grid squeezes two columns onto a 375px screen,
     which is far too tight for the longer Hindi labels. */
  .ebx-panel--tight .ebx-cart { max-height: 260px; }
  .ebx-form--compact {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px 12px;
  }
  .ebx-form--compact .ebx-field > label,
  .ebx-form--compact .ebx-field__label { font-size: 11.5px; }
  .ebx-form--compact .ebx-static { min-height: 42px; }
  /* keep the action button a full touch target like every other control */
  .ebx-form--compact .ebx-field--action .w3-button,
  .ebx-form--compact .ebx-field--action button { min-height: 42px; }
}

/* customer credit status — now sits inside the action bar, left of the buttons */
.ebx-custnote { color: var(--ebx-muted); margin-right: auto; }
.ebx-custnote:empty { display: none; }

/* ---------- order cart ---------- */

.ebx-cart { max-height: 300px; overflow: auto; -webkit-overflow-scrolling: touch; }
.ebx-cart table { margin: 0; }
.ebx-cart td, .ebx-cart th { font-size: 13px; }

.ebx-cart-empty { padding: 26px 14px; text-align: center; color: #8b93a4; font-size: 13px; }

.ebx-totalbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  justify-content: flex-end;
  padding: 11px 14px;
  border-top: 1px solid var(--ebx-line);
  background: #f7f9fc;
}

.ebx-totalbar__label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--ebx-muted); }
.ebx-totalbar__value { font-size: 20px; font-weight: 700; color: var(--ebx-navy); }

.ebx-formactions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 14px;
  border-top: 1px solid var(--ebx-line);
}

@media screen and (max-width: 620px) {
  .ebx-formactions { flex-direction: column-reverse; align-items: stretch; }
  /* .w3-btn as well as .w3-button — EditClient's Save/Delete are w3-btn spans,
     which stayed at content width and looked broken in the stacked column */
  .ebx-formactions .w3-button, .ebx-formactions .w3-btn,
  .ebx-formactions input[type=submit] { width: 100%; }
}

/* ---------- cards & headings ---------- */

.ebx-card {
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  padding: 16px;
}

/* ---------- per-setting rows (OrgInfo.php) ----------
   Each setting is its own <form>, so a row is a flex container in its own
   right (a <form> is just a block element — no wrapper div needed). One
   Update button per row instead of one Submit at the end of the whole page,
   so saving one setting can never carry the others along with it. */

.ebx-settingsrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--ebx-line);
}

.ebx-settingsrow:last-of-type { border-bottom: 0; }

.ebx-settingsrow__label {
  flex: 0 0 190px;
  font-weight: 600;
  color: var(--ebx-ink);
}

.ebx-settingsrow input[type=text],
.ebx-settingsrow input[type=number],
.ebx-settingsrow select,
.ebx-settingsrow textarea {
  flex: 1 1 260px;
  max-width: 360px;
  width: auto;
}

.ebx-settingsrow textarea { min-height: 42px; }

.ebx-settingsrow__btn {
  flex: 0 0 auto;
  min-height: 36px;
}

@media screen and (max-width: 620px) {
  .ebx-settingsrow__label { flex: 1 1 100%; }
  .ebx-settingsrow input[type=text],
  .ebx-settingsrow input[type=number],
  .ebx-settingsrow select,
  .ebx-settingsrow textarea { flex: 1 1 100%; max-width: none; }
  .ebx-settingsrow__btn { flex: 1 1 100%; }
}

/* Compact variant (OrgInfo.php, 2026-08-23): each setting is its own bordered
   card in a responsive grid instead of one long single-column list — same
   number of controls, roughly half the vertical scroll on a wide screen. */
.ebx-settingsgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 10px 18px;
}

.ebx-settingsgrid .ebx-settingsrow {
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius-s);
  padding: 9px 12px;
  background: var(--ebx-surface);
}

.ebx-settingsgrid .ebx-settingsrow__label { flex-basis: 150px; font-size: 13px; }

/* Wage Adjustments popup (Settings.php, 2026-08-23): a modal has far less
   room to spare than a full page, so this is tighter again than
   .ebx-settingsgrid — smaller padding/gaps/label width, and no .ebx-card
   wrapper (its own 16px padding was on top of every row's own padding).
   Two columns instead of one long list is what actually avoids the modal
   needing to scroll; the skills checkbox rows opt out via --full since a
   7-role list wrapped into a narrow column reads worse than it needs to. */
.ebx-adjgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px 16px;
}

.ebx-adjgrid .ebx-settingsrow {
  padding: 5px 2px;
  gap: 6px 8px;
  border-bottom: 1px solid var(--ebx-line);
  /* The base .ebx-settingsrow is flex-wrap:wrap for a full-width page row —
     fine there, but at a ~340px grid-column width it let a growing text
     input claim so much of the line that the Update button had nowhere left
     and wrapped to its own second line, roughly doubling every row's height
     (86px measured instead of the ~40px a single line needs). Locking to one
     line here and letting the input shrink instead is what actually keeps
     every row compact. */
  flex-wrap: nowrap;
}

.ebx-adjgrid .ebx-settingsrow__label { flex-basis: 118px; font-size: 12.5px; }

.ebx-adjgrid .ebx-settingsrow input[type=text],
.ebx-adjgrid .ebx-settingsrow input[type=number],
.ebx-adjgrid .ebx-settingsrow select {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

.ebx-adjgrid .ebx-settingsrow__btn { flex: 0 0 auto; min-height: 30px; padding: 4px 10px; }

.ebx-adjgrid .ebx-settingsrow--full { grid-column: 1 / -1; }

@media screen and (max-width: 480px) {
  .ebx-adjgrid .ebx-settingsrow { flex-wrap: wrap; }
  .ebx-adjgrid .ebx-settingsrow__label { flex-basis: 100%; }
}

/* Per-row edit/delete icons on OpenPurchase.php's line-item table — a
   plain <i> would otherwise carry no touch target or hover feedback. */
.ebx-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--ebx-radius-s);
  color: var(--ebx-muted);
  cursor: pointer;
}
.ebx-iconbtn:hover { background: var(--ebx-bg); color: var(--ebx-navy); }
.ebx-iconbtn--danger:hover { background: #fdecea; color: var(--ebx-danger); }

.ebx-pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.ebx-pagehead h1, .ebx-pagehead h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ebx-navy);
}

/* a cluster inside the head row — title + search on one side, page actions on
   the other. .ebx-pagehead is space-between, so two groups sit at the edges. */
.ebx-pagehead__group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* w3-padding-small buttons come out 26px tall, which reads as undersized beside
   a 39px input on the same row */
.ebx-pagehead__group .w3-btn,
.ebx-pagehead__group .w3-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

@media screen and (max-width: 620px) {
  .ebx-pagehead__group { width: 100%; }
  .ebx-pagehead__group input[type=text],
  .ebx-pagehead__group input[type=search] { flex: 1 1 140px; width: auto !important; }
  .ebx-pagehead__group .w3-btn { flex: 1 1 auto; text-align: center; }
}

/* pill-shaped order-id trigger used on Receipts.php's Order Id column. It is
   the click target that opens the modify/delete popup, not just a label, so
   it must stay a button even when there is no order id to show. */
.ebx-orderbadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  background: #eef1fb;
  border: 1px solid #ccd6f5;
  color: #33418c;
}
.ebx-orderbadge:hover { background: #dfe5fa; }
.ebx-orderbadge--empty { background: var(--ebx-surface); border-color: var(--ebx-line); color: var(--ebx-muted); font-weight: 400; }

/* Receipt amount column — bold and colour-coded so a received figure stands
   out on a busy listing, matching the money styling used elsewhere (.ebx-lbal). */
.ebx-amount { font-weight: 700; color: var(--ebx-ok); }
.ebx-amount--due { font-weight: 700; color: var(--ebx-danger); }

/* Status symbol (AccPayable.php, 2026-08-23) — replaces two 20x20 raster
   icons (img/red.png, img/green.png) with a scalable icon that carries its
   own tooltip and reads correctly at any zoom level. */
.ebx-statusicon { font-size: 17px; }
.ebx-statusicon--overdue { color: var(--ebx-danger); }
.ebx-statusicon--ontime  { color: var(--ebx-ok); }

/* ---------- dashboard ---------- */

.ebx-grid { display: grid; gap: 14px; margin-bottom: 16px; }

/* tiles reflow by available width rather than a fixed column count, so this
   works from a 320px phone up to an ultrawide monitor */
.ebx-grid--kpi  { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.ebx-grid--half { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.ebx-grid--wide { grid-template-columns: 2fr 1fr; }
@media screen and (max-width: 1100px) { .ebx-grid--wide { grid-template-columns: 1fr; } }

/* Settings.php — plain navigation tiles, no value/sub line like .ebx-kpi */
.ebx-grid--nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.ebx-kpi {
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-left: 4px solid var(--ebx-navy-300);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  padding: 14px 16px;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}

.ebx-kpi:hover { transform: translateY(-2px); box-shadow: var(--ebx-shadow-l); color: inherit; }

.ebx-kpi__label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--ebx-muted);
}

.ebx-kpi__value {
  font-size: 26px; font-weight: 700; line-height: 1.25;
  color: var(--ebx-ink); margin-top: 5px;
  overflow-wrap: anywhere;
}

.ebx-kpi__sub { font-size: 12px; color: var(--ebx-muted); margin-top: 2px; }

.ebx-kpi--sales { border-left-color: var(--ebx-navy-300); }
.ebx-kpi--cash  { border-left-color: var(--ebx-ok); }
.ebx-kpi--exp   { border-left-color: var(--ebx-danger); }
.ebx-kpi--qty   { border-left-color: var(--ebx-amber-600); }
.ebx-kpi--due   { border-left-color: var(--ebx-warn); }
.ebx-kpi--purch { border-left-color: var(--ebx-info); }
.ebx-kpi--cost  { border-left-color: var(--ebx-warn); }
.ebx-kpi--rate  { border-left-color: var(--ebx-navy-700); }

/* ---------- Settings.php nav tiles ---------- */

.ebx-navtile {
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-top: 3px solid var(--ebx-navy-300);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--ebx-ink);
  transition: transform .12s ease, box-shadow .12s ease;
}

.ebx-navtile:hover { transform: translateY(-2px); box-shadow: var(--ebx-shadow-l); color: var(--ebx-ink); }

.ebx-navtile__icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--ebx-amber-50, rgba(232,172,0,.14));
  color: var(--ebx-navy-300);
  font-size: 18px;
}

.ebx-navtile__label { font-size: 13px; font-weight: 600; line-height: 1.3; }

@media screen and (max-width: 480px) {
  .ebx-grid--nav { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ebx-navtile { padding: 14px 6px; }
}

/* ---------- ItemList.php item cards ---------- */

.ebx-grid--items { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.ebx-itemcard {
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .12s ease, box-shadow .12s ease;
}

.ebx-itemcard:hover { transform: translateY(-2px); box-shadow: var(--ebx-shadow-l); }

.ebx-itemcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ebx-itemcard__name { font-size: 15px; font-weight: 700; color: var(--ebx-ink); overflow-wrap: anywhere; }

.ebx-itemcard__id {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 700; color: var(--ebx-muted);
  background: var(--ebx-bg);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.ebx-itemcard__desc { font-size: 12.5px; color: var(--ebx-muted); min-height: 16px; }

.ebx-itemcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--ebx-line);
}

.ebx-itemcard__rate { font-size: 13px; font-weight: 600; color: var(--ebx-ok); }

.ebx-itemcard__actions { display: flex; gap: 6px; }

.ebx-itemcard__actions a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--ebx-radius-s);
  border: 1px solid var(--ebx-line);
  color: var(--ebx-navy-300);
  text-decoration: none;
  transition: background .12s ease;
}

.ebx-itemcard__actions a:hover { background: var(--ebx-bg); color: var(--ebx-navy-300); }

.ebx-panel {
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;               /* lets grid children shrink instead of overflowing */
  overflow: hidden;
}

.ebx-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--ebx-line);
  background: #f7f9fc;
}

.ebx-panel__title {
  font-size: 13.5px; font-weight: 700; color: var(--ebx-navy);
  display: flex; align-items: center; gap: 8px;
}

.ebx-panel__link { font-size: 12px; text-decoration: none; white-space: nowrap; }
.ebx-panel__body { padding: 12px 14px; }
.ebx-panel__body--flush { padding: 0; }

.ebx-chart { width: 100%; min-height: 120px; }

/* scrolling list inside a panel — replaces the old height:150px;overflow:scroll */
.ebx-list { max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ebx-list table { margin: 0; }

.ebx-empty { padding: 26px 14px; text-align: center; color: #8b93a4; font-size: 13px; }

/* production pipeline */
.ebx-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }

.ebx-flow__step {
  background: #f7f9fc;
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius-s);
  padding: 11px 12px;
  text-align: center;
}

.ebx-flow__n     { font-size: 19px; font-weight: 700; color: var(--ebx-navy); }
.ebx-flow__label { font-size: 11.5px; color: var(--ebx-muted); text-transform: uppercase; letter-spacing: .3px; }

.ebx-num   { font-variant-numeric: tabular-nums; }
/* !important because w3.css's own ".w3-table td, .w3-table-all td { text-align:left }"
   carries a class+tag selector, which out-specifies a bare class selector here — without
   this, .ebx-right silently does nothing inside any w3-table/w3-table-all cell (confirmed
   live: Dashboard.php's Orders/Deliveries Qty/Value columns, both marked .ebx-right, were
   rendering left-aligned everywhere). w3.css's own alignment utilities
   (.w3-right-align etc.) already use !important for exactly this reason. */
.ebx-right { text-align: right !important; }

.ebx-daterange { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ebx-daterange input[type=date] { min-width: 140px; }

@media screen and (max-width: 1060px) {
  .ebx-kpi__value { font-size: 22px; }
  .ebx-grid { gap: 11px; }
}

/* ---------- lite chrome ----------
   HeaderLite.php / FooterLite.php: for pages that must render without a session
   (login failure, OTP, terminated service) and for transient status screens.
   Single bar, no nav row, so the header height is just the top bar. */

.ebx-lite { --ebx-header-h: var(--ebx-topbar-h); }

.ebx-lite .ebx-topbar__user { gap: 4px; max-width: 60%; }

.ebx-litelink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--ebx-radius-s);
  color: #3a2c00;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ebx-litelink:hover { background: rgba(0,0,0,.10); color: #3a2c00; }

@media screen and (max-width: 620px) {
  .ebx-litelink span { display: none; }
  .ebx-litelink { padding: 6px 8px; font-size: 15px; }
}

/* ---------- status screens ---------- */

.ebx-statuswrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 0 28px;
}

.ebx-status {
  width: 100%;
  max-width: 640px;
  background: var(--ebx-surface);
  border: 1px solid var(--ebx-line);
  border-top: 5px solid var(--ebx-info);
  border-radius: var(--ebx-radius);
  box-shadow: var(--ebx-shadow);
  padding: 30px 26px 26px;
  text-align: center;
}

.ebx-status--ok   { border-top-color: var(--ebx-ok); }
.ebx-status--err  { border-top-color: var(--ebx-danger); }
.ebx-status--warn { border-top-color: var(--ebx-warn); }

.ebx-status__icon { font-size: 42px; line-height: 1; color: var(--ebx-info); }
.ebx-status--ok   .ebx-status__icon { color: var(--ebx-ok); }
.ebx-status--err  .ebx-status__icon { color: var(--ebx-danger); }
.ebx-status--warn .ebx-status__icon { color: var(--ebx-warn); }

.ebx-status__title {
  font-size: 20px; font-weight: 700; color: var(--ebx-ink);
  margin: 12px 0 6px;
}

.ebx-status__msg {
  font-size: 15px; color: var(--ebx-muted);
  margin: 0 0 22px;
  overflow-wrap: anywhere;      /* server messages can be long and unbroken */
  white-space: pre-line;        /* a literal \n in the message renders as a real line break */
}

.ebx-status__msg:lang(hi) { line-height: 1.7; }

.ebx-status__actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}

.ebx-status__actions .w3-button { min-width: 120px; }

@media screen and (max-width: 620px) {
  .ebx-status { padding: 24px 18px 20px; }
  .ebx-status__actions .w3-button { width: 100%; }
}

/* ---------- tooltip ----------
   css/tooltip.css was requested from ../css/ and 404'd on every page, so
   .tooltiptext rendered as permanently-visible inline text on 13 pages. */

.tooltip { position: relative; display: inline-block; }

.tooltip .tooltiptext {
  visibility: hidden;
  opacity: 0;
  width: 160px;
  background: var(--ebx-ink);
  color: #fff;
  text-align: center;
  border-radius: var(--ebx-radius-s);
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  position: absolute;
  z-index: 1400;
  bottom: 125%;
  left: 50%;
  margin-left: -80px;
  box-shadow: var(--ebx-shadow-l);
  transition: opacity .15s;
}

.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }

.ebx-pagehead__count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  color: var(--ebx-muted);
  white-space: nowrap;
}

/* the filtered total is the figure being looked for — same amber chip the
   action-bar figures use, so a number reads as a number app-wide */
.ebx-pagehead__count .ebx-count__amt {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--ebx-amber-100);
  border: 1px solid var(--ebx-amber-600);
  color: var(--ebx-navy);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ---------- pagination ----------
   Rendered by js/ebrix-paginate.js under any listing longer than the tenant's
   "Listing rows / page" setting. */

.ebx-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 8px 0 4px;
}

.ebx-pager__status {
  font-size: 12.5px;
  color: var(--ebx-muted);
  white-space: nowrap;
}

.ebx-pager__btn {
  min-width: 42px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius-s);
  background: var(--ebx-surface);
  color: var(--ebx-ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.ebx-pager__btn:hover:not(:disabled) {
  background: var(--ebx-navy);
  border-color: var(--ebx-navy);
  color: #fff;
}

.ebx-pager__btn:disabled { opacity: .4; cursor: default; }

@media screen and (max-width: 620px) {
  .ebx-pager { justify-content: space-between; }
  .ebx-pager__btn { flex: 0 0 auto; min-width: 64px; min-height: 42px; }
}

/* ---------- end-of-page action bar ----------
   Emitted by Footer.php / FooterLite.php, so it lands in the same place inside
   #cc on every page. Before this, 38 pages hand-rolled a Back link with four
   different class combinations and the other 104 had none at all. */

.ebx-pagefoot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 18px 0 0;
  padding: 12px 0 2px;
  border-top: 1px solid var(--ebx-line);
}

.ebx-pagefoot__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--ebx-line);
  border-radius: var(--ebx-radius-s);
  background: var(--ebx-surface);
  color: var(--ebx-ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ebx-pagefoot__btn:hover {
  background: var(--ebx-navy);
  border-color: var(--ebx-navy);
  color: #fff;
}

.ebx-pagefoot__btn .fa { font-size: 12px; }

/* A page total rides on this same bar rather than costing a row of its own, and
   it is what gets pushed to the right — the nav buttons stay grouped together
   on the left. */
/* only the first chip pushes right; any after it sit alongside it */
.ebx-pagefoot__info--first { margin-left: auto; }

.ebx-pagefoot__info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--ebx-radius-s);
  background: var(--ebx-amber-100);
  border: 1px solid var(--ebx-amber-600);
  color: var(--ebx-ink);
  font-size: 13px;
  white-space: nowrap;
}

.ebx-pagefoot__info b { font-size: 15px; color: var(--ebx-navy); }

@media screen and (max-width: 620px) {
  .ebx-pagefoot__btn { flex: 1 1 140px; justify-content: center; }
  /* figures go full width on their own lines rather than squeezing the buttons */
  .ebx-pagefoot__info,
  .ebx-pagefoot__info--first { margin-left: 0; width: 100%; justify-content: center; }
}

/* ---------- footer ---------- */

.footer2 {
  position: static;      /* was position:fixed — it covered content on short screens */
  width: 100%;
  flex: 0 0 auto;        /* never squeezed by the flex column */
  /* body is a flex column, so auto margin here drops the footer to the bottom of
     a short page and leaves it in normal flow on a long one */
  margin-top: auto;
  font-size: 12px;
}

/* the <p> inside carried a default 1em margin top and bottom, adding ~24px of
   dead height to the bottom of every page */
.footer2 p { margin: 3px 0; }

/* ---------- utilities ---------- */

.ebx-scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }

@media print {
  .ebx-chrome, .footer2, .ebx-noprint { display: none !important; }
  #cc, .ebx-page { padding-top: 0 !important; max-width: none; }
  .ebx-tablewrap { overflow: visible; border: 0; box-shadow: none; }
}

/* ---------- loader ledger (async_GetLoaderLedger.php fragment) ----------
   The fragment is injected by both LoaderMgmt.php and Status.php, so its
   styling lives here rather than in either page. */
.ebx-lbal {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--ebx-radius);
  border: 1px solid var(--ebx-line); margin-bottom: 10px;
  font-size: 15px;
}
.ebx-lbal__k { font-weight: 600; }
.ebx-lbal__v { font-size: 20px; font-weight: 700; margin-left: auto; }
.ebx-lbal--adv { background: #e8f2ff; border-color: #b8d4f5; color: #10457f; }
.ebx-lbal--due { background: #fdecea; border-color: #f5c2bd; color: #8c1d13; }
.ebx-lbal--nil { background: #eef7ee; border-color: #c6e3c6; color: #1e5b25; }

.ebx-lsum {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ebx-muted); margin-bottom: 10px;
}

#tk.w3-table thead th {
  font-size: 12px; letter-spacing: .3px; padding: 8px 10px; white-space: nowrap;
}
#tk.w3-table td { padding: 8px 10px; font-size: 12.5px; }
#tk .ebx-num { text-align: right; white-space: nowrap; }
