/* styles.css - the page's own stylesheet, moved out whole. */

  /* ==========================================================
     Emergency Health Services — Fleet Management System
     Visual layer: "the register"
     Grounded in the bound vehicle register it replaces —
     ledger paper, a ruled margin, printed statutory hands,
     red ink for a lapsed entry. Machine data is set in mono
     with tabular figures; a coloured spine on the left of a
     row carries the record's statutory state, never decoration.
     ========================================================== */
  /* Every panel the browser draws for this page - the saved-info list over a
     field, date pickers, a select's dropdown - follows the page's colour
     scheme. Declared light here as well as in the head, so the stylesheet
     carries it wherever it is loaded. */
  :root{
    color-scheme:light;
    /* ink and paper */
    --ink:#16202B;
    --muted:#5A6472;
    --paper:#F1F3F2;
    --panel:#FFFFFF;
    --ledger:#F2E9EA;
    --line:#D8C8CB;
    --line-soft:#EFE4E6;

    /* The interface has its own colour, cool and quiet, so the logo is the
       one warm thing on the page and is never mistaken for chrome. */
    --navy:#5C1F2A;
    --navy-mid:#7E2C3A;
    --navy-dk:#2E0F15;
    --seal:#7A5220;

    /* state */
    --saffron:#9E2F45;
    --forest:#0E5F38;
    --lapse:#B4232A;
    --caution:#8A5A08;

    /* state grounds */
    --amber-bg:#FBF2DE;
    --green-bg:#E4F0E9;
    --red-bg:#F8E7E5;
    --blue-bg:#F6E8EA;

    /* legacy aliases kept so older rules keep resolving */
    --green:#0E5F38;
    --alert:#B4232A;

    --mono:'IBM Plex Mono','Cascadia Mono',Consolas,monospace;
    --serif:'Noto Serif',Georgia,serif;
    --sans:'Noto Sans','Segoe UI',sans-serif;

    /* type scale */
    --fs:15px;
    --t-micro:11.5px;
    --t-label:12.5px;
    --t-sm:13.5px;
    --t-head:17.5px;
    --t-page:21px;
    --t-stat:27px;
    --t-stat-sm:21px;

    /* spacing rhythm: 4 / 8 / 12 / 20 / 32 */
    --s1:4px; --s2:8px; --s3:12px; --s4:20px; --s5:32px;
    --radius:8px;
    --radius-lg:14px;
    --radius-pill:999px;
    --gutter:26px;
    /* The gap either side of a table cell's contents. Every column on every
       register reads it, so the spacing is one format and is changed in one
       place. It was written into each rule separately at 14px 12px, which
       set the columns further apart than they need to be. */
    --cell-y:10px;
    --cell-x:8px;
    /* The menu column: how wide it stands, how far its names are set in,
       and the gutter its scrollbar keeps at the right. The modules are drawn
       to the near edge of that gutter, so the logo is drawn to it too. */
    --navw:254px;
    --navpad:12px;
    --navsb:16px;
    --navcol:calc(var(--navw) - var(--navsb) - var(--navpad));
    --measure:1420px;
  }

  /* ---------- the colours the application can be drawn in ----------
     Four variables carry the application's colour: --navy paints nearly
     every coloured surface, --navy-mid answers a hover, --navy-dk is its
     deepest shade and --saffron is the accent against it. Retoning those
     four retones the application. A tone the list does not hold falls
     through and the default colours stand. */
  body.theme-colour[data-tone="teal"]{
    --navy:#0E5F63; --navy-mid:#147A80; --navy-dk:#083C3F; --saffron:#C2571E;
  }
  body.theme-colour[data-tone="blue"]{
    --navy:#1B4F8A; --navy-mid:#2563A8; --navy-dk:#102F52; --saffron:#D97706;
  }
  body.theme-colour[data-tone="green"],
  body.theme-colour[data-tone="forest"]{
    --navy:#0E5F38; --navy-mid:#147A48; --navy-dk:#073A22; --saffron:#B45309;
  }
  body.theme-colour[data-tone="amber"],
  body.theme-colour[data-tone="saffron"]{
    --navy:#8A5A0E; --navy-mid:#B07A0E; --navy-dk:#593A08; --saffron:#9A3412;
  }
  body.theme-colour[data-tone="violet"],
  body.theme-colour[data-tone="purple"]{
    --navy:#4A2E7A; --navy-mid:#6B3FA0; --navy-dk:#2C1B4A; --saffron:#BE185D;
  }
  body.theme-colour[data-tone="maroon"],
  body.theme-colour[data-tone="red"]{
    --navy:#5C1F2A; --navy-mid:#7E2C3A; --navy-dk:#2E0F15; --saffron:#A16207;
  }

  /* ---------- the same tones, on the ground and on the sign-in screen ----------

     Retoning the four above paints every coloured surface the application
     draws. Two things stood outside it and went on being drawn in the
     application's own colours whatever was chosen: the paper the pages sit
     on, and the sign-in screen, whose palette is scoped to `.gate` and so is
     not reached by anything set on the body.

     Both are answered here. The colour is kept where the theme is kept - it
     outlives the session, so the sign-in screen is already drawn in the
     chosen tone before anybody has signed in. Default names none of this and
     the stylesheet stands as written. */

  body.theme-colour[data-tone="teal"]{
    --paper:#EDF3F3;
      /* The bands and rules the pages are ruled with follow the ground they
       sit on: a rose-grey panel head over a teal page is the one surface left
       saying what the colour used to be. */
    --ledger:#E4EFEF;
    --line:#C3D8D8;
    --line-soft:#E4EFEF;
}
  body.theme-colour[data-tone="teal"] .gate{
    --fms-ask:#EDF5F5;
    --fms-back:#062227;
    --fms-right-1:#10666B;
    --fms-right-2:#0B4E52;
    --fms-right-3:#083C3F;
    --fms-glow:20,122,128;
      /* The button, the focus ring and the required mark follow the tone too -
       a magenta call to action on a teal ground reads as another brand's
       screen rather than this one's. */
    --fms-purple:#0E5F63;
    --fms-violet:#0E5F63;
    --fms-magenta:#147A80;
    --fms-pink:#147A80;
    --fms-orange:#1FA3AA;
}

  body.theme-colour[data-tone="blue"]{
    --paper:#EEF2F8;
      /* The bands and rules the pages are ruled with follow the ground they
       sit on: a rose-grey panel head over a blue page is the one surface left
       saying what the colour used to be. */
    --ledger:#E6EDF6;
    --line:#C6D5E7;
    --line-soft:#E6EDF6;
}
  body.theme-colour[data-tone="blue"] .gate{
    --fms-ask:#EEF3FA;
    --fms-back:#081A31;
    --fms-right-1:#1E5493;
    --fms-right-2:#163F70;
    --fms-right-3:#102F52;
    --fms-glow:37,99,168;
      /* The button, the focus ring and the required mark follow the tone too -
       a magenta call to action on a blue ground reads as another brand's
       screen rather than this one's. */
    --fms-purple:#1B4F8A;
    --fms-violet:#1B4F8A;
    --fms-magenta:#2563A8;
    --fms-pink:#2563A8;
    --fms-orange:#3B82D6;
}

  body.theme-colour[data-tone="green"],
  body.theme-colour[data-tone="forest"]{
    --paper:#EDF4EF;
      /* The bands and rules the pages are ruled with follow the ground they
       sit on: a rose-grey panel head over a green page is the one surface left
       saying what the colour used to be. */
    --ledger:#E4EFE8;
    --line:#C4DACB;
    --line-soft:#E4EFE8;
}
  body.theme-colour[data-tone="green"] .gate,
  body.theme-colour[data-tone="green"] .gate,
  body.theme-colour[data-tone="forest"] .gate{
    --fms-ask:#EDF5F0;
    --fms-back:#052718;
    --fms-right-1:#10663C;
    --fms-right-2:#0B4E2D;
    --fms-right-3:#073A22;
    --fms-glow:20,122,72;
      /* The button, the focus ring and the required mark follow the tone too -
       a magenta call to action on a green ground reads as another brand's
       screen rather than this one's. */
    --fms-purple:#0E5F38;
    --fms-violet:#0E5F38;
    --fms-magenta:#147A48;
    --fms-pink:#147A48;
    --fms-orange:#0E7A47;
}

  body.theme-colour[data-tone="amber"],
  body.theme-colour[data-tone="saffron"]{
    --paper:#F6F2E9;
      /* The bands and rules the pages are ruled with follow the ground they
       sit on: a rose-grey panel head over a amber page is the one surface left
       saying what the colour used to be. */
    --ledger:#F4EDDF;
    --line:#DFD0B2;
    --line-soft:#F4EDDF;
}
  body.theme-colour[data-tone="amber"] .gate,
  body.theme-colour[data-tone="amber"] .gate,
  body.theme-colour[data-tone="saffron"] .gate{
    --fms-ask:#F8F3E9;
    --fms-back:#2A1B04;
    --fms-right-1:#8A5A0E;
    --fms-right-2:#6E4709;
    --fms-right-3:#593A08;
    --fms-glow:176,122,14;
      /* The button, the focus ring and the required mark follow the tone too -
       a magenta call to action on a amber ground reads as another brand's
       screen rather than this one's. */
    --fms-purple:#8A5A0E;
    --fms-violet:#8A5A0E;
    --fms-magenta:#B07A0E;
    --fms-pink:#B07A0E;
    --fms-orange:#D9A227;
}

  body.theme-colour[data-tone="violet"],
  body.theme-colour[data-tone="purple"]{
    --paper:#F2EFF7;
      /* The bands and rules the pages are ruled with follow the ground they
       sit on: a rose-grey panel head over a violet page is the one surface left
       saying what the colour used to be. */
    --ledger:#EDE8F5;
    --line:#D2C6E6;
    --line-soft:#EDE8F5;
}
  body.theme-colour[data-tone="violet"] .gate,
  body.theme-colour[data-tone="violet"] .gate,
  body.theme-colour[data-tone="purple"] .gate{
    --fms-ask:#F2EFF8;
    --fms-back:#1A0F2E;
    --fms-right-1:#4F3182;
    --fms-right-2:#3C2563;
    --fms-right-3:#2C1B4A;
    --fms-glow:107,63,160;
      /* The button, the focus ring and the required mark follow the tone too -
       a magenta call to action on a violet ground reads as another brand's
       screen rather than this one's. */
    --fms-purple:#4A2E7A;
    --fms-violet:#4A2E7A;
    --fms-magenta:#6B3FA0;
    --fms-pink:#6B3FA0;
    --fms-orange:#8F5CD1;
}

  body.theme-colour[data-tone="maroon"],
  body.theme-colour[data-tone="red"]{
    --paper:#F5EEEF;
      /* The bands and rules the pages are ruled with follow the ground they
       sit on: a rose-grey panel head over a maroon page is the one surface left
       saying what the colour used to be. */
    --ledger:#F1E5E7;
    --line:#DCC3C7;
    --line-soft:#F1E5E7;
}
  body.theme-colour[data-tone="maroon"] .gate,
  body.theme-colour[data-tone="maroon"] .gate,
  body.theme-colour[data-tone="red"] .gate{
    --fms-ask:#F8EFF1;
    --fms-back:#250B10;
    --fms-right-1:#61212D;
    --fms-right-2:#471820;
    --fms-right-3:#2E0F15;
    --fms-glow:126,44,58;
      /* The button, the focus ring and the required mark follow the tone too -
       a magenta call to action on a maroon ground reads as another brand's
       screen rather than this one's. */
    --fms-purple:#5C1F2A;
    --fms-violet:#5C1F2A;
    --fms-magenta:#7E2C3A;
    --fms-pink:#7E2C3A;
    --fms-orange:#A63A4E;
}

  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  /* The page behind a dialog kept its own scrollbars, so a popup opened over a
     register that scrolls sideways showed that register's bar beneath it. The
     page is held still while anything is open over it, and the scrollbar
     gutter is kept either way so the page does not shift as a dialog opens.
     A wide register scrolls inside its own panel, so the page itself is never
     wider than the window. Clipping the body was tried and taken out again:
     it makes the body a scroll container, which stops the menu sticking. */
  html{scrollbar-gutter:stable;}
  html.modal-open{overflow:hidden;}
  /* The page is a column: the masthead, the shell that holds the menu and the
     screen, and the footer under them. The shell takes whatever height is left,
     so on a short page - a dashboard, a register with four rows - the footer is
     pushed to the bottom of the window instead of standing halfway up it with
     empty paper below. On a long page it stays where it always was, under the
     end of the content, and scrolls with it. */
  body{
    background:var(--paper);
    color:var(--ink);
    font-family:var(--sans);
    font-size:var(--fs);
    line-height:1.55;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
    display:flex;flex-direction:column;min-height:100vh;
  }
  /* what gives way, and what does not: the shell takes the slack, the masthead
     and the footer keep their own height and are never squeezed */
  .masthead{flex:none;}
  .shell{flex:1 0 auto;}
  footer{flex:none;}
  h1,h2,h3,h4,legend{font-family:var(--serif);margin:0;font-weight:700;letter-spacing:-.004em;}
  .te{font-family:'Noto Sans Telugu',var(--sans);}
  a{color:var(--navy);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;}
  a:hover{color:var(--saffron);}
  button{font-family:inherit;font-size:inherit;cursor:pointer;}
  :focus-visible{outline:3px solid var(--saffron);outline-offset:2px;}
  .skip{position:absolute;left:-9999px;top:0;background:#fff;padding:10px 16px;z-index:200;font-weight:600;}
  .skip:focus{left:8px;top:8px;}
  /* Words kept for a screen reader and not drawn: a control marked with a sign
     still has to say what it is. */
  .sr-only{
    position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
    clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;
  }

  /* machine data — registration marks, IMEI, dates, counts */
  .mono,.num,.vno,.summary dd,.kv td{
    font-family:var(--mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;
  }

  /* ---------- the masthead pickers ----------
     One field apiece: the name of the field and what it is set to, inside the
     one box - drawn exactly as Notifications and the account are. The label
     stood outside a boxed select before, so Project and Theme each read as two
     things on the bar while the two beside them read as one. */
  /* The field is marked with a sign, not named in words: the bar carries four
     controls and two of them spelling their own names out crowded it. The word
     is still in the label for a screen reader and on the hover. */
  .mastpick label{display:inline-flex;align-items:center;color:var(--muted);cursor:pointer;}
  .mastpick .pick-mark{display:inline-flex;}
  .mastpick .pick-mark svg{display:block;}
  /* The select is what the field is set to, not a second field inside it. */
  .masttools .mastpick select{
    max-width:190px;cursor:pointer;border:0;background:none;border-radius:0;
    padding:0;min-height:0;color:var(--navy);font-family:var(--sans);
    font-size:var(--t-label);font-weight:600;
  }

  /* ---------- masthead ---------- */
  /* One bar: the logo, the menu, and who is signed in. */
  .masthead{
    background:var(--panel);padding:10px var(--gutter) 0 var(--navpad);
    display:flex;align-items:center;gap:var(--s4);flex-wrap:wrap;
    border-bottom:1px solid var(--line);position:relative;
  }
  .masthead::after{
    content:"";position:absolute;left:var(--navw);top:0;bottom:-1px;
    width:1px;background:var(--line);
  }
  /* Drawn in, the menu is too narrow to stand a logo against, so the rule is
     not carried up: a line that stopped short of the logo would read worse
     than no line at all. It is dropped for the same reason once the menu
     gives up the left and lies across the top. */
  body.nav-mini .masthead::after{display:none;}
  @media (max-width:900px){ .masthead::after{display:none;} }
  .masthead .emblem,.masthead .mast-meta{margin-bottom:10px;}
  /* The logo is set by the width of the menu column and keeps its own
     proportions, so it stands square with the module names under it. */
  .emblem{
    width:var(--navcol);height:auto;max-width:100%;flex:none;
    object-fit:contain;display:block;
  }
  @media (max-width:720px){ .emblem{width:190px;} }
  /* the masthead controls stand at the right: the theme, what is waiting,
     and who is signed in */
  /* The greeting stands in the space between the logo and the four controls,
     which the masthead had left empty. `margin-left:auto` on .mast-meta still
     pushes the controls to the right-hand edge, so nothing else moves. It is
     given away first on a narrow screen, where the controls matter more. */
  /* The greeting travels across the space the masthead leaves between the logo
     and its four controls. It takes that space and no more - `min-width:0` is
     what lets a flex item be narrower than its own text, which is what makes
     the overflow, and so the travelling, possible at all. */
  /* The greeting is given the left half of the masthead and no more; the four
     controls keep the right half. `min-width:0` is what lets a flex item be
     narrower than its own text, which is what makes the overflow - and so the
     travelling - possible at all. */
  .mast-greet{
    /* `flex-basis:50%` put the controls on a second line: a wrapping flex row
       lays items out by their base size and wraps the last one rather than
       shrinking it, and the logo plus half the masthead plus the four controls
       came to more than the row. The base is nothing now and the line grows
       into whatever the logo and the controls leave, capped at half, so all of
       it stands on one row with the controls in the other half. */
    flex:1 1 0;max-width:50%;min-width:0;overflow:hidden;margin-bottom:10px;
    -webkit-mask-image:linear-gradient(to right,transparent,#000 20px,#000 calc(100% - 20px),transparent);
    mask-image:linear-gradient(to right,transparent,#000 20px,#000 calc(100% - 20px),transparent);
  }
  /* One copy, crossing from the right edge to the left and coming round again.
     `left` is read against the half it travels in and `translateX` against the
     line's own width, so it starts fully clear of the right edge and ends fully
     clear of the left whatever the name and post happen to be - no width is
     measured or written into the page. Position is relative, so the line still
     takes its normal space and the masthead keeps its height. */
  .mast-greet .greet-track{
    position:relative;display:inline-flex;align-items:baseline;white-space:nowrap;
    will-change:left,transform;animation:greet-travel 26s linear infinite;
  }
  @keyframes greet-travel{
    from{left:100%;transform:translateX(0);}
    to{left:0;transform:translateX(-100%);}
  }
  /* Held still to be read: pointing at it stops it, and a reader who has asked
     the system for less motion is never given any. */
  .mast-greet:hover .greet-track,
  .mast-greet:focus-within .greet-track{animation-play-state:paused;}
  @media (prefers-reduced-motion:reduce){
    .mast-greet .greet-track{animation:none;}
  }
  /* Set in the theme's own colour, like the page heading under it: `--navy` is
     the one variable the theme picker rewrites, so the greeting follows Teal,
     Blue, Green, Amber, Violet or Maroon without a rule of its own for each.
     The greeting reads at heading size; what follows it - the post, the level,
     the time - sits a size below in the theme's lighter tone, so the name is
     what the eye takes first. */
  /* A profile read rather than filled in: the same two-column detail rows the
     card above uses, and a line saying who keeps them. */
  .pf-detail-read{margin-top:2px;}
  .pf-note{margin:10px 0 0;font-size:var(--t-label);color:var(--muted);}

  .mast-greet .greet-hello{
    font-family:var(--sans);font-size:var(--t-head);font-weight:700;
    color:var(--navy);line-height:1.3;white-space:nowrap;letter-spacing:-.01em;
  }
  .mast-greet .greet-post{
    font-size:var(--t-sm);color:var(--navy-mid);line-height:1.3;white-space:nowrap;
  }
  .mast-greet .greet-dot{
    margin:0 7px;opacity:.5;color:var(--navy-mid);flex:none;
  }
  @media (max-width:900px){ .mast-greet{display:none;} }

  .mast-meta{margin-left:auto;text-align:right;font-size:var(--t-label);color:var(--muted);line-height:1.75;}
  .masttools{display:flex;align-items:center;gap:var(--s2);}
  .drop{position:relative;}
  /* The four controls on the masthead - Project, Theme, Notifications and the
     account - are one field drawn by one rule, so they cannot drift apart. The
     box belongs to the whole control, which is what puts Project's and Theme's
     labels inside it beside what they are set to. */
  .masttools .tool,.masttools .who,.masttools .mastpick{
    display:inline-flex;align-items:center;gap:8px;min-height:38px;
    background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
    padding:5px 11px;color:var(--navy);font-family:var(--sans);
    font-size:var(--t-label);font-weight:500;white-space:nowrap;
  }
  .masttools .tool:hover,.masttools .who:hover,
  .masttools .mastpick:hover{background:var(--blue-bg);border-color:var(--navy);}
  /* The field takes the ring, so it is drawn round the whole control rather
     than round a select sitting inside it. */
  .masttools .mastpick:focus-within{outline:2px solid var(--navy);outline-offset:1px;}
  .tool svg{flex:none;}
  .tool .car,.who-car{font-size:9px;color:var(--muted);}
  .tool .tally{
    font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:11px;font-weight:700;
    background:var(--lapse);color:#fff;border-radius:var(--radius-pill);padding:0 6px;line-height:16px;
  }
  .tool .tally.none{background:var(--line);color:var(--muted);}
  .dropmenu{
    position:absolute;top:calc(100% + 6px);right:0;z-index:90;display:none;
    min-width:246px;text-align:left;background:var(--panel);
    border:1px solid var(--line);border-radius:var(--radius);
    box-shadow:0 16px 34px rgba(11,42,47,.22);padding:var(--s1) 0;
  }
  .dropmenu.wide{min-width:340px;max-width:92vw;}
  /* what is waiting scrolls; the heading and the two actions do not */
  .droplist{
    max-height:min(46vh, 340px);overflow-y:auto;overscroll-behavior:contain;
    scrollbar-width:thin;
  }
  .droplist::-webkit-scrollbar{width:9px;}
  .droplist::-webkit-scrollbar-thumb{
    background:#C9CBD0;border-radius:5px;border:2px solid var(--panel);
  }
  .droplist::-webkit-scrollbar-track{background:var(--ledger);}
  .drop.open .dropmenu{display:block;}
  .dropmenu .grp{
    font-size:var(--t-micro);font-weight:600;color:var(--muted);
    text-transform:uppercase;letter-spacing:.08em;padding:9px 14px 5px;
  }
  .dropmenu button{
    display:flex;align-items:center;gap:10px;width:100%;text-align:left;
    background:none;border:none;padding:8px 14px;font-size:var(--t-label);
    color:var(--ink);line-height:1.4;border-left:3px solid transparent;
  }
  .dropmenu button:hover{background:var(--blue-bg);border-left-color:var(--navy);}
  .dropmenu button.on{border-left-color:var(--navy);color:var(--navy);font-weight:600;}
  .dropmenu .swatch{
    width:16px;height:16px;border-radius:5px;flex:none;border:1px solid rgba(0,0,0,.12);
  }
  .dropmenu .alert-t{display:block;font-weight:600;color:var(--ink);}
  .dropmenu .alert-s{display:block;font-size:var(--t-micro);color:var(--muted);margin-top:1px;}
  .dropmenu .alert-n{
    margin-left:auto;font-family:var(--mono);font-variant-numeric:tabular-nums;
    font-weight:700;font-size:12px;color:var(--navy);
  }
  .dropmenu .alert-n.warn{color:var(--lapse);}
  .dropmenu .empty-line{padding:12px 14px;font-size:var(--t-label);color:var(--muted);}
  .dropmenu .foot{
    display:flex;gap:8px;padding:10px 14px;margin-top:var(--s1);
    border-top:1px solid var(--line-soft);
  }
  .dropmenu .foot .btn{flex:1 1 0;justify-content:center;}
  /* a notification that has been read stands back from the ones that have not */
  .dropmenu button.read .alert-t{font-weight:500;color:var(--muted);}
  .dropmenu button.read .alert-n{color:var(--muted);}
  .mast-meta b{color:var(--ink);font-weight:600;font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:12px;}
  /* the account control: who is signed in, and what they can do about it */
  .account{position:relative;display:inline-block;text-align:left;}
  /* .btn sets its own display, which would otherwise beat the hidden
     attribute and leave both the badge and Sign in on screen at once */
  .account [hidden]{display:none !important;}
  .drop.open .tool,.account.open .who{background:var(--blue-bg);border-color:var(--navy);}
  /* the name sits on the line the tool's own label sits on, and the role
     under it, without carrying the box any taller than the tool beside it */
  .who-text{display:flex;flex-direction:column;line-height:1.12;text-align:left;}
  .who-name{font-size:var(--t-label);font-weight:600;color:var(--navy);}
  .who-role{font-size:11px;font-weight:400;color:var(--muted);}
  .usermenu{
    position:absolute;top:calc(100% + 4px);right:0;min-width:200px;z-index:80;
    background:var(--panel);border:1px solid var(--navy);border-top:3px solid var(--saffron);
    box-shadow:0 14px 30px rgba(11,42,47,.22);padding:var(--s1) 0;display:none;
  }
  .account.open .usermenu{display:block;}
  .usermenu button{
    display:block;width:100%;text-align:left;background:none;border:none;
    padding:8px 14px;font-size:var(--t-sm);color:var(--ink);
    border-left:3px solid transparent;
  }
  .usermenu button:hover{background:var(--blue-bg);border-left-color:var(--navy);}
  .usermenu button.danger{color:var(--lapse);border-top:1px solid var(--line-soft);}
  .usermenu button.danger:hover{background:var(--red-bg);border-left-color:var(--lapse);}

  /* ---------- navigation ---------- */
  /* The menu stands on the masthead now, between the logo and who is
     signed in, so it is drawn in ink on paper rather than in navy. */
  /* ---------- the menu, standing down the left ----------
     Every section carries its title, and the modules that belong to it are
     listed under it. Nothing is hidden behind a drop-down. */
  .sidebar{
    flex:none;width:var(--navw);align-self:stretch;background:var(--panel);
    border-right:1px solid var(--line);padding:var(--s4) 0 var(--s5);
    position:sticky;top:0;max-height:100vh;overflow:auto;scrollbar-gutter:stable;
  }
  .mainnav{background:none;display:block;padding:0;}
  /* the section stands over the modules that belong to it: the title set
     larger, the names under it set smaller. The title is pressed to show the
     modules, and pressed again to put them away. */
  /* A section heading is set as a filing tab: it runs out of the left edge of
     the menu, carries the section's own colour on that edge, and is rounded
     off at the open end. The modules under it are left as they were — the tab
     is what tells one group of them from the next. */
  /* A section names itself and nothing more. It carried a tinted capsule and
     a coloured bar down its left, which put a shape behind every heading in
     the menu and read as a button that could be pressed - it cannot. The name
     is left, in the section's own colour; the module names below it are what
     the eye follows. Text starts where theirs does, so the column lines up. */
  .navttl{
    display:flex;align-items:center;gap:8px;
    font-size:13.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
    color:var(--sec,var(--navy));
    margin:0 16px 8px 0;padding:6px 16px 6px 12px;
    background:none;
    transition:opacity .14s ease;
    opacity:.72;
  }
  .navttl svg{flex:none;opacity:.95;}
  /* the section being read stands out from the ones that are not - now by
     standing at full strength rather than by wearing a heavier shape */
  .navitem.current .navttl{
    opacity:1;
  }
  /* drawn in, the tab keeps its colour but gives up its name */
  .sidebar.mini .navttl{margin-right:8px;}

  /* ---------- the menu, put away ----------
     One control at the head of the menu draws it in to its marks, and draws
     it out again. Nothing is lost while it is in: every module keeps its
     place, its mark and its colour, and names itself on hover. */
  .navtoggle{
    display:flex;align-items:center;gap:9px;width:100%;
    background:none;border:none;text-align:left;font-family:var(--sans);
    font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
    color:var(--navy);padding:2px 12px 14px;
  }
  .navtoggle:hover{color:var(--navy-mid);}
  .navtoggle svg{flex:none;}
  .sidebar{transition:width .14s ease;}
  .sidebar.mini{width:64px;}
  .sidebar.mini .navtoggle{justify-content:center;padding:2px 0 14px;}
  /* the label the menu drew in put away is gone from the control altogether -
     the mark stands on its own, drawn in or out (index.html) */
  .sidebar.mini .navttl{
    justify-content:center;gap:0;padding:6px 0;
    font-size:0;letter-spacing:0;
  }
  .sidebar.mini .navttl svg{opacity:.55;}
  .sidebar.mini .navmenu button{
    justify-content:center;padding:10px 0;gap:0;
    border-left-width:0;border-radius:0;margin-right:0;
  }
  .sidebar.mini .navmenu button span{display:none;}
  .sidebar.mini .navitem{margin-bottom:var(--s2);}
  .mainnav a{
    color:var(--ink);text-decoration:none;font-size:var(--t-sm);font-weight:500;
    padding:10px 14px;
  }
  .mainnav a:hover{background:var(--blue-bg);color:var(--navy);}
  .mainnav a[aria-current="page"]{color:var(--navy);font-weight:600;background:var(--blue-bg);}
  .navitem{position:relative;margin-bottom:var(--s3);}
  .navitem:last-child{margin-bottom:0;}
  .navbtn{
    background:none;border:none;color:var(--ink);font-size:var(--t-sm);font-weight:500;
    padding:10px 14px;display:inline-flex;gap:7px;align-items:center;
    border-radius:var(--radius);
  }
  .navbtn .car{font-size:9px;color:var(--muted);}
  .navbtn svg{flex:none;opacity:.9;}
  .navbtn:hover{background:var(--blue-bg);color:var(--navy);}
  .navitem.open .navbtn{background:var(--blue-bg);color:var(--navy);}
  .navitem.current .navbtn{color:var(--navy);font-weight:600;background:var(--blue-bg);}
  .navmenu{
    position:static;min-width:0;max-width:none;
    background:none;border:none;box-shadow:none;padding:0;display:block;
  }
  .navmenu .grp{
    font-size:12px;font-weight:600;color:var(--muted);padding:9px 16px var(--s1);
    border-top:1px solid var(--line-soft);
  }
  .navmenu .grp:first-child{border-top:none;}
  .navmenu button{
    display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:none;
    padding:7px 12px 7px 9px;font-size:12.5px;color:var(--ink);line-height:1.35;
    border-left:3px solid transparent;
  }
  .navmenu button svg{flex:none;color:var(--navy-mid);opacity:.9;}
  .navmenu button:hover svg,.navmenu button.on svg{color:var(--navy);opacity:1;}
  .navmenu button:hover{background:var(--blue-bg);border-left-color:var(--navy);}
  /* the page that is open is filled with the theme's own colour, so the
     selection is read before anything else on the menu */
  .navmenu button.on{
    background:var(--navy);border-left-color:var(--navy-dk);
    color:#FFFFFF;font-weight:600;
    border-radius:0 var(--radius-pill) var(--radius-pill) 0;
    margin-right:12px;
  }
  .navmenu button.on:hover{background:var(--navy-mid);border-left-color:var(--navy-dk);}
  .navmenu button.on svg,.navmenu button.on:hover svg{color:#FFFFFF;opacity:1;}
  .navmenu button .mdesc{display:block;font-size:var(--t-micro);color:var(--muted);margin-top:1px;}
  .navmenu button .tally{
    margin-left:auto;color:var(--navy);font-weight:600;font-size:12px;
    font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  .navmenu button .tally.warn{color:var(--lapse);}



  /* ---------- layout ---------- */
  /* The menu is flush to the left edge of the window; the page it opens takes
     the rest and keeps its own measure. */
  .shell{display:flex;align-items:flex-start;max-width:none;margin:0;}
  main{flex:1 1 auto;min-width:0;max-width:var(--measure);margin:0 auto;padding:var(--s4) var(--gutter) var(--s5);}
  @media (max-width:1240px){
    .summary,.summary.fill,.pmgrid{grid-template-columns:repeat(3,minmax(0,1fr));}
    .filterbox .filters{flex-wrap:wrap;}
    .filterbox .filters > .fld{flex:1 1 168px;}
    .filterbox .filter-actions{flex:1 1 100%;margin-top:var(--s2);justify-content:flex-end;}
  }
  @media (max-width:820px){
    .summary,.summary.fill,.pmgrid{grid-template-columns:repeat(2,minmax(0,1fr));}
    .filterbox .filters > .fld{flex:1 1 132px;}
    .filterbox .filter-actions{flex:1 1 100%;margin-top:var(--s2);flex-wrap:wrap;}
    .twocol{grid-template-columns:1fr;}
  }
  @media (max-width:900px){
    .shell{display:block;}
    .sidebar{
      width:auto;position:static;max-height:none;
      border-right:none;border-bottom:1px solid var(--line);padding:var(--s3) 0;
    }
  }
  .page-head{
    display:flex;justify-content:space-between;align-items:flex-end;gap:var(--s4);
    flex-wrap:wrap;margin-bottom:var(--s4);
    padding-bottom:var(--s3);border-bottom:2px solid var(--navy);
  }
  .page-head h2{font-size:var(--t-page);color:var(--navy);line-height:1.2;}
  .toolbar{display:flex;gap:var(--s2);flex-wrap:wrap;}
  /* An element given `hidden` must go, whatever it is.

     `hidden` is the browser's own `display:none`, and any rule in this file
     that sets a display beats it - so `.toolbar{display:flex}` kept the bar
     over the register on screen after the page had hidden it, and three
     buttons a post may not use stood there all the same. The same trap had
     already been patched one panel at a time (.account, .tk-form, .de-form);
     this settles it for the whole page, so hiding a thing hides it. */
  [hidden]{display:none !important;}
  /* a register's own actions sit at the right-hand end of its bar */
  .toolbar.right{justify-content:flex-end;}

  .sec-head{margin-bottom:var(--s4);padding-bottom:var(--s3);border-bottom:2px solid var(--navy);}
  /* a module's actions stand on the heading line, over the same rule */
  .sec-head.with-bar{display:flex;justify-content:space-between;align-items:flex-end;gap:var(--s4);flex-wrap:wrap;}
  .sec-head.with-bar .toolbar{margin-bottom:0 !important;}
  .sec-head h2{font-size:var(--t-page);color:var(--navy);line-height:1.2;}
  .sec-head p{margin:var(--s1) 0 0;font-size:var(--t-sm);color:var(--muted);max-width:74ch;}

  /* ---------- controls ---------- */
  /* A quiet button is the paper it stands on with a wash of the chosen tone
     through it, so Cancel and Reset are retoned with everything else rather
     than staying the one cool-grey thing on a maroon or an amber screen. */
  .btn{
    background:color-mix(in srgb, var(--navy) 4%, var(--panel));
    border:1px solid var(--line);color:var(--ink);
    padding:7px 13px;border-radius:var(--radius);font-size:13px;font-weight:500;
    display:inline-flex;align-items:center;gap:7px;
  }
  .btn:hover{
    background:color-mix(in srgb, var(--navy) 12%, var(--panel));
    border-color:color-mix(in srgb, var(--navy) 45%, var(--line));
  }
  .btn:active{background:color-mix(in srgb, var(--navy) 20%, var(--panel));}
  .btn-primary{background:var(--navy);border-color:var(--navy);color:#fff;font-weight:600;}
  .btn-primary:hover{background:var(--navy-mid);border-color:var(--navy-mid);}
  /* Save carries the tone at full strength, the same as Save Profile does */
  .btn-save{background:var(--navy);border-color:var(--navy);color:#fff;font-weight:600;}
  /* The same button as any other: the theme's own tone. What it does is in its
     label and in the question asked before it acts. */
  .btn-danger{border-color:var(--navy);color:#FFFFFF;background:var(--navy);}
  .btn-danger:hover{background:var(--navy-mid);border-color:var(--navy-mid);}
  .btn-save:hover{background:var(--navy-mid);border-color:var(--navy-mid);}
  .btn-sm{padding:3px 9px;font-size:12px;}

  /* ---------- the steps a register offers on a row ----------
     Five small buttons in the last column, kept on one line so the row does
     not grow a second one, and the state a person is already in drawn as the
     button that is pressed rather than as one more thing to click. */
  .tbl td.rowact{white-space:nowrap;}
  .rowact-btn{margin:0 4px 0 0;padding:3px 8px;font-size:11.5px;}
  .rowact-btn:last-child{margin-right:0;}
  .rowact-btn.on{
    background:var(--navy);border-color:var(--navy);color:#FFFFFF;
    cursor:default;opacity:1;
  }
  .rowact-btn.danger{color:var(--lapse);border-color:#E0BEBE;}
  .rowact-btn.danger:hover{background:var(--red-bg);border-color:var(--lapse);}
  .user-toggle{
    position:relative;width:34px;height:20px;padding:0;border:0;border-radius:12px;
    background:#D5DEE0;vertical-align:middle;cursor:pointer;
  }
  .user-toggle span{
    position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:50%;
    background:#FFFFFF;box-shadow:0 1px 2px rgba(16,24,40,.25);
    transition:left .15s ease;
  }
  .user-toggle.on{background:#16A765;}
  .user-toggle.on span{left:17px;}
  /* The project Active switch is drawn in the chosen theme, like the project chips. */
  .proj-toggle.on{background:var(--navy);}
  /* and the register's own, on each vehicle's row */
  .veh-toggle.on{background:var(--navy);}
  .veh-active{display:inline-flex;align-items:center;gap:8px;}
  .veh-active .sub{margin:0;}
  .proj-toggle[disabled]{opacity:.55;cursor:default;}
  .project-access{white-space:nowrap;}
  .project-item{display:inline-flex;flex-direction:column;align-items:center;vertical-align:top;margin-right:10px;}
  /* the designation held in that project, under its chip */
  .project-role{margin-top:3px;font-size:10px;line-height:1.1;font-weight:600;color:var(--muted);letter-spacing:.02em;}
  .proj-role-fld{margin-top:14px;}
  /* User Management: a designation per project, where the projects hold different ones */
  .proj-desig{white-space:nowrap;line-height:1.45;}
  .proj-desig-code{display:inline-block;min-width:2.6em;margin-right:4px;font-size:11px;font-weight:600;color:var(--muted);}
  /* The project chips are drawn in the chosen theme: a fixed pink read as
     another application's colour on a green or blue screen. */
  .project-pill{
    min-width:48px;padding:7px 12px;border:1px solid var(--line);border-radius:18px;
    background:var(--panel);color:var(--muted);font:600 12px/1.1 inherit;cursor:pointer;
  }
  .project-pill:hover{border-color:var(--navy);color:var(--navy);}
  .project-pill.on{background:var(--navy);border-color:var(--navy);color:#FFFFFF;}
  /* A chip on a row the post may not change is a label: it neither points nor lights up. */
  span.project-pill{cursor:default;}
  span.project-pill:not(.on):hover{border-color:var(--line);color:var(--muted);}
  /* The project chips and the row's steps stand side by side on every row, so
     they are drawn to one size - the same height and the same text - rather than
     a tall chip beside a short button. */
  .project-pill,
  .rowact-btn{
    box-sizing:border-box;height:28px;font-size:12px;line-height:1;
    display:inline-flex;align-items:center;justify-content:center;
  }
  /* The steps are kept at the right-hand edge of the register they belong to,
     because that register is wider than the window: unpinned they sat off the
     screen and the column read as missing until somebody scrolled for it.
     Scoped to the register that has them, so the last column of every other
     table is left where it is. */
  .usertbl .tbl td.rowact,
  .usertbl .tbl thead th:last-child{
    position:sticky;right:0;z-index:2;
    box-shadow:-8px 0 10px -10px rgba(16,24,40,.45);
  }
  .usertbl .tbl td.rowact{background:var(--panel);}
  .usertbl .tbl tbody tr:nth-child(even) td.rowact{background:var(--panel);}
  .usertbl .tbl thead th:last-child{background:var(--ledger);z-index:4;}

  /* ---------- the register reads like every other ----------

     It kept a window of its own - a box as tall as what was left of the
     screen, with the rows scrolling inside it and the head pinned - while
     every other register on the application runs down the page and is moved
     sideways by taking hold of it. Two ways of reading a table, one of them
     only here. It reads the way the rest do now: the page carries the rows,
     and the frame gives the sideways reach.

     The Action column stays pinned to the right, which is the one thing about
     this register that is its own - it is how a row is acted on. */
  .btn-link{background:none;border:none;color:var(--navy);text-decoration:none;padding:2px 4px;font-size:var(--t-label);}
  .btn-link:hover{color:var(--saffron);}
  .btn-link.danger{color:var(--lapse);}

  /* ---------- what is attached to a row ----------
     The picture stands in the column that carries it, at the size of a stamp,
     and opens the full set when it is clicked. A column headed ITEM PHOTO
     that reads "1 file" is a list of filenames; this is the photograph. */
  .filechips{display:inline-flex;align-items:center;gap:4px;}
  .filechip{
    width:34px;height:34px;flex:none;padding:0;overflow:hidden;cursor:pointer;
    border:1px solid var(--line);border-radius:6px;background:var(--panel);
    display:inline-flex;align-items:center;justify-content:center;
    transition:border-color .12s ease, box-shadow .12s ease;
  }
  .filechip:hover{border-color:var(--navy);box-shadow:0 0 0 2px color-mix(in srgb, var(--navy) 18%, transparent);}
  .filechip img{width:100%;height:100%;object-fit:cover;display:block;}
  .filechip.paper span{
    font-family:var(--mono);font-size:9px;font-weight:700;letter-spacing:.02em;
    color:var(--navy);
  }
  .filechip.paper{background:var(--ledger);}
  .filechip.gone span{color:var(--lapse);font-size:13px;}
  /* ---------- a line of the stock register, opened ----------
     Four short lists across the head - what the part is, whose it is, what is
     on the shelf and what it cost - and under them the two registers that
     actually move it: what has been added, and what has been sent between
     districts. */
  .stockline .stkline-cols{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:0 var(--s4);align-items:start;
  }
  .stockline .tbl.kv{width:100%;}
  .stockline .tbl.kv th{
    width:44%;text-align:left;font-weight:600;color:var(--muted);
    font-size:var(--t-label);white-space:normal;
  }
  .stockline .tbl.kv td{font-size:var(--t-sm);}
  .stockline .hist-h{margin-top:var(--s4);}
  .stockline .stkline-cols .hist-h:first-child{margin-top:var(--s2);}

  /* A register line that opens says so under the pointer. */
  .tbl tr.rowopen{cursor:pointer;}
  /* Qty Available and Qty Closing Balance open nothing, so they do not say they do. */
  .tbl tr.rowopen > td.stk-still{cursor:default;}
  .tbl tr.rowopen:hover > td{background:var(--ledger);}

  .filechip.more{
    width:auto;min-width:26px;padding:0 6px;background:var(--ledger);
    font-size:11px;font-weight:600;color:var(--navy);
  }

  /* ---------- register totals ---------- */
  .summary{
    /* the band is set to a fixed number of columns, so it reads the same
       whether the menu is out or drawn in */
    display:grid;grid-template-columns:repeat(var(--cols,6),minmax(0,1fr));gap:var(--s3);
    grid-auto-rows:1fr;
    border:none;background:none;margin:0 0 var(--s4);
  }
  /* Every card is the same three bands, each of a fixed height: the mark and
     its label, the figure, the note. A label that runs to two lines therefore
     cannot push its figure up or down — read across a band and every figure
     stands on the same line. */
  /* a band of four readings takes the whole width rather than leaving a gap
     at the end of the row */
  .summary.fill{grid-template-columns:repeat(var(--cols,4),minmax(0,1fr));}
  .summary > div:not(.go),
  .summary > div.go button{
    display:grid;grid-template-rows:32px 1fr 26px;gap:4px;
    min-height:112px;padding:10px 13px 11px;
    border-radius:var(--radius-lg);text-align:left;
  }
  /* A card carrying two figures needs the room the wrapped labels take. The
     row is still one height across the band, so the figures line up. */
  .summary > div:has(.kmpl-split):not(.go),
  .summary > div.go:has(.kmpl-split) button{min-height:140px;}
  /* every card is curved, whether it opens something or not: the border sits
     on the card itself, so the corner has to be set there too */
  .summary > div{
    border:1px solid var(--line);background:var(--panel);
    border-radius:var(--radius-lg);overflow:hidden;
  }
  /* a card that opens something reads as one surface, not a box with a button in it */
  .summary > div.go{padding:0;display:block;}
  .summary > div.go button{
    width:100%;height:100%;background:none;border:none;font:inherit;color:inherit;
  }
  .summary > div.go:hover{border-color:var(--navy);box-shadow:0 2px 10px rgba(11,42,47,.12);}
  /* the card the list is being read through, said the same way a drill-down
     count says it */
  .summary > div.go.on{
    border-color:var(--navy);border-width:2px;
    background:color-mix(in srgb, var(--navy) 6%, var(--panel));
  }
  .summary > div.go.on dt{color:var(--navy);}
  .summary > div.go button:hover dt{color:var(--navy);}
  .summary dt{
    font-size:var(--t-label);color:var(--muted);margin:0;line-height:1.3;
    min-width:0;overflow-wrap:anywhere;
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;
    overflow:hidden;
  }
  .summary dd{
    margin:0;align-self:center;font-size:var(--t-stat-sm);font-weight:600;line-height:1.05;
    letter-spacing:-.02em;color:var(--navy);
  }
  /* a figure is not coloured by what it says; every one is set the same */
  .summary .note{
    margin:0;align-self:end;font-size:var(--t-micro);color:var(--muted);line-height:1.35;
    min-width:0;overflow-wrap:anywhere;
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;
    overflow:hidden;
  }
  /* Each card carries its own mark and its own tone, so a reading is known by
     its colour before it is read. */
  .summary .head{display:flex;align-items:center;gap:var(--s2);height:100%;overflow:hidden;min-width:0;}
  .summary .mark{
    display:inline-flex;align-items:center;justify-content:center;
    width:24px;height:24px;border-radius:var(--radius);flex:none;
  }
  .summary > div{border-top:3px solid var(--line);}
  /* teal, slate, blue and cyan are not states: they are the interface's own
     colour, so they follow whichever theme is chosen */
  .summary .t-teal .mark{background:var(--blue-bg);color:var(--navy);}
  .summary > .t-teal{border-top-color:var(--navy);}
  .summary .t-slate .mark{background:var(--blue-bg);color:var(--navy-mid);}
  .summary > .t-slate{border-top-color:var(--navy-mid);}
  .summary .t-green .mark{background:var(--green-bg);color:var(--forest);}
  .summary > .t-green{border-top-color:var(--forest);}
  .summary .t-amber .mark{background:var(--amber-bg);color:var(--caution);}
  .summary > .t-amber{border-top-color:var(--caution);}
  .summary .t-red .mark{background:var(--red-bg);color:var(--lapse);}
  .summary > .t-red{border-top-color:var(--lapse);}
  .summary .t-gold .mark{background:#F4EEDD;color:#7A6320;}
  .summary > .t-gold{border-top-color:#7A6320;}
  .summary .t-violet .mark{background:#F3EFFC;color:#7C3AED;}
  .summary > .t-violet{border-top-color:#7C3AED;}
  .summary .t-blue .mark{background:var(--blue-bg);color:var(--navy);}
  .summary > .t-blue{border-top-color:var(--navy);}
  .summary .t-cyan .mark{background:var(--blue-bg);color:var(--navy-mid);}
  .summary > .t-cyan{border-top-color:var(--navy-mid);}

  /* ---------- filter panel ---------- */
  fieldset{
    border:1px solid var(--line);background:var(--panel);
    padding:var(--s3) 16px 16px;margin:0 0 var(--s4);border-radius:var(--radius);
  }
  legend{font-size:14px;color:var(--navy);padding:0 8px;}
  .filters{display:grid;grid-template-columns:repeat(5,1fr);gap:var(--s3) 14px;}
  /* The search and filter row is set smaller than a form, so nine fields and
     the register's own buttons stand on one line. */
  /* one straight line: the fields share what is left and the buttons sit at
     the end of it, so the row reads the same whether the menu is out or in */
  .filterbox .filters{
    display:flex;flex-wrap:nowrap;align-items:flex-end;gap:10px;
  }
  .filterbox .filters > .fld{flex:1 1 0;min-width:0;}
  .filterbox .filters > .fld input,.filterbox .filters > .fld select{min-width:0;}
  .filterbox .filter-actions{flex:none;margin-top:0;flex-wrap:nowrap;}
  .filterbox .fld label{font-size:11.5px;margin-bottom:2px;}
  /* One straight line, whatever a field is called.
     A label long enough to wrap - "Movement measure" - took two lines and
     pushed its own box a line lower than the rest, so the row read as a set of
     steps with a gap above them. Labels keep to one line and are cut with an
     ellipsis where they do not fit; the full name is on the box itself for
     anyone who hovers it, and every box then stands on the same rule. */
  .filterbox .filters > .fld{
    display:flex;flex-direction:column;justify-content:flex-end;
  }
  .filterbox .filters > .fld label{
    display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    line-height:1.35;min-height:1.35em;
  }
  /* and what a box holds is cut the same way rather than running under its
     own edge */
  .filterbox .filters > .fld input,
  .filterbox .filters > .fld select{
    text-overflow:ellipsis;
  }
  /* Every control on the row is cut to one size: the boxes, Clear, and the
     register's own buttons all stand the same height and read the same. */
  .filterbox .fld input,
  .filterbox .fld select,
  .filterbox .filter-actions .btn{
    height:30px;padding:0 9px;font-size:12.5px;line-height:1;
    border:1px solid var(--line);border-radius:var(--radius);
    font-family:inherit;box-sizing:border-box;
  }
  .filterbox .filter-actions .btn{
    display:inline-flex;align-items:center;justify-content:center;
    min-width:104px;font-weight:500;
  }
  /* The two that open something read as one pair: same fill, same weight.
     Clear keeps the plain outline, since it undoes rather than opens. */
  .filterbox .filter-actions .toolbar .btn{
    background:var(--navy);border-color:var(--navy);color:#fff;font-weight:600;
  }
  .filterbox .filter-actions .toolbar .btn:hover{
    background:var(--navy-mid);border-color:var(--navy-mid);
  }
  /* One line: the fields, then Clear, then the register's own buttons at the
     far end of it. The fields give way as the row narrows. */
  .filterbox .filters{
    display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--s2) 10px;
  }
  .filterbox .fld{flex:1 1 132px;min-width:0;}
  .filterbox .filter-actions{
    display:flex;align-items:flex-end;gap:var(--s2);margin-top:0;flex:1 1 auto;
  }
  /* ---------- the registry's own filter row ----------
     The row stood on one line but stopped short of the page: each field was
     held to its 132px measure and what was left over went to the end of the
     bar, so the line ran out with a hand's width of white after Reset. Above
     the width the row wraps at, the fields share the whole line between them
     and the two buttons sit hard against the right edge - the bar covers the
     page. Below that width nothing here applies and the row wraps as before. */
  @media (min-width:1241px){
    .filterbox.reg-filters .filters{flex-wrap:nowrap;}
    .filterbox.reg-filters .filters > .fld{flex:1 1 0;min-width:0;}
    /* a label too long for its share is cut rather than wrapped, so no one
       field makes the whole bar two lines tall */
    .filterbox.reg-filters .fld label{
      white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    }
    .filterbox.reg-filters .filter-actions{flex:0 0 auto;margin-left:auto;}
  }

  /* Clear belongs to the fields — it empties them — so it stays at the end of
     the row of fields. What the register itself does is not a filter, so only
     those buttons are held to the right-hand edge of the bar. */
  .filter-tail{display:flex;align-items:flex-end;gap:var(--s2);margin-left:auto;}
  /* the bar carries an inline bottom margin for when it stands alone; in
     the field row it would lift the buttons off the line */
  .filterbox .filter-actions .toolbar{margin-left:auto;margin-bottom:0 !important;}
  .fld label{display:block;font-size:var(--t-label);color:var(--muted);margin-bottom:var(--s1);font-weight:500;}
  .fld input,.fld select{
    width:100%;border:1px solid var(--line);border-radius:var(--radius);
    padding:7px 9px;font-size:var(--t-sm);font-family:inherit;color:var(--ink);background-color:#fff;
    /* Force the light theme on every form control, so any native dropdown the
       browser draws stays on white, not the black it falls to under an OS dark
       theme. */
    color-scheme:light;
  }

  /* The Part Number / Part Name autocomplete - a list the page draws itself, so
     it is white and carries the number and the name on one row. It is laid over
     the field and moves nothing around it. */
  .ac-wrap{position:relative;}
  .ac-list{
    position:absolute;left:0;right:0;top:100%;margin-top:3px;z-index:60;
    background:#fff;border:1px solid var(--line);border-radius:var(--radius);
    box-shadow:0 14px 30px rgba(6,10,32,.18);max-height:260px;overflow-y:auto;
  }
  .ac-row{
    display:flex;gap:10px;align-items:baseline;padding:8px 11px;cursor:pointer;
    border-bottom:1px solid #f0f0f3;
  }
  .ac-row:last-child{border-bottom:0;}
  .ac-row:hover{background:#f6f4fb;}
  .ac-num{font-family:var(--mono);font-weight:700;color:var(--ink);white-space:nowrap;}
  .ac-name{color:#6b7280;font-size:.9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  /* A part picked on a repair line: the panel is given room of its own, because
     the box it hangs under is one of five on the line and a part number fills
     it on its own. The name stands under the number rather than beside it, so
     it is read whole instead of being clipped to nothing. */
  .ac-list.ac-wide{right:auto;min-width:330px;max-width:min(420px,92vw);}
  /* A list showing one thing per row - names under the Part Name box, numbers
     under the Part Number box - gives that one thing the whole row. */
  .ac-list.ac-wide .ac-row{display:block;}
  .ac-name.ac-only{color:var(--ink);font-size:1em;white-space:normal;}
  .ac-row.ac-stack{display:block;}
  .ac-row.ac-stack .ac-num{display:block;}
  .ac-row.ac-stack .ac-name{display:block;white-space:normal;font-size:.92em;margin-top:2px;}
  .ac-row.ac-more{cursor:default;font-style:italic;}
  .ac-row.ac-more:hover{background:none;}
  .fld input:focus,.fld select:focus{outline:3px solid var(--saffron);outline-offset:-1px;border-color:var(--saffron);}
  /* ---------- one dropdown, everywhere ----------
     A field that offers a list looked like two different controls depending on
     what drew it: a native <select> carried whatever chevron the browser and
     the operating system felt like drawing, while the vendor picker - a box the
     page draws itself, because it is searched as well as picked - carried a
     solid triangle of its own. Side by side on the same row (Vendor / Workshop
     beside Payment mode) they read as two kinds of field.

     Every list now wears the same mark: the browser's own arrow is taken off
     and one chevron is drawn in its place, in the same size, the same colour
     and the same distance from the right-hand edge, on the native selects and
     on the picker alike. Nothing about how either behaves changes - a select is
     still a select. */
  :root{
    --field-chevron:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%234A5568' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  select{
    -webkit-appearance:none;appearance:none;
    background-image:var(--field-chevron);
    background-repeat:no-repeat;
    background-position:right 10px center;
    padding-right:30px;
  }
  /* the picker is drawn by the page, so it is given the same mark rather than
     its own triangle (vendor_pick.js keeps the element as the place to press) */
  .vp-btn{
    background-image:var(--field-chevron);
    background-repeat:no-repeat;
    background-position:right 10px center;
    padding-right:30px;
  }
  .vp-caret{
    width:12px;height:8px;border:0;background:none;opacity:0;
  }
  /* a select that is not drawn to this pattern keeps the browser's arrow */
  select[multiple],select[size]{
    -webkit-appearance:auto;appearance:auto;background-image:none;padding-right:9px;
  }

  /* The search and filter fields stand on the page itself: no panel behind
     them, no border around them, just the boxes and their labels. */
  .filterbox,.dlg .filterbox{
    background:none;border:none;padding:0;margin:0 0 var(--s4);
  }
  .filterbox legend{
    padding:0;margin:0 0 var(--s3);font-family:var(--serif);font-weight:700;
    font-size:14px;color:var(--navy);
  }
  .filter-actions{
    display:flex;gap:9px;align-items:flex-end;margin-top:var(--s3);
  }
  .req{color:var(--lapse);}
  .mand-note{font-size:var(--t-label);color:var(--lapse);margin:0 0 var(--s3);}
  /* a form with nothing to say above its fields leaves no gap there */
  .mand-note:empty{display:none;}
  /* The same note, when it is naming what the sheet is still waiting for: it
     has to read as a complaint and not as the standing line it replaces. */
  .mand-note.note-missing{
    font-weight:600;background:color-mix(in srgb, var(--lapse) 10%, transparent);
    border-left:3px solid var(--lapse);padding:8px 10px;border-radius:var(--radius);
  }

  /* ---------- a field left blank says so under itself ----------
     The note above a form says which fields are mandatory; this says which of
     them is still empty, under the box itself, where the person filling the
     form is already looking. Put there when a save is refused and taken off
     again the moment the box is answered (forms.js). */
  .fld-err{
    margin:4px 0 0;font-size:11.5px;line-height:1.35;color:var(--lapse);font-weight:500;
  }
  .fld.is-missing > label{color:var(--lapse);}
  .fld.is-missing input,
  .fld.is-missing select,
  .fld.is-missing textarea{
    border-color:var(--lapse);background:#fdf6f6;
  }
  /* the red border is the field's own answer, not the page's focus ring */
  .fld.is-missing input:focus,
  .fld.is-missing select:focus,
  .fld.is-missing textarea:focus{border-color:var(--lapse);}

  /* ---------- the register table ---------- */
  /* A register wider than the page is moved sideways by taking hold of it —
     no bar is drawn under it. */
  /* `.tblwrap` is the same frame under another spelling: the views that draw
     their own table - a stock purchase, a voucher, the parts report - used it
     and it was styled nowhere, so those tables stood without the register's
     border, background or sideways reach while every dashboard table had
     them. Both spellings are the register frame. */
  .tablewrap,.tblwrap{
    border:1px solid var(--line);background:var(--panel);overflow-x:auto;
    scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior-x:contain;
  }
  .tablewrap::-webkit-scrollbar,.tblwrap::-webkit-scrollbar{display:none;width:0;height:0;}
  /* A register kept on one line runs wider than the page, and is moved
     sideways by taking hold of it, as every other wide register is. */
  .tbl-wide{width:auto;min-width:100%;}
  .tbl-wide th,.tbl-wide td{white-space:nowrap;}
  .tablewrap.pannable{cursor:grab;}
  .tablewrap.panning{cursor:grabbing;user-select:none;}
  .tbl{
    border-collapse:collapse;width:100%;font-size:13px;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;
  }
  .tbl caption{
    text-align:left;padding:10px 14px;font-size:13px;color:var(--muted);
    border-bottom:1px solid var(--line);background:var(--panel);
  }
  .tbl caption b{color:var(--ink);font-family:var(--mono);font-variant-numeric:tabular-nums;}
  .tbl th{
    background:var(--ledger);color:var(--navy);text-align:left;font-weight:600;font-size:var(--t-label);
    padding:var(--cell-y) var(--cell-x);border-bottom:2px solid var(--navy);white-space:nowrap;
  }
  .tbl th button{
    background:none;border:none;color:var(--navy);font-weight:600;font-size:var(--t-label);padding:0;
    display:inline-flex;gap:5px;align-items:center;
  }
  .tbl th button:hover{text-decoration:underline;color:var(--saffron);}
  .tbl th .ind{color:var(--saffron);font-size:10px;}
  /* A register row is read across, so it is given the height to be followed
     with the eye: deeper cells, and a floor under a row whose cells are all
     one line. */
  .tbl td{
    padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line-soft);
    vertical-align:top;height:52px;
  }
  .tbl tbody tr:hover{background:#F2F6F6;}
  .tbl tbody tr.r-lapse:hover{background:#FBF1EF;}
  .tbl .num{text-align:right;}
  /* The stock register's quantity columns read down the middle, not hard right,
     so the figures sit under their headings. */
  .tbl .num.stkq{text-align:center;}
  .stockhist .hist-h{margin:14px 0 6px;font-size:var(--t-sm);color:var(--ink);}
  .stockhist .hist-h:first-child{margin-top:0;}
  .vno{font-weight:600;color:var(--navy);font-size:13.5px;letter-spacing:.03em;display:block;}
  .sub{display:block;font-size:var(--t-micro);color:var(--muted);margin-top:1px;}
  /* A pill reads whole or not at all: it keeps its own width in a flex row
     rather than being squeezed, and never runs past what holds it. A label
     too long for its card wraps inside the pill instead of being cut off. */
  .pill{
    display:inline-block;font-size:var(--t-micro);font-weight:600;padding:1px 8px;
    border-radius:var(--radius);white-space:nowrap;border:1px solid transparent;
    flex:0 0 auto;max-width:100%;
  }
  .pill.wrap,.pmcard .pill{white-space:normal;}
  /* wrapped or not, the badge keeps to the right edge of its card */
  .pmcard .top > .pill{margin-left:auto;}
  .p-green{background:var(--green-bg);color:#0A4A2B;border-color:#BFD9CA;}
  .p-amber{background:var(--amber-bg);color:var(--caution);border-color:#E3CE9B;}
  .p-red{background:var(--red-bg);color:var(--lapse);border-color:#E5C2BD;}
  .p-blue{background:var(--blue-bg);color:var(--navy);border-color:#BFD3D6;}
  .p-grey{background:#EDEBE4;color:var(--muted);border-color:#D8D5CC;}
  /* key to the margin rule, sits with the table caption */
  .spinekey{display:flex;gap:14px;flex-wrap:wrap;align-items:center;margin-top:7px;font-size:var(--t-micro);}
  .spinekey .k{display:inline-flex;align-items:center;gap:6px;color:var(--muted);}
  .spinekey .k::before{content:"";width:3px;height:13px;background:currentColor;}

  /* ---------- Permission Management: modules down the side, posts across ----------
     Every rule is held under .permgrid, so no other register is restyled. */
  .permgrid .tbl th,.permgrid .tbl td{text-align:center;vertical-align:middle;}
  .permgrid .tbl td{height:auto;padding:7px 6px;}
  .permgrid .tbl thead th{padding:8px 7px;line-height:1.2;}
  .permgrid .tbl thead th b{display:block;font-family:var(--mono);font-size:11.5px;letter-spacing:.02em;}
  .permgrid .tbl thead th span{display:block;font-weight:500;font-size:10.5px;color:var(--muted);text-transform:capitalize;}
  .permgrid .tbl th:first-child,.permgrid .tbl td:first-child{
    position:sticky;left:0;z-index:2;text-align:left;background:var(--panel);
    box-shadow:inset -1px 0 0 var(--line);min-width:230px;
  }
  .permgrid .tbl thead th:first-child{background:var(--ledger);z-index:3;}
  .permgrid .tbl tbody tr:hover td:first-child{background:#F2F6F6;}
  .permgrid .tbl td.pg-modcell b{display:block;font-weight:600;color:var(--ink);}
  .permgrid .tbl td.pg-modcell .sub{white-space:normal;max-width:280px;}
  .permgrid .tbl tr.pg-sec th{
    background:var(--line-soft);color:var(--navy);text-align:left;font-size:var(--t-micro);
    letter-spacing:.06em;text-transform:uppercase;padding:6px 8px;border-bottom:1px solid var(--line);
  }
  .permgrid .pg-marks{display:inline-flex;gap:2px;}
  .permgrid .pg-m{
    display:inline-block;min-width:42px;padding:2px 5px;border-radius:4px;border:1px solid;
    font:600 10px/1.3 var(--sans);text-align:center;white-space:nowrap;
  }
  .permgrid .pg-view{background:var(--blue-bg);color:var(--navy);border-color:#BFD3D6;}
  .permgrid .pg-create{background:var(--green-bg);color:#0A4A2B;border-color:#BFD9CA;}
  .permgrid .pg-edit{background:var(--amber-bg);color:var(--caution);border-color:#E3CE9B;}
  .permgrid .pg-delete{background:var(--red-bg);color:var(--lapse);border-color:#E5C2BD;}
  .permgrid .pg-approve{background:#EDE6F5;color:#4B2A7A;border-color:#D3C4E6;}
  /* The action switches only show what a post may do, so they point like text. */
  .permgrid .pg-switch{display:inline-block;cursor:default;}
  /* A switch the person signed in may flip is a button and points like one; for an
     admin, the switches they may not flip are dimmed so the others stand out. */
  .permgrid button.pg-switch{cursor:pointer;}
  .permgrid .pg-switch.pg-locked{opacity:.55;}

  .permgrid .pg-key{display:inline-flex;gap:12px;flex-wrap:wrap;align-items:center;font-weight:500;font-size:var(--t-micro);color:var(--muted);}
  .permgrid .pg-key > span{display:inline-flex;gap:4px;align-items:center;}
  /* Every role in one box: each level's name stands before its cards, and the
     levels run on from one another, wrapping, so the whole set reads in a few lines. */
  .perm-role-groups{
    display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:0 0 14px;
    padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);
  }
  /* the level names and cards all take their place in the one flow, so a line
     fills before the next begins rather than a whole level jumping down; a
     level's name is held to its first card */
  .perm-role-group,.perm-role-chips{display:contents;}
  .perm-role-lead{display:inline-flex;align-items:center;gap:5px;}
  .perm-role-group h3{margin:0 0 0 8px;color:var(--muted);font-size:10px;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;}
  .perm-role-group:first-child h3{margin-left:0;}
  .perm-role-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border:1px solid #BFD3D6;
    border-radius:18px;background:var(--navy);color:#FFFFFF;cursor:pointer;font:inherit;}
  .perm-role-chip:hover{background:var(--navy-mid);}
  /* the card whose permissions the table is reading */
  .perm-role-chip.on{background:var(--panel);color:var(--navy);border-color:var(--navy);box-shadow:0 0 0 2px var(--navy);}
  .perm-role-chip.on span{color:var(--muted);}
  .perm-role-chip b{font-size:11px;}
  .perm-role-chip span{font:9px var(--mono);color:#C8D9DE;}
  .spinekey .k-lapse{color:var(--lapse);}
  .spinekey .k-soon{color:var(--caution);}
  .spinekey .k-valid{color:#8C9A90;}
  /* actions read as a line of clerical instructions, not a stack of buttons */
  #regTable td:nth-child(3),#regTable td:nth-child(4){white-space:nowrap;}
  #regTable td:last-child,#regTable th:last-child{width:220px;}
  #regTable .rowacts{flex-wrap:nowrap;}
  .rowacts{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;}
  /* an action on a row is a button, drawn in whichever theme is chosen */
  .rowacts .btn-link{
    display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;
    padding:5px 11px;border-radius:var(--radius);
    background:var(--navy);border:1px solid var(--navy);color:#FFFFFF;
    font-family:var(--sans);font-size:var(--t-micro);font-weight:600;text-decoration:none;
  }
  .rowacts .btn-link:hover{background:var(--navy-mid);border-color:var(--navy-mid);color:#FFFFFF;}
  /* Every action on a row is drawn the same way, in the theme's own colour -
     View, Edit and Delete read as one set rather than as two. What Delete
     does is said by the question it asks before it acts, not by its colour. */
  /* ---------- Delete: the bin that eats its label (shifts.js shiftDeleteBtn, eatBtn) ----------
     Drawn the same wherever a record is taken off - a row's actions or a cell of its own. */
  .eat-btn{
    position:relative;display:inline-flex;align-items:center;vertical-align:middle;gap:6px;height:28px;padding:0 11px 0 9px;
    border:none;border-radius:999px;cursor:pointer;color:#FFFFFF;white-space:nowrap;
    background:linear-gradient(145deg,var(--navy-mid),var(--navy) 55%,var(--navy-dk));
    box-shadow:0 6px 14px -6px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.12);
    font-family:var(--sans);font-size:var(--t-micro);font-weight:700;
    transition:padding .5s cubic-bezier(.65,0,.35,1),gap .4s ease,transform .18s ease,filter .2s ease;
  }
  .eat-btn:hover{filter:brightness(1.18);}
  .eat-btn:active{transform:scale(.94);}
  .eat-btn:disabled{cursor:progress;opacity:1;}
  .eat-btn .eat-icon{flex:0 0 auto;display:flex;width:14px;height:14px;}
  .eat-btn .eat-icon svg{width:100%;height:100%;overflow:visible;}
  .eat-btn .eat-lid{transform-origin:12px 7.5px;transition:transform .3s cubic-bezier(.5,0,.3,1);}
  .eat-btn.eat-opening .eat-lid{transform:rotate(-28deg);}
  .eat-btn.eat-eating .eat-lid{transform:rotate(0deg);transition-delay:.1s;}
  .eat-btn .eat-label-wrap{display:inline-block;max-width:60px;overflow:visible;
    transition:max-width .4s cubic-bezier(.65,0,.35,1) .05s;}
  .eat-btn .eat-label{display:inline-block;white-space:nowrap;}
  .eat-btn .eat-slot{display:inline-block;vertical-align:bottom;transition:width .32s cubic-bezier(.55,0,.25,1) .04s;}
  .eat-btn .eat-slot.eat-gone{width:0 !important;}
  .eat-btn .eat-letter{display:inline-block;transition:transform .34s cubic-bezier(.4,0,.2,1),opacity .3s ease;}
  .eat-btn .eat-slot.eat-gone .eat-letter{transform:translateY(-11px) rotate(-24deg) scale(.5);opacity:0;}
  .eat-btn.eat-eating{width:28px;padding:0;gap:0;justify-content:center;}
  .eat-btn.eat-eating .eat-label-wrap{max-width:0;}
  .eat-btn::after{content:'';position:absolute;inset:3px;border-radius:50%;border:2px solid rgba(255,255,255,.22);
    border-top-color:#FFFFFF;opacity:0;pointer-events:none;}
  .eat-btn.eat-processing::after{opacity:1;animation:eat-spin .65s linear infinite;}
  @keyframes eat-spin{to{transform:rotate(360deg);}}
  /* the row the entry stood on fades out once the server has taken it off */
  .tbl tr.eat-row-gone td{opacity:0;transform:translateX(14px);transition:opacity .35s ease,transform .35s ease;}
  @media (prefers-reduced-motion: reduce){
    .eat-btn,.eat-btn *,.tbl tr.eat-row-gone td{transition:none !important;}
    .eat-btn.eat-processing::after{animation-duration:1.6s;}
  }
  /* ---------- the row's other buttons, drawn the way Delete is (shifts.js shiftActBtn) ----------
     A rounded button with its icon before its name: the theme's colour for View, Approve, Edit,
     Resolve and the flag, red for Reject; Delete keeps its dark bin. */
  .rowacts .act-btn{
    position:relative;display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 12px 0 10px;
    border:none;border-radius:999px;cursor:pointer;color:#FFFFFF;white-space:nowrap;
    font-family:var(--sans);font-size:var(--t-micro);font-weight:700;
    transition:transform .18s ease,filter .2s ease,box-shadow .25s ease;
  }
  .rowacts .act-btn.act-brand{
    background:linear-gradient(145deg,var(--navy-mid),var(--navy) 55%,var(--navy-dk));
    box-shadow:0 6px 14px -6px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.22);
  }
  .rowacts .act-btn.act-danger{
    background:linear-gradient(145deg,var(--navy-mid),var(--navy) 55%,var(--navy-dk));
    box-shadow:0 6px 14px -6px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.22);
  }
  .rowacts .act-btn:hover{filter:brightness(1.12);}
  .rowacts .act-btn:active{transform:scale(.94);}
  .act-btn .act-icon{flex:0 0 auto;display:flex;width:14px;height:14px;transition:transform .25s cubic-bezier(.5,0,.3,1);}
  .act-btn .act-icon svg{width:100%;height:100%;overflow:visible;}
  .act-btn:hover .act-icon{transform:translateY(-1px) rotate(-8deg);}
  /* The flag is drawn as the button's own letter - white on the theme's
     glass - rather than as an emoji, which carries its own colours with it. */
  .rowacts .act-btn.act-flag{padding:0 11px;font-size:15px;line-height:1;
    font-family:var(--sans);color:#FFFFFF;}
  @media (prefers-reduced-motion: reduce){
    .act-btn,.act-btn .act-icon{transition:none !important;}
    .act-btn:hover .act-icon{transform:none;}
  }
  /* machine data never breaks across lines */
  .tbl td .mono,.tbl td.mono,.tbl .vno{white-space:nowrap;}
  .empty{padding:var(--s5) 16px;text-align:center;color:var(--muted);}
  .empty b{display:block;color:var(--ink);margin-bottom:var(--s1);font-size:14px;}

  .pager{
    display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;
    padding:10px 14px;border-top:1px solid var(--line);background:var(--ledger);font-size:13px;
  }
  /* The pager sits inside the box that scrolls sideways, and a wide register
     scrolls it with the rows: its two ends then stood short of the table's, one
     off the left of the view and one short of the right. Pinned to the visible
     box, it keeps the table's own edges however far the rows are moved across. */
  .tablewrap > .pager{
    position:sticky;left:0;z-index:1;
    width:100%;box-sizing:border-box;
  }
  .pager .pages{display:flex;gap:5px;align-items:center;}
  .pager .pages button{
    border:1px solid var(--line);background:#fff;padding:3px 10px;border-radius:var(--radius);
    font-size:var(--t-label);font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  .pager .pages button[aria-current="true"]{background:var(--navy);border-color:var(--navy);color:#fff;font-weight:600;}
  .pager .pages button:disabled{color:#A9B1BF;cursor:not-allowed;font-family:var(--sans);}
  .pager select{border:1px solid var(--line);padding:3px 6px;border-radius:var(--radius);font-family:inherit;font-size:var(--t-label);}
  /* The box that opens on "Custom" is sized for a number and keeps the spin
     arrows off - they cramped the figure into the corner and cut it in half. */
  .pager input[type="number"]{
    width:72px;border:1px solid var(--line);padding:3px 8px;border-radius:var(--radius);
    font-family:var(--mono);font-size:var(--t-label);text-align:center;background:#fff;
  }
  .pager input[type="number"]::-webkit-outer-spin-button,
  .pager input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
  .pager input[type="number"]{-moz-appearance:textfield;appearance:textfield;}

  /* ---------- panels ---------- */
  .panel{border:1px solid var(--line);background:var(--panel);margin-bottom:var(--s4);}
  .panel > h3{
    font-size:15px;color:var(--navy);padding:11px 14px;
    border-bottom:1px solid var(--line);background:var(--ledger);
  }
  .panel-body{padding:14px;}
  .twocol{display:grid;grid-template-columns:1fr 1fr;gap:var(--s4);}
  .kv{width:100%;border-collapse:collapse;font-size:var(--t-sm);}
  .kv th{text-align:left;font-weight:500;color:var(--muted);padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line-soft);width:58%;}
  .kv td{padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line-soft);font-weight:600;text-align:right;}
  .bar{height:8px;background:#E4E2DA;border:1px solid var(--line-soft);}
  .bar i{display:block;height:100%;background:var(--forest);}
  /* a count carries its share of the fleet beside it */
  .kv-share th{width:64%;font-weight:500;color:var(--ink);}
  .kv-share .share{display:block;height:5px;background:#E4E2DA;margin-top:7px;max-width:240px;}
  .kv-share .share i{display:block;height:100%;background:var(--navy);}
  .kv-share td{white-space:nowrap;}
  .kv-share .pct{
    display:inline-block;min-width:46px;text-align:right;color:var(--muted);
    font-weight:400;font-size:var(--t-micro);
  }
  .recview td{font-variant-numeric:tabular-nums;}
  details.faq{border-bottom:1px solid var(--line-soft);padding:10px 0;}
  details.faq summary{cursor:pointer;font-weight:600;font-size:var(--t-sm);color:var(--navy);}
  details.faq p{margin:7px 0 0;font-size:var(--t-sm);color:var(--ink);max-width:74ch;}

  /* ---------- dialogs ---------- */
  .backdrop{
    position:fixed;inset:0;background:rgba(11,42,47,.60);z-index:100;
    display:none;justify-content:center;align-items:flex-start;padding:26px 14px;overflow-y:auto;
  }
  .backdrop.open{display:flex;}
  .dlg{
    background:var(--panel);border:1px solid var(--navy);width:100%;max-width:1020px;
    border-radius:var(--radius);box-shadow:0 22px 50px rgba(11,42,47,.30);
  }
  .dlg.narrow{max-width:660px;}
  .confirm-msg{margin:0;font-size:var(--t-sm);color:var(--ink);line-height:1.5;max-width:62ch;}
  /* A yes/no question is asked in the middle of the screen, where the eye already
     is. Only this popup: the long form windows keep their top so their first
     fields are in view. An auto margin, not align-items, so a popup taller than
     the window still scrolls from its top instead of being cut off. */
  #confirmDlg .dlg{margin:auto;}
  .dlg.wide{max-width:1180px;}
  .dlg.wide .filterbox{margin-bottom:var(--s4);}
  .dlg-head{
    background:var(--navy);color:#fff;padding:13px 18px;
    display:flex;justify-content:space-between;align-items:center;gap:14px;
    border-bottom:3px solid var(--seal);
  }
  .dlg-head h3{font-size:16.5px;color:#fff;}
  .dlg-head .ref{font-size:12px;color:#BECAE0;font-family:var(--sans);font-weight:400;margin-top:1px;}
  .dlg-close{background:transparent;border:1px solid #4A5D80;color:#fff;border-radius:var(--radius);padding:3px 10px;font-size:13px;}
  .dlg-close:hover{background:var(--navy-mid);}
  .dlg-body{padding:16px 18px;max-height:calc(100vh - 170px);overflow-y:auto;}
  .form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--s3) 16px;}
  .dlg fieldset{background:#FBFAF7;margin-bottom:14px;}
  .dlg legend{font-size:var(--t-sm);}
  .expiry-flag{font-size:var(--t-micro);font-weight:600;margin-top:var(--s1);display:inline-block;}
  .expiry-flag.exp{color:var(--lapse);}
  .expiry-flag.soon{color:var(--caution);}
  .expiry-flag.ok{color:var(--forest);}
  .docs{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--s3);}
  .doc{border:1px solid var(--line);background:#fff;padding:10px;border-radius:var(--radius);}
  .doc h4{margin:0 0 6px;font-size:var(--t-label);font-family:var(--sans);font-weight:600;}
  .doc .state{font-size:var(--t-micro);color:var(--muted);display:block;margin-bottom:7px;}
  .doc .state.none{color:var(--lapse);}
  .doc-acts{display:flex;gap:6px;flex-wrap:wrap;}
  .dlg-foot{
    border-top:1px solid var(--line);background:var(--ledger);padding:12px 18px;
    display:flex;gap:9px;justify-content:flex-end;flex-wrap:wrap;
  }
  .dlg-foot .left{margin-right:auto;font-size:var(--t-label);color:var(--muted);}
  /* ---------- module sub-tabs: the register's own tab strip ---------- */
  .modtabs{
    display:flex;flex-wrap:wrap;gap:0;margin:0 0 var(--s4);
    border-bottom:2px solid var(--navy);background:var(--panel);
    border:1px solid var(--line);border-bottom:2px solid var(--navy);
  }
  .modtabs button{
    background:none;border:none;
    padding:10px 16px;font-size:var(--t-sm);font-weight:500;color:var(--muted);
    display:inline-flex;align-items:center;gap:8px;
  }
  .modtabs button:hover{background:var(--ledger);color:var(--ink);}
  .modtabs button.on{color:var(--navy);font-weight:600;background:var(--ledger);}
  .modtabs .n{font-family:var(--mono);font-size:12px;color:var(--muted);}
  .modtabs button.on .n{color:var(--saffron);}
  .modtabs .tally{
    font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:var(--t-micro);
    color:var(--muted);background:var(--paper);border:1px solid var(--line-soft);
    padding:0 6px;border-radius:var(--radius);
  }
  .modtabs button.on .tally{color:var(--navy);border-color:var(--line);}
  /* a figure that moved up this period, and stock promised out of the scope */
  .tbl .up{color:var(--forest);}
  .btn-link.hold{color:#6B3FA0;font-weight:600;}
  /* the papers behind a column */
  .btn-link.file{color:var(--saffron);font-weight:600;}
  .btn-link.file:hover{color:var(--navy);}
  /* a remark is given room to read on one or two lines rather than being
     squeezed into a column of single words */
  .tbl .clip{display:inline-block;min-width:210px;max-width:300px;}
  /* the monthly consumption sheet: two header rows, a block of four a day */
  .tbl.monthly th{font-size:var(--t-micro);padding:var(--cell-y) var(--cell-x);}
  .tbl.monthly th.daygrp{border-left:1px solid var(--line);font-family:var(--mono);}
  .tbl.monthly th.sm{font-size:10.5px;font-weight:500;color:var(--muted);border-bottom:2px solid var(--navy);}
  .tbl.monthly td{padding:var(--cell-y) var(--cell-x);font-size:12px;height:auto;}
  .tbl.monthly th{padding:var(--cell-y) var(--cell-x);}
  /* a page that is on the menu but not open yet says so in the middle of it */
  .soon-tag{
    margin:0;font-family:var(--serif);font-weight:700;
    font-size:27px;color:var(--seal);letter-spacing:-.01em;
  }
  .soon-inline{
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    text-align:center;min-height:40vh;padding:var(--s5) var(--s4);
    border:1px solid var(--line);background:var(--panel);
  }
  .soon-inline .lead{margin:var(--s3) auto 0;max-width:44ch;}
  .soon-inline .soon-page{margin:var(--s2) 0 0;font-size:var(--t-sm);color:var(--ink);font-weight:600;}
  /* the register read three ways, as the application offers it */
  /* The panel's heading line carries the register's title on the left, and on
     the right the reading being shown and what acts on it. */
  .panel > h3{display:flex;align-items:center;gap:var(--s3);flex-wrap:wrap;}
  .panel > h3 .h3bar{
    margin-left:auto;display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;
    font-family:var(--sans);font-weight:400;
  }
  .panel > h3 .toolbar{margin:0;}
  .viewswitch{display:flex;gap:0;border:1px solid var(--line);background:var(--panel);width:max-content;}
  .viewswitch button{
    background:none;border:none;border-right:1px solid var(--line-soft);
    padding:8px 14px;font-size:var(--t-label);font-weight:500;color:var(--muted);
  }
  .viewswitch button:last-child{border-right:none;}
  .viewswitch button:hover{background:var(--ledger);color:var(--ink);}
  .viewswitch button.on{background:var(--navy);color:#fff;font-weight:600;}
  .panel > h3 .viewswitch button,.panel > h3 .toolbar .btn{height:28px;padding:0 12px;font-size:var(--t-label);}
  .panel > h3 .toolbar .btn{display:inline-flex;align-items:center;}
  .lead{margin:0 0 var(--s3);font-size:var(--t-sm);color:var(--muted);max-width:74ch;}
  .lead:last-child{margin-bottom:0;}

  /* module form fields */
  .m-fld textarea{
    width:100%;border:1px solid var(--line);border-radius:var(--radius);
    padding:7px 9px;font-size:var(--t-sm);font-family:inherit;color:var(--ink);background:#fff;resize:vertical;
  }
  .m-fld textarea:focus{outline:3px solid var(--saffron);outline-offset:-1px;border-color:var(--saffron);}
  .m-fld.wide{grid-column:1 / -1;}
  /* the lines an invoice was bought on, and what they come to */
  /* A line reads on the same three-across grid as the heading above it. */
  .line-card{border:1px solid var(--line);background:#fff;padding:var(--s3) 14px 14px;margin-bottom:var(--s3);}
  .line-head{
    display:flex;align-items:center;gap:var(--s3);margin-bottom:var(--s3);
    padding-bottom:var(--s2);border-bottom:1px solid var(--line-soft);
  }
  .line-no{font-weight:600;font-size:var(--t-sm);color:var(--navy);}
  .line-total{
    margin-left:auto;font-family:var(--mono);font-variant-numeric:tabular-nums;
    font-size:var(--t-sm);font-weight:600;color:var(--navy);
  }
  .line-card .m-fld input[type="number"]{text-align:right;font-family:var(--mono);}

  /* kill native number spinners everywhere */
  input[type="number"]{-moz-appearance:textfield;appearance:textfield;}
  input[type="number"]::-webkit-outer-spin-button,
  input[type="number"]::-webkit-inner-spin-button{
    -webkit-appearance:none;appearance:none;margin:0;display:none;
  }
  /* the certificates a line carries, one row per unit bought */
  .warr-set{margin-top:14px;border-top:1px solid var(--line-soft);padding-top:var(--s3);}
  /* The heading keeps the left of the rule and the paging control the right,
     dropping under it only when the dialog is too narrow to hold both. */
  .warr-bar{
    display:flex;align-items:center;justify-content:space-between;
    gap:6px var(--s3);flex-wrap:wrap;margin-bottom:var(--s2);
  }
  .warr-head{
    font-size:var(--t-label);font-weight:600;color:var(--navy);
    letter-spacing:.05em;text-transform:uppercase;
  }
  .warr-page{
    display:flex;align-items:center;gap:6px 10px;flex-wrap:wrap;
    margin-left:auto;font-size:var(--t-label);color:var(--muted);
  }
  .warr-page b{color:var(--ink);font-weight:600;font-family:var(--mono);font-variant-numeric:tabular-nums;}
  .warr-page label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
  .warr-page select,.warr-custom{
    border:1px solid var(--line);background:#fff;border-radius:var(--radius);
    padding:3px 6px;font-family:inherit;font-size:var(--t-label);color:var(--ink);
  }
  .warr-custom{width:74px;text-align:right;font-family:var(--mono);}
  .warr-page select:focus,.warr-custom:focus{
    outline:3px solid var(--saffron);outline-offset:-1px;border-color:var(--saffron);
  }
  .warr-page .pages{display:flex;align-items:center;gap:4px;}
  .warr-page .pages button{
    border:1px solid var(--line);background:#fff;padding:2px 8px;border-radius:var(--radius);
    font-size:var(--t-label);line-height:1.5;color:var(--navy);
  }
  .warr-page .pages button:hover:not(:disabled){background:var(--navy);border-color:var(--navy);color:#fff;}
  .warr-page .pages button:disabled{color:#A9B1BF;cursor:not-allowed;}
  .warr-of{
    font-family:var(--mono);font-variant-numeric:tabular-nums;
    color:var(--ink);padding:0 2px;white-space:nowrap;
  }
  .warr-note{margin:0;font-size:var(--t-label);color:var(--muted);}
  .warr-wrap{overflow-x:auto;}
  .warr-grid{
    display:grid;grid-template-columns:34px repeat(4,minmax(120px,1fr));
    gap:var(--s2) 12px;align-items:end;min-width:620px;
  }
  .warr-lab{font-size:var(--t-label);color:var(--muted);font-weight:500;}
  .warr-no{font-family:var(--mono);font-size:var(--t-sm);color:var(--muted);padding-bottom:8px;}
  .warr-grid input,.warr-grid select{
    width:100%;border:1px solid var(--line);border-radius:var(--radius);
    padding:7px 9px;font-size:var(--t-sm);font-family:inherit;color:var(--ink);background:#fff;
  }
  .warr-grid input:focus,.warr-grid select:focus{
    outline:3px solid var(--saffron);outline-offset:-1px;border-color:var(--saffron);
  }
  /* A tyre or a battery is entered one unit at a time, so each unit stands
     in its own card under the line, numbered the way the store numbers it. */
  .unit-card{
    border:1px solid var(--line-soft);background:var(--ledger);
    border-radius:var(--radius);padding:10px 12px 12px;margin-bottom:var(--s2);
  }
  .unit-card:last-child{margin-bottom:0;}
  .unit-no{
    font-size:var(--t-label);font-weight:600;color:var(--navy);
    margin-bottom:7px;font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  .unit-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--s2) 14px;}
  @media (max-width:980px){ .unit-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
  .unit-grid .m-fld input,.unit-grid .m-fld select{background-color:#fff;}
  @media (max-width:620px){ .unit-grid{grid-template-columns:1fr;} }
  /* A mileage card reads two things at once: what the vehicles averaged, and
     the fuel they drew to run it. Two halves of one card, divided down the
     middle, so neither is read without the other. */
  .kmpl-split{display:flex;align-items:stretch;gap:0;width:100%;}
  .kmpl-half{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:2px;
    padding:0 9px;}
  .kmpl-half:first-child{padding-left:0;}
  .kmpl-half:last-child{padding-right:0;}
  /* a rule between each reading, so the three are read apart */
  .kmpl-half + .kmpl-half{border-left:1px solid var(--line-soft);}
  /* The figure is read, never cut. It used to be held to one line and clipped,
     so a card with no reading said "No read..." and the label under it
     "ORIGINA CONSUMP" - the two things the card is for, both unreadable. It
     wraps instead, and the card grows to hold it. */
  .kmpl-half b{font-size:17px;line-height:1.15;font-weight:700;overflow-wrap:anywhere;}
  .kmpl-half i{font-style:normal;font-size:10.5px;line-height:1.25;color:var(--muted);
    text-transform:uppercase;letter-spacing:.02em;overflow-wrap:anywhere;}
  @media (max-width:620px){
    .kmpl-split{flex-direction:column;gap:8px;}
    .kmpl-half{padding:0;}
    .kmpl-half + .kmpl-half{border-left:0;border-top:1px solid var(--line-soft);padding-top:8px;}
  }
  /* the other projects a person is also on, ticked one per project */
  .pickset{display:flex;flex-wrap:wrap;gap:8px 14px;padding:9px 10px;
    border:1px solid var(--line);border-radius:var(--radius);background:#fff;min-height:40px;}
  .pickone{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);
    font-size:13px;color:var(--ink);cursor:pointer;white-space:nowrap;}
  .pickone input{width:15px;height:15px;margin:0;cursor:pointer;accent-color:var(--navy);}
  /* the generated number is read off the catalogue, never typed into */
  .gen-fld{background:var(--ledger) !important;color:var(--muted);cursor:default;font-family:var(--mono);}
  .gen-fld:focus{outline:none;border-color:var(--line);}
  /* the pager's own buttons are worded on this list, so they are set wider */
  .warr-page .pages select{
    border:1px solid var(--line);background:#fff;border-radius:var(--radius);
    padding:2px 6px;font-family:inherit;font-size:var(--t-label);color:var(--ink);
  }
  .lines-set{position:relative;}
  /* A section holding no item yet says so, rather than standing as a heading
     over nothing - which reads as something that failed to draw. */
  .lines-none{
    margin:0;padding:16px 14px;text-align:center;
    border:1px dashed var(--line);border-radius:var(--radius);
    font-size:var(--t-label);color:var(--muted);
  }
  .lines-none b{color:var(--ink);}
  /* It sits on the section's own rule, opposite the legend.

     It is the only control that adds a line to an invoice, and it was drawn
     at 12px in panel white on a white rule - the same colour as the border it
     straddles - so it read as part of the frame rather than as the button it
     is. Set in the application's own colour at the size of a real control,
     and lifted off the rule with a shadow so the frame still reads behind it.

     Scoped to .lines-add alone: .btn-sm is worn by small buttons all over the
     application and none of them is meant to change. */
  .lines-add{
    position:absolute;top:-17px;right:14px;
    padding:7px 15px;font-size:13px;font-weight:600;line-height:1.2;
    background:var(--navy);border-color:var(--navy);color:#fff;
    box-shadow:0 1px 3px rgba(0,0,0,.16);
  }
  /* .btn:hover carries a class and a state, so the hover is answered in kind
     - a plain .lines-add would lose to it and flash the grey back. */
  .lines-add:hover{background:var(--navy-mid);border-color:var(--navy-mid);color:#fff;}
  .lines-add:active{background:var(--navy);border-color:var(--navy);}
  .lines-add:focus-visible{outline:2px solid var(--saffron);outline-offset:2px;}
  .lines-foot{
    display:flex;align-items:flex-end;justify-content:flex-end;gap:var(--s4);
    flex-wrap:wrap;padding:var(--s3) 0 0;
  }
  .lines-foot .totals{display:flex;gap:0;margin:0;border:1px solid var(--line);background:var(--panel);}
  .lines-foot .totals div{padding:8px 14px;border-right:1px solid var(--line-soft);}
  .lines-foot .totals div:last-child{border-right:none;}
  .lines-foot .totals dt{font-size:var(--t-label);color:var(--muted);margin:0;}
  .lines-foot .totals dd{
    margin:3px 0 0;font-family:var(--mono);font-variant-numeric:tabular-nums;
    font-size:15px;font-weight:600;color:var(--navy);
  }
  /* ---------- what is attached to a record ----------
     The heading carries the field's own Add button at the far end, and every
     paper stands under it in a numbered slot of its own. */
  .form-grid + .fileset{
    margin-top:var(--s3);padding-top:var(--s3);border-top:1px solid var(--line-soft);
  }
  .fileset + .fileset{margin-top:var(--s3);}
  .fileset .fhead{
    display:flex;align-items:center;justify-content:space-between;
    gap:var(--s3);flex-wrap:wrap;margin-bottom:var(--s2);
  }
  .fileset .fhead label{margin:0;font-weight:600;color:var(--navy);font-size:var(--t-sm);}
  /* the picker itself is never seen: the slot's own button stands for it */
  .fileset{position:relative;}
  .fld input.fhide,input.fhide{
    position:absolute;left:0;top:0;width:1px;height:1px;min-width:0;
    padding:0;border:0;opacity:0;pointer-events:none;
  }
  .fonfile{margin:0 0 var(--s2);font-size:var(--t-label);color:var(--muted);font-style:italic;}
  /* what a file cell opens: the papers themselves, side by side */
  .docgrid{display:flex;flex-wrap:wrap;gap:var(--s3);}
  .docshot{
    margin:0;flex:1 1 280px;max-width:420px;border:1px solid var(--line);
    border-radius:var(--radius);background:#fff;overflow:hidden;
  }
  .docshot img,.docshot iframe{
    display:block;width:100%;height:300px;border:none;
    object-fit:contain;background:var(--ledger);
  }
  .docshot .docmiss{
    display:flex;align-items:center;justify-content:center;height:300px;
    background:var(--ledger);color:var(--muted);font-family:var(--mono);
    font-size:var(--t-sm);font-weight:600;letter-spacing:.06em;
  }
  .docshot figcaption{
    display:flex;align-items:center;gap:10px;flex-wrap:wrap;
    padding:8px 10px;border-top:1px solid var(--line-soft);background:var(--panel);
  }
  .docshot .dname{
    flex:1 1 auto;min-width:0;font-size:var(--t-label);color:var(--ink);
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  .docshot .dsize{
    font-size:var(--t-micro);color:var(--muted);
    font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  /* ---------- the disposal decision ----------
     Each part of the sheet carries its own colour on its heading, so the
     piece that came off is told apart at a glance from what was decided
     about it and from the proofs behind that decision. */
  .dsec{background:#FBFAF7;margin-bottom:14px;}
  .dsec > legend{
    font-size:var(--t-label);font-weight:700;letter-spacing:.06em;
    text-transform:uppercase;padding:0 6px;
  }
  .dsec.s-piece > legend{color:#0F6F63;}
  .dsec.s-decision > legend{color:#B0651A;}
  .dsec.s-billing > legend{color:var(--navy);}
  .dsec.s-buyers > legend{color:#6D4AA8;}
  .dsec.s-proof > legend{color:#1F5F8B;}
  .dsec-sub{margin:0 0 var(--s3);font-size:var(--t-label);color:var(--muted);}
  /* what the stock record already holds, read as a note rather than a field */
  .dsec-note{
    display:flex;align-items:center;gap:6px 18px;flex-wrap:wrap;
    margin:var(--s3) 0 0;padding-top:var(--s2);border-top:1px solid var(--line-soft);
    font-size:var(--t-label);color:var(--muted);
  }
  .dsec-note b{
    color:var(--navy);font-weight:600;letter-spacing:.05em;text-transform:uppercase;
    font-size:var(--t-micro);
  }
  /* the status is worked out, so it is shown rather than offered */
  .dstate{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:33px;}
  .dhint{font-size:var(--t-micro);color:var(--muted);line-height:1.25;max-width:15ch;}
  /* a figure the sheet works out for itself */
  .dcalc{
    display:block;width:100%;border:1px solid var(--line);border-radius:var(--radius);
    padding:7px 9px;font-size:var(--t-sm);background:var(--amber-bg);
    color:var(--forest);font-weight:600;
    font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  /* the buyers after the first, a line at a time */
  .dbuyer{
    border:1px solid var(--line);border-left:3px solid #6D4AA8;
    border-radius:var(--radius);background:#fff;padding:12px;margin-bottom:var(--s3);
  }
  .dgrid5{grid-template-columns:repeat(5,minmax(0,1fr));}
  @media (max-width:1100px){ .dgrid5{grid-template-columns:repeat(3,minmax(0,1fr));} }
  @media (max-width:820px){ .dgrid5{grid-template-columns:repeat(2,minmax(0,1fr));} }
  .dbuyer-foot{
    display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;
    margin-top:var(--s3);padding-top:var(--s2);border-top:1px dashed var(--line);
  }
  .dbuyer-foot .dpend{flex:0 0 190px;}
  .dfoot{display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
  .dsum{font-size:var(--t-label);color:var(--muted);}
  .dsum b{
    color:var(--navy);font-weight:600;
    font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  .dsep{padding:0 8px;color:var(--line);}
  /* ---------- raising a stock request ---------- */
  .reqpart{
    border:1px solid var(--line);border-radius:var(--radius);
    background:#FBFAF7;padding:14px;margin-bottom:var(--s3);
  }
  .reqpart-head{
    display:flex;align-items:center;gap:var(--s3);margin-bottom:var(--s3);
    padding-bottom:var(--s2);border-bottom:1px solid var(--line-soft);
  }
  .reqpart-no{font-weight:600;font-size:var(--t-sm);color:var(--navy);}
  .reqpart-head .btn-link{margin-left:auto;}
  .reqgrid2{grid-template-columns:1fr 2fr;}
  .reqgrid5{grid-template-columns:repeat(5,minmax(0,1fr));}
  @media (max-width:1100px){
    .reqgrid2{grid-template-columns:1fr;}
    .reqgrid5{grid-template-columns:repeat(3,minmax(0,1fr));}
  }
  @media (max-width:820px){ .reqgrid5{grid-template-columns:repeat(2,minmax(0,1fr));} }
  /* the way out when the part is not on the master */
  .reqhand{display:inline-block;margin:2px 0 var(--s3);font-size:var(--t-label);}
  .reqpri{display:flex;align-items:center;gap:8px;}
  .reqpri select{flex:1 1 auto;min-width:0;}
  .pdot{flex:none;width:9px;height:9px;border-radius:50%;}
  .reqadd-part{display:flex;justify-content:flex-end;margin-bottom:var(--s2);}
  /* who the notice is written to */
  .reqbar{
    display:flex;align-items:center;gap:var(--s3);width:100%;
    border:1px solid var(--line);border-radius:var(--radius);background:var(--ledger);
    padding:10px 12px;text-align:left;margin-top:var(--s3);
  }
  .reqbar:hover{border-color:var(--navy);}
  .reqbar-l{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--ink);font-size:var(--t-sm);}
  .reqbar-l .sub{display:inline;color:var(--muted);font-size:var(--t-label);margin:0;}
  .reqbar-r{margin-left:auto;color:var(--navy-mid);font-size:var(--t-label);font-weight:600;}
  .reqwho{
    border:1px solid var(--line);border-top:none;background:var(--panel);
    border-radius:0 0 var(--radius) var(--radius);padding:14px;
  }
  .reqfrom{
    margin:0 0 var(--s3);border:1px solid var(--line-soft);border-radius:var(--radius);
    background:var(--ledger);padding:10px 12px;
  }
  .reqfrom > div{display:flex;gap:14px;padding:3px 0;}
  .reqfrom dt{flex:0 0 88px;color:var(--muted);font-size:var(--t-label);margin:0;}
  .reqfrom dd{margin:0;font-size:var(--t-label);color:var(--ink);}
  .reqsub{
    font-size:var(--t-micro);font-weight:700;letter-spacing:.07em;text-transform:uppercase;
    color:var(--navy);margin:var(--s3) 0 var(--s2);
  }
  .reqlbl{margin:0 0 6px;font-size:var(--t-label);color:var(--ink);font-weight:600;}
  .reqlbl span{color:var(--muted);font-weight:400;margin-left:6px;}
  .reqchips{display:flex;flex-wrap:wrap;gap:10px;}
  .reqchip{
    flex:1 1 260px;max-width:340px;border:1px solid var(--line);
    border-radius:var(--radius);background:#fff;padding:8px 10px;
  }
  .reqchip-t{display:flex;align-items:center;gap:7px;}
  .reqchip-t b{font-size:var(--t-label);color:var(--ink);}
  .reqchip-r{font-size:var(--t-micro);color:var(--muted);margin-top:2px;letter-spacing:.03em;}
  .reqchip-e{font-size:var(--t-micro);color:var(--muted);font-family:var(--mono);margin-top:1px;}
  .reqx{
    margin-left:auto;border:none;background:none;color:var(--muted);
    font-size:15px;line-height:1;padding:0 2px;
  }
  .reqx:hover{color:var(--lapse);}
  /* the + that opens the box an address is added in, drawn as the last chip */
  .reqplus{
    flex:0 0 auto;max-width:none;display:flex;align-items:center;justify-content:center;gap:6px;
    min-width:150px;min-height:62px;border-style:dashed;color:var(--navy-mid);
    font-size:var(--t-label);font-weight:600;cursor:pointer;
  }
  .reqplus span{font-size:18px;line-height:1;}
  .reqplus:hover{border-color:var(--navy);color:var(--navy);}
  .reqlist{margin-bottom:var(--s3);}
  .reqlist .reqadd{margin-top:var(--s2);}
  .reqreset{display:block;margin:0 0 var(--s2);font-size:var(--t-label);}
  .reqcc{margin:0 0 var(--s3);font-size:var(--t-label);color:var(--muted);}
  .reqadd{display:flex;align-items:flex-end;gap:10px;margin-bottom:var(--s3);}
  .reqadd .m-fld{flex:1 1 auto;min-width:0;}
  .reqmsg-t{margin:var(--s2) 0;font-size:var(--t-label);}
  /* the notice itself, read before it is sent */
  .reqmsg{
    border:1px solid var(--line);border-radius:var(--radius);
    background:#fff;padding:14px;font-size:var(--t-label);color:var(--ink);line-height:1.55;
  }
  .reqmsg p{margin:0 0 var(--s2);}
  .reqmsg-s{font-size:var(--t-sm);}
  .reqmsg-kv{margin:0 0 var(--s2);}
  .reqmsg-kv > div{display:flex;gap:14px;}
  .reqmsg-kv dt{flex:0 0 96px;color:var(--muted);margin:0;}
  .reqmsg-kv dd{margin:0;}
  .reqmsg-own{
    border-left:3px solid var(--saffron);padding-left:10px;color:var(--navy);
  }
  .reqmsg-sig{color:var(--muted);margin-bottom:0;}
  /* ---------- moving stock between districts ---------- */
  .mvtop{display:grid;grid-template-columns:1fr 1fr;gap:var(--s3) 22px;margin-bottom:var(--s3);}
  @media (max-width:900px){ .mvtop{grid-template-columns:1fr;} }
  .mvcol .m-fld{margin-bottom:var(--s3);}
  .mvsub{
    font-size:var(--t-micro);font-weight:700;letter-spacing:.07em;text-transform:uppercase;
    color:#0F6F63;margin-bottom:var(--s2);
  }
  .mvhint{display:block;margin-top:4px;font-size:var(--t-micro);color:var(--muted);line-height:1.35;}
  .mvhint.bad,.m-fld input.bad{color:var(--lapse);}
  .m-fld input.bad{border-color:var(--lapse);}
  /* the figures the decision turns on, read together */
  .mvtiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:var(--s3);}
  @media (max-width:820px){ .mvtiles{grid-template-columns:1fr 1fr;} }
  .mvtile{
    border:1px solid var(--line);border-radius:var(--radius);
    background:var(--panel);padding:8px 12px;
  }
  .mvtile.on{background:var(--blue-bg);border-color:#BFD3D6;}
  .mvtile.bad{background:var(--red-bg);border-color:#E5C2BD;}
  .mvtile dt{
    font-size:var(--t-micro);font-weight:700;letter-spacing:.06em;text-transform:uppercase;
    color:var(--muted);margin:0;
  }
  .mvtile dd{
    margin:3px 0 0;font-size:15px;font-weight:600;color:var(--navy);
    font-family:var(--mono);font-variant-numeric:tabular-nums;
  }
  .mvtile.bad dd{color:var(--lapse);}
  .mvsec{background:#FBFAF7;margin-bottom:14px;}
  .mvsec > legend{
    font-size:var(--t-micro);font-weight:700;letter-spacing:.07em;
    text-transform:uppercase;color:var(--navy);padding:0 6px;
  }
  .mvgrid5{grid-template-columns:repeat(5,minmax(0,1fr));}
  @media (max-width:1100px){ .mvgrid5{grid-template-columns:repeat(3,minmax(0,1fr));} }
  @media (max-width:820px){ .mvgrid5{grid-template-columns:repeat(2,minmax(0,1fr));} }
  /* ---------- the readings the register is reported on ---------- */
  /* the reading being looked at, named on the panel that shows it */
  .rep-switch{margin-left:auto;}
  .rep-panel > h3{gap:var(--s3);}
  /* A reading is read across, so its table is given room to be dragged
     sideways and its own bar to do it with: the register's tables are panned
     by hand, but a reading is long enough that the bar has to be there. */
  .rep-wide{
    scrollbar-width:auto;-ms-overflow-style:auto;
    padding-bottom:2px;
  }
  .rep-wide::-webkit-scrollbar{display:block;height:11px;}
  .rep-wide::-webkit-scrollbar-thumb{
    background:#C3CBC7;border-radius:6px;border:2px solid var(--panel);
  }
  .rep-wide::-webkit-scrollbar-track{background:var(--ledger);}
  .rep-tbl th{white-space:nowrap;}
  .rep-tbl td{white-space:nowrap;}
  .rep-tbl .empty{white-space:normal;}
  /* ---------- the audit log ---------- */
  .aud-when{white-space:nowrap;font-size:var(--t-micro);}
  /* ---------- stock requests, read by stage ---------- */
  .reqtabs{
    display:flex;flex-wrap:wrap;gap:0;margin-bottom:var(--s3);
    border-bottom:1px solid var(--line);
  }
  .reqtabs button{
    background:none;border:none;border-bottom:2px solid transparent;
    padding:8px 14px;font-size:var(--t-label);font-weight:500;color:var(--muted);
  }
  .reqtabs button:hover{color:var(--navy);}
  .reqtabs button.on{color:var(--navy);font-weight:700;border-bottom-color:var(--navy);}
  /* a priority is marked, not pilled */
  .pridot{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;font-weight:600;}
  .pridot .dot{width:8px;height:8px;border-radius:50%;flex:none;}
  /* A part of a sheet is named on a rule of its own colour, so one part is
     told from the next down a long form. */
  .dlg fieldset > legend{
    display:flex;align-items:center;gap:9px;
    font-size:var(--t-sm);font-weight:700;color:var(--navy);
  }
  .dlg fieldset > legend::before{
    content:"";width:3px;height:15px;background:var(--navy);border-radius:2px;flex:none;
  }
  /* What the vehicle has already cost, at the head of an expense sheet. It is
     read, not answered, so it is drawn as a plain card rather than as another
     part of the sheet with a rule and boxes under it. */
  .prev-spend{background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px 14px 4px;}
  .prev-spend > legend{color:var(--ink);}
  .prev-spend > legend::before{display:none;}
  .prev-spend .exd-links > div{border-bottom:0;padding-bottom:4px;}
  .prev-spend .exd-links b{font-size:15px;color:var(--navy);}
  /* what a part of a sheet asks for under its lines */
  .lines-after{margin-top:var(--s3);padding-top:var(--s3);border-top:1px solid var(--line-soft);}
  /* a part drawn for a repair, entered a line at a time */
  .rline{
    position:relative;border:1px solid var(--line-soft);border-radius:var(--radius);
    background:#fff;padding:12px 44px 12px 12px;margin-bottom:var(--s3);
  }
  .rline:last-child{margin-bottom:0;}
  .rgrid{grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch;}
  /* A long label wraps to a second line, and on a plain grid that pushed its
     own box down while its neighbours stayed up, so a row of boxes read as
     two rows. The label takes the slack instead and every box in a row sits
     on the same line, whether its label ran to one line or two. */
  .rgrid > .fld{display:flex;flex-direction:column;justify-content:flex-end;}
  .rgrid > .fld > label{flex:1 1 auto;}
  .rgrid > .fld > .btn{width:100%;padding-top:6px;padding-bottom:6px;}
  @media (max-width:1100px){ .rgrid{grid-template-columns:repeat(3,minmax(0,1fr));} }
  @media (max-width:820px){ .rgrid{grid-template-columns:repeat(2,minmax(0,1fr));} }
  .rline-x{position:absolute;top:12px;right:12px;padding:2px 9px;line-height:1.4;}
  /* a job billed to a vendor and drawn off the shelf at once: the two are
     kept apart, because only one of them moves the district's balance */
  .rline-both{padding-bottom:6px;}
  .rsub{
    border:1px solid var(--line-soft);border-radius:var(--radius);
    background:var(--ledger);padding:10px;margin-top:var(--s3);
  }
  .rsub-h{
    display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;
    margin-bottom:var(--s3);
  }
  .rsub-h span{
    flex:1 1 auto;font-size:var(--t-stat-sm);font-weight:700;
    letter-spacing:.04em;text-transform:uppercase;color:var(--navy);
  }
  /* the button stands at the right of its heading, and stays there on the
     narrow widths where the heading takes the line to itself */
  .rsub-h .btn{margin-left:auto;flex:0 0 auto;}
  .rsub-line{position:relative;background:#fff;border:1px solid var(--line-soft);
    border-radius:var(--radius);padding:12px 44px 12px 12px;margin-bottom:var(--s3);}
  .rsub-line:last-child{margin-bottom:0;}
  .rsub-none{margin:0;font-size:var(--t-stat-sm);color:var(--muted);}
  .fslots{display:flex;flex-wrap:wrap;gap:var(--s3) 16px;}
  .fslot{flex:none;width:146px;}
  .fslot-ttl{
    font-size:var(--t-label);color:var(--muted);margin-bottom:5px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  /* inside a slot the tile stands over what is done with it */
  .fslot-row{display:flex;flex-direction:column;align-items:stretch;gap:7px;}
  .fslot-tile{
    width:100%;height:96px;border:1px dashed var(--line);
    border-radius:var(--radius);background:#fff;overflow:hidden;
    display:flex;align-items:center;justify-content:center;
  }
  .fslot-tile img{width:100%;height:100%;object-fit:cover;display:block;}
  /* A tile holding something is pressed to open it, so it reads as pressable:
     the same tile, with a hand over it and the navy edge on hover. */
  button.fslot-tile{padding:0;cursor:pointer;font:inherit;color:inherit;}
  button.fslot-tile:hover,button.fslot-tile:focus-visible{
    border-color:var(--navy);border-style:solid;
    box-shadow:0 6px 14px -12px rgba(6,10,32,.5);
  }
  .fslot-tile .fnone{font-size:var(--t-micro);color:var(--muted);}
  .fslot-tile .fext{
    font-family:var(--mono);font-size:var(--t-label);font-weight:600;
    color:var(--navy);letter-spacing:.04em;
  }
  /* A PDF is drawn on its tile, its first page, with the reader's own chrome
     turned off. It takes no clicks, so the tile around it still opens it. */
  .fpdf{width:100%;height:100%;display:block;border:0;pointer-events:none;background:#fff;}
  /* The document itself, read on the server and shown on the panel: the words
     of a Word file with its own headings and emphasis, the rows of a
     spreadsheet. It scrolls inside the panel, so a long document does not push
     the caption and its buttons off the page.

     Written against `.docshot` so it outranks the panel's own rule for a file
     that cannot be drawn - that one sets a monospace, muted, evenly-weighted
     face for a bare kind label, and it was flattening the document: every
     heading and every bold line read as the same grey typewriter text. */
  .docshot:has(.docread){max-width:640px;flex-basis:420px;}
  .docshot .docread{
    display:block;height:auto;min-height:220px;max-height:60vh;padding:0;
    background:#fff;color:var(--ink);font-family:inherit;font-weight:400;
    letter-spacing:normal;text-align:left;
  }
  .docshot .docread-body{
    width:100%;max-height:60vh;overflow:auto;padding:18px 20px;text-align:left;
    font-family:var(--sans, inherit);font-size:13px;line-height:1.6;
    color:var(--ink);font-weight:400;letter-spacing:normal;
  }
  .docshot .docread-body p{margin:0 0 10px;}
  /* the document's own shape: its headings, its emphasis, its lists and the
     pictures set inside it, so the paper reads as the paper */
  .docshot .docread-body h1,
  .docshot .docread-body h2,
  .docshot .docread-body h3{
    margin:16px 0 7px;color:var(--navy);line-height:1.3;font-weight:700;letter-spacing:normal;}
  .docshot .docread-body h1{font-size:18px;}
  .docshot .docread-body h2{font-size:15px;}
  .docshot .docread-body h3{font-size:14px;}
  .docshot .docread-body strong,.docshot .docread-body b{font-weight:700;color:var(--ink);}
  .docshot .docread-body em,.docshot .docread-body i{font-style:italic;}
  .docshot .docread-body ul,.docshot .docread-body ol{margin:0 0 10px;padding-left:22px;}
  .docshot .docread-body li{margin:0 0 4px;}
  .docshot .docread-body img{max-width:100%;height:auto;display:block;margin:10px 0;border-radius:4px;}
  .docshot .docread-body a{color:var(--navy);}
  .docshot .docread-body h4{margin:14px 0 6px;font-size:13px;font-weight:700;color:var(--navy);}
  .docshot .docread-body pre{
    margin:0;white-space:pre-wrap;word-break:break-word;
    font-family:var(--mono);font-size:12px;color:var(--ink);}
  .docshot .docread-body table{
    border-collapse:collapse;width:100%;margin:0 0 12px;font-size:12px;}
  .docshot .docread-body td,.docshot .docread-body th{
    border:1px solid var(--line-soft);padding:5px 8px;vertical-align:top;
    font-weight:400;letter-spacing:normal;}
  .docshot .docread-body tr:first-child td,.docshot .docread-body th{
    background:var(--ledger);font-weight:600;}
  .docshot .docread-body .dp-more{color:var(--muted);font-style:italic;}
  /* the viewer's panel for a file the browser will not draw holds the same
     typed chip a tile does, so the two read alike */
  .docmiss .fkind{width:100%;height:100%;}
  .docmiss .fkind-ext{font-size:16px;padding:6px 12px;}
  .docmiss .fkind-note{font-size:12px;}
  /* A file the browser will not draw says what it is: the kind, marked by
     colour so a spreadsheet is not read as a contract, and what to do with it. */
  .fkind{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    width:100%;height:100%;padding:6px;text-align:center;
  }
  .fkind-ext{
    font-family:var(--mono);font-size:13px;font-weight:700;letter-spacing:.06em;
    line-height:1;padding:4px 8px;border-radius:5px;color:#fff;background:var(--muted);
  }
  .fkind-note{font-size:10px;line-height:1.2;color:var(--muted);}
  .fkind.k-pdf  .fkind-ext{background:#B3261E;}
  .fkind.k-doc  .fkind-ext{background:#1A4E8A;}
  .fkind.k-xls  .fkind-ext{background:#1B6E3C;}
  .fkind.k-ppt  .fkind-ext{background:#B05A16;}
  .fkind.k-any  .fkind-ext{background:#5A6472;}
  .fslot-acts{display:flex;align-items:center;gap:4px 8px;flex-wrap:wrap;min-width:0;}
  .fslot-acts .btn{padding:2px 9px;}
  /* the name of the paper reads under the buttons, across the slot */
  .fslot-acts .fmeta{flex:1 1 100%;display:flex;flex-direction:column;gap:1px;min-width:0;}
  .fslot-acts .fname{
    font-size:var(--t-micro);color:var(--ink);
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;
  }
  .fslot-acts .fsize{
    font-size:var(--t-micro);color:var(--muted);
    font-family:var(--mono);font-variant-numeric:tabular-nums;
  }

  /* the registration mark, set as it appears on the vehicle */
  .plateblock{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-bottom:16px;}
  .plate{
    font-family:var(--mono);font-weight:600;font-size:19px;letter-spacing:.06em;
    color:var(--ink);background:#fff;border:2px solid var(--ink);
    padding:6px 14px;border-radius:3px;white-space:nowrap;
  }
  .plate-side{min-width:0;}
  .plate-line{font-size:var(--t-sm);color:var(--muted);}
  .plate-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;}
  .recview{width:100%;border-collapse:collapse;font-size:var(--t-sm);}
  .recview th{
    text-align:left;font-weight:500;color:var(--muted);width:44%;
    padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line-soft);background:#FAFAF7;
  }
  .recview td{padding:var(--cell-y) var(--cell-x);border-bottom:1px solid var(--line-soft);font-weight:600;}
  .recview tr:last-child th,.recview tr:last-child td{border-bottom:none;}

  .statusbar{display:none !important;}
  .statusbar{
    position:fixed;left:0;right:0;bottom:0;background:var(--navy-dk);color:#fff;
    padding:12px var(--gutter);font-size:var(--t-sm);transform:translateY(100%);transition:transform .18s;z-index:150;
    display:flex;gap:10px;align-items:center;border-top:3px solid var(--seal);
  }
  .statusbar.show{transform:translateY(0);}
  .statusbar i{width:9px;height:9px;background:#5FCB8B;border-radius:50%;flex:none;}

  /* ---------- footer ---------- */
  /* The band the logo sits on is a card at the foot of the page, not a bar
     ruled across it: it stands clear of the three edges and its corners are
     turned, so the dark ground does not run hard into the window.

     Glass, like the buttons: the theme's own dark tone at part strength over a
     blur, a lit top edge and a rim of the same tone. The colour is taken from
     `--navy-dk`, so each project's footer is its own. A browser without
     `color-mix` or `backdrop-filter` keeps the solid band above - the glass is
     added over it, never instead of it. */
  footer{
    background:#fff;color:var(--muted);font-size:var(--t-label);
    margin:var(--s5) var(--gutter) var(--gutter);
    border:1px solid var(--navy);
    border-radius:var(--radius-lg);overflow:hidden;
  }
  @supports (backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px)){
    footer{
      /* White glass: the card is white, and the only thing the theme colours is
         the line around it - the rim and the faint tint of its shadow. Each
         project keeps its own edge without the footer turning that colour. */
      background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
      -webkit-backdrop-filter:blur(14px) saturate(150%);
      backdrop-filter:blur(14px) saturate(150%);
      border:1px solid color-mix(in srgb, var(--navy) 55%, transparent);
      box-shadow:inset 0 1px 0 rgba(255,255,255,.9),
        0 8px 22px color-mix(in srgb, var(--navy) 16%, transparent);
    }
  }
  @media (max-width:720px){
    footer{margin:var(--s4) 10px 10px;border-radius:var(--radius);}
  }
  /* The banner at the foot of the page: centred, on the footer's own ground so
     it carries whatever theme the project is drawn in. It is given a measure of
     its own rather than the page's, so it does not stretch to a billboard on a
     wide screen, and it gives way to the width of the phone on a narrow one. */
  /* The banner signs the page off at the foot of it: centred, on nothing but
     the footer's own ground - no plate, no card, no border - and turned at the
     corners like everything else on the page. Its measure is its own, because
     it is a wide banner rather than the square-ish mark the masthead carries. */
  /* The depth of the footer is set here and nowhere else: the logo is given a
     height, not a width, so the band is that height plus its padding and can
     not creep back. 40px of logo and 6px above and below it comes to a 52px
     band. The width follows the picture's own proportions. */
  .foot-logo{
    display:flex;justify-content:center;align-items:center;
    padding:6px var(--gutter);background:transparent;
  }
  /* Cut out, so there is nothing to round off and nothing to sit it on - the
     letters stand straight on the footer's own ground.

     52px, and the picture behind it is 156px - exactly three times what is
     shown, resampled once from the original rather than twice. At 40px off a
     twice-resampled picture the two lines of lettering went soft; this is the
     size the words can actually be read at. */
  .foot-logo img{
    display:block;height:52px;width:auto;max-width:100%;
  }
  @media (max-width:720px){
    .foot-logo{padding:5px var(--gutter);}
    .foot-logo img{height:42px;}
  }

  @media (max-width:1100px){
    :root{--gutter:18px;}
    .filters{grid-template-columns:repeat(3,1fr);}
    .summary{grid-template-columns:repeat(3,1fr);}
    .form-grid{grid-template-columns:repeat(2,1fr);}
    .docs{grid-template-columns:repeat(3,1fr);}
    .twocol{grid-template-columns:1fr;}
  }
  @media (max-width:720px){
    :root{--gutter:14px;--t-page:19px;--t-stat:23px;--t-stat-sm:19px;}
    .filters{grid-template-columns:1fr 1fr;}
    .summary{grid-template-columns:1fr 1fr;}
    .form-grid{grid-template-columns:1fr;}
    .docs{grid-template-columns:1fr 1fr;}
    .mast-meta{text-align:left;}
    main{padding:16px var(--gutter) var(--s5);}
  }

  /* a register of this width belongs on a landscape sheet */
  @page{size:A4 landscape;margin:12mm;}
  @media print{
    .mainnav,.toolbar,.filter-actions,fieldset.filterbox,.pager,.statusbar,footer{display:none !important;}
    body{background:#fff;font-size:11px;}
    .masthead{padding:0 0 8px;border-bottom:2px solid #000;}
    .page-head{border-bottom:1px solid #000;}
    .tablewrap{border:1px solid #000;}
    .tbl th{background:#fff;color:#000;border:1px solid #000;}
    .tbl td{border:1px solid #000;}
    .rowacts{display:none;}
    /* the sheet is A4 wide, so the register is set tighter and the
       action column — which has nothing to print — is dropped */
    .tbl th:last-child,.tbl td:last-child{display:none;}
    .tbl th,.tbl td{padding:4px 6px;font-size:10px;height:auto;}
    .tbl th:nth-child(5),.tbl td:nth-child(5){min-width:0;}
    .tbl td:nth-child(3),.tbl td:nth-child(4){white-space:normal;}
    .sub{font-size:9px;}
    .pill{border-color:#000;}
  }
  /* ---------- curved surfaces ----------
     One corner size for the controls, a larger one for the surfaces that hold
     them. Anything that holds a table clips its own corners so the rows sit
     inside the curve. */
  .panel,.tablewrap,.modtabs,.viewswitch,.line-card,.soon-inline,
  .dlg,.navmenu,.usermenu,.fslot-tile,.doc,.pager{
    border-radius:var(--radius-lg);
  }
  .modtabs,.viewswitch,.dlg,.navmenu,.usermenu{
    overflow:hidden;
  }
  .panel{overflow:visible;}
  /* a panel already clips, so its table need not curve again */
  .panel .tablewrap{border-radius:0;}
  .panel > h3{border-radius:var(--radius-lg) var(--radius-lg) 0 0;}
  .pager{border-radius:0 0 var(--radius-lg) var(--radius-lg);}
  /* Inside a panel the panel's own corners are the ones that show, so the
     pager squares off with the table above it rather than curving inside a
     curve - which is what left the two ends looking unequal. */
  .panel .pager{border-radius:0;}
  .btn,.fld input,.fld select,.m-fld input,.m-fld select,.m-fld textarea,
  .lines-tbl input,.lines-tbl select,.pager .pages button,
  .dlg-close,.who,.mast-meta .who{
    border-radius:var(--radius);
  }
  .pill{border-radius:var(--radius-pill);padding-left:10px;padding-right:10px;}
  .modtabs button:first-child,.viewswitch button:first-child{
    border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg);
  }
  .emblem{border-radius:var(--radius);}
  /* the register keeps square corners on the sheet */
  @media print{
    .panel,.summary,.tablewrap,.modtabs,.viewswitch,.line-card,.dlg,.pill,.btn{
      border-radius:0 !important;
    }
  }

  @media (prefers-reduced-motion:reduce){
    *{transition:none !important;animation:none !important;}
  }

  /* ---------- Dashboard: FMS Overview ----------
     The overview reads on the cards the rest of the application already uses,
     so a figure on this page looks the same as the figure it opens. */
  .db-bar{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);flex-wrap:wrap;margin-bottom:var(--s3);}
  .db-lead{margin:0;font-size:var(--t-label);color:var(--muted);}

  /* A card that carries two readings splits them, the way the breakdown
     cards do: one box each, and each box opens its own list. */
  .summary .db-split{display:grid;grid-template-columns:1fr 1fr;gap:var(--s2);grid-row:2 / -1;}
  .summary .db-split > div{
    border:1px solid var(--line-soft);border-radius:var(--radius);
    padding:6px 8px;background:var(--paper);min-width:0;
  }
  .summary .db-split .n{display:block;font-size:var(--t-micro);color:var(--muted);line-height:1.25;min-height:24px;}
  .summary .db-split .v{
    display:block;font-family:var(--mono);font-size:14px;font-weight:600;
    color:var(--navy);margin:2px 0 4px;white-space:nowrap;letter-spacing:-.02em;
  }
  .summary .db-split .l{
    background:none;border:none;padding:0;font:inherit;font-size:var(--t-micro);
    color:var(--navy);text-decoration:none;cursor:pointer;text-align:left;
  }
  .summary .db-split .l:hover{color:var(--navy-mid);}

  /* ---------- preventive maintenance ---------- */
  /* the schedule cards take the whole width, in fixed columns, so the band
     reads the same whether the menu is out or drawn in */
  /* the panel head carries its own title alone */
  .pm-h3{display:flex;align-items:center;justify-content:space-between;gap:var(--s2) var(--s3);flex-wrap:wrap;}
  .pm-h3 .pm-title{display:inline-flex;align-items:center;gap:8px;}
  .pm-date{display:inline-flex;align-items:center;gap:8px;margin:0;font-family:var(--sans);font-size:var(--t-sm);font-weight:600;}
  .pm-date input{font-family:var(--sans);font-size:var(--t-sm);font-weight:700;color:var(--navy);
    padding:5px 10px;border:2px solid var(--navy);border-radius:8px;background:var(--panel);cursor:pointer;}
  .pmgrid{display:grid;grid-template-columns:repeat(var(--cols,4),minmax(0,1fr));gap:var(--s3);grid-auto-rows:1fr;}
  /* each service's card is drawn in its state: red where a vehicle is overdue, amber where
     one is due soon, green where every vehicle is clear */
  .pmcard{--pm-tone:var(--forest);
    border:2px solid var(--pm-tone);border-radius:12px;padding:14px 16px 12px;background:var(--panel);
    display:flex;flex-direction:column;gap:8px;cursor:pointer;box-shadow:0 3px 8px rgba(0,0,0,.05);
    transition:box-shadow .15s ease, transform .15s ease;
  }
  .pmcard:hover,.pmcard:focus-visible{box-shadow:0 6px 16px rgba(0,0,0,.10);transform:translateY(-1px);outline:none;}
  .pmcard.pm-over{--pm-tone:var(--lapse);}
  .pmcard.pm-soon{--pm-tone:var(--caution);}
  /* the name and its interval stay on one line, so every card's count sits at the same height
     (the longest interval, 1,20,000 KM / 480 days, had dropped to a line of its own) */
  .pmcard .top{display:flex;align-items:center;justify-content:space-between;gap:var(--s2);flex-wrap:nowrap;}
  .pmcard .nm{font-weight:700;color:var(--pm-tone);font-size:var(--t-sm);flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
  .pmcard .pm-interval{flex:none;font-size:10.5px;font-weight:700;color:var(--pm-tone);padding:3px 8px;border-radius:12px;
    background:color-mix(in srgb, var(--pm-tone) 10%, transparent);white-space:nowrap;}
  .pmcard .big{font-family:var(--mono);font-size:var(--t-stat);font-weight:600;color:var(--navy);line-height:1;}

  .pmcard .big em{font-family:var(--sans);font-style:normal;font-size:var(--t-label);font-weight:600;color:var(--muted);margin-left:7px;}
  .pmcard .pills{display:flex;flex-wrap:wrap;gap:6px;}
  .pmcard .foot{margin-top:auto;padding-top:8px;border-top:1px solid var(--line-soft);display:flex;
    justify-content:space-between;align-items:center;font-size:var(--t-micro);font-weight:700;color:var(--pm-tone);}

  /* ---------- Daily Shift Entries (shifts.js) ---------- */
  .shift-actions{display:flex;gap:var(--s2);align-items:center;}
  /* Flag on a row is the flag symbol alone; its name is kept for screen readers and the tooltip. */
  .rowacts .btn-link.shift-flag-btn{font-size:16px;line-height:1;padding-inline:10px;
    font-family:var(--sans);color:#FFFFFF;}
  .shift-filters{display:flex;flex-wrap:wrap;gap:var(--s2);align-items:center;margin:0 0 var(--s3);
    padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);}
  .shift-filters input,.shift-filters select{min-height:34px;padding:4px 10px;border:1px solid var(--line);
    border-radius:8px;background:var(--panel);font:inherit;font-size:var(--t-sm);color:var(--ink);}
  .shift-filters .shift-search{flex:1 1 260px;min-width:200px;}
  .shift-filters select{min-width:170px;}
  .summary > .shift-alert{background:#FFFBEB;border-color:#F5C26B;}
  .shift-claims{font-size:var(--t-micro);font-weight:600;color:var(--muted);}
  .summary > .shift-alert .shift-claims{color:var(--caution);}
  /* the pager, inside the register's panel under its last row */
  .shift-pager{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:var(--s2);
    padding:10px 14px;border-top:1px solid var(--line);background:var(--panel);font-size:var(--t-sm);}
  .shift-pager-right{display:inline-flex;align-items:center;gap:8px;}
  .shift-pager select{margin-left:6px;min-height:30px;border:1px solid var(--line);border-radius:6px;background-color:var(--panel);}
  .shift-of{min-width:44px;text-align:center;font-weight:600;}
  #modFormBody .fld-wide{grid-column:1 / -1;}

  /* ---------- Support Tickets Desk (tickets.js) ---------- */
  .tk-tags{display:flex;flex-wrap:wrap;gap:4px;max-width:260px;}
  .tk-tag{display:inline-block;max-width:240px;padding:2px 8px;border:1px solid var(--line);border-radius:999px;
    background:var(--paper);font-size:11.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .tk-tag-more{color:var(--muted);font-family:inherit;line-height:inherit;cursor:pointer;}
  .tk-tag-more:hover{color:var(--ink);border-color:var(--muted);}
  .tk-tags:not(.tk-tags-open) .tk-tag-extra{display:none;}
  .tk-desk-subject{display:block;max-width:320px;}
  .tk-no{white-space:nowrap;}
  .tkt-more{margin:8px 0 0;font-size:12.5px;color:var(--muted);}
  /* ---------- Raise Ticket (tickets.js) ---------- */
  .dlg.tk-mode{max-width:880px;}
  /* the Tag / Assign To list opens over the sheet rather than inside a scroll */
  .dlg.tk-mode .dlg-body{max-height:none;overflow:visible;}
  .tk-form{display:flex;flex-direction:column;gap:12px;}
  /* a button's own display must not show what the sheet has hidden (the attachment's Remove) */
  .tk-form [hidden]{display:none !important;}
  .tk-form .fld{display:flex;flex-direction:column;gap:5px;margin:0;}
  .tk-form label{font-size:var(--t-sm);font-weight:600;color:var(--ink);}
  .tk-form input[type="text"],.tk-form textarea,.tk-form select{width:100%;padding:8px 12px;border:1px solid var(--line);
    border-radius:8px;background:var(--panel);font:inherit;font-size:var(--t-sm);color:var(--ink);box-sizing:border-box;}
  .tk-form textarea{resize:vertical;min-height:96px;}
  .tk-top{display:grid;grid-template-columns:130px minmax(0,1fr);gap:14px;align-items:start;}
  .tk-assign{position:relative;display:flex;flex-direction:column;gap:5px;}
  .tk-assign-head{display:flex;justify-content:space-between;align-items:center;gap:8px;}
  .tk-assign-label{font-size:var(--t-sm);font-weight:700;color:var(--ink);}
  .tk-count{font-size:12px;font-weight:600;color:var(--muted);}
  .tk-box{min-height:44px;border:1.5px solid var(--line);border-radius:8px;padding:6px 10px;background:var(--panel);
    display:flex;flex-wrap:wrap;gap:6px;align-items:center;cursor:pointer;}
  .tk-box.open{border-color:var(--navy);box-shadow:0 0 0 2px color-mix(in srgb, var(--navy) 18%, transparent);}
  .tk-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:16px;font-size:13px;font-weight:700;line-height:1.4;}
  .tk-chip-dept{background:#EEF2FF;color:#4338CA;border:1px solid #C7D2FE;}
  .tk-chip-user{background:#E0F2FE;color:#0369A1;border:1px solid #BAE6FD;}
  .tk-chip-x{background:none;border:none;color:inherit;cursor:pointer;font-size:15px;font-weight:700;padding:0 2px;line-height:1;}
  .tk-toggle{margin-left:auto;background:#F1F5F9;border:1px solid #CBD5E1;border-radius:8px;padding:4px 10px;
    font-size:12.5px;font-weight:700;color:var(--navy);cursor:pointer;}
  .tk-panel{position:absolute;top:100%;left:0;right:0;z-index:40;margin-top:4px;background:var(--panel);
    border:1.5px solid #CBD5E1;border-radius:8px;box-shadow:0 12px 28px -4px rgba(0,0,0,.22);padding:12px 14px;
    max-height:430px;overflow-y:auto;}
  .tk-search input{width:100%;padding:8px 12px;border:1.5px solid var(--ink);border-radius:6px;font:inherit;font-size:var(--t-sm);box-sizing:border-box;}
  .tk-sec{margin-top:12px;}
  .tk-sec-depts{padding-bottom:12px;border-bottom:1px solid var(--line);}
  .tk-sec-title{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.02em;margin-bottom:6px;}
  .tk-t-dept{color:#4338CA;} .tk-t-dfm{color:#0369A1;} .tk-t-dm{color:#0891B2;}
  .tk-t-oe{color:#B45309;} .tk-t-head{color:#7C3AED;} .tk-t-crew{color:#475569;}
  .tk-depts{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:6px;}
  .tk-users{display:flex;flex-direction:column;gap:4px;max-height:150px;overflow-y:auto;}
  .tk-opt{display:flex;align-items:center;gap:9px;padding:6px 10px;border:1px solid #EEF1F5;border-radius:6px;
    background:var(--panel);font-size:13px;font-weight:500;cursor:pointer;}
  .tk-opt input{width:16px;height:16px;cursor:pointer;flex:none;}
  .tk-opt.on{border-color:#4F46E5;background:#EEF2FF;font-weight:700;}
  .tk-users-head{display:flex;justify-content:space-between;align-items:center;margin-top:12px;
    font-size:12px;font-weight:800;text-transform:uppercase;color:var(--ink);}
  .tk-users-head span:last-child{text-transform:none;color:var(--muted);font-weight:700;}
  .tk-empty{margin-top:8px;padding:14px;border:1px dashed #CBD5E1;border-radius:8px;color:var(--muted);font-size:13px;background:#F8FAFC;}
  .tk-panel-foot{display:flex;justify-content:flex-end;margin-top:12px;padding-top:10px;border-top:1px solid var(--line);}
  .tk-attach{display:flex;align-items:center;gap:10px;}
  .tk-thumb{width:88px;height:88px;border:1.5px dashed #CBD5E1;border-radius:8px;display:flex;align-items:center;
    justify-content:center;font-size:12px;color:var(--muted);overflow:hidden;background:#FAFBFC;text-align:center;}
  .tk-thumb img{width:100%;height:100%;object-fit:cover;}
  /* a file already saved on the record, shown from the server and opened full size on a click */
  .tk-thumb .de-saved-file{display:flex;align-items:center;justify-content:center;width:100%;height:100%;
    color:inherit;text-decoration:none;}
  /* the logsheet pictures of a daily entry: a tile each, its own remove, and + Add for more */
  .de-logs{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start;}
  .de-log{position:relative;}
  .de-log-x{position:absolute;top:-7px;right:-7px;width:22px;height:22px;padding:0;border:1px solid var(--line);
    border-radius:50%;background:var(--panel);color:var(--lapse);font-size:14px;line-height:1;cursor:pointer;
    box-shadow:0 1px 3px rgba(0,0,0,.15);}
  .de-log-add{width:88px;height:88px;border:1.5px dashed var(--navy);border-radius:8px;background:transparent;
    color:var(--navy);font:inherit;font-size:13px;font-weight:700;cursor:pointer;}
  .de-log-add:hover{background:var(--ledger);}
  .de-log-count{margin-left:6px;font-size:11.5px;font-weight:500;color:var(--muted);}
  .tk-file-name{padding:4px;word-break:break-all;font-size:11px;}
  @media (max-width:720px){ .tk-top{grid-template-columns:1fr;} }

  /* ---------- Add / Edit Daily Entry (shifts.js) ---------- */
  .dlg.de-mode{max-width:880px;}
  .de-form [hidden]{display:none !important;}
  .de-error{margin-bottom:12px;padding:10px 12px;border:1px solid #F5C2C0;border-radius:8px;background:#FEF2F2;
    color:#B42318;font-size:var(--t-sm);font-weight:600;}
  .de-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;align-items:start;}
  .de-full{grid-column:1 / -1;}
  .de-fld{display:flex;flex-direction:column;gap:5px;min-width:0;}
  .de-fld label{font-size:12.5px;font-weight:700;color:var(--ink);}
  /* the range an activity reading must stay inside, and what is said when a keystroke leaves it */
  .de-hint{font-size:11.5px;line-height:1.3;color:var(--muted);}
  .de-hint.de-hint-bad{color:#B42318;font-weight:600;}
  .de-form input,.de-form select,.de-form textarea{width:100%;box-sizing:border-box;padding:8px 12px;border:1px solid var(--line);
    border-radius:8px;background-color:#F8FAFC;font:inherit;font-size:var(--t-sm);color:var(--ink);}
  .de-form input[readonly]{background:#EEF2F6;color:var(--muted);}
  .de-form select:disabled{opacity:.6;cursor:not-allowed;}
  .de-form textarea{min-height:68px;resize:vertical;}
  .de-card{background:#F8FAFC;border:1px solid var(--line);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:6px;}
  .de-card.de-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;}
  .de-col{display:flex;flex-direction:column;gap:8px;min-width:0;}
  .de-card-head{font-size:15px;font-weight:700;color:var(--ink);}
  .de-card-note{font-size:12.5px;color:var(--muted);}
  .de-card-title{font-size:12px;font-weight:800;}
  .de-day{color:#0F7C86;} .de-night{color:#2563EB;}
  .de-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:6px;}
  .de-form .de-acts select{width:auto;min-width:80px;padding:4px 8px;}
  .de-form .de-acts #de-add-activity{min-width:210px;}
  .de-chip{padding:3px 10px;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-size:12px;
    font-weight:600;cursor:pointer;color:var(--ink);}
  .de-chip:hover{border-color:var(--lapse);color:var(--lapse);}
  .de-readout{display:flex;flex-direction:column;gap:3px;padding:6px 0 10px;border-bottom:1px solid var(--line);}
  .de-readout span,.de-info-head,.de-stats span{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);}
  .de-readout strong{font-size:16px;color:var(--ink);}
  .de-info{background:#F8FAFC;border:1px solid var(--line);border-radius:8px;padding:10px 14px;display:flex;flex-direction:column;gap:3px;}
  .de-info strong{font-size:15px;color:#0F7C86;}
  .de-info em{font-style:normal;font-weight:500;font-size:12px;color:var(--muted);margin-left:6px;text-transform:uppercase;}
  .de-info-good{font-size:12.5px;font-weight:600;color:#059669;}
  .de-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px 12px;margin-top:6px;}
  .de-stats div{display:flex;flex-direction:column;gap:3px;border-bottom:1px solid var(--line);padding-bottom:6px;}
  .de-stats strong{font-size:14px;color:var(--ink);}
  /* a figure the card takes from the oxygen trip, where the day has no fuel figure of its own */
  .de-stats strong em{margin-left:4px;font-style:normal;font-size:10.5px;font-weight:600;color:var(--muted);
    text-transform:uppercase;letter-spacing:.03em;}
  .de-uploads{display:flex;flex-wrap:wrap;gap:16px 28px;}
  /* The accident papers are the shared upload box now, the same one the
     Expenses and Stock sheets use, so each takes the width its slots need and
     they read down the sheet rather than being squeezed side by side. */
  .de-uploads .fileset{flex:1 1 100%;min-width:0;}
  .de-uploads .fileset .fhead{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    margin:0 0 6px;}
  .de-uploads .fileset .fhead label{margin:0;}
  @media (max-width:720px){ .de-grid,.de-card.de-two{grid-template-columns:1fr;} }

  /* ---------- charts ---------- */
  .chartwrap svg{display:block;width:100%;height:auto;}
  .chartnote{margin:var(--s2) 0 0;font-size:var(--t-micro);color:var(--muted);}

  /* ---------- priority tickets ---------- */
  .tkt{
    border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel);
    padding:var(--s3) 14px;margin-bottom:var(--s3);display:grid;
    grid-template-columns:1fr auto auto;gap:var(--s3);align-items:start;
  }
  .tkt:last-child{margin-bottom:0;}
  .tkt .pills{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px;}
  .tkt h4{font-family:var(--sans);font-size:var(--t-sm);font-weight:600;color:var(--navy);margin:0 0 6px;text-transform:uppercase;letter-spacing:.01em;}
  .tkt .meta{font-size:var(--t-micro);color:var(--muted);line-height:1.9;}
  .tkt .meta b{color:var(--ink);font-weight:600;}
  .tkt .chip{
    display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line-soft);
    background:var(--paper);border-radius:var(--radius-pill);padding:1px 9px;margin:0 4px 3px 0;
    font-size:var(--t-micro);color:var(--navy);
  }
  .tkt .body{margin:8px 0 0;font-size:var(--t-label);color:var(--ink);}
  .tkt .idtag{align-self:center;font-family:var(--mono);font-size:var(--t-micro);color:var(--muted);white-space:nowrap;}
  .tkt .acts{display:flex;flex-direction:column;gap:6px;min-width:138px;}
  .tkt .acts .btn{width:100%;justify-content:center;}

  /* ---------- district readiness is read as a table ---------- */
  /* ---------- filter chips and dialog readings ---------- */
  .chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
  .chips .lbl{font-size:var(--t-label);color:var(--muted);margin-right:2px;}
  .chip-b{
    border:1px solid var(--line);background:var(--panel);border-radius:var(--radius);
    padding:4px 11px;font-family:var(--sans);font-size:var(--t-label);color:var(--navy);cursor:pointer;
  }
  .chip-b:hover{border-color:var(--navy);}
  .chip-b.on{background:var(--navy);border-color:var(--navy);color:#fff;font-weight:600;}
  .chip-b .n{font-family:var(--mono);margin-left:5px;}
  .chip-b.tally{background:var(--amber-bg);border-color:#E2CE9F;color:var(--caution);cursor:default;font-weight:600;}
  .dstat{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);padding:9px 13px;margin-bottom:var(--s2);}
  /* a count that narrows the table under it reads as pressable, and shows
     when it is the one being read */
  button.dstat{display:block;width:100%;text-align:left;font:inherit;cursor:pointer;}
  button.dstat:hover,button.dstat:focus-visible{
    border-color:var(--navy);box-shadow:0 4px 10px -8px rgba(6,10,32,.5);outline:none;}
  button.dstat.on{border-color:var(--navy);border-width:2px;background:color-mix(in srgb, var(--navy) 6%, var(--panel));}
  .dstat .k{font-size:var(--t-micro);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
  .dstat .v{font-family:var(--mono);font-size:19px;font-weight:600;color:var(--navy);display:block;margin-top:2px;}
  .dstat.bad .v{color:var(--lapse);}
  .dstat.warn .v{color:var(--caution);}
  .dstat.good .v{color:var(--forest);}
  .dbfoot-left{margin-right:auto;font-size:var(--t-label);color:var(--muted);}

  /* ---------- the sign-in gate ----------
     Nothing on the system is drawn until somebody has signed in.
     Split screen: the ask on the left in white, the promise on the
     right in the brand gradient over the night run. Every colour and
     the type here belong to the gate alone and are scoped to .gate,
     so nothing leaks into the application behind it. */
  .gate{
    --fms-purple:#7A18C9;
    --fms-violet:#5B1FA8;
    --fms-magenta:#E0117F;
    --fms-pink:#F2247B;
    --fms-orange:#F7901E;
    --fms-amber:#FDB913;
    --fms-navy:#141E4E;
    --fms-ink:#101828;
    --fms-slate:#5B6478;
    --fms-line:#E3E6EF;
    --fms-ask:#F2F0FB;   /* the one colour the ask is set on */
    --fms-font:'Poppins','Segoe UI',system-ui,sans-serif;
    /* The four the sign-in screen is actually painted in: the ground behind
       the card, the three stops of the promise beside it, and the colour its
       button glows in. Written as variables at the values they always had, so
       Default is untouched and a tone has something to answer. */
    --fms-back:#0B1230;
    --fms-right-1:#232E6B;
    --fms-right-2:#1A2358;
    --fms-right-3:#121A46;
    --fms-glow:224,17,127;

    position:fixed;inset:0;z-index:300;display:flex;align-items:center;justify-content:center;
    padding:20px;background:var(--fms-back);overflow:auto;
  }
  /* the application sets its headings in a serif; the gate is set in one face */
  .gate,.gate *{font-family:var(--fms-font);}
  .gate[hidden]{display:none;}
  body.gated{overflow:hidden;}
  /* A session is already kept, so the sign-in screen is not drawn while the
     scripts are being read - it flashed on every refresh. The application
     takes the mark off the moment it finds there is no session to restore. */
  html.fms-has-session .gate{display:none;}
  /* While a kept session is being restored, the application is not shown half
     built: the masthead, the menu and the page are hidden until the screens
     have been drawn, and the page stands on its own background meanwhile. */
  html.fms-booting body > *:not(.gate){visibility:hidden;}
  html.fms-booting body{background:var(--bg, #F4F6F7);}

  /* the card ------------------------------------------------ */
  .gate-card{
    position:relative;z-index:1;width:100%;max-width:972px;
    display:grid;grid-template-columns:minmax(0,0.43fr) minmax(0,0.57fr);
    background:var(--fms-ask);border-radius:22px;overflow:hidden;
    box-shadow:0 30px 70px rgba(6,10,32,.55), 0 0 0 1px rgba(255,255,255,.06);
    min-height:min(568px, calc(100vh - 40px));
    color-scheme:light;
  }

  /* ---------- left: the ask ---------- */
  .gate-left{
    position:relative;z-index:2;background:var(--fms-ask);
    padding:22px 24px 22px;display:flex;flex-direction:column;justify-content:center;align-items:center;
    overflow:hidden;
  }
  .gate-head,.gate-form{position:relative;z-index:1;}

  .gate-head{position:relative;z-index:1;width:100%;max-width:326px;padding:0;margin:0 auto 18px;background:none;border:none;}
  .gate-chip{display:inline-flex;padding:0;background:none;box-shadow:none;border-radius:0;}
  .gate-chip{display:block;}
  .gate-head .emblem{
    height:auto;width:100%;max-width:266px;display:block;
  }
  /* the office the register is kept for, and the two projects it covers */
  /* the two projects the register covers, set off on their own ground */

  .gate-form{width:100%;max-width:326px;padding:0;margin:0 auto;border:none;}
  .gate-form h1{
    font-family:var(--fms-font);font-weight:700;font-size:19px;
    color:var(--fms-ink);margin:0;line-height:1.22;letter-spacing:-.012em;
  }
  .gate-note{margin:5px 0 13px;font-size:11.5px;color:var(--fms-slate);line-height:1.55;}

  .gate-form .fld{margin-bottom:9px;}
  /* every field is named above it, so nothing rests on a placeholder alone */
  .gate-form .fld label{
    display:block;margin:0 0 6px 2px;
    font-size:11px;font-weight:600;color:var(--fms-ink);letter-spacing:.01em;
  }
  .gate-form .fld label .req{color:var(--fms-magenta);}
  .gate-in{position:relative;display:block;}
  .gate-in > svg.gate-lead{
    position:absolute;left:13px;top:50%;transform:translateY(-50%);
    color:var(--fms-slate);pointer-events:none;
  }
  .gate-form input,.gate-form select{
    width:100%;padding:9px 13px 9px 38px;border-radius:9px;
    border:1.5px solid var(--fms-line);background:#FFFFFF;
    font-family:var(--fms-font);font-size:12.5px;color:var(--fms-ink);
    transition:border-color .14s, box-shadow .14s;
    -webkit-appearance:none;appearance:none;
  }
  .gate-form input::placeholder{color:#98A0B3;}
  .gate-form input:focus,.gate-form select:focus{
    outline:none;border-color:var(--fms-purple);
    box-shadow:0 0 0 4px rgba(122,24,201,.13);
  }
  .gate-form select{
    padding-right:44px;cursor:pointer;color:var(--fms-ink);
    background-repeat:no-repeat;background-position:right 18px center;
  }
  .gate-caret{
    position:absolute;right:18px;top:50%;transform:translateY(-50%);
    color:var(--fms-slate);pointer-events:none;
  }
  .gate-eye{
    position:absolute;right:8px;top:50%;transform:translateY(-50%);
    width:34px;height:34px;display:flex;align-items:center;justify-content:center;
    border:none;background:none;color:var(--fms-slate);cursor:pointer;border-radius:9px;
  }
  .gate-eye:hover{color:var(--fms-purple);background:rgba(122,24,201,.07);}

  .gate-hint{
    margin:9px 0 0;font-size:10px;line-height:1.5;color:var(--fms-slate);
  }
  .gate-err{
    margin:0 0 11px;padding:9px 13px;border:1px solid #F5C2C0;
    border-radius:10px;background:#FDEDEC;color:#B4232A;font-size:12.5px;
    line-height:1.5;
  }
  /* the same strip carries a plain notice, in a colour that is not a refusal */
  .gate-err.info{border-color:#C9D8F5;background:#EDF3FE;color:#1D3D7A;}

  .gate-go{
    width:100%;display:flex;align-items:center;justify-content:center;gap:11px;
    margin-top:5px;padding:10px 14px;border-radius:10px;border:none;cursor:pointer;
    font-family:var(--fms-font);font-size:14px;font-weight:600;color:#FFFFFF;
    /* Three stops of one family. All three are the gate's own palette, and a
       theme has to set all three: the themes set the first two and left the
       third on a gold belonging to no theme, which is the split running
       across the button. Default keeps the BAVYA gradient - purple, magenta,
       orange - and each theme now ends on a lighter step of its own colour. */
    background:linear-gradient(90deg,var(--fms-purple) 0%,var(--fms-magenta) 42%,var(--fms-orange) 100%);
    box-shadow:0 12px 26px rgba(var(--fms-glow),.32);
    transition:transform .12s, box-shadow .12s, filter .12s;
  }
  .gate-go:hover{filter:brightness(1.06);box-shadow:0 16px 32px rgba(var(--fms-glow),.4);}
  .gate-go:active{transform:translateY(1px);}
  .gate-go svg{flex:none;}

  /* ---------- right: the promise ----------
     The photograph is the ground. It runs along the foot of the panel at
     its own proportion, so the whole of the run stays in frame, and the
     words set over it carry their own shadow rather than a heavy scrim. */
  .gate-right{
    position:relative;overflow:hidden;color:#FFFFFF;
    padding:18px 22px 16px;
    display:flex;flex-direction:column;
    background:linear-gradient(168deg,var(--fms-right-1) 0%,var(--fms-right-2) 44%,var(--fms-right-3) 100%);
  }
  .gate-photo{
    position:absolute;left:0;right:0;bottom:0;z-index:0;
    width:100%;height:62%;object-fit:cover;object-position:center 42%;
    filter:saturate(1.28) contrast(1.12) brightness(1.08);
    -webkit-mask-image:linear-gradient(180deg, rgba(0,0,0,0) 0%, #000 15%, #000 100%);
    mask-image:linear-gradient(180deg, rgba(0,0,0,0) 0%, #000 15%, #000 100%);
    pointer-events:none;user-select:none;
  }
  .gate-scrim{
    position:absolute;inset:0;z-index:1;pointer-events:none;
    background:linear-gradient(180deg,
      rgba(14,20,58,.42) 0%, rgba(14,20,58,.20) 26%, rgba(14,20,58,0) 46%,
      rgba(10,15,44,0) 72%, rgba(9,13,42,.42) 92%, rgba(8,12,38,.72) 100%);
  }

  .gate-org{position:relative;z-index:3;text-align:center;line-height:1.35;}
  .gate-org b{
    display:block;font-size:16px;font-weight:700;color:#FFFFFF;
    text-shadow:0 2px 6px rgba(5,9,30,.95);
  }
  .gate-org > span{
    display:block;margin-top:2px;font-size:11.5px;font-weight:500;color:#D7E0F8;
    text-shadow:0 1px 4px rgba(5,9,30,.9);
  }
  .gate-org .gate-proj{
    display:inline-block;margin-top:7px;padding:3px 11px;
    font-size:10px;font-weight:700;color:#FFFFFF;
    text-transform:uppercase;letter-spacing:.1em;
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.22);border-radius:999px;
  }
  .gate-org .gate-proj i{font-style:normal;color:var(--fms-amber);margin:0 7px;}

  /* the six the system is made of, along the head of the dark half */
  .gate-mods{
    position:relative;z-index:3;margin-top:14px;
    display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;
  }
  .gate-mod{text-align:center;}
  .gate-mod .gate-tile{
    width:38px;height:38px;margin:0 auto 6px;
    display:flex;align-items:center;justify-content:center;
  }
  .gate-mod .gate-tile svg{
    width:24px;height:24px;filter:drop-shadow(0 1px 4px rgba(4,8,28,.85));
  }
  .gate-mod p{
    margin:0;font-size:9.5px;line-height:1.3;font-weight:600;color:#FFFFFF;
    text-shadow:0 1px 3px rgba(4,7,26,.95), 0 0 12px rgba(4,7,26,.8);
  }

  /* the three the run buys, along its foot */
  .gate-stats{
    position:relative;z-index:3;margin-top:auto;padding-top:20px;
    display:flex;align-items:stretch;gap:12px;
  }
  .gate-stat{
    flex:1 1 0;min-width:0;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  }
  .gate-stat svg{color:#FFFFFF;filter:drop-shadow(0 1px 3px rgba(5,9,30,.85));}
  .gate-stat span{
    font-size:11px;font-weight:600;color:#FFFFFF;text-align:center;
    text-shadow:0 1px 3px rgba(4,7,26,.95), 0 0 12px rgba(4,7,26,.8);
  }
  .gate-stats .gate-bar{width:1px;align-self:stretch;background:rgba(255,255,255,.34);}

  /* on a short screen the gate steps down again rather than being scrolled */
  @media (max-height:720px){
    .gate{padding:12px;}
    .gate-card{min-height:min(512px, calc(100vh - 24px));max-width:912px;border-radius:15px;}

    .gate-org b{font-size:14.5px;}
    .gate-org > span{font-size:10.5px;}
    .gate-org .gate-proj{font-size:9px;padding:3px 9px;}
    .gate-left{padding:20px 28px 24px;}
    .gate-head{margin-bottom:15px;}
    .gate-head .emblem{max-width:226px;}
    .gate-form{margin-top:14px;}
    .gate-form h1{font-size:17.5px;}
    .gate-note{margin:4px 0 13px;font-size:13px;}
    .gate-form .fld{margin-bottom:10px;}
    .gate-form .fld label{margin-bottom:4px;font-size:11.5px;}
    .gate-hint{margin-top:10px;font-size:10.5px;}
    .gate-in input,.gate-in select{padding:10px 14px 10px 42px;font-size:13.5px;}
    .gate-in > svg.gate-lead{left:14px;}
    .gate-go{padding:11px 16px;font-size:15px;}
    .gate-right{padding:18px 20px 16px 30px;}
  }

  /* ---------- narrower screens ---------- */
  @media (max-width:1080px){
    .gate-right{padding:30px 32px 26px 48px;}
    .gate-left{padding:32px 30px 26px;}
  }
  @media (max-width:900px){
    .gate{padding:0;}
    .gate-card{
      grid-template-columns:minmax(0,1fr);max-width:560px;min-height:0;
      border-radius:0;box-shadow:none;
    }
    .gate-left{order:1;padding:30px 22px 38px;}
    .gate-right{order:2;min-height:400px;}
    .gate-right{padding:14px 16px 14px;}
    .gate-mod .gate-tile{width:34px;height:34px;}
    .gate-mod .gate-tile svg{width:21px;height:21px;}
    .gate-mod p{font-size:9px;}
    .gate-org b{font-size:14.5px;}
  }

/* ============ the BAVYA - FMS logo ============
   Drawn in the page: the four-leaf mark and the wordmark over "Fleet Management
   System". Where src/assets/bavya-fms-logo.png has been saved, that picture is
   shown in its place (the <img> inside marks the logo .has-file when it loads). */
.bfms-logo{display:flex;align-items:center;gap:12px;line-height:1;position:relative;
  font-family:'Poppins','Segoe UI',system-ui,sans-serif;}
.bfms-logo .bfms-file{display:none;}
.bfms-logo.has-file .bfms-file{display:block;width:100%;height:auto;}
.bfms-logo.has-file .bfms-mark,.bfms-logo.has-file .bfms-word{display:none;}
.bfms-mark{flex:none;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:3px;
  width:var(--bfms-mark,54px);height:var(--bfms-mark,54px);}
.bfms-mark i{display:block;}
.bfms-mark i:nth-child(1){background:linear-gradient(135deg,#FDC830,#F7931E);border-radius:44% 14% 14% 14%;}
.bfms-mark i:nth-child(2){background:linear-gradient(135deg,#F9A13A,#F26A1B);border-radius:14% 44% 14% 14%;}
.bfms-mark i:nth-child(3){background:linear-gradient(135deg,#E8214A,#C8102E);border-radius:14% 14% 14% 44%;}
.bfms-mark i:nth-child(4){background:linear-gradient(135deg,#6A1FB0,#4A148C);border-radius:14% 14% 44% 14%;}
.bfms-word{display:flex;flex-direction:column;min-width:0;}
.bfms-name{display:flex;align-items:baseline;white-space:nowrap;
  font-size:var(--bfms-size,32px);font-weight:700;letter-spacing:.01em;}
.bfms-name b{font-weight:700;
  background:linear-gradient(90deg,#4A148C 0%,#8E1AA8 30%,#D81B60 64%,#F7901E 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;}
.bfms-name em{font-style:italic;font-weight:800;
  background:linear-gradient(90deg,#E0117F,#F7901E);
  -webkit-background-clip:text;background-clip:text;color:transparent;}
.bfms-tag{display:block;margin-top:5px;padding-top:5px;position:relative;
  font-size:var(--bfms-tag,8.5px);font-weight:600;letter-spacing:.42em;text-transform:uppercase;
  color:#3A3F55;white-space:nowrap;}
.bfms-tag::before{content:"";position:absolute;left:0;right:.42em;top:0;height:2px;border-radius:2px;
  background:linear-gradient(90deg,#7A18C9,#E0117F 55%,#F7901E);}
/* in the masthead the logo keeps to the menu column's height */
.masthead .bfms-logo.emblem{width:auto;--bfms-mark:38px;--bfms-size:21px;--bfms-tag:6.4px;gap:9px;}

/* ============ the sign-in page, as BAVYA - FMS draws it ============
   The white card on the left - logo, Welcome Back, the two fields, Remember me
   and Forgot Password, Login, the two federated buttons and the secure-access
   line - and the night run on the right with the promise over it. These rules
   come after the gate's own, so they are what the page is drawn in. */
.gate{background:linear-gradient(135deg,#EEF0F8 0%,#E4E7F2 100%);}
.gate-card{max-width:1180px;grid-template-columns:minmax(0,0.42fr) minmax(0,0.58fr);
  min-height:min(660px, calc(100vh - 40px));background:#FFFFFF;
  box-shadow:0 30px 70px rgba(40,30,90,.22), 0 0 0 1px rgba(40,30,90,.05);}
.gate-left{background:#FFFFFF;padding:34px 44px 22px;justify-content:center;}
.gate-head{max-width:360px;margin:0 auto 20px;}
.gate-head .bfms-logo{--bfms-mark:58px;--bfms-size:33px;--bfms-tag:8.6px;}
.gate-form{max-width:360px;}
.gate-form h1{font-size:30px;font-weight:800;letter-spacing:-.02em;color:#10132B;}
.gate-note{margin:4px 0 18px;font-size:14px;color:#5B6478;}
.gate-form .fld{margin-bottom:12px;}
.gate-form .gate-in input{padding:12px 46px 12px 46px;font-size:14px;border-radius:10px;}
.gate-in > svg.gate-lead{left:15px;color:#3A3F55;}
.gate-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:4px 0 14px;}
.gate-remember{display:inline-flex;align-items:center;gap:9px;font-size:13px;font-weight:500;color:var(--fms-ink);cursor:pointer;}
.gate-form .gate-remember input{width:18px;height:18px;padding:0;margin:0;border:none;box-shadow:none;
  -webkit-appearance:auto;appearance:auto;accent-color:var(--fms-purple);cursor:pointer;}
.gate-link{border:none;background:none;padding:0;cursor:pointer;
  font-family:var(--fms-font);font-size:13px;font-weight:600;color:var(--fms-purple);}
.gate-link:hover{text-decoration:underline;}
.gate-go{margin-top:2px;padding:13px 16px;font-size:17px;border-radius:12px;}
.gate-or{display:flex;align-items:center;gap:12px;margin:18px 0 14px;font-size:12px;color:#8A90A2;}
.gate-or::before,.gate-or::after{content:"";flex:1;height:1px;background:var(--fms-line);}
.gate-sso{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.gate-sso-btn{display:flex;align-items:center;justify-content:center;gap:9px;padding:10px 8px;
  border:1.5px solid var(--fms-line);border-radius:10px;background:#FFFFFF;cursor:pointer;
  font-family:var(--fms-font);font-size:12.5px;font-weight:500;color:var(--fms-ink);}
.gate-sso-btn:hover{border-color:var(--fms-purple);}
.gate-sso-btn svg{flex:none;}
.gate-secure{display:flex;align-items:center;justify-content:center;gap:11px;margin-top:20px;}
.gate-secure svg{flex:none;}
.gate-secure b{display:block;font-size:13px;font-weight:600;color:var(--fms-ink);}
.gate-secure small{display:block;margin-top:2px;font-size:12px;color:var(--fms-slate);}
.gate-foot{position:relative;z-index:1;margin:22px 0 0;font-size:11.5px;color:var(--fms-slate);text-align:center;}
.gate-foot i{font-style:normal;margin:0 7px;color:#B9BFCC;}
.gate-swoosh{position:absolute;left:-58px;bottom:-66px;width:120px;height:170px;z-index:0;pointer-events:none;
  border-radius:0 100% 0 0;transform:rotate(14deg);opacity:.92;
  background:linear-gradient(160deg,var(--fms-magenta),var(--fms-purple));}

/* the right: the run fills the panel, a curved white edge meets the card */
.gate-right{padding:26px 34px 22px 80px;}
.gate-right::before,.gate-right::after{content:"";position:absolute;top:-8%;height:116%;left:-2px;z-index:4;
  pointer-events:none;border-radius:0 100% 100% 0 / 0 50% 50% 0;}
.gate-right::before{width:72px;background:linear-gradient(180deg,var(--fms-purple),var(--fms-magenta) 55%,var(--fms-orange));}
.gate-right::after{width:64px;background:#FFFFFF;}
.gate-right .gate-photo{top:0;height:100%;object-position:center 72%;
  -webkit-mask-image:none;mask-image:none;}
.gate-right .gate-scrim{background:linear-gradient(180deg,
  rgba(16,24,72,.90) 0%, rgba(16,24,72,.58) 32%, rgba(16,24,72,.10) 56%,
  rgba(10,14,44,.22) 78%, rgba(8,12,38,.80) 100%);}
.gate-motto{position:relative;z-index:3;margin:0 0 20px;text-align:right;
  font-size:12px;font-weight:600;letter-spacing:.32em;text-transform:uppercase;color:#FFFFFF;
  text-shadow:0 1px 4px rgba(4,7,26,.9);}
.gate-motto i{font-style:normal;color:var(--fms-orange);margin:0 10px;letter-spacing:0;}
.gate-right .gate-org{text-align:left;}
.gate-headline{margin:0;font-size:42px;line-height:1.1;font-weight:800;letter-spacing:-.015em;color:#FFFFFF;
  text-shadow:0 3px 14px rgba(4,7,26,.55);}
.gate-headline span{background:linear-gradient(90deg,#FF2D7A 0%,#FF5A4E 45%,#FFB23E 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none;}
.gate-rule{display:block;width:120px;height:4px;margin-top:14px;border-radius:4px;
  background:linear-gradient(90deg,var(--fms-magenta),var(--fms-purple));}
.gate-right .gate-mods{margin-top:26px;gap:12px;}
.gate-right .gate-mod .gate-tile{width:58px;height:58px;margin-bottom:9px;border-radius:14px;
  background:#FFFFFF;box-shadow:0 8px 18px rgba(4,8,28,.35);}
.gate-right .gate-mod .gate-tile svg{width:30px;height:30px;filter:none;}
.gate-right .gate-mod p{font-size:11.5px;}
.gate-right .gate-stats{justify-content:flex-start;max-width:50%;}
.gate-brand{position:absolute;right:0;bottom:0;z-index:3;width:44%;padding:44px 26px 18px 76px;
  text-align:right;color:#FFFFFF;
  background:linear-gradient(135deg,rgba(247,144,30,.0) 0%,rgba(224,17,127,.92) 38%,rgba(122,24,201,.96) 100%);
  clip-path:polygon(52% 0,100% 0,100% 100%,0 100%);}
.gate-brand b{display:block;font-size:27px;font-weight:800;letter-spacing:.01em;white-space:nowrap;}
.gate-brand small{display:block;margin-top:5px;font-size:8.5px;font-weight:600;letter-spacing:.38em;text-transform:uppercase;}
.gate-pulse{display:block;width:110px;height:36px;margin:0 0 6px auto;}

@media (max-height:760px){
  .gate-head .bfms-logo{--bfms-mark:48px;--bfms-size:28px;}
  .gate-form h1{font-size:25px;}
  .gate-note{margin-bottom:12px;}
  .gate-or{margin:12px 0 10px;}
  .gate-secure{margin-top:14px;}
  .gate-headline{font-size:34px;}
  .gate-right .gate-mod .gate-tile{width:50px;height:50px;}
  .gate-right .gate-mod .gate-tile svg{width:26px;height:26px;}
}
@media (max-width:900px){
  .gate-right::before,.gate-right::after{display:none;}
  .gate-right{padding:18px;}
  .gate-left{padding:30px 22px 34px;}
  .gate-headline{font-size:30px;}
  .gate-brand{display:none;}
  .gate-right .gate-stats{max-width:none;}
  .gate-right .gate-mods{grid-template-columns:repeat(3,minmax(0,1fr));}
}

/* ============ the sign-in page: new_login.png, with the real controls over it ============
   The picture keeps its own proportions (1536 x 1024) and sits inside the window
   with room around it (its height leaves 80px: the gate's padding and a margin),
   so the page never scrolls; on a large screen it stops at 1280px wide. Each
   control sits where it is drawn, given as a share of the picture, and its type
   is sized to the picture (cqw), so nothing drifts when the window changes size. */
.gate-shot{position:relative;width:min(100%, calc((100vh - 80px) * 1.5), 1280px);max-width:1536px;
  aspect-ratio:1536 / 1024;container-type:inline-size;margin:auto;}
/* the ground behind the card is the theme's own colour - the application's --navy family, dark
   to bright - so Default is its maroon and each tone its teal, blue, green, amber or violet; the
   theme is applied before the sign-in screen shows */
.gate{background:linear-gradient(135deg, var(--navy-dk) 0%, var(--navy) 55%, var(--navy-mid) 100%);}
.gate-shot-img{position:absolute;inset:0;width:100%;height:100%;display:block;
  pointer-events:none;user-select:none;
  /* the picture is the card alone (see-through around it), so its shadow follows the card's shape */
  filter:drop-shadow(0 1.2cqw 2.8cqw rgba(0,0,0,.38));}
/* the new_logo.png banner (its card alone), over the white side where the picture's own logo was;
   multiplied in, so any white at its edge takes the panel's own off-white and no box shows round it */
.gate-shot-logo{position:absolute;left:3.255%;top:13.027%;width:31.901%;height:auto;display:block;
  pointer-events:none;user-select:none;mix-blend-mode:multiply;}
/* The Login button and the curve at the bottom left are drawn in the brand's purple, red and orange.
   In a colour theme a tint lies over each, blended by colour: it gives the drawn pixels the theme's
   hue and keeps their own brightness, so the white Login text and icon stay white, the button keeps
   its dark-to-light run, and the curve keeps its two bands. Default shows them exactly as drawn. */
.gate-shot .gs-tint{position:absolute;display:none;pointer-events:none;mix-blend-mode:color;}
body.theme-colour .gate-shot .gs-tint{display:block;}
/* 2px past the drawn button on every side, so its soft edge takes the tint too (the white round it stays white) */
.gate-shot .gs-tint-login{left:4.622%;top:70.215%;width:32.096%;height:6.836%;border-radius:.65cqw;
  background:linear-gradient(90deg, var(--fms-purple) 0%, var(--fms-magenta) 50%, var(--fms-orange) 100%);}
/* the curve's box stops short of the button's bottom-left corner, so that corner is tinted once */
.gate-shot .gs-tint-swoosh{left:1.628%;top:75.781%;width:10.091%;height:15.234%;
  clip-path:polygon(0 0, 31% 0, 31% 7.7%, 100% 7.7%, 100% 100%, 0 100%);
  background:linear-gradient(160deg, var(--fms-pink) 0%, var(--fms-purple) 100%);}
.gate-shot .gate-form{position:absolute;inset:0;max-width:none;width:auto;margin:0;padding:0;}
/* the office and its two projects, in the place the picture's headline was */
.gate-shot-org{position:absolute;left:45.3%;top:11.6%;width:38%;pointer-events:none;
  font-family:'Poppins','Segoe UI',system-ui,sans-serif;line-height:1.2;color:#FFFFFF;}
.gate-shot-org b{display:block;font-size:3.05cqw;font-weight:700;letter-spacing:-.01em;
  text-shadow:0 .2cqw .8cqw rgba(4,7,26,.55);white-space:nowrap;}
.gate-shot-org > span{display:block;margin-top:.45cqw;font-size:1.55cqw;font-weight:500;color:#D7E0F8;
  text-shadow:0 .1cqw .5cqw rgba(4,7,26,.6);}
.gate-shot-org .gate-shot-proj{display:inline-block;margin-top:.9cqw;padding:.3cqw 1cqw;
  font-size:1cqw;font-weight:700;color:#FFFFFF;text-transform:uppercase;letter-spacing:.1em;white-space:nowrap;
  background:rgba(255,255,255,.10);border:.08cqw solid rgba(255,255,255,.28);border-radius:999px;}
.gate-shot-org .gate-shot-proj i{font-style:normal;color:#FDB913;margin:0 .6cqw;}
.gate-shot .gs{position:absolute;box-sizing:border-box;margin:0;}
/* the two fields: white over the drawn placeholder, the drawn box and icon left showing */
.gate-shot input.gs-in{border:none;border-radius:.3cqw;background:#FFFFFF;padding:0 .3cqw 0 .72cqw;
  font-family:'Poppins','Segoe UI',system-ui,sans-serif;font-size:1.22cqw;color:#10132B;
  -webkit-appearance:none;appearance:none;box-shadow:none;outline:none;}
.gate-shot input.gs-in::placeholder{color:#5F6577;}
.gate-shot input.gs-in:focus{box-shadow:none;border:none;}
.gate-shot input.gs-in:focus-visible{outline:none;}
/* the browser's saved-login fill keeps the field white, so no tinted block shows inside the drawn box */
.gate-shot input.gs-in:-webkit-autofill,
.gate-shot input.gs-in:-webkit-autofill:hover,
.gate-shot input.gs-in:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 1000px #FFFFFF inset;box-shadow:0 0 0 1000px #FFFFFF inset;
  -webkit-text-fill-color:#10132B;caret-color:#10132B;transition:background-color 99999s ease-out 0s;}
/* each field fills its drawn box from just past the icon to the inner edge (the password stops short of the eye) */
.gate-shot .gs-user{left:8.854%;top:44.336%;width:27.148%;height:5.273%;}
.gate-shot .gs-pass{left:8.854%;top:56.934%;width:23.698%;height:5.078%;}
/* the focus ring lies on the drawn box's own border, icon and all */
.gate-shot .gs-ring{pointer-events:none;border:.14cqw solid transparent;border-radius:.55cqw;
  transition:border-color .15s ease, box-shadow .15s ease;}
.gate-shot .gs-ring-user{left:4.753%;top:43.848%;width:31.836%;height:6.25%;}
.gate-shot .gs-ring-pass{left:4.753%;top:56.445%;width:31.836%;height:6.152%;}
.gate-shot .gs-user:focus ~ .gs-ring-user,
.gate-shot .gs-pass:focus ~ .gs-ring-pass{border-color:rgba(122,24,201,.6);box-shadow:0 0 0 .25cqw rgba(122,24,201,.12);}
/* the buttons: see-through over the drawn ones */
.gate-shot .gs-hit{background:transparent;border:none;padding:0;cursor:pointer;color:transparent;
  border-radius:.8cqw;box-shadow:none;filter:none;}
.gate-shot .gs-hit:hover{background:rgba(255,255,255,.10);}
.gate-shot .gs-eye:hover{background:rgba(91,31,168,.06);}
.gate-shot .gs-hit:focus-visible{outline:.16cqw solid rgba(122,24,201,.6);outline-offset:.15cqw;}
.gate-shot .gs-eye-mark{position:absolute;width:1px;height:1px;opacity:0;}
.gate-shot .gs-eye{left:32.9%;top:57.422%;width:2.9%;height:4.3%;}
.gate-shot .gs-login{left:4.8%;top:70.428%;width:31.8%;height:6.3%;margin:0;font-size:0;}
.gate-shot .gs-login:disabled{cursor:progress;background:rgba(255,255,255,.22);}
/* a refusal or a notice, just under Login */
.gate-shot .gate-err{position:absolute;left:4.8%;top:76.92%;width:31.8%;margin:0;z-index:2;
  padding:.45cqw .8cqw;font-size:.86cqw;line-height:1.35;border-radius:.6cqw;}

/* ============ Expense details (Expenses → View) ============ */
.exd{display:flex;flex-direction:column;gap:14px;font-size:var(--t-sm);color:var(--ink);text-align:left;}
.exd-hero{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;
  background:var(--navy-dk);color:#fff;border-radius:12px;padding:16px 18px;}
.exd-badge{display:inline-block;padding:2px 8px;border-radius:4px;background:var(--saffron);color:#fff;
  font-size:var(--t-micro);font-weight:700;letter-spacing:.06em;text-transform:uppercase;}
.exd-hero h4{margin:8px 0 4px;font-size:var(--t-head);color:#fff;}
.exd-sub{font-size:var(--t-label);color:rgba(255,255,255,.78);}
.exd-sub b{color:#fff;}
.exd-sub .dsep{margin:0 8px;}
.exd-bill{text-align:right;}
.exd-bill span{display:block;font-size:var(--t-micro);color:rgba(255,255,255,.72);}
.exd-bill b{font-size:var(--t-sm);}
.exd-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.exd-tile{background:var(--panel);border:1px solid var(--line);border-left:4px solid var(--navy);
  border-radius:10px;padding:10px 12px;min-width:0;}
.exd-tile:nth-child(2){border-left-color:var(--forest);}
.exd-tile:nth-child(3){border-left-color:var(--navy-mid);}
.exd-tile:nth-child(4){border-left-color:var(--caution);}
.exd-tile:nth-child(4) b{color:var(--caution);}
.exd-tile span{display:block;font-size:var(--t-micro);color:var(--muted);}
.exd-tile b{display:block;margin-top:2px;overflow-wrap:anywhere;}
.exd-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:12px 14px;}
.exd-card > h5{margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid var(--line-soft);
  font-size:var(--t-sm);font-weight:700;color:var(--ink);}
.exd-all{border-left:4px solid var(--navy);}
.exd-links{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.exd-links > div{border-bottom:1px solid var(--line-soft);padding-bottom:8px;min-width:0;}
.exd-links span,.exd-grid5 span{display:block;font-size:10.5px;font-weight:700;letter-spacing:.04em;
  text-transform:uppercase;color:var(--muted);}
.exd-links b{display:block;margin:3px 0 2px;}
.exd-links small{display:block;font-size:var(--t-micro);color:var(--muted);overflow-wrap:anywhere;}
.exd-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.exd-fields > div{background:var(--paper);border:1px solid var(--line-soft);border-radius:8px;
  padding:8px 10px;min-width:0;}
.exd-fields span{display:block;font-size:var(--t-micro);color:var(--muted);}
.exd-fields b{display:block;overflow-wrap:anywhere;}
.exd-miss{color:var(--muted);font-weight:600;}
.exd-grid5{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px 14px;}
.exd-grid5 > div{border-bottom:1px solid var(--line-soft);padding:4px 0;min-width:0;}
.exd-grid5 b{display:block;font-weight:600;overflow-wrap:anywhere;}
.exd-docs{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;}
.exd-docs > div{display:flex;align-items:center;gap:8px;}
.exd-docs > div > span{font-size:var(--t-label);color:var(--muted);}
.exd-note{border:1px dashed var(--line);border-radius:8px;padding:10px 12px;background:var(--paper);
  font-size:var(--t-label);color:var(--muted);}
.exd-note b{color:var(--ink);}
@media (max-width:900px){
  .exd-tiles,.exd-links,.exd-fields,.exd-grid5{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* ============ My Profile (the user menu → Profile) ============ */
.dlg.pf-wide{max-width:960px;width:calc(100vw - 40px);}
.pf-host{padding:0 !important;background:transparent !important;border:0 !important;}
.pf{display:flex;flex-direction:column;gap:16px;}
.pf-hero{border:1px solid var(--line);border-left:4px solid var(--saffron);border-radius:12px;
  padding:16px 18px;background:#fff;}
.pf-hero-top{display:flex;align-items:center;gap:14px;}
.pf-avatar{width:52px;height:52px;border-radius:50%;background:#0f766e;color:#fff;display:flex;
  align-items:center;justify-content:center;font-weight:700;font-size:1.1rem;flex:0 0 auto;}
/* What the two new passwords say for themselves, under the boxes: nothing
   until one is typed, then whether they match. */
.pf-pw-note{margin:8px 0 0;font-size:var(--t-label);min-height:1.1em;}
.pf-pw-ok{color:var(--navy);}
.pf-pw-bad{color:var(--lapse);}
.pf-pw-wait{color:var(--muted);}

  /* The picture in the masthead, in the circle the initials stood in. */
  .who-avatar.has-face{padding:0;overflow:hidden;}
  .who-face{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%;}

/* The line under the districts: the fleet added up. */
  tr.dtot > td{background:var(--blue-bg);border-top:2px solid var(--line);}

/* The pieces a batch decision is about, listed under the count. */
.dsec-batch span{display:block;margin-top:2px;color:var(--ink);}

/* Ticking pieces on Old Parts Removed, and the bar that acts on them. */
.oldpick-cell{width:34px;text-align:center;}
.oldpick-cell input{width:16px;height:16px;cursor:pointer;}
tr.oldpick-on > td{background:color-mix(in srgb, var(--navy) 6%, transparent);}
.oldpick-bar{display:flex;align-items:end;gap:var(--s3);flex-wrap:wrap;
  padding:10px 12px;margin-bottom:var(--s2);border:1px solid var(--line);
  border-radius:var(--radius);background:var(--blue-bg);}
/* The count stays at the left and takes the space between, so the buttons sit
   at the right-hand end of the bar. */
.oldpick-n{font-size:var(--t-sm);color:var(--navy);align-self:center;margin-right:auto;}
.oldpick-fld{display:flex;flex-direction:column;gap:3px;font-size:var(--t-label);color:var(--muted);}
.oldpick-fld select{min-width:200px;}

/* The person's picture on the user register: the same circle the profile
   shows, at the size a table row carries. */
/* The person's picture on the user register. Big enough to make a face out,
   and it opens full size when pressed - a circle this size is a mark, not a
   photograph. */
.rbac-face{width:44px;height:44px;border-radius:50%;overflow:hidden;display:flex;
  align-items:center;justify-content:center;flex:0 0 auto;background:#0f766e;color:#fff;
  font-size:.78rem;font-weight:700;letter-spacing:.02em;padding:0;border:1px solid var(--line);}
.rbac-face img{width:100%;height:100%;object-fit:cover;display:block;}
.rbac-face-none{background:var(--blue-bg);color:var(--navy-mid);}
.rbac-face-open{cursor:pointer;}
.rbac-face-open:hover,.rbac-face-open:focus-visible{
  border-color:var(--navy);box-shadow:0 0 0 2px color-mix(in srgb, var(--navy) 22%, transparent);
}

/* The avatar is the person's own picture, and pressing it sets one. It is a
   button now rather than a plain circle, so it carries the same size and
   colour and says what it does on hover. */
.pf-avatar-set{position:relative;overflow:hidden;padding:0;border:none;cursor:pointer;}
.pf-avatar-img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%;}
.pf-avatar-mark{
  position:absolute;left:0;right:0;bottom:0;padding:2px 0;
  background:rgba(15,23,42,.62);color:#fff;font-size:.56rem;font-weight:700;
  letter-spacing:.04em;text-transform:uppercase;opacity:0;transition:opacity .12s;
}
.pf-avatar-set:hover .pf-avatar-mark,
.pf-avatar-set:focus-visible .pf-avatar-mark{opacity:1;}
.pf-avatar-set:focus-visible{outline:2px solid var(--navy);outline-offset:2px;}

.pf-hero-id{flex:1 1 auto;min-width:0;}
.pf-eyebrow{font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted,#64748b);font-weight:700;}
.pf-name{font-size:1.15rem;font-weight:700;color:var(--ink);}
.pf-sub{font-size:.85rem;color:var(--text-muted,#64748b);}
.pf-badge{align-self:flex-start;border:1px solid #16a34a;color:#16a34a;border-radius:999px;
  padding:2px 10px;font-size:.7rem;font-weight:700;letter-spacing:.04em;}
.pf-hero-grid,.pf-detail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 20px;}
.pf-hero-grid{margin-top:14px;padding-top:12px;border-top:1px solid var(--line);}
.pf-detail{border:1px solid var(--line);border-radius:12px;padding:16px 18px;background:#fff;}
.pf-k{font-size:.68rem;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted,#64748b);font-weight:700;margin-bottom:2px;}
.pf-v{font-size:.9rem;color:var(--ink);word-break:break-word;}
.pf-card{border:1px solid var(--line);border-radius:12px;padding:16px 18px;background:#fff;}
.pf-card-h{font-weight:700;color:var(--ink);margin-bottom:14px;}
.pf-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 18px;}
.pf-form .fld label{display:block;font-size:.72rem;color:var(--text-muted,#64748b);font-weight:600;margin-bottom:4px;}
.pf-form .fld input,.pf-form .fld select{width:100%;border:1px solid var(--line);border-radius:8px;
  padding:8px 10px;font-size:.88rem;font-family:inherit;color:var(--ink);background-color:#fff;color-scheme:light;}
.pf-upl{display:flex;flex-direction:column;gap:4px;}
.pf-upl-label{font-size:.72rem;color:var(--text-muted,#64748b);font-weight:600;}
.pf-upl-row{display:flex;gap:8px;align-items:stretch;}
.pf-upl-file{flex:1 1 auto;border:1px dashed var(--line);border-radius:8px;padding:8px 10px;
  font-size:.82rem;color:var(--text-muted,#94a3b8);display:flex;align-items:center;}
.pf-upl-file.has{color:#16a34a;border-style:solid;font-weight:600;}
/* Save Profile follows the theme like every other coloured surface. It was
   pinned to a green of its own - #16a34a - so it stayed that green whichever
   theme was chosen, and was the one control on the screen that ignored it.
   The variables carry the theme, so reading them is all it takes. */
.pf-save{margin-top:16px;width:100%;background:var(--navy);color:#fff;
  border:1px solid var(--navy);border-radius:var(--radius);
  padding:11px;font-weight:700;font-size:.92rem;cursor:pointer;}
.pf-save:hover{background:var(--navy-mid);border-color:var(--navy-mid);}
.pf-save:active{background:var(--navy-dk);border-color:var(--navy-dk);}
.pf-save:focus-visible{outline:2px solid var(--saffron);outline-offset:2px;}
@media (max-width:720px){
  .pf-hero-grid,.pf-detail,.pf-form{grid-template-columns:1fr;}
}
  .pf-file-hidden{display:none;}

/* Profile identity-document tiles: thumbnail + View / Save / Remove */
.pf-drop{border:1px dashed var(--line);border-radius:8px;padding:14px;display:flex;
  flex-direction:column;align-items:center;gap:8px;min-height:96px;justify-content:center;}
.pf-drop-txt{font-size:.82rem;color:var(--text-muted,#94a3b8);}
.pf-tile{position:relative;border:1px solid var(--line);border-radius:8px;padding:10px;
  display:flex;flex-direction:column;align-items:center;gap:8px;background:#fff;}
.pf-tile-x{position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;
  border:0;background:#dc2626;color:#fff;font-size:15px;line-height:1;cursor:pointer;}
.pf-thumb{width:100%;height:88px;border-radius:6px;overflow:hidden;background:#f1f5f9;
  display:flex;align-items:center;justify-content:center;}
.pf-thumb-img{width:100%;height:100%;object-fit:cover;}
.pf-thumb-ext{font-family:var(--mono);font-weight:700;color:var(--ink);font-size:.9rem;}
.pf-tile-acts{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;}
.pf-tile-name{font-size:.72rem;color:var(--text-muted,#64748b);text-align:center;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* This pair used to be a fixed green and, carrying two classes, it outranked
   .btn-save above: the Save record button stayed green whatever tone was
   chosen. It is kept for the specificity it needs against .btn, and now says
   the same thing the themed rule does. */
.btn.btn-save{background:var(--navy);color:#fff;border-color:var(--navy);font-weight:600;}
.btn.btn-save:hover{background:var(--navy-mid);border-color:var(--navy-mid);}
.btn.btn-save:active{background:var(--navy-dk);border-color:var(--navy-dk);}
.btn.btn-save:focus-visible{outline:2px solid var(--saffron);outline-offset:2px;}
/* A Save that has already been given reads as spent, not as the live one */
.btn.btn-save[disabled],.btn.btn-save:disabled{
  background:color-mix(in srgb, var(--navy) 30%, var(--panel));
  border-color:color-mix(in srgb, var(--navy) 30%, var(--panel));
  color:#fff;opacity:.75;cursor:not-allowed;
}
.docprev{display:flex;flex-direction:column;gap:14px;}
.docprev-img{max-width:100%;max-height:60vh;border-radius:8px;object-fit:contain;
  margin:0 auto;display:block;}
.docprev-file{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px;}
.docprev-fname{font-size:.9rem;color:var(--ink);}
.docprev-foot{display:flex;justify-content:flex-end;border-top:1px solid var(--line);padding-top:12px;}

/* Profile tile header: + Add and remove at top-right; save/change feedback line */
.pf-tile-top{display:flex;justify-content:flex-end;gap:6px;margin-bottom:6px;}
.pf-tile-add{border:1px solid var(--line);background:#fff;border-radius:6px;padding:2px 8px;
  font-size:.75rem;cursor:pointer;color:var(--ink);}
.pf-tile-add:hover{border-color:var(--saffron);}
.pf-tile .pf-tile-x{position:static;width:22px;height:22px;}
.pf-msg{margin:10px 0 0;padding:9px 12px;border-radius:8px;font-size:.85rem;font-weight:600;}
.pf-msg.ok{background:#dcfce7;color:#166534;border:1px solid #86efac;}
.pf-msg.err{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5;}

  /* A save that worked is said in the service's own colour, not in a green of
     its own: the button is the application's, and it stays the application's
     while it says so. A refusal keeps the red, which is not a theme colour but
     a warning. */
  .btn.pf-flash-ok,.pf-save.pf-flash-ok{
    background:var(--navy) !important;color:#fff !important;border-color:var(--navy) !important;
  }
  .btn.pf-flash-err,.pf-save.pf-flash-err{background:#dc2626 !important;color:#fff !important;border-color:#dc2626 !important;}

/* A date box given a day on the wrong side of today says so just under it. */
.date-tip{position:fixed;z-index:400;max-width:280px;padding:7px 10px;border-radius:6px;
  background:#991b1b;color:#fff;font-size:.78rem;font-weight:600;line-height:1.35;
  box-shadow:0 4px 14px rgba(0,0,0,.22);pointer-events:none;}

/* ==========================================================
   The menu and the masthead controls, redrawn
   The menu stands on a dark rail in the theme's own deepest tone: section names in small
   capitals, each module's mark in a rounded tile, the modules of a section hung off a fine
   line, and the page that is open lit as a rounded bar. The masthead's controls are rounded:
   Project and Theme as pills, Notifications as a round bell with its count on a badge, and the
   account as the person's initials in a ring beside their name. Everything reads the theme's
   four colours, so Default, Teal, Maroon, Green, Amber and Violet each redraw it.
   ========================================================== */
/* The menu stands on the light page panel again, drawn in the theme's own colour: section names,
   marks and the tinted tiles read `--navy`, and the page that is open is a bar in the theme's
   colour. It keeps the line marks, the tiles and the line the modules hang from. */
.sidebar{
  background:var(--panel);
  background:linear-gradient(180deg,var(--panel) 0%,color-mix(in srgb,var(--navy) 4%,var(--panel)) 100%);
  border-right:1px solid var(--line);padding:14px 10px 28px;
  scrollbar-color:var(--line) transparent;
}
.sidebar::-webkit-scrollbar{width:8px;}
.sidebar::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px;}
.sidebar::-webkit-scrollbar-track{background:transparent;}
.navtoggle{color:var(--navy);padding:4px 6px 16px;gap:10px;font-size:11.5px;letter-spacing:.12em;}
.navtoggle #navToggleMark{display:flex;align-items:center;justify-content:center;width:30px;height:30px;
  border-radius:9px;background:color-mix(in srgb,var(--navy) 8%,var(--panel));
  border:1px solid color-mix(in srgb,var(--navy) 18%,var(--line));transition:background .15s ease;}
.navtoggle:hover{color:var(--navy-mid);}
.navtoggle:hover #navToggleMark{background:color-mix(in srgb,var(--navy) 15%,var(--panel));}
.navttl{
  color:var(--navy) !important;opacity:.62;
  font-size:10.5px;letter-spacing:.13em;margin:0;padding:12px 8px 0;gap:9px;
}
.navttl svg{opacity:.9;}
.navitem.current .navttl{opacity:1;}
.navitem{margin-bottom:6px;}
.navmenu{position:relative;margin-left:14px;padding-left:10px;padding-top:6px;border-left:none;border-radius:0;
  --chain:color-mix(in srgb,var(--navy) 30%,var(--line));}
.navmenu button{
  position:relative;gap:10px;margin:0;padding:7px 10px 7px 6px;border-left:none;border-radius:11px;
  font-size:13px;font-weight:500;color:var(--ink);
  transition:background .15s ease,color .15s ease,box-shadow .2s ease;
}
/* the chain: a line comes down from the section's own mark and turns into each module in a rounded
   elbow; below the last module it stops. Each piece is drawn inside the box it belongs to - the run
   over the list's own top padding by the list, each elbow and each run on by its module - and the
   modules stand edge to edge, so the pieces meet with no gap between them. */
.navmenu::before{content:"";position:absolute;left:0;top:0;height:6px;border-left:1.5px solid var(--chain);}
.navmenu button::before{content:"";position:absolute;left:-10px;top:0;width:9px;height:50%;
  border-top:none;border-left:1.5px solid var(--chain);border-bottom:1.5px solid var(--chain);border-bottom-left-radius:8px;}
.navmenu button:not(:last-child)::after{content:"";position:absolute;left:-10px;top:calc(50% - 9px);bottom:0;
  border-left:1.5px solid var(--chain);}
/* the chain starts at the section's own mark: a short run from just under the mark down to the line
   its modules hang from, so the name and its modules read as one piece */
.navitem{--chain:color-mix(in srgb,var(--navy) 30%,var(--line));}
.navitem:not(.shut) button.navttl{position:relative;}
.navitem:not(.shut) button.navttl::after{content:"";position:absolute;left:14px;top:calc(50% + 11px);bottom:0;
  border-left:1.5px solid var(--chain);}
.sidebar.mini .navitem button.navttl::after{display:none;}
.navmenu button .nav-ico{
  display:flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;border-radius:9px;
  background:color-mix(in srgb,var(--navy) 8%,var(--panel));transition:background .15s ease,transform .2s ease;
}
.navmenu button svg,.navmenu button:hover svg{color:var(--navy) !important;opacity:1;}
.navmenu button:hover{background:color-mix(in srgb,var(--navy) 7%,var(--panel));color:var(--navy);border-left-color:transparent;}
.navmenu button:hover .nav-ico{background:color-mix(in srgb,var(--navy) 15%,var(--panel));transform:translateY(-1px);}
.navmenu button.on,.navmenu button.on:hover{
  margin-right:0;border-radius:11px;color:#FFFFFF;font-weight:600;
  background:var(--navy);
  background:linear-gradient(135deg,var(--navy-mid) 0%,var(--navy) 100%);
  box-shadow:0 10px 20px -12px color-mix(in srgb,var(--navy) 85%,transparent),inset 0 1px 0 rgba(255,255,255,.2);
}
.navmenu button.on .nav-ico{background:rgba(255,255,255,.2);}
.navmenu button.on svg,.navmenu button.on:hover svg{color:#FFFFFF !important;}
/* a section name is a button: pressed, its modules open under it, and pressed again they go away */
button.navttl{
  display:flex;align-items:center;width:100%;border:none;background:none;cursor:pointer;
  font-family:var(--sans);text-align:left;border-radius:9px;transition:background .15s ease,opacity .15s ease;
}
button.navttl:hover{background:color-mix(in srgb,var(--navy) 6%,var(--panel));opacity:1;}
button.navttl:focus-visible{outline:2px solid var(--navy);outline-offset:1px;}
.navitem:not(.shut) .navttl{opacity:1;}
.navttl .nav-chev{margin-left:auto;display:flex;opacity:.85;transition:transform .25s cubic-bezier(.5,0,.3,1);}
.navitem.shut .navttl .nav-chev{transform:rotate(-90deg);}
/* the modules slide open and shut; a shut section's buttons are not reached by Tab */
.navmenu-wrap{display:grid;grid-template-rows:1fr;transition:grid-template-rows .28s cubic-bezier(.5,0,.3,1);}
.navmenu-wrap > .navmenu{min-height:0;overflow:hidden;padding-right:4px;padding-bottom:4px;
  visibility:visible;transition:visibility 0s;}
.navitem.shut .navmenu-wrap{grid-template-rows:0fr;}
.navitem.shut .navmenu-wrap > .navmenu{visibility:hidden;transition:visibility 0s .28s;}
/* drawn in to its marks, every mark stays on the menu whatever is open */
.sidebar.mini .navttl .nav-chev{display:none;}
.sidebar.mini .navitem.shut .navmenu-wrap{grid-template-rows:1fr;}
.sidebar.mini .navitem.shut .navmenu-wrap > .navmenu{visibility:visible;}
@media (prefers-reduced-motion: reduce){
  .navmenu-wrap,.navttl .nav-chev{transition:none;}
}
/* drawn in: the marks alone, centred, with no line to hang from */
.sidebar.mini{width:70px;padding-left:8px;padding-right:8px;}
.sidebar.mini .navtoggle{justify-content:center;padding:4px 0 14px;}
.sidebar.mini .navttl{padding:10px 0 4px;}
.sidebar.mini .navmenu{margin-left:0;padding-left:0;border-left:none;}
.sidebar.mini .navmenu::before,.sidebar.mini .navmenu button::before,.sidebar.mini .navmenu button::after{display:none;}
.sidebar.mini .navmenu{padding-top:0;border-radius:var(--radius-lg);}
.sidebar.mini .navmenu button{justify-content:center;padding:5px 0;}
.sidebar.mini .navmenu button .nav-ico{display:flex;}
.sidebar.mini .navmenu button .nav-lbl{display:none;}
@media (max-width:900px){
  .sidebar{padding:12px 10px;}
}

/* the masthead controls */
.masttools{gap:10px;}
.masttools .mastpick,.masttools .who{
  border-radius:999px;background:var(--panel);border:1px solid var(--line);
  box-shadow:0 1px 2px rgba(16,24,40,.06);min-height:40px;transition:background .15s ease,border-color .15s ease,box-shadow .2s ease;
}
.masttools .mastpick{padding:4px 14px 4px 5px;gap:9px;}
.masttools .mastpick:hover,.masttools .who:hover{
  background:var(--panel);border-color:color-mix(in srgb,var(--navy) 40%,var(--line));
  box-shadow:0 6px 16px -8px color-mix(in srgb,var(--navy) 55%,transparent);
}
.masttools .mastpick label{
  width:30px;height:30px;border-radius:50%;justify-content:center;flex:none;
  background:color-mix(in srgb,var(--navy) 10%,var(--panel));color:var(--navy);
}
.masttools .mastpick select{font-weight:600;color:var(--ink);}
.masttools .tool{
  position:relative;width:40px;height:40px;min-height:40px;padding:0;justify-content:center;gap:0;
  border-radius:50%;background:var(--panel);color:var(--navy);
  box-shadow:0 1px 2px rgba(16,24,40,.06);transition:background .15s ease,border-color .15s ease,box-shadow .2s ease;
}
.masttools .tool:hover{background:var(--panel);border-color:color-mix(in srgb,var(--navy) 40%,var(--line));
  box-shadow:0 6px 16px -8px color-mix(in srgb,var(--navy) 55%,transparent);}
.masttools .tool .car{display:none;}
.masttools .tool .tally{
  position:absolute;top:-5px;right:-5px;min-width:19px;height:19px;line-height:15px;padding:0 5px;
  border:2px solid var(--panel);text-align:center;font-size:10px;
}
.masttools .tool .tally.none{display:none;}
.drop.open .tool,.account.open .who{background:var(--panel);border-color:var(--navy);}
.masttools .who{padding:4px 14px 4px 4px;gap:10px;}
.who-avatar{
  display:flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;border-radius:50%;
  background:linear-gradient(135deg,var(--navy-mid),var(--navy-dk));color:#FFFFFF;
  font-size:11.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;
  box-shadow:0 0 0 2px var(--panel),0 0 0 3.5px color-mix(in srgb,var(--navy) 45%,transparent);
}
.who-avatar:empty{display:none;}
.dropmenu,.usermenu{border-radius:14px;overflow:hidden;}
@media (prefers-reduced-motion: reduce){
  .navmenu button,.navmenu button .nav-ico,.masttools .tool,.masttools .mastpick,.masttools .who{transition:none;}
  .navmenu button:hover .nav-ico{transform:none;}
}

/* ---------- Schedule Services (schedule.js) ---------- */
.sched-bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2);}
.sched-dates{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding:6px 12px;
  border:1px solid var(--line);border-radius:10px;background:var(--panel);}
.sched-date{display:inline-flex;align-items:center;gap:6px;margin:0;font-size:var(--t-sm);font-weight:600;color:var(--muted);}
.sched-date input{min-height:30px;padding:2px 8px;border:1px solid var(--line);border-radius:6px;
  font-weight:700;color:var(--navy);background:var(--panel);}
.sched-heading{margin:var(--s4) 0 var(--s2);font-size:15px;font-weight:700;color:var(--forest);}
.sched-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--s3);margin-bottom:var(--s3);}
@media (max-width:1100px){ .sched-cards{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:560px){ .sched-cards{grid-template-columns:1fr;} }
.sched-card{--ss:#0E7C66;display:flex;flex-direction:column;gap:10px;min-width:0;padding:12px 14px;cursor:pointer;
  border:1px solid color-mix(in srgb,var(--ss) 45%,var(--line));border-radius:12px;background:var(--panel);
  transition:box-shadow .15s ease,transform .15s ease;}
.sched-card:hover,.sched-card:focus-visible{box-shadow:0 6px 16px rgba(0,0,0,.10);transform:translateY(-1px);outline:none;}
.sched-card.on{box-shadow:0 0 0 2px var(--ss);}
.sched-card.sched-ss2{--ss:#2563A8;}
.sched-card.sched-ss3{--ss:#C2610C;}
.sched-card.sched-ss4{--ss:#C0262D;}
.sched-card-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 8px;}
.sched-card-top .nm{white-space:nowrap;font-weight:700;font-size:var(--t-sm);color:var(--ss);}
.sched-int{flex:none;padding:2px 8px;border-radius:12px;font-size:10.5px;font-weight:600;color:var(--ss);
  background:color-mix(in srgb,var(--ss) 10%,var(--panel));}
.sched-card-nums{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.sched-card-nums span{display:block;font-size:var(--t-sm);color:var(--ink);}
.sched-card-nums b{display:block;font-size:22px;font-weight:700;line-height:1.2;color:var(--ink);}
.sched-card-nums b.now{color:var(--ss);}
.sched-card-foot{display:flex;justify-content:space-between;gap:8px;font-size:11.5px;color:var(--muted);}
.sched-filters{padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);}
#sched-list .tbl{min-width:1080px;}
#sched-list .tbl td{vertical-align:middle;}
#sched-list .tbl th{white-space:normal;line-height:1.25;}
#sched-list .tbl td .sub{display:block;font-size:11.5px;line-height:1.35;}
#sched-list tr.sched-over > td{background:color-mix(in srgb,var(--lapse) 7%,var(--panel));}
#sched-list tr.sched-soon > td{background:color-mix(in srgb,var(--caution) 8%,var(--panel));}
.sched-pill{white-space:nowrap;}
.sched-line{display:block;margin-top:3px;}
.sched-bad{color:var(--lapse) !important;font-weight:700;}
/* From / To in the filter bar read in the same text as the lists beside them */
.sched-filters .sched-date{font:inherit;font-size:var(--t-sm);font-weight:400;color:var(--ink);}
.sched-filters .sched-date input{min-height:34px;padding:4px 10px;border:1px solid var(--line);border-radius:8px;
  background:var(--panel);font:inherit;font-size:var(--t-sm);font-weight:400;color:var(--ink);}
.sched-cycles{color:var(--green) !important;font-weight:700;margin-top:4px;}

/* ---------- FMS Overview: five cards a row, the menu out or drawn in (dashboard.js dbOverview) ---------- */
.summary.db-cols-5{grid-template-columns:repeat(5,minmax(0,1fr));}
/* a card carrying one reading where the band was drawn for two (Off-Road Breakdown) gives it the width */
.summary .db-split > div:only-child{grid-column:1 / -1;}

/* ---------- Expenses, region by region: the trail back up (expenses.js expDrillBand) ---------- */
/* The trail over a register: where it stands, and the way back up. The
   Expenses page and the Vehicles Registry read the same one. */
.exp-trail,.drill-trail{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0 0 var(--s2);font-size:var(--t-sm);color:var(--muted);}
.exp-trail b,.drill-trail b{color:var(--navy);font-weight:700;}
@media (max-width:720px){ .summary.db-cols-5{grid-template-columns:1fr 1fr;} }

/* ============ Glass buttons, application-wide ============
   Every button is one family: a pill with a lit top edge and a glass rim that
   lifts and glows under the pointer. The buttons that do the thing are liquid
   glass in the full tone; the quiet ones (Cancel, Clear, Close) are frosted
   glass of the same tone, so the one that acts still reads first. Colours come
   from the theme, so each project keeps its own. Only the surface is drawn
   here - no button does anything it did not do before. Text links inside a
   table, tabs, tiles, file chips and the pager are not buttons of this kind
   and are left as they were. */

/* quiet: frosted glass */
.btn,
.filterbox .filter-actions .btn{
  --glow:var(--navy-mid);
  position:relative;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--navy) 22%, transparent);
  color:var(--navy);
  font-weight:600;
  background:linear-gradient(180deg, rgba(255,255,255,.80),
    color-mix(in srgb, var(--navy) 7%, rgba(255,255,255,.55)));
  -webkit-backdrop-filter:blur(8px) saturate(140%);
  backdrop-filter:blur(8px) saturate(140%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -4px 8px color-mix(in srgb, var(--navy) 8%, transparent),
    0 2px 5px color-mix(in srgb, var(--navy) 14%, transparent);
  transition:transform .18s ease, box-shadow .25s ease, filter .25s ease, background .25s ease, color .2s ease;
}
.btn:hover,
.filterbox .filter-actions .btn:hover{
  transform:translateY(-2px);
  /* The name is kept dark with the glass it stands on. A button drawn as glass here because the
     filter bar's own rule is the more particular one - "+ Add Expense", "+ Add" - was still taking
     its white lettering from btn-primary, so touching it turned the name white on white and the
     button read empty. The full-tone buttons (primary, save, danger) are named more particularly
     still and keep their white lettering. */
  color:var(--navy);
  border-color:color-mix(in srgb, var(--glow) 55%, transparent);
  background:linear-gradient(180deg, rgba(255,255,255,.92),
    color-mix(in srgb, var(--navy) 12%, rgba(255,255,255,.6)));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95),
    0 0 0 1px color-mix(in srgb, var(--glow) 25%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--glow) 35%, transparent),
    0 6px 14px color-mix(in srgb, var(--navy) 22%, transparent);
}
.btn:active,
.filterbox .filter-actions .btn:active{transform:translateY(0);}
.btn:focus-visible{outline:2px solid var(--saffron);outline-offset:2px;}

/* acting: liquid glass in the full tone */
.btn.btn-primary,
.btn.btn-save,
.filterbox .filter-actions .toolbar .btn,
.rowacts .btn-link,
.rowacts .act-btn.act-brand{
  --glow:var(--navy-mid);
  position:relative;
  border-radius:999px;
  border:1px solid transparent;
  color:#fff;
  background:linear-gradient(180deg, color-mix(in srgb, var(--navy-mid) 88%, #fff) 0%, var(--navy) 100%);
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -6px 10px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.28),
    0 2px 4px color-mix(in srgb, var(--navy-dk) 35%, transparent);
  transition:transform .18s ease, box-shadow .25s ease, filter .25s ease;
}
.btn.btn-primary:hover,
.btn.btn-save:hover,
.filterbox .filter-actions .toolbar .btn:hover,
.rowacts .btn-link:hover,
.rowacts .act-btn.act-brand:hover{
  transform:translateY(-2px);
  filter:brightness(1.06);
  color:#fff;
  border-color:transparent;
  background:linear-gradient(180deg, color-mix(in srgb, var(--navy-mid) 88%, #fff) 0%, var(--navy) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -6px 10px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.25),
    0 0 18px 3px color-mix(in srgb, var(--glow) 70%, transparent),
    0 0 40px 8px color-mix(in srgb, var(--glow) 35%, transparent),
    0 6px 14px color-mix(in srgb, var(--navy-dk) 30%, transparent);
}

/* Turning something away is the theme's glass too. What a button does is said
   by its label and by the question asked before it acts; it is not a colour.
   One tone across the application means a screen reads as one set of controls
   rather than as three. */
.btn.btn-danger,
.rowacts .act-btn.act-danger{
  --glow:var(--navy-mid);
  color:#fff;
  border-color:transparent;
  background:linear-gradient(180deg, color-mix(in srgb, var(--navy-mid) 92%, #fff) 0%,
    var(--navy) 55%, var(--navy-dk) 100%);
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -6px 10px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.22),
    0 2px 4px color-mix(in srgb, var(--navy-dk) 35%, transparent);
}
.btn.btn-danger:hover,
.rowacts .act-btn.act-danger:hover{
  transform:translateY(-2px);
  color:#fff;
  background:linear-gradient(180deg, color-mix(in srgb, var(--navy-mid) 88%, #fff) 0%,
    var(--navy) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 0 0 1px rgba(255,255,255,.22),
    0 0 18px 3px color-mix(in srgb, var(--glow) 70%, transparent),
    0 0 36px 6px color-mix(in srgb, var(--glow) 35%, transparent),
    0 6px 14px color-mix(in srgb, var(--navy-dk) 30%, transparent);
}

/* The flag is still a flag - the mark on it says so - and it glows in the
   theme's own light like every other button. */
.rowacts .act-btn.act-flag,
.rowacts .btn-link.shift-flag-btn{--glow:var(--navy-mid);}

/* Delete, the bin that eats its label: a glass rim and a glow. Its own ::after
   is the spinner, so the rim is drawn in the shadow instead. */
.eat-btn{
  box-shadow:0 6px 14px -6px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 0 0 1px rgba(255,255,255,.16);
  transition:padding .5s cubic-bezier(.65,0,.35,1), gap .4s ease, transform .18s ease,
    filter .2s ease, box-shadow .25s ease;
}
.eat-btn:not(.eat-eating):not(:disabled):hover{
  transform:translateY(-2px);
  box-shadow:0 6px 14px -6px rgba(0,0,0,.55),
    inset 0 1px 0 rgba(255,255,255,.2),
    inset 0 0 0 1px rgba(255,255,255,.22),
    0 0 16px 2px color-mix(in srgb, var(--navy-mid) 55%, transparent),
    0 0 34px 6px color-mix(in srgb, var(--navy-mid) 25%, transparent);
}
.eat-btn:not(.eat-eating):not(:disabled):active{transform:scale(.94);}

/* Two buttons are placed on the frame they belong to rather than standing in the flow: the one that
   adds a line, on its section's rule opposite the legend, and the × that takes a repair line off, in
   that line's own corner. The glass rule above gives every .btn `position:relative` for its glow, and
   being later it was winning here - so "+ Add Item" dropped under the legend on the left and the ×
   fell into the line. Both are named with .btn so they keep the place they were given. */
.btn.lines-add{position:absolute;top:-17px;right:14px;}
.btn.rline-x{position:absolute;top:12px;right:12px;}

/* a dialog's Close: frosted glass on the dialog's own heading */
.dlg-close{
  border-radius:999px;
  border:1px solid rgba(255,255,255,.35);
  color:#fff;
  background:linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.18);
  transition:transform .18s ease, box-shadow .25s ease, background .25s ease;
}
.dlg-close:hover{
  transform:translateY(-1px);
  background:linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,.14));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45),
    0 0 14px 2px rgba(255,255,255,.28),
    0 4px 10px rgba(0,0,0,.22);
}

/* a button that cannot be pressed does not lift or glow; how it looks spent
   is its own rule's (a given Save, above, reads as spent) */
.btn:disabled,
.btn[disabled]{cursor:not-allowed;}
.btn:disabled:hover,
.btn[disabled]:hover,
.btn.btn-primary:disabled:hover,
.btn.btn-primary[disabled]:hover,
.btn.btn-danger:disabled:hover,
.btn.btn-danger[disabled]:hover{transform:none;filter:none;box-shadow:none;}
.btn.btn-save:disabled:hover,
.btn.btn-save[disabled]:hover{
  transform:none;filter:none;box-shadow:none;
  background:color-mix(in srgb, var(--navy) 30%, var(--panel));
  border-color:color-mix(in srgb, var(--navy) 30%, var(--panel));
}

@media (prefers-reduced-motion:reduce){
  .btn:hover,.rowacts .btn-link:hover,.rowacts .act-btn:hover,
  .eat-btn:not(.eat-eating):not(:disabled):hover,.dlg-close:hover{transform:none;}
}

/* ---------- vendor dropdowns: searched, with + Add vendor (vendor_pick.js) ----------
   The select stays in the sheet, out of sight, so what reads and saves it is unchanged; the box
   standing in for it is drawn the way the sheet draws its selects. */
select.vp-native{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;
  margin:0 !important;border:0 !important;opacity:0 !important;pointer-events:none !important;overflow:hidden;clip:rect(0 0 0 0);}
/* The box standing in for the select is the search as well: it carries the vendor
   picked and is typed into to narrow the list. It is a frame around a plain input,
   so the field reads as one field - it was a button with a second search box
   inside the list it opened, which asked for the same answer twice. */
.vp-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;
  min-height:34px;padding:7px 9px;border:1px solid var(--line);border-radius:var(--radius);background:#fff;color:var(--ink);
  font-family:inherit;font-size:var(--t-sm);text-align:left;cursor:text;color-scheme:light;}
.vp-btn .vp-val{flex:1 1 auto;min-width:0;width:100%;padding:0;margin:0;border:0;background:none;
  font-family:inherit;font-size:inherit;color:inherit;text-overflow:ellipsis;}
.vp-btn .vp-val:focus{outline:none;}
.vp-btn .vp-val::placeholder{color:var(--muted);opacity:1;}
.vp-caret{flex:none;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;
  border-top:6px solid currentColor;opacity:.65;transition:transform .15s ease;cursor:pointer;}
.vp-btn[aria-expanded="true"] .vp-caret{transform:rotate(180deg);}
.vp-btn:focus-within,.vp-btn[aria-expanded="true"]{outline:3px solid var(--saffron);outline-offset:-1px;border-color:var(--saffron);}
.vp-btn.vp-off{opacity:.6;cursor:not-allowed;}
.vp-btn.vp-off .vp-val{cursor:not-allowed;}
.de-form .vp-btn{padding:8px 12px;border-radius:8px;background:#F8FAFC;}
.de-form .vp-btn .vp-val{background:none;}

.vp-panel{position:fixed;z-index:450;display:flex;flex-direction:column;background:#fff;color:var(--ink);
  border:1px solid var(--line);border-radius:10px;box-shadow:0 18px 40px rgba(6,10,32,.22);overflow:hidden;color-scheme:light;}
.vp-panel[hidden]{display:none;}
.vp-list{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 0;}
.vp-opt{padding:7px 12px;font-size:var(--t-sm);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.vp-opt.vp-blank{color:var(--muted);}
.vp-opt.vp-cur{font-weight:700;}
.vp-opt:hover{background:#F1F3F7;}
.vp-opt.vp-on{background:var(--navy);color:#fff;}
.vp-opt mark{background:#FDE68A;color:inherit;padding:0;border-radius:2px;}
.vp-opt.vp-on mark{background:rgba(255,255,255,.28);}
.vp-none{padding:12px;font-size:var(--t-sm);color:var(--muted);}
/* it stands over the list, so the line it carries is under it */
.vp-foot{flex:none;border-bottom:1px solid var(--line);padding:6px;background:#FAFAFB;}
.vp-foot:empty{display:none;}
.vp-add{display:block;width:100%;padding:8px 10px;border:1px dashed var(--navy-mid);border-radius:8px;background:transparent;
  color:var(--navy);font-family:inherit;font-size:var(--t-sm);font-weight:700;text-align:left;cursor:pointer;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.vp-add:hover,.vp-add:focus-visible{background:var(--navy);border-style:solid;border-color:var(--navy);color:#fff;}
.vp-add-dlg{z-index:440;}
.vp-add-err{margin:0 0 10px;padding:8px 12px;border-radius:8px;background:#FDECEC;color:#B42318;font-size:var(--t-sm);font-weight:600;}
.vp-add-err[hidden]{display:none;}

/* ---------- one vehicle, read whole (Vehicle Registry → View, record.js) ----------
   The record's own page: what has run out, every particular, the fuel standing, the crew mapped to
   it, its papers and its history - each in its own card. */
.vv{display:flex;flex-direction:column;gap:14px;}
.vv-card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:14px 16px;}
.vv-card > h4{margin:0 0 10px;font-size:var(--t-sm);font-weight:700;color:var(--ink);
  display:flex;align-items:center;gap:8px;}
.vv-card > h4::before{content:"";width:3px;height:14px;border-radius:2px;background:var(--navy);}
.vv-card.vv-warn{background:#FDF3F3;border-color:#E9C4C4;}
.vv-card.vv-warn > h4{color:var(--lapse);}
.vv-card.vv-warn > h4::before{background:var(--lapse);}
.vv-alerts{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;font-size:var(--t-sm);}
.vv-alerts .pill{margin-left:6px;}
.vv-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px 16px;}
.vv-cell{min-width:0;display:flex;flex-direction:column;gap:3px;}
.vv-cell > span{font-size:var(--t-label);font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted);}
.vv-cell > b{font-size:var(--t-sm);font-weight:700;color:var(--ink);word-break:break-word;}
.vv-cell > b i{font-style:normal;font-weight:500;color:var(--muted);}
.vv-cell .pill{margin-left:4px;}
.vv-miss{color:var(--muted);font-weight:500;}
.vv-none{margin:0;padding:14px;text-align:center;border:1px dashed var(--line);border-radius:8px;
  font-size:var(--t-sm);color:var(--muted);}
.vv-note{margin:10px 0 0;font-size:var(--t-label);color:var(--muted);}
.vv-docs{display:grid;grid-template-columns:repeat(auto-fit,minmax(232px,1fr));gap:12px;}
.vv-doc{border:1px solid var(--line);border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px;
  background:#FCFCFD;}
.vv-doc > span{font-size:var(--t-label);font-weight:700;color:var(--ink);}
.vv-doc.vv-doc-none{background:none;border-style:dashed;}
/* The papers a vehicle carries, read down the sheet: the paper's name on the
   left, the copy filed for it on the right, the way a stock line reads its
   invoice and its photograph. */
.vv-doc-tbl{width:100%;}
.vv-doc-tbl th{
  width:34%;text-align:left;vertical-align:middle;font-weight:700;color:var(--ink);
  font-size:var(--t-label);white-space:normal;
}
.vv-doc-tbl th .pill{margin-left:6px;vertical-align:middle;}
.vv-doc-tbl th .vv-doc-line{
  display:block;margin-top:3px;font-style:normal;font-weight:500;
  font-size:var(--t-label);color:var(--muted);
}
.vv-doc-tbl td{vertical-align:middle;}
.vv-doc-tbl tr.vv-doc-none th,.vv-doc-tbl tr.vv-doc-none td{color:var(--muted);}
@media (max-width:640px){
  .vv-doc-tbl th{width:44%;}
}

/* Each paper as a picture of itself. A tile is pressed to open the whole set in
   the document viewer, which is where it always opened from. */
.vv-shots{display:flex;flex-wrap:wrap;gap:8px;}
.vv-shot{width:100px;height:72px;padding:0;overflow:hidden;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  border:1px solid var(--line);border-radius:8px;background:#F2F4F6;}
.vv-shot:hover,.vv-shot:focus-visible{border-color:var(--navy);
  box-shadow:0 0 0 2px color-mix(in srgb, var(--navy) 18%, transparent);}
.vv-shot img{width:100%;height:100%;object-fit:cover;display:block;}
.vv-shot-paper{background:var(--ledger);}
.vv-shot-kind{font-size:var(--t-label);font-weight:700;letter-spacing:.04em;color:var(--muted);}
.vv-shot-note{font-size:10px;line-height:1.2;color:var(--muted);}
.vv-shot-more{font-size:var(--t-sm);font-weight:700;color:var(--navy);background:none;}
/* The bill a repair's part came in on, shown under the part on the job sheet
   and in the voucher's own lines. It is read, not filled in: the paper was
   uploaded once with the stock intake. */
.rstockbill{grid-column:1 / -1;}
/* Where a quantity came off more than one purchase, the shares it was made of -
   each priced at its own purchase's rate, so the line's total can be read
   rather than taken on trust. */
.rdraw{margin:8px 0 0;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;
  font-size:var(--t-label);color:var(--muted);}
.rdraw-part{background:var(--paper);border:1px solid var(--line-soft);border-radius:6px;
  padding:3px 8px;overflow-wrap:anywhere;}
.rdraw-part b{color:var(--ink);}
.rdraw-short{border-color:var(--caution);}
.rdraw-short i{font-style:normal;color:var(--caution);}
/* The box that opens under a list when the row picked was "add custom" - the
   answer is typed here, and the marker itself is never saved. It sits under its
   own list, marked so it reads as the answer rather than as a second field. */
.cust-typed{margin-top:6px;border-color:var(--saffron);}
.cust-typed:focus{outline:2px solid var(--saffron);outline-offset:1px;}
.cust-typed[hidden]{display:none;}
.rstockbill-said{margin:0 0 6px;font-size:var(--t-label);color:var(--muted);}
.rstockbill .stk-shots{margin-top:2px;}
.rstockbill .stk-shot{width:84px;height:60px;}

/* The papers on a stock line, on the sheet the line opens. Its own rules, so
   the record sheet's tiles and these cannot restyle one another. */
.stk-shots{display:flex;flex-wrap:wrap;gap:8px;}
.stk-shot{width:104px;height:74px;padding:0;overflow:hidden;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  border:1px solid var(--line);border-radius:8px;background:#F2F4F6;}
.stk-shot:hover,.stk-shot:focus-visible{border-color:var(--navy);
  box-shadow:0 0 0 2px color-mix(in srgb, var(--navy) 18%, transparent);}
.stk-shot img{width:100%;height:100%;object-fit:cover;display:block;}
/* a chip in a register cell carries the same colour the tiles use, so a
   spreadsheet is not read as a contract wherever it is shown */
.filechip.paper.k-pdf span{background:#B3261E;color:#fff;}
.filechip.paper.k-doc span{background:#1A4E8A;color:#fff;}
.filechip.paper.k-xls span{background:#1B6E3C;color:#fff;}
.filechip.paper.k-ppt span{background:#B05A16;color:#fff;}
.filechip.paper.k-any span{background:#5A6472;color:#fff;}
.filechip.paper span{padding:2px 5px;border-radius:4px;font-size:9px;font-weight:700;
  letter-spacing:.04em;line-height:1;}
/* the vehicle's paper tiles draw the same preview as every other tile */
.vv-shot .fpdf{width:100%;height:100%;display:block;border:0;pointer-events:none;background:#fff;}
.vv-shot .fkind{display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:3px;width:100%;height:100%;padding:4px;text-align:center;}
.vv-shot .fkind-ext{font-family:var(--mono);font-size:12px;font-weight:700;letter-spacing:.06em;
  line-height:1;padding:3px 7px;border-radius:5px;color:#fff;background:var(--muted);}
.vv-shot .fkind-note{font-size:10px;line-height:1.2;color:var(--muted);}
.vv-shot .fkind.k-pdf .fkind-ext{background:#B3261E;}
.vv-shot .fkind.k-doc .fkind-ext{background:#1A4E8A;}
.vv-shot .fkind.k-xls .fkind-ext{background:#1B6E3C;}
.vv-shot .fkind.k-ppt .fkind-ext{background:#B05A16;}
.vv-shot .fkind.k-any .fkind-ext{background:#5A6472;}
/* the same preview the upload tiles draw, sized to this tile */
.stk-shot .fpdf{width:100%;height:100%;display:block;border:0;pointer-events:none;background:#fff;}
.stk-shot .fkind{display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:3px;width:100%;height:100%;padding:4px;text-align:center;}
.stk-shot .fkind-ext{font-family:var(--mono);font-size:12px;font-weight:700;letter-spacing:.06em;
  line-height:1;padding:3px 7px;border-radius:5px;color:#fff;background:var(--muted);}
.stk-shot .fkind-note{font-size:10px;line-height:1.2;color:var(--muted);}
.stk-shot .fkind.k-pdf .fkind-ext{background:#B3261E;}
.stk-shot .fkind.k-doc .fkind-ext{background:#1A4E8A;}
.stk-shot .fkind.k-xls .fkind-ext{background:#1B6E3C;}
.stk-shot .fkind.k-ppt .fkind-ext{background:#B05A16;}
.stk-shot .fkind.k-any .fkind-ext{background:#5A6472;}
.stk-shot-paper{background:var(--ledger);}
.stk-shot-kind{font-size:var(--t-label);font-weight:700;letter-spacing:.04em;color:var(--muted);}
.stk-shot-note{font-size:10px;line-height:1.2;color:var(--muted);}
.stk-shot-more{font-size:var(--t-sm);font-weight:700;color:var(--navy);background:none;}
.vv-shot-gone{border-style:dashed;}
.vv-shot-gone .vv-shot-kind,.vv-shot-gone .vv-shot-note{color:var(--lapse);}
/* History: one entry a line, newest first - a change to the record, a move to
   another district or base, a crew mapping, or a job it was off the road for.
   The coloured left spine says which of those it is, and nothing outside this
   card is styled by any of it. */
.vv-hist{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px;}
.vv-hist-row{display:flex;align-items:stretch;gap:12px;background:#FCFCFD;
  border:1px solid var(--line);border-left:3px solid var(--line);border-radius:8px;padding:10px 12px;}
.vv-hist-row.vv-hist-transfer{border-left-color:var(--navy);}
.vv-hist-row.vv-hist-crew{border-left-color:var(--caution);}
.vv-hist-row.vv-hist-offroad{border-left-color:var(--lapse);}
.vv-hist-row.vv-hist-record{border-left-color:var(--green);}
.vv-hist-when{flex:0 0 76px;display:flex;flex-direction:column;gap:2px;}
.vv-hist-when > b{font-size:var(--t-label);font-weight:700;color:var(--ink);}
.vv-hist-when > span{font-size:var(--t-label);color:var(--muted);}
.vv-hist-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;}
.vv-hist-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.vv-hist-head > b{font-size:var(--t-sm);color:var(--ink);}
.vv-hist-msg{margin:0;font-size:var(--t-label);color:var(--muted);}
.vv-hist-chg{margin:2px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:3px;}
.vv-hist-chg li{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;font-size:var(--t-label);}
.vv-hist-chg li > span{font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted);}
.vv-hist-chg li > b{font-weight:700;color:var(--ink);word-break:break-word;}
.vv-hist-chg li > b > i{font-style:normal;font-weight:500;color:var(--muted);}
.vv-hist-chg li > em{font-style:normal;color:var(--muted);}
.vv-hist-more,.vv-hist-who{font-size:var(--t-label);color:var(--muted);}
.vv-hist-more{margin:2px 0 0;}
@media (max-width:640px){
  .vv-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));}
  .vv-docs{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));}
  .vv-hist-row{flex-direction:column;gap:6px;}
  .vv-hist-when{flex:0 0 auto;flex-direction:row;gap:6px;align-items:baseline;}
}

/* ---------- the register's rungs: project, region, district ----------
   The registry is opened a step at a time rather than as one long list. A card
   is a place on the fleet, not a statistic: it carries its name, what stands
   under it, and how those vehicles are. The trail above says where the reading
   has got to and lets any step of it be gone back to. */
.reg-drill{margin:0 0 var(--s4);}
.drill-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(232px,1fr));gap:var(--s3);
}
.drill-card{
  display:flex;flex-direction:column;gap:4px;text-align:left;min-width:0;
  padding:12px 14px 11px;font:inherit;color:inherit;cursor:pointer;
  border:1px solid var(--line);border-top:3px solid var(--navy-mid);
  border-radius:var(--radius-lg);background:var(--panel);
}
.drill-card:hover{border-color:var(--navy);box-shadow:0 2px 10px rgba(11,42,47,.12);}
.drill-card:hover .dc-name{color:var(--navy);}
.dc-kind{
  font-size:var(--t-micro);font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);
}
.dc-name{
  font-size:var(--t-sm);font-weight:700;color:var(--ink);line-height:1.25;
  overflow-wrap:anywhere;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;
}
.dc-n{
  font-size:var(--t-stat-sm);font-weight:600;line-height:1.05;letter-spacing:-.02em;
  color:var(--navy);margin-top:2px;
}
.dc-n i{font-style:normal;font-size:var(--t-label);font-weight:500;color:var(--muted);margin-left:6px;}
.dc-note{font-size:var(--t-micro);color:var(--muted);line-height:1.35;overflow-wrap:anywhere;}
.dc-foot{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin-top:6px;padding-top:7px;border-top:1px solid var(--line);
}
.dc-foot i{font-style:normal;font-size:var(--t-micro);}
.dc-flag{color:var(--lapse);font-weight:600;}
.dc-next{color:var(--navy);font-weight:600;margin-left:auto;}
@media (max-width:900px){
  .drill-grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));}
}
@media (max-width:640px){
  .drill-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));}
}

/* ---------- Transfer Vehicle (rendering.js) ----------
   The posting a vehicle is moved to. Every rule is scoped to the dialog's own
   id, so the register's other sheets keep the grid and fieldset they had. */
#vehMoveDlg .form-grid{grid-template-columns:repeat(2,1fr);}
#vehMoveDlg .vm-from{
  margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid var(--line-soft);
  display:flex;flex-direction:column;gap:3px;
}
#vehMoveDlg .vm-from span{
  font-size:var(--t-micro);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);
}
#vehMoveDlg .vm-from b{font-size:var(--t-sm);color:var(--ink);}
#vehMoveDlg .vm-crew{margin-top:14px;}
#vehMoveDlg .vm-crew-box{
  display:flex;align-items:center;gap:9px;cursor:pointer;
  border:1px solid var(--line);background:#fff;border-radius:var(--radius);padding:9px 11px;
}
#vehMoveDlg .vm-crew-box b{font-size:var(--t-sm);}
/* A box with nothing to decide is still readable, and says why it is off. */
#vehMoveDlg .vm-crew-box:has(input:disabled){cursor:default;opacity:.72;}
#vehMoveDlg #vm-crewnote{margin:7px 0 0;}
/* One format for every field: the label on one line - "(optional)" beside it,
   not under it - so the boxes of a row stand level, and the reason box drawn
   the way the dropdowns are, across the whole dialog. */
#vehMoveDlg .form-grid{gap:14px 16px;align-items:end;}
#vehMoveDlg .fld label .sub{display:inline;margin-left:4px;font-weight:400;}
#vehMoveDlg .fld select{min-height:38px;}
#vehMoveDlg .vm-reason{grid-column:1 / -1;}
#vehMoveDlg .vm-reason textarea{
  display:block;width:100%;min-height:72px;resize:vertical;box-sizing:border-box;
  border:1px solid var(--line);border-radius:var(--radius);background-color:#fff;color-scheme:light;
  padding:8px 10px;font-size:var(--t-sm);font-family:inherit;line-height:1.45;color:var(--ink);
}
#vehMoveDlg .vm-reason textarea::placeholder{color:var(--muted);}
#vehMoveDlg .vm-reason textarea:focus{outline:3px solid var(--saffron);outline-offset:-1px;border-color:var(--saffron);}
@media (max-width:640px){
  #vehMoveDlg .form-grid{grid-template-columns:1fr;}
}

/* ============ how Export, Clear and Search move (utils/button_fx.js) ============
   The three motions, drawn in the theme's own colours. Each is given to the
   buttons the application already has, by what the button is - so a register
   added later gets them without being told about them. */

/* ---- Export: the button draws down to a coin, fills, turns once, ticks ---- */
.btn[data-fx="export"]{
  position:relative; overflow:hidden;
  transition:width .48s cubic-bezier(.65,0,.35,1), border-radius .48s cubic-bezier(.65,0,.35,1),
    padding .48s cubic-bezier(.65,0,.35,1), background .35s ease, border-color .35s ease;
}
.btn[data-fx="export"][data-fx-state="loading"],
.btn[data-fx="export"][data-fx-state="success"]{
  width:38px; min-width:38px; padding:0; border-radius:50%; cursor:default;
}
.btn[data-fx="export"][data-fx-state="done"]{
  border-color:var(--forest); color:var(--forest);
  background:color-mix(in srgb, var(--forest) 12%, var(--panel));
}
.btn[data-fx="export"] .fx-word{
  display:inline-flex; align-items:center; gap:7px;
  transition:opacity .22s ease, transform .3s cubic-bezier(.65,0,.35,1);
}
.btn[data-fx="export"][data-fx-state="loading"] .fx-word,
.btn[data-fx="export"][data-fx-state="success"] .fx-word{
  opacity:0; transform:scale(.6);
}
.btn[data-fx="export"] .fx-ring{
  position:absolute; inset:0; opacity:0; transform:scale(.6); pointer-events:none;
  transition:opacity .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.btn[data-fx="export"][data-fx-state="loading"] .fx-ring,
.btn[data-fx="export"][data-fx-state="success"] .fx-ring{ opacity:1; transform:scale(1); }
.btn[data-fx="export"] .fx-fill{
  position:absolute; left:0; right:0; bottom:0; height:4%;
  background:color-mix(in srgb, var(--navy-mid) 55%, transparent);
  transition:height 1s cubic-bezier(.45,0,.2,1);
}
.btn[data-fx="export"][data-fx-state="loading"] .fx-fill{ height:92%; }
.btn[data-fx="export"][data-fx-state="success"] .fx-fill{ height:100%; }
.btn[data-fx="export"] .fx-orbit{ position:absolute; inset:0; animation:fxSpin 1.1s linear infinite; }
.btn[data-fx="export"][data-fx-state="success"] .fx-orbit{ opacity:0; transition:opacity .15s ease; }
@keyframes fxSpin{ to{ transform:rotate(360deg); } }
.btn[data-fx="export"] .fx-dot{
  position:absolute; top:3px; left:50%; width:5px; height:5px; margin-left:-2.5px;
  border-radius:50%; background:var(--navy-dk);
}
.btn[data-fx="export"] .fx-check{
  position:absolute; inset:0; margin:auto; width:17px; height:17px; fill:none;
  stroke:#FFFFFF; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:24; stroke-dashoffset:24; opacity:0;
}
.btn[data-fx="export"][data-fx-state="success"] .fx-check{ opacity:1; animation:fxDraw .4s ease forwards; }
@keyframes fxDraw{ to{ stroke-dashoffset:0; } }
.btn[data-fx="export"][data-fx-state="done"] .fx-word{ animation:fxPop .34s cubic-bezier(.34,1.56,.64,1); }
@keyframes fxPop{ 0%{ opacity:0; transform:scale(.5); } 100%{ opacity:1; transform:scale(1); } }

/* ---- Clear: a bin that swallows the word ---- */
.btn[data-fx="clear"]{ display:inline-flex; align-items:center; gap:7px; overflow:visible; }
.btn[data-fx="clear"] .fx-bin{ flex:none; transform-origin:50% 65%; }
.btn[data-fx="clear"][data-fx-state="eating"] .fx-bin{ animation:fxGulp 1.3s cubic-bezier(.36,0,.66,1); }
@keyframes fxGulp{
  0%,100%{ transform:scale(1) rotate(0deg); }
  18%{ transform:scale(1.1,.9) rotate(-4deg); }
  38%,55%{ transform:scale(1.2,1.28) rotate(3deg); }
  75%{ transform:scale(.94,1.06) rotate(-2deg); }
  90%{ transform:scale(1.03,.98) rotate(1deg); }
}
.btn[data-fx="clear"] .fx-bin-lid{ transform-box:fill-box; transform-origin:12% 100%; }
.btn[data-fx="clear"][data-fx-state="eating"] .fx-bin-lid{ animation:fxLid 1.3s cubic-bezier(.45,0,.4,1); }
@keyframes fxLid{
  0%{ transform:rotate(0deg); }
  22%,58%{ transform:rotate(-52deg) translate(-1.5px,-2px); }
  100%{ transform:rotate(0deg); }
}
.btn[data-fx="clear"] .fx-word{ display:inline-block; transition:opacity .22s ease, transform .22s ease; }
.btn[data-fx="clear"][data-fx-state="eating"] .fx-word{
  opacity:0; transform:translateY(9px) scale(.35);
  transition:opacity .25s ease .12s, transform .25s cubic-bezier(.5,-.2,.75,0) .12s;
}
.btn[data-fx="clear"][data-fx-state="idle"] .fx-word{ animation:fxPop .35s cubic-bezier(.34,1.56,.64,1); }

/* ---- Search: a magnifier that lifts as the box is typed into ---- */
input[type="search"][data-fx="search"]{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334608f' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.6' y2='16.6'/></svg>");
  background-repeat:no-repeat; background-position:10px 50%; background-size:15px 15px;
  padding-left:32px;
  transition:background-position .28s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease,
    border-color .25s ease;
}
input[type="search"][data-fx="search"]:focus{
  background-position:10px 42%;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--navy-mid) 22%, transparent);
}
@media (prefers-reduced-motion: reduce){
  .btn[data-fx="export"] .fx-orbit{ animation:none; }
  .btn[data-fx="export"] .fx-fill,
  .btn[data-fx="export"] .fx-word,
  .btn[data-fx="clear"] .fx-bin,
  .btn[data-fx="clear"] .fx-bin-lid,
  .btn[data-fx="clear"] .fx-word,
  input[type="search"][data-fx="search"]{ animation:none; transition:none; }
}

/* ---- Search: a circle that opens into a bar (utils/button_fx.js) ---- */
/* The open box is never laid over the fields beside it: it takes its room
   from the row, so nothing is covered and nothing is hidden.

   A shut box is the button and nothing more. Its field used to hold a whole
   column open while the box was shut, which left a hand's width of white
   between the circle and the field after it; the field is now the size of the
   circle, and widens with the box as it opens. */
.fx-search-cell{
  position:relative;
  flex:0 0 auto !important;
  width:38px; min-width:0;
  transition:width .42s cubic-bezier(.65,0,.35,1);
}
.fx-search-cell[data-fx-open="1"]{ width:var(--fx-cell-open, 300px); }
/* the name belongs to the open box - the circle says what it is on its own */
.fx-search-cell > label{ opacity:0; white-space:nowrap; transition:opacity .2s ease; }
.fx-search-cell[data-fx-open="1"] > label{ opacity:1; transition-delay:.2s; }
/* the fields after it move along, one a moment behind the next */
.fx-shift{
  animation:fxShiftAlong .44s cubic-bezier(.34,1.24,.64,1) both;
  animation-delay:var(--fx-step, 0ms);
}
@keyframes fxShiftAlong{
  0%{ transform:translateX(-12px); opacity:.45; }
  100%{ transform:translateX(0); opacity:1; }
}
.fx-search[data-fx-state="open"]{ box-shadow:0 8px 18px -14px rgba(6,10,32,.4); }
.fx-search{
  position:relative; display:inline-flex; align-items:center;
  width:34px; height:34px; border-radius:50%;
  border:1px solid var(--line); background:var(--paper); overflow:hidden;
  transition:width .3s cubic-bezier(.65,0,.35,1), border-color .25s ease, background .25s ease;
}
.fx-search[data-fx-state="open"]{
  width:var(--fx-open-w, 240px); border-radius:999px;
  border-color:var(--navy); background:var(--panel);
}
.fx-search[data-fx-state="opening"]{
  border-color:var(--navy); background:var(--panel);
  animation:fxPillOpen .56s cubic-bezier(.65,0,.35,1) forwards;
}
.fx-search[data-fx-state="closing"]{
  border-color:var(--navy); background:var(--panel);
  animation:fxPillShut .46s cubic-bezier(.65,0,.35,1) forwards;
}
@keyframes fxPillOpen{
  0%{ width:34px; height:34px; border-radius:50%; }
  44%{ width:var(--fx-open-w, 240px); height:5px; border-radius:999px; }
  100%{ width:var(--fx-open-w, 240px); height:34px; border-radius:999px; }
}
@keyframes fxPillShut{
  0%{ width:var(--fx-open-w, 240px); height:34px; border-radius:999px; }
  56%{ width:var(--fx-open-w, 240px); height:5px; border-radius:999px; }
  100%{ width:34px; height:34px; border-radius:50%; }
}
/* One cross, not two. The browser draws its own clear button inside a search
   box, which stood beside the pill's - two crosses on the same bar. */
.fx-search input[type="search"]::-webkit-search-cancel-button,
.fx-search input[type="search"]::-webkit-search-decoration{
  -webkit-appearance:none; appearance:none; display:none;
}
.fx-search input[type="search"]{
  flex:1 1 auto; min-width:0; height:100%; border:0; outline:0; background:transparent;
  padding:0 34px 0 14px; font-family:var(--sans); font-size:var(--t-label); color:var(--ink);
  opacity:0; pointer-events:none; transition:opacity .16s ease;
  /* the magnifier drawn on the box itself belongs to the closed state only */
  background-image:none;
}
.fx-search[data-fx-state="open"] input[type="search"],
.fx-search[data-fx-state="opening"] input[type="search"]{ opacity:1; pointer-events:auto; }
.fx-search[data-fx-state="opening"] input[type="search"]{ transition:opacity .26s ease .28s; }
.fx-search .fx-s-open{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  border:0; padding:0; background:transparent; color:var(--navy); cursor:pointer;
  transition:opacity .12s ease, transform .18s ease;
}
.fx-search[data-fx-state="open"] .fx-s-open,
.fx-search[data-fx-state="opening"] .fx-s-open,
.fx-search[data-fx-state="closing"] .fx-s-open{ opacity:0; transform:scale(.4); pointer-events:none; }
.fx-search .fx-s-close{
  position:absolute; top:2px; right:2px; width:28px; height:28px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; border:0; cursor:pointer;
  background:var(--navy); color:#FFFFFF; opacity:0; transform:scale(.5); pointer-events:none;
  transition:opacity .16s ease, transform .26s cubic-bezier(.34,1.56,.64,1);
}
.fx-search .fx-s-close svg{ width:13px; height:13px; }
.fx-search[data-fx-state="open"] .fx-s-close{ opacity:1; transform:scale(1); pointer-events:auto; }
.fx-search[data-fx-state="opening"] .fx-s-close{ opacity:1; transform:scale(1); transition-delay:.36s; }
.fx-search .fx-s-close:hover{ background:var(--navy-mid); }
@media (prefers-reduced-motion: reduce){
  .fx-search, .fx-search input[type="search"], .fx-search .fx-s-open, .fx-search .fx-s-close{
    animation:none; transition:none;
  }
  .fx-search-cell, .fx-search-cell > label{ transition:none; }
  .fx-shift{ animation:none; }
}

/* ---------- GPS & Telematics (modules/gps.js) ---------- */
.gps-upd{font-size:var(--t-label);color:var(--muted);}
.gps-wrap{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:14px;align-items:start;}
.gps-mappanel{padding:0;overflow:hidden;}
.gps-map{height:560px;width:100%;background:var(--ledger);}
.gps-legend{display:flex;flex-wrap:wrap;gap:14px;padding:8px 12px;font-size:var(--t-label);color:var(--muted);border-top:1px solid var(--line-soft);}
.gps-legend i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:-1px;}
.gps-listpanel h3{margin-bottom:0;}
.gps-list{max-height:560px;overflow:auto;}
.gps-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid var(--line-soft);padding:9px 12px;cursor:pointer;font:inherit;color:inherit;min-height:48px;}
.gps-item:hover{background:var(--ledger);}
.gps-item.on{background:var(--blue-bg);box-shadow:inset 3px 0 0 var(--navy);}
.gps-dot{flex:0 0 10px;height:10px;border-radius:50%;}
.gps-main{flex:1 1 auto;min-width:0;}
.gps-main .sub,.gps-side .sub{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.gps-side{flex:0 0 auto;text-align:right;max-width:48%;}
.gps-none{padding:18px 14px;color:var(--muted);margin:0;}
.gps-kv{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 18px;margin:0 0 14px;}
.gps-kv div{min-width:0;}
.gps-kv dt{font-size:var(--t-micro);color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.gps-kv dd{margin:2px 0 0;font-weight:600;overflow-wrap:anywhere;}
.gps-route{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-top:10px;border-top:1px solid var(--line-soft);}
.gps-route input[type=date]{min-height:34px;}
.gps-replay{display:inline-flex;gap:6px;align-items:center;}
.gps-tracktxt{margin:10px 0 0;color:var(--muted);font-size:var(--t-sm);}
#view-section .summary > div.on{outline:2px solid var(--navy);outline-offset:-2px;}
@media (max-width:640px){
  .gps-filters .filters{flex-wrap:wrap;}
  .gps-filters .filters > .fld{flex:1 1 40%;min-width:130px;}
  .gps-filters .filter-actions{flex:1 1 100%;justify-content:flex-end;margin-top:var(--s2);}
}
@media (max-width:1000px){
  .gps-wrap{grid-template-columns:minmax(0,1fr);}
  .gps-map{height:380px;}
  .gps-list{max-height:420px;}
  .gps-kv{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* ============ KPI fit (2026-09-30) ============
   Every figure stays inside its card, at every width.
   The bands' own base rules (.summary.fill, .pmgrid) were written after the
   phone and tablet breakpoints, so on a narrow screen they put the desktop
   column count back - four Schedule Service cards side by side on a phone.
   These come last, so the breakpoints hold. */
@media (max-width:1100px){
  .summary.fill{grid-template-columns:repeat(3,minmax(0,1fr));}
  .pmgrid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:720px){
  .summary.fill{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:480px){
  .pmgrid{grid-template-columns:1fr;}
}
/* a card is measured on its own width, so what it holds can answer to it */
.summary > div{container-type:inline-size;}
/* A mileage card holds three readings. In a card too narrow for three columns
   they are stacked, one line each - the reading, then what it is - rather
   than broken a letter at a time ("No rea din g"). */
@container (max-width:300px){
  .summary .kmpl-split{flex-direction:column;gap:5px;}
  .summary .kmpl-half{padding:0;flex-direction:row;flex-wrap:wrap;align-items:baseline;column-gap:6px;}
  .summary .kmpl-half + .kmpl-half{border-left:0;border-top:1px solid var(--line-soft);padding-top:5px;}
  .summary .kmpl-half b{font-size:14px;white-space:nowrap;overflow-wrap:normal;}
}
@container (max-width:190px){
  .summary .db-split{grid-template-columns:1fr;}
}
.summary dd{min-width:0;max-width:100%;}
/* a figure set smaller or shortened to fit keeps its full value on hover */
.summary dd[title]{cursor:help;}
/* the service cards: the name breaks between its words, the count's word goes under it when there is no room */
.pmcard .nm{overflow-wrap:break-word;word-break:normal;}
.pmcard .big{display:flex;flex-wrap:wrap;align-items:baseline;row-gap:2px;}
/* the masthead on a phone: its controls wrap onto a second line rather than
   pushing the whole page sideways */
@media (max-width:720px){
  .mast-meta{min-width:0;max-width:100%;margin-left:0;}
  .masttools{flex-wrap:wrap;justify-content:flex-start;row-gap:8px;}
  .masttools .who{max-width:100%;min-width:0;}
  .masttools .who .who-text{min-width:0;max-width:150px;overflow:hidden;}
  .masttools .who .who-name,.masttools .who .who-role{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
}
/* On a phone each row of cards is as tall as its own cards, not as the
   tallest card on the page - "Operated Vehicles" stacked its two halves and
   every other card on the dashboard grew to its height, mostly empty. */
@media (max-width:720px){
  .summary,.summary.fill{grid-auto-rows:auto;}
}
/* A filter bar on a phone: two fields a row, each wide enough to read what is
   chosen ("All states", a date), and the buttons on a row of their own. */
@media (max-width:640px){
  .filterbox .filters{flex-wrap:wrap;}
  .filterbox .filters > .fld{flex:1 1 40%;min-width:130px;}
  .filterbox .filter-actions{flex:1 1 100%;flex-wrap:wrap;justify-content:flex-end;margin-top:var(--s2);}
}
/* A panel heading's own buttons (District Stock / Purchase Invoices / Old
   Parts Removed, Request Stock Entry, Move Stock) wrap under the title on a
   phone rather than running past the edge of the screen. */
@media (max-width:720px){
  .panel > h3{flex-wrap:wrap;row-gap:8px;}
  .panel > h3 .h3bar{flex-wrap:wrap;max-width:100%;margin-left:0;row-gap:6px;}
}

/* ---------- Old Parts Removed: the Export button (stock.js exportOldParts) ----------
   Lifts on hover with its arrow bobbing; on a click the arrow drops while the
   file is made, then the button turns green with a pop to say it is done. */
.btn-export{display:inline-flex;align-items:center;gap:6px;
  transition:transform .18s ease, box-shadow .18s ease, background-color .25s ease, color .25s ease, border-color .25s ease;}
.btn-export .bx-ico{display:inline-flex;}
.btn-export .bx-arrow{transform-origin:center;}
.btn-export:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(76,46,128,.18);}
.btn-export:hover .bx-arrow{animation:bxBob .9s ease-in-out infinite;}
.btn-export:active{transform:translateY(0) scale(.97);}
.btn-export.bx-busy{pointer-events:none;opacity:.85;}
.btn-export.bx-busy .bx-arrow{animation:bxDrop .45s ease-in infinite;}
.btn-export.bx-done{background:var(--green-bg);border-color:var(--green);color:var(--green);}
.btn-export.bx-done .bx-ico{animation:bxPop .4s cubic-bezier(.3,1.6,.5,1);}
@keyframes bxBob{0%,100%{transform:translateY(0);}50%{transform:translateY(2px);}}
@keyframes bxDrop{0%{transform:translateY(-4px);opacity:0;}40%{opacity:1;}100%{transform:translateY(4px);opacity:0;}}
@keyframes bxPop{0%{transform:scale(.4);}100%{transform:scale(1);}}
@media (prefers-reduced-motion: reduce){
  .btn-export, .btn-export:hover{transform:none;transition:none;}
  .btn-export .bx-arrow, .btn-export.bx-done .bx-ico{animation:none !important;}
}

/* ---------- Spares / Tyres / Battery intake: each line's own papers (forms.js linePapersHtml) ---------- */
/* the lines stand side by side - Line 1, Line 2, Line 3 ... - in one row that
   scrolls sideways once there are more than fit */
#linePapersHost,#partPhotosHost{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch;gap:var(--s2);
  overflow-x:auto;padding-bottom:6px;}
.line-papers{flex:0 0 300px;min-width:0;padding:10px 12px;border:1px solid var(--line);
  border-radius:10px;background:var(--panel);}
.line-papers .fhead{flex-wrap:wrap;gap:6px;}
.line-papers-head{margin-bottom:6px;font-weight:700;color:var(--navy);}

/* ---------- "+ Add Item" on Parts Required & Float Stock (the repair lines) ----------
   It straddled the section's rule and sat over the first line's corner, so it
   read as part of the frame. Here it is moved down inside the section, to the
   right above the lines, in solid colours. Only the repair section (the one
   holding #repairHost) is moved; "+ Add" on a purchase keeps its place. */
.lines-set:has(> #repairHost) > .btn.lines-add{
  position:static;display:block;width:fit-content;margin:4px 0 12px auto;
  padding:8px 16px;font-size:13px;font-weight:700;
  background:var(--navy);border:1px solid var(--navy);color:#fff;
  box-shadow:0 2px 6px rgba(76,46,128,.25);
}
.lines-set:has(> #repairHost) > .btn.lines-add:hover{background:var(--navy-mid);border-color:var(--navy-mid);color:#fff;}

/* "Line 1", "Line 2" ... over each part card on Parts Required & Float Stock (forms.js repairLinesHtml) */
.rline-head{margin:0 40px 8px 0;font-weight:700;font-size:var(--t-sm);color:var(--navy);}

/* ---------- Expenses job sheet: Item Photo, part by part (forms.js partPhotosHtml) ----------
   One row per part - New, Before and After item photo side by side - under
   "Part 1", "Part 2" ... The per-box "+ Add" and the numbered caption are left
   off, so each box reads as the one photo it asks for. */
.part-photos-title{margin-bottom:6px;font-weight:700;color:var(--navy);}
.part-photos + .part-photos{margin-top:var(--s3);}
.part-photos-head{margin-bottom:4px;font-weight:700;font-size:var(--t-sm);color:var(--navy);}
.part-photos-row{display:flex;flex-wrap:wrap;gap:var(--s3);}
.part-photos-row > .fileset{flex:0 0 auto;width:auto;margin:0;}
.part-photos-row .fhead{margin-bottom:4px;}
/* each of the three takes several files - "+ Add" opens another slot, and the
   picker takes pictures, PDFs and documents, several at once */
.part-photos-row .fhead{gap:6px;flex-wrap:wrap;}
.part-photos-row .fhead .btn{padding:2px 8px;font-size:11px;}
.part-photos-row .fslot-ttl{display:none;}
.part-photos-row .fhead label{font-weight:400;color:var(--muted);}

/* the expense job sheet's line blocks (forms.js partPhotosHtml): the item photos
   stand three to a row inside the block, wrapping where the block is narrow */
#partPhotosHost .line-papers{flex:0 0 340px;}
#partPhotosHost .part-photos-row{gap:var(--s2);margin-bottom:var(--s2);}
#partPhotosHost .part-photos-title{margin-top:4px;font-size:var(--t-sm);}

/* the row of Line blocks scrolls sideways without a visible scrollbar
   (touchpad, Shift + mouse wheel, or a finger on a touch screen) */
#linePapersHost,#partPhotosHost{scrollbar-width:none;-ms-overflow-style:none;}
#linePapersHost::-webkit-scrollbar,#partPhotosHost::-webkit-scrollbar{display:none;height:0;}

/* ---------- row action buttons, the Tickets look, across the application ----------
   Every table's row buttons - View, Edit, Delete, Approve, Transfer, Crew, the
   flag, In progress / Resolve / Reject - are drawn as the Tickets desk draws
   them: a rounded pill in the brand gradient, purple through magenta to orange,
   with white bold text and a soft lift on hover. Only the look changes; what
   each button does is untouched. A colour tone that sets its own --fms-* stops
   is followed; otherwise the brand's own stops are used. */
.rowacts .btn-link,
.rowacts .act-btn,
.rowacts .act-btn.act-brand,
.rowacts .act-btn.act-danger,
.rowacts .eat-btn{
  border-radius:999px;
  border:1px solid transparent;
  color:#fff;
  font-weight:700;
  background:linear-gradient(90deg,
    var(--fms-purple,#7A18C9) 0%, var(--fms-magenta,#E0117F) 55%, var(--fms-orange,#F7901E) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(122,24,201,.28);
}
.rowacts .btn-link:hover,
.rowacts .act-btn:hover,
.rowacts .act-btn.act-brand:hover,
.rowacts .act-btn.act-danger:hover,
.rowacts .eat-btn:not(.eat-eating):not(:disabled):hover{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(90deg,
    var(--fms-purple,#7A18C9) 0%, var(--fms-magenta,#E0117F) 55%, var(--fms-orange,#F7901E) 100%);
  filter:brightness(1.08);
  transform:translateY(-2px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 6px 14px rgba(224,17,127,.35);
}
@media (prefers-reduced-motion:reduce){
  .rowacts .btn-link:hover,.rowacts .act-btn:hover,.rowacts .eat-btn:hover{transform:none;}
}

/* Support Tickets Desk: the action taken, kept to a readable width (tickets.js) */
.tk-resolution{display:block;max-width:260px;white-space:normal;}

/* the ticket View's Resolve, in the row buttons' gradient */
.btn.btn-primary.tk-resolve,.btn.btn-primary.tk-resolve:hover{
  background:linear-gradient(90deg,var(--fms-purple,#7A18C9) 0%,var(--fms-magenta,#E0117F) 55%,var(--fms-orange,#F7901E) 100%);
  border-color:transparent;color:#fff;font-weight:700;}

/* Resolve ticket: the one box it asks (dashboard.js ticketResolveForm) */
.tk-resolve-note{width:100%;min-height:72px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;
  font:inherit;font-size:var(--t-sm);resize:vertical;box-sizing:border-box;}
.tk-resolve-note:focus{outline:2px solid var(--saffron);outline-offset:1px;}
#tkResolveErr{margin:6px 0 0;color:var(--lapse);font-size:12px;font-weight:600;}

/* Approvals: the days pending pill stays on one line (audit.js apDaysPending) */
.ap-days{white-space:nowrap;}

/* ---------- Base locations: the cards drawn as tickets (notifications.js baseTicket) ----------
   A coloured head with the name, a darker band under it, then a TOTAL column of
   base locations, each project's vehicles and the backup vehicles. Each card
   takes the next colour in turn; the corner at the foot is rounded wider, as a
   ticket's is. Scoped to .bt-* so nothing else on the page changes. */
.bt-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:18px;margin:6px 0 var(--s4);}
.bt-card{--bt:#6A1B9A;--bt-dk:#3E1066;--bt-soft:#F6F1FA;--bt-ink:#fff;
  position:relative;display:flex;flex-direction:column;overflow:hidden;
  border:4px solid var(--bt);border-radius:18px 18px 34px 18px;background:var(--bt-soft);
  box-shadow:0 6px 16px -8px color-mix(in srgb, var(--bt) 60%, transparent);
  transition:transform .18s ease, box-shadow .2s ease;}
.bt-card.bt-click{cursor:pointer;}
.bt-card.bt-click:hover,.bt-card.on{transform:translateY(-3px);
  box-shadow:0 12px 24px -10px color-mix(in srgb, var(--bt) 75%, transparent);}
.bt-card.on{outline:3px solid color-mix(in srgb, var(--bt) 45%, transparent);outline-offset:2px;}
.bt-head{position:relative;padding:18px 12px 12px;background:var(--bt);color:var(--bt-ink);
  text-align:center;font-weight:800;font-size:15px;line-height:1.25;}
.bt-head::before{content:"";position:absolute;top:6px;left:50%;width:70%;height:3px;transform:translateX(-50%);
  border-radius:3px;background:rgba(255,255,255,.55);}
.bt-band{padding:8px 10px;background:var(--bt-dk);color:#fff;text-align:center;font-weight:700;font-size:12px;
  letter-spacing:.01em;}
.bt-table{width:100%;border-collapse:collapse;}
.bt-table thead th{padding:8px 12px 4px;font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:#6B7280;text-align:center;}
.bt-table thead th:first-child{width:58%;}
.bt-table tbody th{padding:12px 12px;text-align:left;font-weight:500;font-size:13px;color:#2A2F45;
  border-top:1px solid color-mix(in srgb, var(--bt) 14%, #E8E8EE);}
.bt-table tbody td{padding:12px 12px;text-align:center;border-top:1px solid color-mix(in srgb, var(--bt) 14%, #E8E8EE);
  white-space:nowrap;}
.bt-table tbody td b{font-size:19px;font-weight:800;color:var(--bt);}
.bt-go{margin-left:10px;font-style:normal;font-weight:800;color:var(--bt-dk);}
.bt-purple {--bt:#6A1B9A;--bt-dk:#3E1066;--bt-soft:#F6F1FA;}
.bt-magenta{--bt:#D81B60;--bt-dk:#9C0F43;--bt-soft:#FCF1F5;}
.bt-orange {--bt:#F7931E;--bt-dk:#C2660C;--bt-soft:#FFF7EE;--bt-ink:#2A1A06;}
.bt-amber  {--bt:#FBC02D;--bt-dk:#A87C08;--bt-soft:#FFFAEB;--bt-ink:#2A1F04;}
.bt-teal   {--bt:#0E8A86;--bt-dk:#0A5F5C;--bt-soft:#EEF8F7;}
.bt-blue   {--bt:#1E66C8;--bt-dk:#123F82;--bt-soft:#EFF4FC;}
.bt-green  {--bt:#1E8E4E;--bt-dk:#11602F;--bt-soft:#EEF8F1;}
.bt-pink   {--bt:#B0168C;--bt-dk:#760C5D;--bt-soft:#FBF0F8;}
.bt-indigo {--bt:#3F3FA6;--bt-dk:#26266E;--bt-soft:#F1F1FA;}
.bt-red    {--bt:#E04A2F;--bt-dk:#A02E18;--bt-soft:#FDF2EF;}
.bt-amber .bt-table tbody td b{color:#A87C08;}
@media (prefers-reduced-motion:reduce){ .bt-card,.bt-card.bt-click:hover{transition:none;transform:none;} }

/* ---------- KPI cards, "leaf corners", across the application ----------
   Every reading card (dashboard and every module's band - dbCards, statStrip)
   is one shape: a band across the top in the theme's own colour carrying the
   icon and the name in white, then on white the figure, large, and the note
   under it. Two opposite corners are rounded and two nearly square. The band
   is drawn in --navy, which each colour tone sets, so the cards follow the
   theme chosen. What a card shows and what it opens are unchanged. */
dl.summary > div{
  border:1px solid color-mix(in srgb, var(--navy) 16%, var(--line)) !important;
  border-radius:22px 6px 22px 6px !important;
  background:var(--panel);overflow:hidden;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}
dl.summary > div:not(.go),
dl.summary > div.go button{
  grid-template-rows:auto 1fr auto !important;gap:2px;
  padding:0 16px 14px !important;border-radius:inherit;
}
dl.summary .head{
  height:auto !important;margin:0 -16px 10px;padding:11px 16px;
  background:var(--navy);color:#fff;
}
dl.summary .head .mark{width:20px;height:20px;background:transparent !important;color:#fff !important;}
dl.summary .head dt{color:#fff !important;font-weight:700;font-size:14px;-webkit-line-clamp:1;line-clamp:1;}
dl.summary dd{color:var(--ink,#101828) !important;font-weight:800;font-size:clamp(24px,2.4vw,32px);
  letter-spacing:-.02em;align-self:end;}
dl.summary .note{color:var(--muted);font-size:12.5px;align-self:start;}
dl.summary > div.go:hover{border-color:var(--navy) !important;
  box-shadow:0 6px 16px -6px color-mix(in srgb, var(--navy) 45%, transparent);}
dl.summary > div.go button:hover dt,
dl.summary > div.go.on dt{color:#fff !important;}
dl.summary > div.go.on{border-color:var(--navy) !important;border-width:2px !important;
  background:color-mix(in srgb, var(--navy) 5%, var(--panel));}
/* the two-figure cards (Operated Vehicles) keep their halves under the band */
dl.summary .db-split{grid-row:auto;}

/* ---------- Preventive Maintenance Overview cards, in the KPI cards' leaf shape ----------
   The service's name on a band in the theme colour, white; then the count, the
   Overdue / Due Soon / Safe pills and View Records on white. Two opposite
   corners rounded, two nearly square, as every KPI card now is. */
.pmgrid .pmcard{
  padding:0 16px 12px;border:1px solid color-mix(in srgb, var(--navy) 16%, var(--line));
  border-radius:22px 6px 22px 6px;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.pmgrid .pmcard:hover,.pmgrid .pmcard:focus-visible{border-color:var(--navy);
  box-shadow:0 6px 16px -6px color-mix(in srgb, var(--navy) 45%, transparent);}
.pmgrid .pmcard .top{margin:0 -16px 6px;padding:11px 16px;background:var(--navy);}
.pmgrid .pmcard .nm{color:#fff;font-size:14px;}
.pmgrid .pmcard .big{font-family:var(--sans);font-weight:800;color:var(--ink,#101828);font-size:clamp(24px,2.4vw,32px);}
.pmgrid .pmcard .foot{color:var(--navy);}

/* Vendor sheet: the Location section's five lists, three to a row like the sections around it (rbac.js vendorLocHtml) */
#vendorLocHost{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s3) var(--s4);}
@media (max-width:760px){ #vendorLocHost{grid-template-columns:1fr;} }

/* ---------- Material Indents (indents.js) ---------- */
.ind-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s3) var(--s4);}
.ind-form .fld.wide,.ind-form .fileset{grid-column:1 / -1;}
.ind-form input,.ind-form select,.ind-form textarea{width:100%;box-sizing:border-box;}
.ind-step{padding:4px 0;border-bottom:1px dashed var(--line);}
.ind-step:last-child{border-bottom:0;}
@media (max-width:760px){ .ind-form{grid-template-columns:1fr;} }

/* Material Indents: the sub category dropdown that searches as it is typed into (indents.js) */
.ind-sub-wrap input{padding-right:30px;}
.ind-sub-caret{position:absolute;right:11px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--muted);font-size:12px;}
.ind-sub-list{max-height:300px;}
.ind-sub-more{cursor:default;color:var(--muted);font-size:12px;font-style:italic;}

/* Material Indents: "+ Add Indent" at the foot of the part list, and the small panel it opens (indents.js) */
.ind-sub-add{position:sticky;bottom:0;background:#fff;font-weight:700;color:var(--navy);
  border:1px dashed color-mix(in srgb, var(--navy) 40%, var(--line));border-radius:8px;margin:6px;}
.ind-sub-add:hover{background:color-mix(in srgb, var(--navy) 6%, #fff);}
.ind-add-part{margin-top:8px;padding:10px 12px;border:1px dashed color-mix(in srgb, var(--navy) 40%, var(--line));
  border-radius:10px;background:color-mix(in srgb, var(--navy) 3%, var(--panel));}
.ind-add-head{font-weight:700;color:var(--navy);margin-bottom:8px;font-size:13px;}
.ind-add-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px;}
.ind-add-grid label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);}
.ind-add-acts{display:flex;justify-content:flex-end;gap:8px;margin-top:10px;}
/* the new-part panel across the sheet: its four boxes on one row, two on a narrow screen */
.ind-form .ind-add-part{margin-top:0;}
.ind-form .ind-add-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
@media (max-width:900px){ .ind-form .ind-add-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
/* five boxes now, the generating number among them */
.ind-form .ind-add-grid{grid-template-columns:repeat(5,minmax(0,1fr));}
@media (max-width:1000px){ .ind-form .ind-add-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
/* six boxes now, Quantity the last of them */
.ind-form .ind-add-grid{grid-template-columns:repeat(6,minmax(0,1fr));}
@media (max-width:1100px){ .ind-form .ind-add-grid{grid-template-columns:repeat(3,minmax(0,1fr));} }
@media (max-width:700px){ .ind-form .ind-add-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }

/* Material Indents: the quotation in the indent's view, as a preview tile that opens it (indents.js) */
.ind-doc{display:inline-flex;flex-direction:column;gap:6px;text-decoration:none;color:inherit;}
.ind-doc-tile{display:flex;align-items:center;justify-content:center;width:180px;height:130px;overflow:hidden;
  border:1px solid var(--line);border-radius:10px;background:#fff;}
.ind-doc-tile img{max-width:100%;max-height:100%;object-fit:contain;}
.ind-doc-tile embed{width:100%;height:100%;pointer-events:none;}
.ind-doc:hover .ind-doc-tile{border-color:var(--navy);box-shadow:0 4px 12px -4px color-mix(in srgb, var(--navy) 40%, transparent);}
.ind-doc-name{font-size:12px;color:var(--muted);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* the quotation tile is a button now, opening the viewer */
button.ind-doc{background:none;border:0;padding:0;cursor:pointer;font:inherit;text-align:left;}

/* User sheet: + Add role's panel under Post held (rbac.js roleAddPanelHtml) */
.role-add{padding:10px 12px;border:1px dashed color-mix(in srgb, var(--navy) 40%, var(--line));border-radius:10px;
  background:color-mix(in srgb, var(--navy) 3%, var(--panel));}
.role-add-head{font-weight:700;color:var(--navy);margin-bottom:8px;font-size:13px;}
.role-add-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;}
.role-add-grid label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);}
.role-add-acts{display:flex;justify-content:flex-end;gap:8px;margin-top:10px;}
@media (max-width:700px){ .role-add-grid{grid-template-columns:1fr;} }

/* Material Indents - supply details on Mark supplied; CFO dashboard rows */
.isp-in{ width:100%; max-width:320px; padding:6px 9px; border:1px solid var(--line, #d0d5dd); border-radius:6px; font:inherit; }
input#isp-qty.isp-in{ max-width:120px; }
tr.ind-supply-row{ cursor:pointer; }
tr.ind-supply-row:hover td{ background:var(--hover, rgba(0,0,0,.035)); }

/* Material Indents - Mark supplied: the supply sheet under the indent, as Raise Indent reads */
#modViewDlg tr.isp-row > td{padding:var(--s3) 0 0;background:transparent;}
#modViewDlg .isp-set{margin:0;}
#modViewDlg .isp-set .fld label{display:block;margin-bottom:4px;}
#modViewDlg .isp-set input:not(.vp-val),#modViewDlg .isp-set textarea{padding:8px 10px;border:1px solid var(--line, #d0d5dd);border-radius:6px;font:inherit;}
#modViewDlg .isp-set input[type=file]{border:0;padding:4px 0;}

/* ---------- one theme: row buttons drawn as the primary button is ----------
   The row buttons (View, Edit, the flag, Approve, Delete ...) and the ticket
   Resolve button wore a purple-magenta-orange gradient of their own, apart from
   + Add Entry and the KPI card heads. They take the primary button's own theme
   colours now (--navy-mid to --navy), so every button and card head follows the
   one theme chosen for the application. Only the look changes. */
.rowacts .btn-link,
.rowacts .act-btn,
.rowacts .act-btn.act-brand,
.rowacts .act-btn.act-danger,
.rowacts .eat-btn,
.btn.btn-primary.tk-resolve{
  --glow:var(--navy-mid);
  border-radius:999px;
  border:1px solid transparent;
  color:#fff;
  font-weight:700;
  background:linear-gradient(180deg, color-mix(in srgb, var(--navy-mid) 88%, #fff) 0%, var(--navy) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -6px 10px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.28),
    0 2px 4px color-mix(in srgb, var(--navy-dk) 35%, transparent);
}
.rowacts .btn-link:hover,
.rowacts .act-btn:hover,
.rowacts .act-btn.act-brand:hover,
.rowacts .act-btn.act-danger:hover,
.rowacts .eat-btn:not(.eat-eating):not(:disabled):hover,
.btn.btn-primary.tk-resolve:hover{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(180deg, color-mix(in srgb, var(--navy-mid) 80%, #fff) 0%, var(--navy) 100%);
  filter:none;
  transform:translateY(-2px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 0 0 1px rgba(255,255,255,.22),
    0 0 14px 2px color-mix(in srgb, var(--glow) 55%, transparent),
    0 6px 14px color-mix(in srgb, var(--navy-dk) 30%, transparent);
}

/* ---------- Base locations: the ticket cards in the application's theme ----------
   Each card took the next of ten fixed colours. Every card now wears the theme's
   own colours - the head in --navy-mid, the band in --navy-dk, the body a soft
   tint of it - so the cards change with the theme as the KPI cards do. */
.bt-card.bt-purple,.bt-card.bt-magenta,.bt-card.bt-orange,.bt-card.bt-amber,.bt-card.bt-teal,
.bt-card.bt-blue,.bt-card.bt-green,.bt-card.bt-pink,.bt-card.bt-indigo,.bt-card.bt-red{
  --bt:var(--navy-mid);
  --bt-dk:var(--navy-dk);
  --bt-soft:color-mix(in srgb, var(--navy-mid) 6%, #fff);
  --bt-ink:#fff;
}
.bt-card.bt-amber .bt-table tbody td b{color:var(--bt);}

/* Edit: the review before saving (forms.js modReviewOpen) */
.rv-review .rv-was{color:var(--muted);text-decoration:line-through;}
.rv-review .rv-now{color:var(--navy);}
.rv-review .rv-tag{margin-left:6px;font-size:11px;}
/* the review is a small window: narrow, short, its list scrolling inside */
#modViewDlg.rv-review .dlg{max-width:460px;width:calc(100vw - 32px);}
#modViewDlg.rv-review .dlg-body,#modViewDlg.rv-review .dlg > div:not(.dlg-head):not(.dlg-foot){max-height:46vh;overflow:auto;}
#modViewDlg.rv-review th[scope=row]{width:38%;font-size:12px;}
#modViewDlg.rv-review td{font-size:13px;}

/* District stock register: a vertical line between every column (stock.js stockRegister) */
.stk-grid table th,.stk-grid table td{border-right:1px solid color-mix(in srgb, var(--navy-mid) 22%, #d9dee5);}
.stk-grid table th:last-child,.stk-grid table td:last-child{border-right:0;}

/* Stock Report: a vertical line between every column (parts.js .rep-tbl), and a
   firmer one where each day's OB / Recd / Cons / CB group ends on the monthly sheet */
table.rep-tbl th,table.rep-tbl td{border-right:1px solid color-mix(in srgb, var(--navy-mid) 22%, #d9dee5);}
table.rep-tbl th:last-child,table.rep-tbl td:last-child{border-right:0;}
table.rep-tbl.monthly th.daygrp{border-right:2px solid color-mix(in srgb, var(--navy-mid) 45%, #c9d0da);}

/* ---------- while the data is still being read (api.js fmsLoading) ----------
   The page stands drawn in full; a bar under the masthead says the data is
   loading, and every card figure shimmers where its number will stand. */
#fmsLoadBar{position:fixed;top:0;left:0;right:0;z-index:4000;display:flex;align-items:center;gap:10px;
  pointer-events:none;}
#fmsLoadBar[hidden]{display:none;}
#fmsLoadBar .flb-track{position:absolute;top:0;left:0;right:0;height:3px;overflow:hidden;
  background:color-mix(in srgb, var(--navy-mid) 15%, transparent);}
#fmsLoadBar .flb-track i{position:absolute;top:0;bottom:0;width:35%;background:var(--navy-mid);
  animation:flbRun 1.2s ease-in-out infinite;}
#fmsLoadBar .flb-text{position:fixed;top:8px;left:50%;transform:translateX(-50%);padding:3px 12px;border-radius:999px;
  background:var(--navy-mid);color:#fff;font-size:12px;font-weight:700;box-shadow:0 4px 12px rgba(0,0,0,.18);}
@keyframes flbRun{0%{left:-35%;}100%{left:100%;}}
body.fms-loading dl.summary dd{color:transparent !important;border-radius:6px;
  background:linear-gradient(90deg, color-mix(in srgb, var(--navy-mid) 10%, #fff) 25%,
    color-mix(in srgb, var(--navy-mid) 20%, #fff) 50%, color-mix(in srgb, var(--navy-mid) 10%, #fff) 75%);
  background-size:200% 100%;animation:fmsShimmer 1.2s linear infinite;}
body.fms-loading dl.summary dd *{visibility:hidden;}
@keyframes fmsShimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}
@media (prefers-reduced-motion:reduce){
  #fmsLoadBar .flb-track i,body.fms-loading dl.summary dd{animation:none;}
}

/* Old Parts disposal: each proof upload in its own card, the way the expense
   sheet's Removal / Replacement Photo box stands (stock.js dispProofBox) */
.disp-proof-row{display:flex;flex-wrap:wrap;gap:var(--s3);align-items:stretch;}
.disp-proof-card{flex:0 1 340px;min-width:260px;padding:10px 12px;border:1px solid var(--line);
  border-radius:10px;background:var(--panel);}
.disp-proof-card > .fileset{margin:0;width:auto;}
.disp-proof-card .fhead{justify-content:flex-start;flex-wrap:wrap;gap:8px;}
.disp-proof-card .fhead .btn{padding:2px 10px;font-size:11px;}

/* ---------- KPI cards as tickets, across the application ----------
   Every reading card (statStrip, dbCards) is drawn the way the Base Locations
   cards are: a head in the theme's colour with the card's name, a darker band
   under it carrying the note, then the figure on a soft tint of the theme with
   a › where the card opens something, and the corner at the foot rounded wide.
   Only the look - every card in the one theme colour (--navy-mid / --navy-dk),
   so it changes with the theme. What a card shows and opens is unchanged. */
dl.summary > div{
  --tk:var(--navy-mid);--tk-dk:var(--navy-dk);--tk-soft:color-mix(in srgb, var(--navy-mid) 6%, #fff);
  border:4px solid var(--tk) !important;border-radius:18px 18px 34px 18px !important;
  background:var(--tk-soft) !important;overflow:hidden;padding:0 !important;
  box-shadow:0 6px 16px -8px color-mix(in srgb, var(--tk) 60%, transparent) !important;
  transition:transform .18s ease, box-shadow .2s ease;
}
dl.summary > div:not(.go),
dl.summary > div.go button{
  display:flex !important;flex-direction:column;align-items:stretch;gap:0 !important;
  min-height:0 !important;height:100%;padding:0 !important;border-radius:inherit;text-align:left;
}
/* the head: the card's name, white on the theme colour, a light line over it */
dl.summary .head{
  order:1;position:relative;display:flex !important;align-items:center;justify-content:center;
  margin:0 !important;padding:18px 12px 12px !important;background:var(--tk) !important;color:#fff;
}
dl.summary .head::before{content:"";position:absolute;top:6px;left:50%;width:70%;height:3px;
  transform:translateX(-50%);border-radius:3px;background:rgba(255,255,255,.55);}
dl.summary .head .mark{display:none !important;}
dl.summary .head dt{color:#fff !important;font-weight:800;font-size:15px;text-align:center;
  -webkit-line-clamp:2;line-clamp:2;}
/* the band: what the figure is, white on the darker shade */
dl.summary .note{
  order:2;margin:0 !important;padding:8px 10px;background:var(--tk-dk);color:#fff !important;
  text-align:center;font-weight:700;font-size:12px;line-height:1.3;align-self:stretch;
}
/* the figure, in the theme colour, on the soft body; a › where the card opens */
dl.summary dd{
  order:3;display:flex;align-items:center;justify-content:center;gap:8px;flex:1 1 auto;
  margin:0 !important;padding:16px 14px;color:var(--tk) !important;font-weight:800;align-self:stretch;
}
dl.summary > div.go dd::after{content:"\203A";font-size:.7em;font-weight:800;color:var(--tk-dk);}
/* two figures on one card (Operated Vehicles): a row each, name and figure */
dl.summary .db-split,dl.summary .kmpl-split{order:3;flex:1 1 auto;margin:0 !important;padding:4px 0 !important;
  display:flex !important;flex-direction:column;gap:0 !important;background:transparent !important;}
dl.summary .db-split > div,dl.summary .kmpl-split > div{display:flex !important;flex-wrap:wrap;align-items:center;
  justify-content:space-between;gap:2px 10px;padding:10px 16px !important;margin:0 !important;
  background:transparent !important;border:0 !important;border-bottom:1px solid color-mix(in srgb, var(--tk) 15%, #fff) !important;border-radius:0 !important;}
dl.summary .db-split > div:last-child,dl.summary .kmpl-split > div:last-child{border-bottom:0 !important;}
dl.summary .db-split .n{color:var(--ink,#101828);font-size:13px;}
dl.summary .db-split .v{color:var(--tk);font-weight:800;font-size:20px;}
dl.summary .db-split .l{flex-basis:100%;color:var(--tk-dk);font-size:11.5px;font-weight:700;
  background:none;border:0;padding:0;text-align:left;cursor:pointer;}
/* a card that opens something lifts under the pointer; the one being read through is ringed */
dl.summary > div.go:hover{transform:translateY(-3px);border-color:var(--tk) !important;
  box-shadow:0 12px 24px -10px color-mix(in srgb, var(--tk) 75%, transparent) !important;}
dl.summary > div.go.on{outline:3px solid color-mix(in srgb, var(--tk) 45%, transparent);outline-offset:2px;
  border-width:4px !important;background:var(--tk-soft) !important;}
dl.summary > div.go button:hover dt,dl.summary > div.go.on dt{color:#fff !important;}
@media (prefers-reduced-motion:reduce){ dl.summary > div{transition:none;} dl.summary > div.go:hover{transform:none;} }

/* ---------- the ticket cards (dashboard.js dbJourneyCards; sections.js statStrip) ----------
   The Dashboard's FMS Overview and every page's KPI row: a head with the card's
   name, a darker band saying what it reads, then a row for each figure - its
   name, the figure, and a › where it opens something. Every card in the theme's
   own colour (--navy-mid / --navy-dk), so the cards change with the theme. */
.bj-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:18px;
  margin:var(--s3) 0 var(--s4);align-items:stretch;}
@media (max-width:600px){ .bj-grid{grid-template-columns:1fr;} }
.bj-card{
  --bj:var(--navy-mid);--bj-dk:var(--navy-dk);
  display:flex;flex-direction:column;overflow:hidden;
  border:4px solid var(--bj);border-radius:18px 18px 34px 18px;
  background:color-mix(in srgb, var(--bj) 6%, #fff);
  box-shadow:0 10px 22px -16px rgba(20,20,40,.45);
}
.bj-head{position:relative;background:var(--bj);color:#fff;text-align:center;font-weight:800;font-size:16px;
  padding:20px 12px 12px;min-height:3.4em;display:flex;align-items:center;justify-content:center;
  line-height:1.25;box-sizing:border-box;}
.bj-head::before{content:'';position:absolute;left:18px;right:18px;top:7px;height:4px;border-radius:4px;
  background:rgba(255,255,255,.45);}
.bj-band{background:var(--bj-dk);color:#fff;text-align:center;font-size:12.5px;font-weight:700;padding:7px 10px;
  min-height:3.1em;display:flex;align-items:center;justify-content:center;line-height:1.3;box-sizing:border-box;}
.bj-body{flex:1;padding:4px 0 6px;}
.bj-row{display:grid;grid-template-columns:minmax(0,1fr) auto 22px;align-items:center;gap:10px;
  padding:11px 12px 11px 16px;min-height:52px;box-sizing:border-box;
  border-bottom:1px solid color-mix(in srgb, var(--bj) 12%, #fff);}
.bj-row:last-child{border-bottom:0;}
.bj-k{font-size:13.5px;color:var(--ink,#101828);white-space:nowrap;}
.bj-v{font-size:19px;font-weight:800;color:var(--bj);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right;}
.bj-go{font-size:18px;font-weight:800;color:var(--bj-dk);text-align:center;}
.bj-press{cursor:pointer;transition:box-shadow .15s ease, transform .15s ease;}
.bj-press:hover{transform:translateY(-2px);box-shadow:0 16px 26px -14px color-mix(in srgb, var(--bj) 70%, transparent);}
.bj-press:focus-visible{outline:3px solid var(--saffron);outline-offset:2px;}
.bj-on{outline:3px solid color-mix(in srgb, var(--bj) 45%, transparent);outline-offset:2px;}
/* a figure too long to stand beside its name takes the line under it, whole */
.bj-row.bj-long{grid-template-columns:minmax(0,1fr) 22px;grid-template-areas:"k go" "v v";row-gap:4px;}
.bj-long .bj-k{grid-area:k;white-space:normal;line-height:1.3;overflow-wrap:anywhere;} /* a long name wraps, whole, above its figure */
.bj-long .bj-go{grid-area:go;}
.bj-long .bj-v{grid-area:v;text-align:left;font-size:clamp(15px, 1.3vw, 20px);}
/* the dashboard's overview: five to a row on a wide screen */
.db-bj{margin:0;}
.db-bj .bj-v{font-size:clamp(15px, 1.15vw, 19px);}
/* a page's KPI row: every card on one line, all the same size; it wraps on narrow screens */
.kpi-bj{margin:var(--s3) 0 var(--s4);}
.kpi-bj .bj-grid{margin:0;grid-template-columns:repeat(var(--bj-cols,6),minmax(0,1fr));gap:14px;}
.kpi-bj .bj-head{font-size:14.5px;padding:18px 10px 10px;min-height:2.9em;}
.kpi-bj .bj-band{font-size:11.5px;padding:6px 8px;min-height:2.8em;}
.kpi-bj .bj-body{display:flex;flex-direction:column;justify-content:center;}
.kpi-bj .bj-row{padding:11px 8px 11px 12px;gap:6px;}
@media (max-width:1100px){ .kpi-bj .bj-grid{grid-template-columns:repeat(3,minmax(0,1fr));} }
@media (max-width:600px){ .kpi-bj .bj-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (prefers-reduced-motion:reduce){ .bj-press,.bj-press:hover{transition:none;transform:none;} }
/* while the data is still being read, a figure shimmers where it will stand */
body.fms-loading .bj-v{color:transparent !important;border-radius:6px;min-width:3ch;
  background:linear-gradient(90deg, color-mix(in srgb, var(--navy-mid) 10%, #fff) 25%,
    color-mix(in srgb, var(--navy-mid) 20%, #fff) 50%, color-mix(in srgb, var(--navy-mid) 10%, #fff) 75%);
  background-size:200% 100%;animation:fmsShimmer 1.2s linear infinite;}
/* Old Parts disposal: Unit price read off the expense voucher, shown read-only (stock.js dBox) */
input.dbox-ro{background:color-mix(in srgb, var(--navy-mid) 8%, #fff) !important;color:var(--ink,#101828);cursor:default;}

/* ---------- the sign-in screen's Project field (index.html #gateProject) ----------
   Drawn in the space between "Login to access BAVYA - FMS" and the username box,
   as the drawn boxes are: white, a light border, the icon at the left. */
.gate-shot .gs-proj-box{left:4.753%;top:37.4%;width:31.836%;height:5.4%;background:#FFFFFF;
  border:.1cqw solid #D7DAE6;border-radius:.55cqw;color:#10132B;display:flex;align-items:center;
  padding-left:1.45cqw;pointer-events:none;}
.gate-shot .gs-proj-box svg{width:1.7cqw;height:1.7cqw;}
.gate-shot select.gs-proj{left:8.854%;top:37.75%;width:27.148%;height:4.7%;border:none;background:transparent;
  padding:0 .3cqw 0 .72cqw;font-family:'Poppins','Segoe UI',system-ui,sans-serif;font-size:1.22cqw;
  color:#10132B;cursor:pointer;outline:none;box-shadow:none;}
.gate-shot select.gs-proj:focus-visible{outline:.16cqw solid rgba(122,24,201,.6);outline-offset:.15cqw;border-radius:.3cqw;}

/* the sign-in screen's Designation field (index.html #gateDesig), drawn the way
   the Project field is, in the space between the Password box and Login */
.gate-shot .gs-desig-box{left:4.753%;top:63.9%;width:31.836%;height:5.4%;background:#FFFFFF;
  border:.1cqw solid #D7DAE6;border-radius:.55cqw;color:#10132B;display:flex;align-items:center;
  padding-left:1.45cqw;pointer-events:none;}
.gate-shot .gs-desig-box svg{width:1.7cqw;height:1.7cqw;}
.gate-shot select.gs-desig{left:8.854%;top:64.25%;width:27.148%;height:4.7%;border:none;background:transparent;
  padding:0 .3cqw 0 .72cqw;font-family:'Poppins','Segoe UI',system-ui,sans-serif;font-size:1.22cqw;
  color:#10132B;cursor:pointer;outline:none;box-shadow:none;}
.gate-shot select.gs-desig:focus-visible{outline:.16cqw solid rgba(122,24,201,.6);outline-offset:.15cqw;border-radius:.3cqw;}

/* ---------- the sign-in fields, all four in one format ----------
   Project, Username, Password and Designation are drawn alike: one white box
   each, the same height, the same border, the same icon at the same size, and
   the same gap between every box down to Login. A white panel lies over the
   picture's own two boxes so none of the drawn borders shows through. */
.gate-shot .gs-cover{left:4.2%;top:36.7%;width:32.9%;height:33.3%;background:#FFFFFF;pointer-events:none;}
.gate-shot .gs-proj-box,.gate-shot .gs-user-box,.gate-shot .gs-pass-box,.gate-shot .gs-desig-box{
  left:4.753%;width:31.836%;height:6.1%;background:#FFFFFF;border:.1cqw solid #D7DAE6;border-radius:.55cqw;
  color:#10132B;display:flex;align-items:center;padding-left:1.45cqw;pointer-events:none;box-sizing:border-box;}
.gate-shot .gs-proj-box svg,.gate-shot .gs-user-box svg,.gate-shot .gs-pass-box svg,.gate-shot .gs-desig-box svg{
  width:1.75cqw;height:1.75cqw;}
.gate-shot .gs-proj-box{top:37.0%;}
.gate-shot .gs-user-box{top:45.3%;}
.gate-shot .gs-pass-box{top:53.6%;}
.gate-shot .gs-desig-box{top:61.9%;}
/* what is typed or picked, inside each box past its icon, in the one font */
.gate-shot select.gs-proj,.gate-shot input.gs-user,.gate-shot input.gs-pass,.gate-shot select.gs-desig{
  left:8.854%;height:4.9%;font-family:'Poppins','Segoe UI',system-ui,sans-serif;font-size:1.22cqw;color:#10132B;
  background:transparent;border:none;padding:0 .3cqw 0 .72cqw;}
.gate-shot select.gs-proj{top:37.6%;width:27.148%;}
.gate-shot input.gs-user{top:45.9%;width:27.148%;background:#FFFFFF;}
.gate-shot input.gs-pass{top:54.2%;width:23.698%;background:#FFFFFF;}
.gate-shot select.gs-desig{top:62.5%;width:27.148%;}
/* the eye, drawn, in the password box */
.gate-shot .gs-eye{left:32.9%;top:54.3%;width:2.9%;height:4.7%;display:flex;align-items:center;justify-content:center;}
.gate-shot .gs-eye-mark{position:static;width:1.6cqw;height:1.6cqw;opacity:1;color:#5F6577;}
/* one focus ring, on whichever box is being filled */
.gate-shot .gs-ring-user{left:4.753%;top:45.3%;width:31.836%;height:6.1%;}
.gate-shot .gs-ring-pass{left:4.753%;top:53.6%;width:31.836%;height:6.1%;}
.gate-shot .gate-form:has(#gateProject:focus) .gs-proj-box,
.gate-shot .gate-form:has(#gateDesig:focus) .gs-desig-box,
.gate-shot .gate-form:has(#gateUser:focus) .gs-user-box,
.gate-shot .gate-form:has(#gatePass:focus) .gs-pass-box{border-color:rgba(122,24,201,.6);
  box-shadow:0 0 0 .25cqw rgba(122,24,201,.12);}
.gate-shot select.gs-proj:focus-visible,.gate-shot select.gs-desig:focus-visible{outline:none;}
/* the order on the sign-in screen: Designation, Project, Username, Password - same boxes, same gaps */
.gate-shot .gs-desig-box{top:37.0%;}
.gate-shot select.gs-desig{top:37.6%;}
.gate-shot .gs-proj-box{top:45.3%;}
.gate-shot select.gs-proj{top:45.9%;}
.gate-shot .gs-user-box{top:53.6%;}
.gate-shot input.gs-user{top:54.2%;}
.gate-shot .gs-ring-user{top:53.6%;}
.gate-shot .gs-pass-box{top:61.9%;}
.gate-shot input.gs-pass{top:62.5%;}
.gate-shot .gs-ring-pass{top:61.9%;}
.gate-shot .gs-eye{top:62.6%;}
/* a state-level designation is signed in without a project: the Project box is
   not shown, and Username and Password move up into its place, gaps unchanged */
.gate-shot .gate-noproj .gs-proj-box,.gate-shot .gate-noproj select.gs-proj{display:none;}
.gate-shot .gate-noproj .gs-user-box,.gate-shot .gate-noproj .gs-ring-user{top:45.3%;}
.gate-shot .gate-noproj input.gs-user{top:45.9%;}
.gate-shot .gate-noproj .gs-pass-box,.gate-shot .gate-noproj .gs-ring-pass{top:53.6%;}
.gate-shot .gate-noproj input.gs-pass{top:54.2%;}
.gate-shot .gate-noproj .gs-eye{top:54.3%;}
.mastpick[hidden]{display:none !important;}
/* the project box for a post signed in to one project: shown, but not switchable (masthead.js) */
.mastpick-locked select{cursor:default;opacity:1;color:inherit;-webkit-appearance:none;appearance:none;background-image:none !important;}
.mastpick-locked select:disabled{color:inherit;}
/* Vehicle Management's project / region / district cards as the Dashboard's ticket cards (drill.js) */
.drill-bj{margin:var(--s3) 0 var(--s4);}
.drill-bj .bj-grid{margin:0;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px;}
.drill-bj .bj-row{min-height:44px;padding:8px 12px 8px 16px;}
@media (max-width:600px){ .drill-bj .bj-grid{grid-template-columns:1fr;} }
/* the line under Fuel Quantity (L): the 70-litre limit (forms.js fuelLimitNote) */
.fuel-limit{margin:4px 0 0;font-size:11.5px;color:var(--muted);}
.fuel-limit.over{color:var(--lapse,#B42318);font-weight:600;}
.rv-review .rv-gone{color:var(--lapse,#B42318);}

/* Daily Entries: the logsheet box drawn as every upload box is (shifts.js deLogsheets) - a card,
   the heading with "+ Add logsheet" beside it, a tile per file with Replace and Remove */
.de-logcard{max-width:520px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);}
.de-logcard .fhead{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:8px;margin-bottom:6px;}
.de-logcard .fhead .btn{padding:2px 10px;font-size:11px;}
.de-logcard .fslots{display:flex;flex-wrap:wrap;gap:var(--s3);}
/* the line under a repair line's Qty when it was held to what the shelf has (forms.js repairQtyBox) */
.qty-cap{margin:4px 0 0;font-size:11.5px;font-weight:600;color:var(--lapse,#B42318);}

/* ---------- the sign-in screen: Username and Password alone again ----------
   Designation and Project are off the screen, so the two fields stand back over
   the picture's own boxes, exactly where they were drawn, with the picture's
   own eye. */
.gate-shot input.gs-user{left:8.854%;top:44.336%;width:27.148%;height:5.273%;background:#FFFFFF;}
.gate-shot input.gs-pass{left:8.854%;top:56.934%;width:23.698%;height:5.078%;background:#FFFFFF;}
.gate-shot .gs-ring-user{left:4.753%;top:43.848%;width:31.836%;height:6.25%;}
.gate-shot .gs-ring-pass{left:4.753%;top:56.445%;width:31.836%;height:6.152%;}
.gate-shot .gs-eye{left:32.9%;top:57.422%;width:2.9%;height:4.3%;}
.gate-shot .gs-eye-mark{position:absolute;width:1px;height:1px;opacity:0;}
/* one eye on the password: the screen's own (gate.js togglePass). Edge put its own
   reveal button inside the box as soon as anything was typed, so two eyes stood
   side by side; the browser's is switched off here, on this box alone. */
.gate-shot input.gs-pass::-ms-reveal,
.gate-shot input.gs-pass::-ms-clear{display:none;width:0;height:0;}
.de-run-over{color:var(--lapse,#B42318) !important;font-weight:700;}

/* Vendor / Workshop read off the expense sheet's parts (forms.js expenseVendorAuto) */
.vend-auto .vend-auto-list{display:flex;flex-wrap:wrap;gap:6px;min-height:38px;align-items:center;
  padding:6px 8px;border:1px solid var(--line, #d6dee3);border-radius:8px;background:var(--soft, #eef4f6)}
.vend-auto .vend-chip{display:inline-flex;gap:6px;align-items:baseline;padding:3px 10px;border-radius:999px;
  background:var(--card, #fff);border:1px solid var(--line, #d6dee3);font-size:13px}
.vend-auto .vend-chip .sub{font-size:12px}

/* Search boxes are plain and still: no lift, no motion (button_fx.js no longer folds them) */
input[type="search"][data-fx="search"]{ transition:border-color .15s ease, box-shadow .15s ease; animation:none; }
input[type="search"][data-fx="search"]:focus{ background-position:10px 50%; }

/* Raise Indent: the parts, one line each (+ Add part, indents.js) */
.ind-lines{display:flex;flex-direction:column;gap:8px}
.ind-line{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) 34px;gap:12px;align-items:end}
.ind-line > .fld{margin:0}
.ind-line-del{height:38px;width:34px;padding:0;font-size:18px;line-height:1}
.ind-line-del-gap{width:34px}
.ind-line-add{align-self:flex-start}
@media (max-width:640px){ .ind-line{grid-template-columns:1fr 34px} .ind-line > .fld:nth-child(2){grid-column:1} }

/* each indent part line: category, part, quantity, remove */
.ind-line{grid-template-columns:minmax(0,1.2fr) minmax(0,2fr) minmax(0,1fr) 34px}
@media (max-width:640px){ .ind-line{grid-template-columns:1fr 34px} .ind-line > .fld{grid-column:1} }

/* indent steps: the quantity each part goes ahead at (Validate / Confirm / Approve) */
.ind-okq{display:flex;flex-direction:column;gap:6px}
.ind-okq-row{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:10px;align-items:center}
.ind-okq-qty{text-align:right}

/* indent part lines: a plain, clear Remove button, the height of the boxes and level with them */
.ind-line{grid-template-columns:minmax(0,1.2fr) minmax(0,2fr) minmax(0,1fr) 96px}
.ind-line-del-gap{width:96px}
.ind-line .ind-line-del{
  height:38px;width:96px;padding:0 10px;margin:0;align-self:end;
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  border:1px solid #e3b4b4;border-radius:8px;background:#fff5f5;color:#b42318;
  font-size:13px;font-weight:600;line-height:1;cursor:pointer;box-shadow:none;transform:none;
}
.ind-line .ind-line-del:hover{background:#fde8e8;border-color:#d98c8c}
.ind-line .ind-line-del:focus-visible{outline:2px solid #b42318;outline-offset:2px}
@media (max-width:640px){ .ind-line{grid-template-columns:1fr} .ind-line .ind-line-del{width:100%} .ind-line-del-gap{display:none} }

/* indent supply: each part's supplied quantity and unit price */
.isp-parts{display:flex;flex-direction:column;gap:6px}
.isp-part{display:grid;grid-template-columns:minmax(0,2fr) 110px 140px 130px;gap:10px;align-items:center}
.isp-part-head{font-size:12px;font-weight:600;color:var(--muted)}
.isp-part .isp-amt{text-align:right}
.isp-part-total{border-top:1px solid var(--line);padding-top:6px}
@media (max-width:640px){ .isp-part{grid-template-columns:1fr 1fr} .isp-part-head{display:none} }

/* indent supply: with GST?, the rate, the price and the amount per part */
.isp-part{grid-template-columns:minmax(0,1.6fr) 90px 130px 120px 120px 130px}
.isp-part .isp-gst{display:block;font-size:11px}
.isp-part select:disabled{opacity:.55}
@media (max-width:640px){ .isp-part{grid-template-columns:1fr 1fr} }

/* the fuel sheet's strip carries five: spend, previous, current, kilometres run, Avg KMPL */
.exd-links:has(> div:nth-child(5)){grid-template-columns:repeat(5,minmax(0,1fr));}
@media (max-width:760px){ .exd-links:has(> div:nth-child(5)){grid-template-columns:repeat(2,minmax(0,1fr));} }
