/* =====================================================================
   Integrated Accounting System - interface styles
   ===================================================================== */
:root {
  /* ACCOVA identity: ink and teal on mist.
     INK  #102B36  primary text and dark panels
     TEAL #00A995  the accent, and every action
     MIST #F3F7F7  the page behind the cards
     The brand board names three colours and nothing else, so everything below
     is either one of them, a tint of one, or a status colour that has to stay
     what it is - a red that meant "wrong" cannot become teal because the logo
     changed. */
  --bg: #F3F7F7;
  --surface: #ffffff;
  --surface-2: #f8fbfb;
  --border: #dfe7e8;
  --border-strong: #c3d0d2;
  /* The outline of a field you type in. It was --border-strong, 1.6:1 on a
     card: the fields melted into the page, and WCAG 1.4.11 asks 3:1 of the
     edge that shows where a control is. 3.6:1 on a card, 3.3:1 on the page
     (design review, 13 October 2026). */
  --input-border: #728c96;
  /* The row under the pointer, so the eye can follow it across a wide table;
     the stripe colour it used was 1.04:1 and barely showed. */
  --row-hover: #eef4f5;
  --text: #102B36;
  --text-dim: #4a5f68;
  /* Darkened from #8d867d, which measured 3.2:1 on the page and 3.6:1 on a
     card - below the 4.5:1 a body of text needs to be read reliably. It is the
     colour of .muted, .hint, .empty and every metric label, so it was the most
     widespread readability fault in the product. Now 4.9:1 and 5.5:1. */
  --text-faint: #5b7079;
  /* Teal is the accent the brand board gives to actions, but the pure #00A995
     measures 2.4:1 on white - far under the 4.5:1 a link or a small label needs.
     So the token is a darkened teal of the same hue for anything that has to be
     read, and the pure brand teal is kept for fills and rules, where contrast is
     not a reading matter. */
  --brand: #00776A;
  --brand-pure: #00A995;
  --brand-dark: #005A50;
  --brand-soft: #e6f6f3;
  /* The same teal again, but for things that are PAINTED teal with white on
     them - buttons and badges - rather than written in teal. In the light
     theme the two are identical. They part in the dark one: text teal has to
     turn light to be read on a dark card, and a light teal button with white
     lettering on it cannot be read at all. */
  --brand-fill: #00776A;
  --brand-fill-hover: #005A50;
  --green-fill: #16794a;
  /* The second teal: focus rings, the info alert, the chosen tick, the edge of
     a toast. This was called --gold, after the identity it replaced, and
     pointed at a teal - a name that lied to anybody editing the stylesheet.
     Darkened from #0E7C8C, which read at 4.30:1 on its own soft background. */
  --accent: #0A6E7C;
  --accent-soft: #e7f2f4;
  --accent-line: #c3dde2;
  --green: #146c42;                /* 5.7:1 on --green-soft, was 4.8 */
  --green-soft: #e4f4ec;
  --red: #b4232a;
  --red-soft: #fceaeb;
  /* Was #96690d, 4.4:1 on its own soft background - just under the line, and
     it carries the Draft chip and every warning in the system. */
  --amber: #7a5408;                /* 6.1:1 on --amber-soft, was 5.1 */
  --amber-soft: #fdf3dc;
  --slate: #35506b;
  --slate-soft: #e8eef5;
  /* The edge each alert is drawn with - its own colour, faded to a line. */
  --green-line: #b9e2cd;
  --red-line: #f2c3c5;
  --amber-line: #f0dcae;
  --sidebar: #102B36;
  --sidebar-2: #17394a;

  /* The panel's own words. The menu was coloured with ten one-off greys, three
     of which the eye cannot tell apart (#8fa8b1, #85a0a9, #94adb6), and its
     foot with a separate warm family - rose and crimson left over from the old
     maroon identity, on the opposite side of the colour wheel from the teal
     above it. One cool family now, named for what each one does. The panel is
     dark in both themes, so none of these change with the theme. */
  --side-strong: #eaf4f6;          /* hover, the active entry, names      10.4+ */
  --side-text: #cbdbe0;            /* the links themselves                10.4:1 */
  --side-label: #a7bcc4;           /* open section headings                7.5:1 */
  --side-muted: #8fa8b1;           /* icons, folded headings, hints        5.9:1 */
  --side-edge: #5f7c87;            /* the outline of a button on the panel 3.3:1 (was 2.9) */
  --side-line: rgba(255, 255, 255, .08);
  --side-hover: rgba(255, 255, 255, .055);

  /* Chart series. Six, chosen by measurement: every pair stays apart for
     normal sight (dE >= 23) and for red-green colour blindness (dE >= 14.6),
     and every one stands at 3:1 or better against the card. The old palette
     had ten, and under colour blindness the brand teal and the rose became
     the same colour, as did the second teal and the slate. Past six no
     palette stays apart; a chart that needs more folds the rest into grey. */
  --chart-teal: #009987;
  --chart-ink: #102B36;
  /* Yellower than it was (#B67A08), so it stays apart from the clay for
     red-green colour blindness (dE 17.6, was 14.4) and still 3.3:1 on a card. */
  --chart-amber: #B58600;
  --chart-blue: #3565B0;
  --chart-clay: #C4552F;
  --chart-grey: #4F5F67;
  --chart-grid: #e2eaeb;
  --chart-axis: #5b7079;
  --chart-dot: #ffffff;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 43, 54, .06), 0 4px 16px rgba(16, 43, 54, .08);
  --topbar-glass: rgba(255, 255, 255, .86);

  /* ---------------------------------------------------------------------
     The rest of the system, not just the colours.

     Colour was tokenised from the start; spacing, type and corners were not,
     so every new screen solved layout with a one-off number and the stylesheet
     drifted to fourteen corner radii and twenty font sizes. These are the
     values it actually converged on, named.
     --------------------------------------------------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-pill: 999px;

  /* A fixed ladder, one step per job. The old one started at 11px and a set of
     books is read for six hours at a time, not glanced at - every step below
     went up by a point, and the two that carry meaning (the page you are on
     and the figure you came for) were given sizes of their own. */
  --fs-xs: 12px;                 /* labels, chips */
  --fs-sm: 13px;                 /* secondary text under a figure */
  --fs-base: 14px;               /* body, tables, forms */
  --fs-md: 15px;                 /* card and section titles */
  --fs-lg: 16px;
  --fs-xl: 23px;                 /* the page title */
  --fs-kpi: 29px;                /* the four figures on the front page */

  /* Three weights, because Segoe UI has three. 550, 650 and 680 were rounded
     by the browser to 600, 700 and 700 anyway - precision that existed only in
     the stylesheet. */
  --fw-normal: 400; --fw-medium: 600; --fw-bold: 700;

  --font-ui: "Segoe UI", Inter, Roboto, system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

/* Tajawal, the brand's Arabic face (kit3, 14 October 2026), served from here:
   the browser policy takes fonts from this server only. Arabic pages read in
   it; English keeps Segoe UI. SIL Open Font License, assets/fonts/OFL-Tajawal.txt. */
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/tajawal-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/tajawal-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/tajawal-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
/* Only the Arabic letters come from Tajawal: Latin words and every figure stay in
   the UI face, whose digits are all one width, so amounts still line up. */
:root[dir="rtl"] { --font-ui: "Tajawal", "Segoe UI", Inter, Roboto, system-ui, -apple-system, sans-serif; }

/* The `hidden` attribute must beat any display rule below - the modal backdrop
   is display:flex, which would otherwise keep it permanently visible. */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  font-family: var(--font-ui);
  font-size: 14px; color: var(--text); background: var(--bg);
}

/* Links were left to the browser, which paints them blue and then purple once
   visited - two colours nothing else in the product uses, appearing on nearly
   every card. They are the brand colour now, and they stay it after a visit. */
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--brand); }
/* The sidebar and anything wearing a button keep their own colour. */
.nav a, .nav a:visited, .btn, a.btn, a.btn:visited { color: inherit; text-decoration: none; }
.nav a:hover, a.btn:hover { text-decoration: none; }

#app { display: flex; height: 100vh; overflow: hidden; }
/* Out of sight until the session is known - see index.html. Visibility, not
   display, so nothing is laid out twice when the cover comes off. */
#app.booting { visibility: hidden; }

/* ------------------------------- Sidebar ------------------------------ */
/* A faint arabesque, the kind cut into a mashrabiya screen, drawn once as a
   data URI so the page still works with no network at all. */
/* The arabesque is still there, at a third of its old strength. It was drawn
   at 0.035 opacity across the whole panel, which is faint on a designer's
   monitor and a texture you read *through* on an ordinary one - thirty menu
   links sat on top of a moving background all day. Branding is worth a little
   readability, not this much: the pattern now only shows at the top, behind
   the mark, and the list itself is on flat colour. */
.sidebar {
  width: 224px; flex: 0 0 224px; color: var(--side-text);
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(176deg, #17394a 0%, var(--sidebar) 38%, #0b1f28 100%);
}
/* The mark gets room to breathe: stacked and centred, large enough to read the
   bars inside the A rather than squinting at a 40px thumbnail. */
/* The block is deliberately compact. At its old size the mark and the wordmark
   took a fifth of the panel, and the panel's job is the menu: what was gained
   in presence was paid for in links you had to scroll to. The mark is still
   large enough to read the arrow inside the A. */
.brand {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 14px 11px; border-bottom: 1px solid var(--side-line);
  background:
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'>\
<g fill='none' stroke='%23ffffff' stroke-opacity='0.016' stroke-width='1'>\
<path d='M28 2 L54 28 L28 54 L2 28 Z'/><path d='M28 14 L42 28 L28 42 L14 28 Z'/>\
<path d='M0 0 L14 14 M56 0 L42 14 M0 56 L14 42 M56 56 L42 42'/></g></svg>") 0 0/56px 56px,
    radial-gradient(120% 90% at 50% 0%, rgba(0,169,149,.09), transparent 62%),
    linear-gradient(180deg, rgba(0,169,149,.06), transparent);
}
.brand-mark {
  /* The artwork is wider than it is tall, so it is fitted inside the square
     rather than stretched to it. */
  width: 58px; height: 58px; display: block; object-fit: contain;
  /* The lockup carries its own ink background, which sits close to the panel
     behind it. A faint teal halo lifts it off; the dark shadow underneath is
     kept for depth. Both are stronger now that the pattern behind them is
     fainter - the mark stands out by being lit, not by shouting over texture. */
  filter: drop-shadow(0 0 9px rgba(0,169,149,.34))
          drop-shadow(0 4px 10px rgba(0,0,0,.45));
}
.brand-name {
  color: #fff; font-weight: var(--fw-bold); font-size: 19px; letter-spacing: 4px;
  line-height: 1.1; margin-top: 9px; padding-left: 4px;  /* optical centring */
}
.brand-tagline {
  font-size: 10px; letter-spacing: .8px; text-transform: uppercase;
  /* The pure brand teal, not the darkened one: this line sits on the ink panel,
     where the darkened teal meant for white backgrounds goes nearly invisible. */
  color: var(--brand-pure); margin-top: 5px;
}
.brand-sub { font-size: 11px; color: var(--side-muted); margin-top: 7px;
  padding-top: 7px; border-top: 1px solid var(--side-line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ---------------------------- The folded menu -------------------------
   Folded, the panel keeps only its icons: the module is still one click away
   and the table gets back 168px. What it must not become is a guessing game,
   so each icon carries its own entry's name beside it on hover, and the choice
   is remembered - somebody who lives in payroll should not have to fold the
   menu again every morning. */
.rail-toggle {
  flex: 0 0 auto; height: 22px; border: none; cursor: pointer;
  background: rgba(255,255,255,.04); color: var(--side-muted); line-height: 1;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.rail-toggle::before { content: "\00AB \00A0 NARROW"; letter-spacing: 1px; font-size: 9.5px; }
/* The word is the stylesheet's, so the dictionary never saw it and Arabic
   read NARROW. Written as escapes - "تضييق القائمة" - so the file's encoding
   cannot mangle it; no letter-spacing, which pulls Arabic letters apart. The
   arrow is the same character: in a right-to-left line it turns round by
   itself and points at the edge the menu folds towards. */
[dir="rtl"] .rail-toggle::before {
  content: "\00AB\00A0\00A0\062A\0636\064A\064A\0642\00A0\0627\0644\0642\0627\0626\0645\0629";
  letter-spacing: 0; font-size: 11px;
}
.rail-toggle:hover { background: rgba(0,169,149,.16); color: var(--side-strong); }
#app.rail .rail-toggle::before { content: "\00BB"; font-size: 13px; letter-spacing: 0; }
#app.rail .sidebar { width: 56px; flex: 0 0 56px; }
#app.rail .brand { padding: 10px 4px 8px; }
#app.rail .brand-mark { width: 34px; height: 34px; }
#app.rail .brand-name,
#app.rail .brand-tagline,
#app.rail .brand-sub,
#app.rail .nav-group,
#app.rail .session-text,
#app.rail .session-actions { display: none; }
/* Folded, the words go and the icon stays: the words used to stay as well,
   cut off at the panel's edge in both languages, so the folded menu read as
   a column of broken labels. font-size 0 hides the text node; the icon is
   drawn at its own pixel size and does not shrink with it. The name comes
   back as the link's title on hover (core.js applyRail) - a tooltip drawn in
   CSS would be cut off by the panel's own overflow. */
#app.rail .nav a { padding: 9px 0; justify-content: center; gap: 0; position: relative;
  font-size: 0; }
#app.rail .nav a .badge { display: none; }
#app.rail .nav a::before { font-size: var(--fs-base); width: auto; }
/* Every section is shown while folded - there are no headings left to open. */
#app.rail .nav-links { display: block !important; }
#app.rail .sidebar-foot { padding: 8px 4px; }
/* The entry's own words, beside the icon, on hover. */
#app.rail .nav a:hover::after {
  content: attr(data-label); position: absolute; inset-inline-start: 100%;
  margin-inline-start: 8px; white-space: nowrap; z-index: 40;
  background: var(--sidebar-2); color: var(--side-strong); padding: 5px 10px;
  border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: var(--fw-normal);
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
}

.nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: #2c4b58; border-radius: 3px; }
/* Each heading folds its own section, so thirty links still fit on a laptop
   screen without scrolling past the half of the system you are not using. */
/* Gold on every one of ten headings turned the accent into wallpaper. The
   headings are now quiet stone and the gold is spent where it earns its
   keep: the bar beside the page you are actually on. */
.nav-group {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px 6px; font-size: var(--fs-xs); text-transform: none;
  letter-spacing: .2px; color: var(--side-label); opacity: 1; font-weight: var(--fw-bold);
  cursor: pointer; user-select: none;
}
.nav-group:hover { color: var(--side-strong); }
.nav-group:focus-visible { outline: 2px solid var(--brand-pure); outline-offset: -2px; }
.nav-group::after {
  content: "\2039";                 /* a chevron, pointing down when open */
  margin-left: auto; font-size: 15px; line-height: 1; opacity: .7;
  transform: rotate(-90deg); transition: transform .15s ease;
}
.nav-group.collapsed::after { transform: rotate(90deg); }
.nav-group.collapsed { color: var(--side-muted); }
/* A heading whose links this account cannot reach folds away with them,
   rather than opening onto nothing. */
.nav-group[hidden] { display: none !important; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 7px 16px;
  color: var(--side-text); text-decoration: none; font-size: var(--fs-base);
  border-left: 3px solid transparent;
}
.nav a::before { content: attr(data-icon); font-size: var(--fs-sm); color: var(--side-muted);
  width: 14px; text-align: center; }
.nav a:hover { background: var(--side-hover); color: #fff; }
/* Where you are, said properly: the brand colour behind it and a teal bar down
   the edge, rather than a thin outline that read as a focus ring. */
.nav a.active {
  background: linear-gradient(90deg, rgba(0,169,149,.55), rgba(0,169,149,.18));
  color: #fff; border-left-color: var(--brand-pure); font-weight: var(--fw-medium);
}
.nav a.active::before { color: var(--brand-pure); }
.badge {
  margin-left: auto; background: var(--brand-fill); color: #fff; border-radius: 9px;
  padding: 1px 7px; font-size: 11px; font-weight: var(--fw-bold); min-width: 18px; text-align: center;
}
.badge:empty { display: none; }
.sidebar-foot { flex: 0 0 auto; padding: 10px 16px; border-top: 1px solid var(--side-line);
  font-size: 12px; color: var(--side-muted); }

/* -------------------------------- Main -------------------------------- */
/* Warm stone with a whisper of the brand in the corners - enough to feel
   designed, faint enough that a page of figures still reads first. */
.main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(900px 520px at 100% 0%, rgba(0,169,149,.10), transparent 60%),
    radial-gradient(760px 480px at 0% 100%, rgba(16,43,54,.07), transparent 62%),
    var(--bg);
}
/* The letterhead for paper. Print hides the sidebar and the title bar, so
   without this a printed report carried no logo and nothing saying whose
   figures these were. Hidden on screen; @media print brings it out. */
.print-head { display: none; }

.topbar {
  min-height: 56px; flex: 0 0 auto; background: var(--topbar-glass);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
}
.topbar h1::before {
  content: ""; display: inline-block; width: 3px; height: 17px; margin-right: 9px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  border-radius: 2px; vertical-align: -3px;
}
/* The title gives way, the buttons do not. A quotation toolbar carries six of
   them next to a long document number; with a locked height and permission to
   wrap, the second row wrapped into space that did not exist and Convert to
   Invoice became unclickable. */
.topbar h1 { font-size: var(--fs-xl); margin: 0; font-weight: var(--fw-bold);
  letter-spacing: -.3px;
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
/* The line under the title on the front page: the day, and who is reading. */
.topbar .page-sub { font-size: var(--fs-sm); color: var(--text-dim); margin-top: 1px; }
.topbar .title-block { display: flex; flex-direction: column; min-width: 0; }
.topbar h1.is-greeting { font-size: 19px; font-weight: var(--fw-medium); }
.topbar .title-block h1 { line-height: 1.15; }
/* The date line (auth.js addDateLine): quiet until today's month is shut. */
.today-line { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: var(--fs-sm); color: var(--text-dim); white-space: nowrap; }
.today-line:empty { display: none; }
.today-line bdi { unicode-bidi: isolate; }
.today-line .today-time { font-variant-numeric: tabular-nums; }
.today-line .today-sep { opacity: .55; }
.today-line.closed { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.today-line .today-note { font-weight: var(--fw-bold); }
.today-line .today-note::before { content: "·"; margin-inline-end: 6px; opacity: .55; font-weight: normal; }
@media (max-width: 1100px) { .today-line .today-more { display: none; } }
/* The page's buttons keep one row on a desk: wrapped, a form's three stood in
   two rows with the title floating between them (28/10). A phone wraps them
   on purpose, below. The date line and the title are what yield. */
.topbar-actions { margin-left: auto; display: flex; gap: var(--sp-2); flex: 0 0 auto;
  align-items: center; flex-wrap: nowrap; justify-content: flex-end; }
/* On a laptop the row is short: the buttons may wrap rather than push the
   title to nothing (Codex, 28/10). */
@media (max-width: 1100px) { .topbar-actions { flex: 1 1 auto; flex-wrap: wrap; } }
.menu-toggle { display: none; }
.content { flex: 1; overflow-y: auto; padding: 20px; }
.loading { padding: 40px; text-align: center; color: var(--text-faint); }

/* The public demonstration says so on every screen. */
.demo-bar {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 12px;
  align-items: center; justify-content: center; text-align: center;
  padding: 7px 20px; font-size: var(--fs-sm); color: var(--text);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.demo-bar a { color: var(--brand); font-weight: 600; }
.demo-bar .demo-switch { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.demo-bar .demo-switch .btn-sm { padding: 2px 10px; }
/* On a phone the bar took three lines of a small screen before anything of
   the company showed. Two now: the sentence on one line, cut if it must be,
   and the people in a row that scrolls sideways. */
@media (max-width: 720px) {
  .demo-bar { padding: 5px 10px; gap: 4px 8px; font-size: 12px; flex-wrap: wrap; }
  .demo-bar > span:first-child {
    flex: 1 1 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .demo-bar .demo-switch {
    flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .demo-bar .demo-switch::-webkit-scrollbar { display: none; }
  .demo-bar .demo-switch .btn-sm { white-space: nowrap; flex: 0 0 auto; }
}

/* The door's "enter as": one row per person, the name over what they do. */
.demo-people-list { display: grid; gap: 6px; }
.demo-person {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
.demo-person:has(input:checked) { border-color: var(--brand); background: var(--surface-2); }
.demo-person input { margin-top: 3px; flex: 0 0 auto; width: auto; }
.demo-person span { display: flex; flex-direction: column; gap: 2px; text-align: start; }
.demo-person b { font-size: var(--fs-sm); }
.demo-person em { font-style: normal; font-size: var(--fs-xs); color: var(--text-faint); }

/* Sits between the title bar and the page, so it survives every redraw and
   is read before anything below it. Empty unless there is something to say. */
.licence-bar { flex: 0 0 auto; padding: 0 20px; }
.licence-bar:empty { display: none; }
.licence-bar /* One line and a button - the linked quotation on a document form - needs
   no more room than a field does. */
.alert.alert-slim { padding: 7px 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert { margin-top: 14px; }
.code-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); font-family: var(--font-mono);
  padding: var(--sp-3); font-size: var(--fs-sm); overflow-x: auto;
  margin: var(--sp-2) 0;
}

/* The first paragraph in a panel should not push the panel open, and the last
   should not leave a gap at the bottom. Twenty-two screens were each saying
   style="margin-top:0" to arrange this one sentence at a time. */
.card-body > p:first-child, .modal-body > p:first-child,
.card-body > .alert:first-child, .modal-body > .alert:first-child,
.alert > p:first-child { margin-top: 0; }
.card-body > p:last-child, .modal-body > p:last-child,
.alert > p:last-child { margin-bottom: 0; }

/* A row of buttons under a form or a list. */
.button-row { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); flex-wrap: wrap; }

/* A metric that has to carry a long value rather than a figure. */
.metric.compact .value { font-size: var(--fs-lg); }

/* ------------------------------- Buttons ------------------------------ */
button, .btn {
  font: inherit; font-weight: var(--fw-medium); padding: 7px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; gap: var(--sp-2);
  white-space: nowrap; text-decoration: none; line-height: 1.4;
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
/* A button that is working is not a button you may press again. Dimming alone
   still invites the second click that files the journal entry twice. */
button:disabled, .btn[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; filter: saturate(.4); pointer-events: none;
}

/*
   One focus ring, everywhere.

   Before this the only thing with a visible focus style was a text field, and
   even that was a recoloured border - which a checkbox does not have. Anyone
   working by keyboard, which on a reconciliation screen is everyone, had no
   way of telling where they were. The ring is drawn outside the control so it
   is visible on a maroon button as well as on white.
*/
button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, .tree-toggle:focus-visible,
table.grid tbody tr.clickable:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 169, 149, .20);
}
/* On the ink panel the page's focus teal all but vanishes; the bright brand
   teal is the one that reads there (5.0:1). */
.nav a:focus-visible, .nav-group:focus-visible,
.sidebar-foot button:focus-visible {
  outline: 2px solid var(--brand-pure); outline-offset: -2px; box-shadow: none;
}
table.grid tbody tr.clickable:focus-visible { outline-offset: -2px; }
.btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.btn-primary:hover { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); }
.btn-danger { background: var(--surface); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
/* a.btn-success too: "a.btn { color: inherit }" outranks the class alone, and a
   green link-button carried ink text, 2.7:1 (28/10). */
.btn-success, a.btn-success { background: var(--green-fill); border-color: var(--green-fill); color: #fff; }
/* The background is said again on hover: without it the plain button's hover
   (button:hover, which outranks a single class) painted the green button pale
   grey under its white words, and the label vanished as the mouse reached it. */
.btn-success:hover { background: var(--green-fill); border-color: var(--green-fill); color: #fff;
  filter: brightness(1.1); }

/* A button with a short list of actions under it (actionMenu, core.js). */
.act-menu { display: inline-flex; }
.act-caret { font-size: 10px; opacity: .65; margin-inline-start: 2px; }
.act-menu-list {
  position: fixed; z-index: 1000; min-width: 230px; max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 4px; display: grid; gap: 1px;
}
.act-menu-list > button {
  border: 0; background: none; width: 100%; justify-content: flex-start; text-align: start;
  padding: 8px 12px; border-radius: var(--r-md); font-weight: var(--fw-normal);
}
.act-menu-list > button:hover, .act-menu-list > button:focus-visible { background: var(--surface-2); }
.act-menu-list > button.act-danger { color: var(--red); }
.act-menu-list > button.act-danger:hover { background: var(--red-soft); }
/* The final action is set apart from the rest by a line. */
.act-menu-list > button.act-danger:not(:first-child) { margin-top: 4px; position: relative; }
.act-menu-list > button.act-danger:not(:first-child)::before {
  content: ""; position: absolute; inset-inline: 6px; top: -3px; border-top: 1px solid var(--border);
}
.btn-sm { padding: 4px 9px; font-size: 12px; }
.icon-btn { border: none; background: none; padding: 5px 8px; font-size: 17px; color: var(--text-dim); }
.icon-btn:hover { background: var(--surface-2); }

/* -------------------------------- Cards ------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface);
}
/* A card heading is the label on a drawer: it should read at a glance from
   across a desk. At 600 weight in the body colour it sank into the table
   under it, and a screen of fifteen cards became one grey wall. */
.card-head h2 { font-size: 15px; margin: 0; font-weight: var(--fw-bold);
  color: var(--text); letter-spacing: -.1px; }
/* The rates fetched from Qatar Central Bank (currencies.js feedCard). */
.feed-line { margin: 0 0 6px; line-height: 1.6; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* ----------------------- Logo, stamp and signature --------------------
   Shown as they will print. A file name tells nobody whether a signature
   came out upside down; the picture does, which is the whole point of
   putting them on the screen rather than in a folder. The frame keeps a
   pale chequer behind it so a transparent PNG can be told from a white
   rectangle - the difference that decides whether a signature sits on the
   page or in a box on it. */
.art-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; }
.art-slot { border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.art-label { font-weight: var(--fw-bold); font-size: 13px; }
.art-frame { height: 96px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; padding: 6px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eceff3 25%, transparent 25%, transparent 75%, #eceff3 75%),
    linear-gradient(45deg, #eceff3 25%, transparent 25%, transparent 75%, #eceff3 75%);
  background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.art-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.art-note { font-size: 12px; line-height: 1.45; }
.art-actions { display: flex; gap: 8px; margin-top: auto; }

/* A file control in the program's words (dressFileInputs, core.js). The
   browser's own stays for the keyboard, a pixel wide. */
.file-pick { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; }
.file-pick-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-pick-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm, 8px); background: var(--surface);
  color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap;
}
.file-pick-btn:hover { background: var(--surface-2); }
.file-pick:focus-within .file-pick-btn { outline: 2px solid var(--brand); outline-offset: 1px; }
.file-pick-name { font-size: var(--fs-sm); word-break: break-all; }
/* A month and a year (monthPickers, core.js); the screen's own field, with
   its name and its value, sits a pixel wide behind them. */
.month-pick { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.month-pick-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.month-pick-m { min-width: 7.5em; }
.month-pick-y { width: 5.5em; }
.field .month-pick select, .field .month-pick input[type="number"] { margin: 0; }

/* ------------------------------- Metrics ------------------------------ */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px;
  margin-bottom: 16px; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.metric { display: flex; flex-direction: column; }
.metric .label { font-size: var(--fs-xs); text-transform: none; letter-spacing: 0;
  color: var(--text-dim); font-weight: var(--fw-medium); }
.metric .value { font-size: 22px; font-weight: var(--fw-bold); margin-top: 6px;
  font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.metric .sub { font-size: var(--fs-sm); color: var(--text-dim); margin-top: 3px;
  margin-top: auto; padding-top: 4px; }
/* The fils and the currency step back on a tile as they do on the front
   page's four figures (splitTileMoney in core.js). */
.metric .value .dec { font-size: .64em; font-weight: var(--fw-medium); color: var(--text-dim); letter-spacing: 0; }
.metric .value .cur { font-size: .5em; font-weight: var(--fw-medium); color: var(--text-faint);
  margin-inline-start: 6px; letter-spacing: .3px; }
/* A coloured edge was on roughly half the tiles, which made it decoration
   rather than a signal. It is now kept for the two states that mean something:
   something is wrong, or something needs doing. */
.metric.good .value { color: var(--green); }
.metric.bad .value { color: var(--red); }
.metric.warn { border-left: 3px solid var(--amber); }
.metric.risk { border-left: 3px solid var(--red); }

/* ------------------------- The four that matter ---------------------- */
/* Everything above the fold answers one question each, in a figure big enough
   to read from a standing position, with one line underneath and no more. */
.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; margin-bottom: 18px; align-items: stretch;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px 14px; display: flex; flex-direction: column; min-height: 118px;
}
/* A phone: two figures a row rather than one, so the four that matter are on
   the first screen instead of four screens' worth of scrolling. */
@media (max-width: 560px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 12px 12px 10px; min-height: 0; }
  .kpi .kpi-value { font-size: 20px; letter-spacing: -.3px; }
  .kpi .kpi-note { font-size: var(--fs-xs); }
}
.kpi .kpi-label { font-size: var(--fs-xs); color: var(--text-dim);
  font-weight: var(--fw-medium); letter-spacing: .1px; }
.kpi .kpi-value {
  font-size: var(--fs-kpi); font-weight: var(--fw-bold); line-height: 1.08;
  margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.8px;
  color: var(--text);
}
/* The fils and the currency are there when you need them and out of the way
   when you are scanning four figures for their order of magnitude. */
.kpi .kpi-value .dec { font-size: .56em; font-weight: var(--fw-medium);
  color: var(--text-dim); letter-spacing: 0; }
.kpi .kpi-value .cur { font-size: .42em; font-weight: var(--fw-medium);
  color: var(--text-faint); margin-left: 8px; letter-spacing: .4px; }
.kpi .kpi-note { font-size: var(--fs-sm); color: var(--text-dim);
  margin-top: auto; padding-top: 8px; }
.kpi.is-good .kpi-value { color: var(--green); }
.kpi.is-bad .kpi-value { color: var(--red); }
.kpi.is-flagged { border-left: 3px solid var(--amber); }
/* The month-by-month line under a figure (ledger.js sparkline). Quiet: brand
   teal going up, the figure's own red going down, a soft wash beneath. */
.kpi { position: relative; overflow: hidden; }
.kpi-spark { display: block; width: calc(100% + 36px); height: 34px; margin: 10px -18px -14px; }
.kpi-spark .line { fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.kpi-spark .area { fill: var(--brand); opacity: .10; }
.kpi-spark.is-down .line { stroke: var(--red); }
.kpi-spark.is-down .area { fill: var(--red); }
@media (max-width: 560px) { .kpi-spark { width: calc(100% + 24px); margin: 8px -12px -10px; height: 26px; } }

/* ---------------------------- Dashboard bands -------------------------
   Twelve tiles in one run is a wall, not a dashboard: the eye has nowhere to
   stop and no idea which three belong together. Naming the groups - what the
   company is worth, what it earned, who owes whom - turns the same figures
   into a page that can be read in order. */
.band { margin: 0 0 18px; }
.band > .band-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 2px 10px; padding-bottom: 7px;
  border-bottom: 2px solid var(--border-strong);
}
/* Sentence case, not shouted. Capitals across every heading is the look of a
   terminal from 1994; the same words set normally read faster and date less. */
.band > .band-head h2 {
  margin: 0; font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text);
  text-transform: none; letter-spacing: -.1px;
}
.band > .band-head h2::before {
  content: ""; display: inline-block; width: 3px; height: 14px; margin-right: 9px;
  background: var(--brand-fill); border-radius: 2px; vertical-align: -2px;
}
.band > .band-head .band-note { font-size: var(--fs-sm); color: var(--text-dim);
  margin-left: auto; }
.band .metrics { margin-bottom: 0; }

/* The statement block: a short balance sheet or trading summary, ruled the
   way one is ruled on paper, with the total carrying a double line. */
.figures { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.figures td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
/* A heading sits over its column: a browser centres a th on its own, and the
   income statement's "Account" and "Amount" met in the middle (28/10). */
.figures th { padding: 7px 4px; text-align: start; font-weight: var(--fw-medium); color: var(--text-dim);
  border-bottom: 1px solid var(--border-strong); }
.figures th.num { text-align: right; }
[dir="rtl"] .figures th.num { text-align: left; }
.figures td.num { text-align: right; font-variant-numeric: tabular-nums;
  font-weight: var(--fw-medium); white-space: nowrap; }
.figures tr.sum td { border-top: 1px solid var(--border-strong); border-bottom: none;
  font-weight: var(--fw-bold); }
.figures tr.sum td.num { font-size: 15px; }
.figures tr.rule td { border-bottom: 2px double var(--border-strong); }
.figures tr:last-child td { border-bottom: none; }
.figures td.indent { padding-left: 18px; color: var(--text-dim); }

/* ---------------------------- Fiscal periods -------------------------- */
.period-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px; }
.period-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.period-tile.closed { background: var(--surface-2); }
.period-tile .period-name { font-weight: var(--fw-medium); display: flex; align-items: center;
  justify-content: space-between; gap: 6px; }
.period-tile .period-counts { font-size: 12px; color: var(--text-dim); }
.period-tile .period-actions { margin-top: auto; display: flex; gap: 4px; flex-wrap: wrap; }

/* A figure on its own says little. The move since last month is the part
   anyone actually reads, so it sits beside the number, not under it. */
.metric .value-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trend { font-size: 12px; font-weight: var(--fw-medium); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--text-faint); }

/* ----------------------------- Action centre --------------------------
   Everything waiting on a person, in one place and in priority order, so
   the first question the dashboard answers is "what do I have to do today".
   -------------------------------------------------------------------- */
.actions-card .card-body { padding: 0; }
.quick-create { display: flex; gap: var(--sp-2); margin-right: var(--sp-3);
  padding-right: var(--sp-3); border-right: 1px solid var(--border); }
.action-more { margin-left: var(--sp-2); }
/* The screens of somebody with Reports off, on their first page. They run on
   to as many lines as there are screens; drawn in the top bar's one-line row
   they ran off the edge (review 2/11). */
.screen-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.actions-card { margin-bottom: 18px; }

.action-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); font-size: var(--fs-base);
}
.action-row:last-child { border-bottom: none; }
.action-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
/* Red for money past its date only; urgent is amber, the rest slate. */
.action-row .dot.high { background: var(--amber); }
.action-row .dot.medium { background: var(--slate); }
.action-row .dot.late { background: var(--red); }
.action-row .dot.low { background: var(--text-faint); }
.action-row .what { flex: 1; min-width: 0; }
.action-row .what strong { font-weight: var(--fw-bold); }
.action-row .detail { color: var(--text-dim); font-size: var(--fs-sm); margin-top: 2px; }
.action-row .count {
  font-variant-numeric: tabular-nums; font-weight: var(--fw-bold); font-size: 15px;
  min-width: 2ch; text-align: right;
}
.action-clear { padding: 22px 16px; text-align: center; color: var(--green);
  font-size: 13px; font-weight: var(--fw-medium); }

/* -------------------------------- Tables ------------------------------ */
/*
   The header row has to stay put while a long report scrolls, or six columns
   of figures end up unlabelled halfway down a general ledger.

   `position: sticky` only sticks inside a box that actually scrolls. With
   `overflow-x: auto` and no height the wrapper never scrolls vertically, so
   the header stuck to a box that never moved - which is to say it did nothing,
   on every screen in the product except the one that set a height by hand.
   The height is what makes it real, and the totals row is worth pinning too:
   it is the line an accountant is looking for.
*/
/* max() keeps a short window from collapsing the table to nothing: on a
   450px-tall screen the subtraction goes negative and the rows disappear. */
.table-wrap { overflow: auto; max-height: max(260px, calc(100vh - 232px)); }
.table-wrap.short { max-height: max(220px, 44vh); }
.table-wrap.full { max-height: none; overflow: visible; overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
table.grid thead th {
  /* start, not left: in Arabic every heading sat at the far end of its column,
     away from the words under it (28/10). */
  background: var(--surface-2); text-align: start; padding: 9px 12px;
  font-weight: var(--fw-medium);
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-dim);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
  /* A sticky cell drops its border when it detaches, so the line under the
     header is drawn as an inset shadow instead. */
  box-shadow: inset 0 -1px 0 var(--border);
}
table.grid tfoot td { position: sticky; bottom: 0; z-index: 2; }
table.grid tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tbody tr:hover { background: var(--row-hover); }
table.grid tbody tr.clickable { cursor: pointer; }
/* A list of names with no bullets and no indent, for a result that is read
   rather than counted - who received their payslip and who did not. */
ul.plain { list-style: none; margin: 4px 0 10px; padding: 0; }
ul.plain li { padding: 3px 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: 0; }

/* The row you are standing on, in a list that includes it - the revision
   history shows every round of an offer, and one of them is the page you are
   already reading. */
table.grid tbody tr.row-highlight { background: var(--accent-soft); }
table.grid tbody tr.row-highlight td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.grid tfoot td {
  padding: 10px 12px; font-weight: var(--fw-bold); border-top: 2px solid var(--border-strong);
  background: var(--surface-2);
}
/* A search that narrows what is already on the screen, sitting in the card's
   own heading rather than above it - it belongs to that table. */
.table-search {
  width: 232px; max-width: 42vw; margin-inline-end: 12px;
  padding: 5px 10px; font-size: var(--fs-sm); font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
}
.table-search:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 169, 149, .16);
}

/* ------------------------- Wide tables, made readable -------------------
   A payroll run is nineteen columns. Two things make one of those legible on a
   screen: rows that do not waste half their height on wrapped job titles, and
   the name staying in place while the figures scroll past it. */
table.grid.dense thead th { padding: 6px 10px; }
table.grid.dense tbody td { padding: 5px 10px; }
table.grid.dense tfoot td { padding: 7px 10px; }
/* Text columns hold one line each; the whole value is on the cell's tooltip.
   Figures were never allowed to wrap. */
table.grid.dense tbody td:not(.num) {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* A pinned cell has to paint over the one sliding under it, so it carries its
   own background rather than inheriting the row's. */
.pinned-grid table.grid tbody td.pinned { background: var(--surface); z-index: 1; }
.pinned-grid table.grid tbody tr:hover td.pinned { background: var(--row-hover); }
.pinned-grid table.grid thead th.pinned { background: var(--surface-2); z-index: 3; }
.pinned-grid table.grid tfoot td.pinned { background: var(--surface-2); z-index: 3; }
/* The join where the pinned block ends, so the eye can see what is held. */
.pinned-grid table.grid td.pinned-last,
.pinned-grid table.grid th.pinned-last { box-shadow: 1px 0 0 var(--border-strong); }
[dir="rtl"] .pinned-grid table.grid td.pinned-last,
[dir="rtl"] .pinned-grid table.grid th.pinned-last { box-shadow: -1px 0 0 var(--border-strong); }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A figure is read against its heading, so the heading has to sit over it. The
   rules above align every header left, which beats .num on specificity and
   leaves the amount stranded under the column before it — these put it back. */
table.grid thead th.num,
table.grid tfoot td.num,
table.lines th.num { text-align: right; }
.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
td .mono, td.mono { white-space: nowrap; }
.muted { color: var(--text-faint); }
.strong { font-weight: var(--fw-medium); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.empty { padding: 34px; text-align: center; color: var(--text-faint); }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }
/* A button that is only an icon - the printer at the end of a list row. */
.btn-sm.btn-icon { padding: 4px 7px; line-height: 0; color: var(--text-dim); }
.btn-sm.btn-icon:hover { color: var(--brand); }

/* ---------------------------- Account tree ---------------------------- */
.tree-name { display: flex; align-items: center; gap: 6px; }
.tree-toggle {
  width: 16px; height: 16px; border: none; background: none; padding: 0; cursor: pointer;
  color: var(--text-faint); font-size: 10px; line-height: 1;
}
.tree-toggle.leaf { visibility: hidden; }
tr.group-row > td { background: var(--surface-2); font-weight: var(--fw-medium); }
tr.hidden-row { display: none; }

/* -------------------------------- Chips ------------------------------- */
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: var(--fs-xs);
  font-weight: var(--fw-medium); letter-spacing: .2px; white-space: nowrap;
}
.chip-draft { background: var(--amber-soft); color: var(--amber); }
.chip-registered { background: var(--slate-soft); color: var(--slate); }
.chip-posted { background: var(--green-soft); color: var(--green); }
.chip-cancelled { background: var(--red-soft); color: var(--red); }
.chip-neutral { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.chip-brand { background: var(--brand-soft); color: var(--brand-dark); }

/* -------------------------------- Forms ------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 13px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.span-2 { grid-column: span 2; }
.field.span-all { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: var(--fw-medium); color: var(--text-dim); }
.field label .req { color: var(--red); }
input, select, textarea {
  font: inherit; padding: 7px 10px; border: 1px solid var(--input-border);
  border-radius: 6px; background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 169, 149, .16);
}
input[readonly], input:disabled, select:disabled {
  background: var(--surface-2); color: var(--text-dim); cursor: not-allowed;
}
textarea { min-height: 62px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }

/* A figure must always be fully readable. The browser's spinner arrows eat
   about 17px on the right — exactly the room the digits need — and nobody
   clicks an arrow to reach 1,000,000, so they go. Tabular figures keep the
   columns of an amount aligned as it is typed. */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.check-field { flex-direction: row; align-items: center; gap: 8px; }
.check-field label { font-size: 13px; color: var(--text); }
.filters { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { min-width: 145px; }
/* Hints under a field were 11px, and they are often the one sentence that
   says what the field is for - read at 12, the same as a field's label. */
.hint { font-size: 12px; color: var(--text-faint); }
/* The part of a document form most documents leave empty, folded under one
   line so the lines are not pushed off the screen (trading.js, documents.js). */
.more-details { grid-column: 1 / -1; border-top: 1px dashed var(--border); padding-top: 10px; }
.more-details > summary { cursor: pointer; color: var(--brand); font-weight: var(--fw-medium);
  font-size: var(--fs-sm); list-style: none; display: inline-flex; align-items: center; gap: 7px;
  user-select: none; }
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary::before { content: "\25B8"; transition: transform .12s ease; }
.more-details[open] > summary::before { transform: rotate(90deg); }
[dir="rtl"] .more-details > summary::before { content: "\25C2"; }
[dir="rtl"] .more-details[open] > summary::before { transform: rotate(-90deg); }
.more-details > .form-grid { margin-top: 12px; }
/* Ready texts under the comments box (notetexts.js), and the question of when
   service lines are income asked as a document is converted (documents.js). */
.note-texts { margin-top: -6px; }
.note-texts[hidden] { display: none; }
.note-texts-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-texts-row select { width: auto; min-width: 220px; max-width: 100%; }
.note-text-preview { margin: 12px 0 6px; padding: 10px 12px; max-height: 180px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.tm-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.tm-all label { font-weight: var(--fw-medium); }
/* A list left to its own width is exactly as wide as its longest choice, and
   what it shows is clipped to that: the final ى of "كما في الأعلى" draws past
   its advance in Tajawal, so its tail was cut ("كما في الأعل"). These lists get
   room beyond their longest choice. The row for every line takes the table's
   size (table.lines makes its own lists 13px), so the four read as one. */
.tm-all select, .tm-all input { font-size: 13px; padding: 5px 7px; }
.tm-all select, #tmLines select { width: auto; min-width: 9em; }
.tm-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tm-dates { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tm-dates[hidden] { display: none; }
.tm-dates input { width: auto; }
/* On a phone the four columns did not fit, and the choice itself sat off the
   screen behind a sideways scroll: each line becomes a small block instead -
   number, item and amount on one row, the choice and its dates under them. */
@media (max-width: 720px) {
  #tmLines, #tmLines tbody { display: block; min-width: 0; }
  #tmLines thead { display: none; }
  #tmLines tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px 10px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid var(--border); }
  #tmLines tbody td { display: block; padding: 0; border: 0; }
  #tmLines tbody td:last-child { grid-column: 1 / -1; margin-top: 4px; }
}

/* --------------------------- Document lines --------------------------- */
table.lines { width: 100%; border-collapse: collapse; font-size: 13px; }
table.lines th {
  background: var(--surface-2); padding: 7px 8px; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-dim); border-bottom: 1px solid var(--border);
  text-align: left; font-weight: var(--fw-medium);
}
table.lines td { padding: 4px 6px; border-bottom: 1px solid var(--border); }
table.lines input, table.lines select { padding: 5px 7px; font-size: 13px; }
table.lines td.num input { text-align: right; }
/* The description box, sized by the script to exactly the text it holds: one
   line until there is a second one, so a table of short descriptions still
   reads as a table. Without the override the general textarea rule opens every
   row 62px tall. */
table.lines textarea.line-desc {
  padding: 5px 7px; font-size: 13px; line-height: 1.45; font-family: inherit;
  min-height: 0; resize: none; display: block;
  /* Not `hidden`: if the measured height is ever wrong the text must still be
     reachable by scrolling rather than silently cut off. */
  overflow-y: auto;
}
/* Wherever a stored description is shown back, the line breaks in it are shown
   too - the grid, the document view, the printed page. */
.pre-line { white-space: pre-line; }
.line-total { padding: 6px 8px; font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); }
/* Says whether a line touches stock at all, right where the item is chosen. */
.line-note { display: block; margin-top: 3px; font-size: 12px; color: var(--text-dim); }
.line-note.service { color: var(--green); }
/* The last price this customer was charged, under the price; amber once the
   price typed is not that one (trading.js invLastNotes). */
.line-note.last-price { white-space: normal; text-align: start; }
.line-note.last-price.differs { color: var(--amber); }
/* When a service line is income or an expense - its date, or a period - under
   its description (trading.js invTimingCell). Amber until it is said. */
.line-timing { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.line-timing select, .line-timing input { width: auto; font-size: 12px; padding: 3px 6px; min-height: 0; }
.line-timing.undecided select { border-color: var(--amber); color: var(--amber); }
.line-note.timing-note { color: var(--amber); }
/* The batch of a tracked item, under its description (trading.js invBatchCell).
   Amber on goods coming in until the batch or its expiry is given. */
.line-batch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.line-batch select, .line-batch input { width: auto; font-size: 12px; padding: 3px 6px; min-height: 0; }
.line-batch input[data-line="batch_no"] { width: 120px; }
.line-batch.undecided input { border-color: var(--amber); }
.line-note.batch-note { color: var(--amber); }
/* Batches and expiry (batches.js): the band a batch stands in. */
.band-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.band-chip.EXPIRED { background: var(--red-soft); color: var(--red); }
.band-chip.D30 { background: var(--amber-soft); color: var(--amber); }
.band-chip.D60, .band-chip.D90 { background: var(--accent-soft); color: var(--text); }
.band-chip.LATER { background: var(--green-soft); color: var(--green); }
.band-chip.NONE { background: var(--surface-2); color: var(--text-dim); }
/* A box to scan into (stock count, serial numbers): never folded away like a filter bar. */
.scan-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.scan-row .field { margin: 0; }
/* The unit a line is written in, under its quantity, and the scanner above the lines. */
.pack-pick { display: block; width: 100%; margin-top: 4px; font-size: 12px; padding: 2px 4px; min-height: 0; }
.scan-input { width: 190px; font-size: 13px; padding: 4px 8px; margin-inline-end: 8px; }

/* Products in sizes and colours (variants.js) */
.combo-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; padding: 4px 0; }
.combo-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 14px; font-size: 12px; cursor: pointer; white-space: nowrap; background: var(--surface); }
.combo-chip input { width: auto; margin: 0; }
table.size-grid th, table.size-grid td { text-align: center; }
table.size-grid tbody th { text-align: start; white-space: nowrap; }

.doc-totals { display: flex; justify-content: flex-end; margin-top: 12px; }
.doc-totals table { border-collapse: collapse; min-width: 260px; }
.doc-totals td { padding: 5px 10px; }
.doc-totals td.label { color: var(--text-dim); }
.doc-totals td.num { font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); }
.doc-totals tr.grand td {
  border-top: 2px solid var(--border-strong); font-size: 16px; font-weight: var(--fw-bold); padding-top: 8px;
}

/* -------------------------------- Modal ------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
  z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 10px; width: 100%; max-width: 560px;
  box-shadow: 0 12px 48px rgba(16, 24, 40, .28); display: flex; flex-direction: column;
}
.modal.wide { max-width: 900px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; }
.modal-head h2 { font-size: 15px; margin: 0; font-weight: var(--fw-medium); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2);
  border-radius: 0 0 10px 10px; }

/* -------------------------------- Toasts ------------------------------ */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex;
  flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--sidebar); color: #fff; padding: 11px 16px; border-radius: 7px;
  box-shadow: 0 6px 22px rgba(16, 24, 40, .28); font-size: 13px; max-width: 420px;
  border-left: 3px solid var(--brand); animation: slidein .18s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: #34d399; }
.toast.warn { border-left-color: #f59e0b; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* An update is not an error and not a passing message: it stays until it is
   dealt with, because ignoring it means working on a stale copy. */
.update-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; z-index: 210;
  background: var(--sidebar); color: #fff; padding: 12px 16px; border-radius: 9px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .34); font-size: 13px;
  border-left: 3px solid var(--accent); max-width: min(680px, calc(100vw - 40px));
  animation: slidein .18s ease-out;
}
.update-bar span { flex: 1; }
.update-bar button { flex: 0 0 auto; }

/* ------------------------------- Sections ----------------------------- */
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-dim);
  font-weight: var(--fw-bold); margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.alert {
  padding: 11px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-warn { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
/* Brown text on a teal ground: the gold identity's info alert with only its
   background changed. It is one teal family now, and reads at 5.2:1. */
.alert-info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.alert-error { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.alert-ok { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
/* The header of a document: dates, references and amounts. The amounts have to
   line up on the decimal like every other column of money in the system. */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px;
  font-size: var(--fs-base); }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button {
  border: none; background: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 8px 14px; color: var(--text-dim); font-weight: var(--fw-medium);
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

@media (max-width: 980px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 90; transform: translateX(-100%);
    transition: transform .2s; }
  .sidebar.open { transform: none; }
  /* In Arabic the menu lives on the right, so it comes in from the right. */
  [dir="rtl"] .sidebar { inset: 0 0 0 auto; transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: none; }
  .nav-shade { position: fixed; inset: 0; z-index: 89; background: rgba(4, 16, 20, .55); }
  .menu-toggle { display: inline-flex; }
  .two-col { grid-template-columns: 1fr; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
}
.nav-shade[hidden] { display: none; }

/* A phone. The title had 112 pixels between the menu button and a row of
   actions, and a page with many actions pushed the language button off the
   screen. The bar takes two rows: the title with the menu and the language
   on the first, the page's buttons on the second, scrolling sideways. */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 6px 8px; }
  .topbar .title-block { flex: 1 1 0; }
  .topbar h1 { font-size: var(--fs-lg, 18px); }
  .topbar h1.is-greeting { font-size: 16px; }
  /* They wrap. Scrolled sideways instead, the second and third buttons of a
     page (Settings, Internal Audit) sat past the left edge of the phone with
     nothing to say they were there (28/10). */
  .topbar-actions {
    order: 10; flex: 1 1 100%; margin: 0; justify-content: flex-start;
    flex-wrap: wrap; row-gap: 6px; padding-bottom: 2px;
  }
  .topbar-actions > *, .topbar-actions .btn, .topbar-actions button { flex: 0 0 auto; white-space: nowrap; }
  .topbar-actions:empty { display: none; }
  /* On a phone the date takes a row of its own under the title, date only. */
  .today-line { order: 9; flex: 1 1 100%; justify-content: flex-start; padding: 2px 8px;
    flex-wrap: wrap; white-space: normal; row-gap: 0; }
  .quick-create { margin: 0; padding: 0; border: 0; }
  .content { padding: 12px; }
}

/*
   Printing a screen.

   The old rule hid the obvious furniture and stopped there, which left three
   things on the paper that had no business being there: .main kept its
   flex-and-hidden layout, so Chromium clipped everything past the first
   screenful; the Excel and PDF buttons live inside card headings, which were
   never hidden, so a printed statement said "Excel PDF" in the middle of it;
   and the fixed update bar printed across the first page. Status chips also
   lost their backgrounds, which on a mono printer made Posted and Cancelled
   identical - so they are told to keep their colour.
*/
@media print {
  /* Most of this system's tables are wider than an upright sheet of A4, which
     gives 704px between its margins: a trial balance wants 909, a guarantee
     register 1001, the asset register 1148. Printed upright they arrive with
     the account name crushed into a hundred pixels, every row broken over
     three lines, and the last columns cut off at the edge of the paper.
     A sheet turned on its side gives 1033, which is where nearly all of them
     fit. The table says which it needs by carrying `wide`, set in grid() from
     the number of columns that reach the paper, so a narrow report still
     prints upright and nobody has to remember to change the dialog. */
  @page { size: A4 portrait; margin: 14mm 12mm; }
  @page wide { size: A4 landscape; margin: 12mm 14mm; }
  body:has(table.grid.wide) { page: wide; }
  /* The widest of them - payroll at seventeen columns - do not fit even turned
     round. A point smaller buys about 120px, which is the difference for all
     but that one. */
  table.grid.wide { font-size: 11px; }
  table.grid.wide thead th { font-size: 10px; }
  html, body { height: auto; background: #fff; overflow: visible !important; }
  /* The screen keeps the shell at one viewport tall and clips what spills out
     of it - that is what makes the app scroll rather than the window. On paper
     the same rule threw away everything past the first page, which read as
     "this report prints nothing". Every box in the chain has to let go. */
  #app { display: block; height: auto; overflow: visible !important; }
  .main { display: block; overflow: visible !important; height: auto; background: none; }
  .content { padding: 0; overflow: visible !important; height: auto; }
  .sidebar, .topbar, .filters, .row-actions, .toasts,
  .update-bar, .modal-backdrop, .licence-bar, .demo-bar,
  .card-head button, .card-head .btn, .action-row button { display: none !important; }
  /* Hiding the filters left the card around them behind: an empty ruled box
     above every printed report. Take the whole card with them. */
  .card:has(> .card-body > .filters) { display: none !important; }

  /* The letterhead, repeated by nothing: one block at the top of the run. */
  .print-head {
    display: flex; align-items: center; gap: 14px;
    padding-bottom: 8px; margin-bottom: 14px;
    border-bottom: 2px solid #102B36;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .print-head img { height: 46px; width: auto; max-width: 190px; }
  .print-head-text { flex: 1; min-width: 0; }
  .print-company { font-size: 14px; font-weight: 700; color: #102B36;
    letter-spacing: -.2px; }
  .print-title { font-size: 12px; color: #4a5f68; margin-top: 2px; }
  .print-stamp { font-size: 10px; color: #5b7079; white-space: nowrap;
    align-self: flex-end; }
  /* A card must NOT refuse to be broken. It was asked to stay whole so a small
     panel would not be split across two sheets - but a report's card holds the
     whole report, which is taller than a sheet, and a box that may not be
     broken and does not fit has to start on a fresh one. That is where the
     blank first page came from: the letterhead, then nothing, then the report
     beginning overleaf. The rows below keep their own promise not to split,
     which is the one that was actually wanted. */
  .card { box-shadow: none; border: none; break-inside: auto; margin-bottom: 10px; }
  .table-wrap { max-height: none !important; overflow: visible !important; }
  table.grid thead th, table.grid tfoot td { position: static; }
  table.grid { break-inside: auto; }
  table.grid tr { break-inside: avoid; }
  /* A report that runs to four sheets had column headings on the first one
     only; from the second sheet on, a reader had four columns of figures and
     nothing saying which was the debit. */
  table.grid thead { display: table-header-group; }
  table.grid tfoot { display: table-footer-group; }
  .chip, table.grid thead th, table.grid tfoot td, .alert, .metric,
  /* The shading is what shows a group from an account it contains. Dropped by
     the printer, a chart of accounts arrives as one flat list of names. */
  table.grid tr.group-row > td {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* The last column of a list is its row of buttons. Hiding the buttons left
     the column standing - an empty ruled strip down the side of the paper,
     and the width it held was taken from the column that needed it most. */
  table.grid:has(.row-actions) thead th:last-child,
  table.grid:has(.row-actions) tbody td:last-child,
  table.grid:has(.row-actions) tfoot td:last-child { display: none; }

  /* The open/close arrows of the account tree are controls, not content; the
     indent stays and goes on saying which account sits under which. */
  .tree-toggle { display: none !important; }

  /* On paper the type column says "Liability" on all forty of the accounts
     sitting under Liabilities - a hundred and forty-five repetitions of what
     the group above each one already says. The width it costs is the width
     the longest account name is short of, and a name broken over three lines
     is what makes the page look thrown together. It stays on the screen,
     where nothing is competing for the room. */
  #accountTree .acc-type { display: none; }

  /* Column widths are set in pixels for a screen a good deal wider than a
     sheet of paper. On A4 the fixed ones hold their size and the one that
     flexes - the name - is squeezed to nothing, so every account wraps onto
     two lines and the page reads as a mess. On paper the table sizes itself
     to what is in it. Dense tables keep their widths: they clip long text on
     purpose, and left to themselves they would run off the page. */
  table.grid:not(.dense) { table-layout: auto; }
  table.grid:not(.dense) thead th,
  table.grid:not(.dense) tbody td { width: auto !important; }

  a[href^="#"] { text-decoration: none; color: inherit; }
}

/* =========================== Right to left ===========================
   Arabic reads the other way, and so does the layout: the menu moves to the
   right, every edge marker swaps side, every chevron turns round.

   One thing does NOT turn round, and it is the important one. A figure is
   still 1,318,912.05 read left to right, a date is still 2026-09-15, and an
   account code is still 5213. Those keep direction: ltr inside a page that is
   otherwise rtl - the column they sit in moves, the characters in them do
   not. An accounting screen that flips its numbers is unreadable, and it is
   the usual way this is got wrong.
   ===================================================================== */
/* The menu goes to the right by itself: #app is a flex row, and in a
   right-to-left page a row starts at the right, so the sidebar - first in the
   page - lands there. Two lines here used to swap the order as well, which
   turned it round a second time and left the Arabic menu on the left, where
   an Arabic reader does not look for it first (Ahmad, 27 September 2026). */

[dir="rtl"] .nav a { border-left: none; border-right: 3px solid transparent; }
[dir="rtl"] .nav a.active {
  border-right-color: var(--brand-pure);
  background: linear-gradient(270deg, rgba(0,169,149,.55), rgba(0,169,149,.18));
}
[dir="rtl"] .nav-group::after { margin-left: 0; margin-right: auto; }
[dir="rtl"] .badge { margin-left: 0; margin-right: auto; }

[dir="rtl"] .topbar h1::before { margin-right: 0; margin-left: 9px; }
[dir="rtl"] .topbar-actions { margin-left: 0; margin-right: auto; }
[dir="rtl"] .quick-create {
  margin-right: 0; margin-left: var(--sp-3);
  padding-right: 0; padding-left: var(--sp-3);
  border-right: none; border-left: 1px solid var(--border);
}

[dir="rtl"] .band > .band-head h2::before { margin-right: 0; margin-left: 9px; }
[dir="rtl"] .band > .band-head .band-note { margin-left: 0; margin-right: auto; }

[dir="rtl"] .metric.warn, [dir="rtl"] .metric.risk,
[dir="rtl"] .kpi.is-flagged, [dir="rtl"] .ai-answer {
  border-left: none; border-right: 3px solid;
}
[dir="rtl"] .metric.warn { border-right-color: var(--amber); }
[dir="rtl"] .metric.risk { border-right-color: var(--red); }
[dir="rtl"] .kpi.is-flagged { border-right-color: var(--amber); }
[dir="rtl"] .ai-answer {
  border-right-color: var(--brand);
  border-radius: var(--r-md) 0 0 var(--r-md);
}

/* The figure runs left to right on an Arabic page too ([dir=rtl] .kpi-value), so the currency keeps its gap on the left: on the right it stuck to the figure, "247,501.32QR" (sweep, 29 October 2026). */
[dir="rtl"] .kpi .kpi-value .cur { margin-left: 8px; margin-right: 0; }
[dir="rtl"] .figures td.indent { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .card-head .spacer { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pw-box input { padding-right: 10px; padding-left: 58px; }
[dir="rtl"] .pw-peek { right: auto; left: 4px; }
[dir="rtl"] .auth-help { justify-content: flex-start; }
[dir="rtl"] .insight-row .chip { margin-top: 1px; }

/* Columns move; the characters inside them do not. */
[dir="rtl"] .num, [dir="rtl"] td.num, [dir="rtl"] th.num,
[dir="rtl"] .mono, [dir="rtl"] .value, [dir="rtl"] .kpi-value,
[dir="rtl"] .figures td.num, [dir="rtl"] input[type="number"],
[dir="rtl"] input[type="date"], [dir="rtl"] input[type="month"],
[dir="rtl"] .code-block, [dir="rtl"] .print-stamp {
  direction: ltr;
}
/* A right-aligned figure column in an rtl table aligns to the left edge of
   the page, which is where the eye now expects the end of a number. */
[dir="rtl"] td.num, [dir="rtl"] th.num, [dir="rtl"] .figures td.num {
  text-align: left;
}

/* Text the company wrote decides its own direction.

   A customer called "Example Real Estate Co." dropped into a right-to-left
   cell otherwise renders as ".Example Real Estate Co" - the full stop is
   neutral, so it takes the direction of the paragraph and jumps to the
   front. plaintext lets each run take the direction of its own first
   letter instead, which is right for a screen holding both languages at
   once: Arabic names read right to left, Latin ones left to right, in the
   same column. */
[dir="rtl"] td, [dir="rtl"] .brand-tagline, [dir="rtl"] .brand-sub,
[dir="rtl"] .card-head h2, [dir="rtl"] .modal-head h2,
[dir="rtl"] .tree-name, [dir="rtl"] .chip, [dir="rtl"] option,
[dir="rtl"] .metric .label, [dir="rtl"] .metric .sub,
[dir="rtl"] .detail, [dir="rtl"] dd, [dir="rtl"] .sub,
/* A box somebody types into holds whichever language they typed. The reminder
   letter is the clearest case: the same textarea carries an Arabic letter to
   one customer and an English one to the next. */
[dir="rtl"] textarea, [dir="rtl"] input {
  unicode-bidi: plaintext;
}
/* Each line takes its own direction (plaintext), and its alignment came with
   it: an English value sat on the left and the Arabic one under it on the
   right, a zigzag down a card (sweep, 29 October 2026). On an Arabic page
   these lines keep to the right whatever language each is in. */
[dir="rtl"] dd, [dir="rtl"] .metric .sub, [dir="rtl"] .metric .label { text-align: right; }
/* plaintext makes a Latin-only cell a left-to-right paragraph, and "start"
   then meant left: "4119 — Hardware Sales" sat at the far side of its column
   from the Arabic names above it. The edge is pinned; the words inside still
   read their own way (28/10). */
[dir="rtl"] td:not(.num):not(.center) { text-align: right; }

/* Arabic has no small-caps and no letter-spacing tradition; the uppercase
   tracking that flatters English here makes Arabic look broken. */
[dir="rtl"] .brand-tagline, [dir="rtl"] .suggest-label,
[dir="rtl"] .band-head h2 {
  letter-spacing: normal; text-transform: none;
}

.lang-toggle {
  font-weight: var(--fw-bold); min-width: 38px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.lang-toggle:hover { border-color: var(--brand); color: var(--brand); }

/* A first-time user meets the sign-in card before anything else, so the
   switch has to be reachable from there too. */
.auth-lang {
  position: absolute; top: 12px; right: 12px;
  padding: 3px 9px; border-radius: 7px; font-size: var(--fs-xs);
  line-height: 1.6; cursor: pointer;
}
[dir="rtl"] .auth-lang { right: auto; left: 12px; }

/* Paper is decided by the document, not by the screen: an invoice going to a
   bank keeps the letterhead's own direction whichever way the app was left. */
@media print {
  [dir="rtl"] .print-head { direction: ltr; }
}

/* ------------------------------ Insights ------------------------------ */
/* A finding is a claim and its reason, side by side. The reason is set
   quieter than the claim but not so quiet it goes unread - it is the part
   that decides whether the claim is worth acting on. */
.insight-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.insight-row:last-child { border-bottom: none; }
.insight-row .chip { flex: 0 0 auto; margin-top: 1px; }
.insight-main { flex: 1; min-width: 0; }
.insight-why { color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin-top: 2px; }
.insight-where { flex: 0 0 auto; }

.proposal { border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2); }
.proposal-head { display: flex; align-items: center; gap: 10px;
  justify-content: space-between; margin-bottom: 4px; }
.proposal .table-wrap { margin-top: 8px; background: var(--surface); border-radius: 6px; }

/* Offered, never applied: the row sits under the field and stays quiet until
   there is something to say. */
.suggest-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 0; }
.suggest-strip:empty { display: none; }
.suggest-label { font-size: 11.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .4px; margin-right: 2px; }
button.suggest-chip { cursor: pointer; border: 1px solid transparent; font: inherit;
  font-size: 11.5px; padding: 3px 9px; }
button.suggest-chip:hover { border-color: var(--brand); }

/* An answer that came from outside the building, marked as such. */
.ai-answer { margin-top: 12px; border-left: 3px solid var(--brand);
  background: var(--surface-2); border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 12px 14px; }
.ai-question { font-weight: var(--fw-bold); color: var(--text-dim);
  font-size: var(--fs-sm); margin-bottom: 6px; }
.ai-text { line-height: 1.65; }
.ai-answer .hint { margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--border); }

.insight-basis { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.insight-basis ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim);
  font-size: 12.5px; line-height: 1.7; }

/* ------------------------------- Charts ------------------------------- */
.chart-card .card-body { padding: 14px 16px 12px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart.donut { width: 200px; height: 200px; flex: 0 0 200px; }
.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-row .chart-legend { flex: 1; min-width: 180px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px;
  font-size: 12px; color: var(--text-dim); }
.chart-legend .legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend b { color: var(--text); font-variant-numeric: tabular-nums; }

.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.bar-track { background: var(--surface-2); border-radius: 5px; height: 16px;
  overflow: hidden; border: 1px solid var(--border); }
.bar-fill { display: block; height: 100%; border-radius: 4px; min-width: 2px;
  transition: width .3s ease; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); white-space: nowrap; }

/* ------------------------- Analysis as a dashboard -------------------- */
/* Rows of cards that share a height, so a row reads as one line of the page
   and not as boxes dropped where they fell. Three across on a wide screen,
   two on a laptop, one on a phone. */
.dash-row { display: grid; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.dash-row.wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.dash-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-row > .card { margin-bottom: 0; }
.dash-row:empty { display: none; }
@media (max-width: 1200px) { .dash-row.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .dash-row.wide, .dash-row.three, .dash-row.two { grid-template-columns: minmax(0, 1fr); }
}
.dash-compare { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -4px 0 14px; font-size: var(--fs-sm); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; }
.seg button { border: none; border-radius: 0; background: var(--surface); padding: 5px 12px;
  color: var(--text-dim); font-weight: var(--fw-medium); }
.seg button + button { border-inline-start: 1px solid var(--border); }
/* --brand-fill, not --brand: in the dark theme --brand is a light teal and
   white on it read 2:1 (28/10). */
.seg button.active { background: var(--brand-fill); color: #fff; }
.metrics.dash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .metrics.dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-tiles .metric { min-height: 118px; }
@media (max-width: 560px) {
  .dash-tiles .metric { padding: 12px; min-height: 0; }
  .dash-tiles .metric .value { font-size: 17px; letter-spacing: -.2px; }
}
.metric.clickable { cursor: pointer; transition: border-color .15s; }
.metric.clickable:hover { border-color: var(--border-strong); }
.metric .spark { display: block; width: 100%; height: 26px; margin-top: 8px; }
.trend.good { color: var(--green); }
.trend.bad { color: var(--red); }
.stack-bar { display: flex; height: 18px; border-radius: 5px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); }
.stack-bar span { display: block; height: 100%; }
.age-legend { display: grid; gap: 7px; margin-top: 14px; font-size: 12.5px; }
.age-legend > div { display: grid; grid-template-columns: 10px 1fr auto 36px; gap: 8px;
  align-items: center; }
.age-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.age-legend b { font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); }
.age-legend .muted { text-align: end; }
.clickable-card { cursor: pointer; }
.clickable-card:hover { border-color: var(--border-strong); }
.bar-row.clickable { cursor: pointer; }
.bar-row.clickable:hover .bar-label { color: var(--text); }

/* ------------------------- Tidier form layout ------------------------- */
.form-grid { align-items: start; }
.field label { display: flex; align-items: center; gap: 4px; min-height: 16px; }
.field input, .field select, .field textarea { height: 34px; }
.field textarea { height: auto; }

/* The month picker in the dashboard's title bar: the same height as the
   buttons beside it, and no wider than the date it holds. */
.dash-month {
  height: 26px; padding: 0 6px; margin-left: 6px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 12px;
}

/* ----------------------- Searchable picker -----------------------------
   A dropdown that has outgrown the browser's own. It looks like every other
   field until you type in it; the list below is the same list, filtered.
   ----------------------------------------------------------------------- */
.combo { position: relative; }
.combo .combo-text { width: 100%; }
.combo .combo-text::placeholder { color: var(--text-faint); opacity: .75; }
/* Fixed, not absolute, and placed by script from the input's own position.
   A card sets `overflow: hidden` to keep its rounded corners, and the content
   area scrolls - between them an absolutely positioned list is sliced off at
   the card edge and shows one row through a letterbox. Fixed positioning
   leaves the card behind entirely. Above the modal's layer, so a picker inside
   a dialog opens over it rather than under it. */
.combo-list {
  position: fixed; z-index: 200;
  max-height: 264px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow); padding: 3px;
}
.combo-list { width: max-content; }
/* Every name whole: the list grows to the longest one (core.js comboPlace),
   and one longer than the window wraps instead of ending in "...". */
.combo-item {
  padding: 6px 9px; border-radius: var(--r-sm); cursor: pointer;
  font-size: var(--fs-sm, 13px); line-height: 1.35; color: var(--text);
  white-space: normal; overflow-wrap: anywhere;
}
.combo-item.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.combo-item.is-chosen { font-weight: var(--fw-bold, 600); }
.combo-item.is-chosen::after { content: " ✓"; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .combo-item { transition: background-color .08s ease; }
}
.field .hint { line-height: 1.35; min-height: 14px; }
.filters .field { margin-bottom: 0; }
.filters > button { height: 34px; align-self: flex-end; }
.form-section {
  grid-column: 1 / -1; margin-top: 6px; padding-top: 10px;
  border-top: 1px solid var(--border); font-size: 11px; font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: .7px; color: var(--text-faint);
}

@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
}
/* ----------------------------- Sign-in ------------------------------- */
/* The sign-in screen is the one place the mark can be as large as it deserves:
   a lit arch on stone, the way the brand board looks. */
.auth-screen {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  width: 100%; padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(0,169,149,.26), transparent 64%),
    radial-gradient(760px 520px at 8% 108%, rgba(0,169,149,.16), transparent 62%),
    linear-gradient(152deg, #17394a 0%, #102B36 52%, #0a1c24 100%);
}
/* A mashrabiya screen, faint, behind everything (and behind the drawing on
   the split screen's brand half) */
.auth-screen::before, .auth-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'>\
<g fill='none' stroke='%2300A995' stroke-opacity='0.12' stroke-width='1.1'>\
<path d='M36 2 L70 36 L36 70 L2 36 Z'/><path d='M36 16 L56 36 L36 56 L16 36 Z'/>\
<circle cx='36' cy='36' r='5'/>\
<path d='M0 0 L16 16 M72 0 L56 16 M0 72 L16 56 M72 72 L56 56'/></g></svg>") 0 0/72px 72px;
  /* Was .09 and reading as a texture rather than a watermark. Halved, and
     faded out sooner, so it frames the card instead of competing with it. */
  opacity: .5;
  mask-image: radial-gradient(110% 90% at 50% 0%, #000 8%, transparent 62%);
  -webkit-mask-image: radial-gradient(110% 90% at 50% 0%, #000 8%, transparent 62%);
}
/* The card sits a little above centre: a form the eye falls onto, rather than
   one it has to travel down to. */
.auth-screen { align-items: flex-start; padding-top: 7vh; }
/* The screen scrolls when the card is taller than it. The application frame
   around it is cut to the window (#app), so a card that grew - the demo door
   with its four people - put the Enter button under the bottom edge of a
   phone with no way to reach it. */
.auth-screen { height: 100vh; height: 100dvh; overflow-y: auto; padding-bottom: 32px; }
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px; background: #ffffff; border-radius: 14px;
  padding: 26px 28px 22px; text-align: center;
  border: 1px solid rgba(0,169,149,.35);
  box-shadow: 0 26px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
}
.auth-logo {
  /* The artwork is wider than it is tall, so the box is given to it and the
     picture is fitted inside rather than stretched to a square. */
  width: 104px; height: 104px; display: block; margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,40,36,.30));
}
.auth-brand { font-size: 31px; font-weight: var(--fw-bold); letter-spacing: 6px; margin: 12px 0 0;
  color: var(--text); padding-left: 6px; }
.auth-tagline { font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--brand); margin: 6px 0 4px; font-weight: var(--fw-medium); }
/* A gold rule between the wordmark and the form, as on the brand board */
.auth-tagline::after {
  content: ""; display: block; width: 52px; height: 2px; margin: 13px auto 15px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.auth-title { font-size: var(--fs-md); margin: 0; font-weight: var(--fw-medium); }
.auth-sub { font-size: var(--fs-sm); color: var(--text-dim); margin: 5px 0 14px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 11px; text-align: left; }
.auth-submit { justify-content: center; padding: 10px; font-size: var(--fs-base); margin-top: 4px; }
.auth-note { font-size: var(--fs-xs); color: var(--text-faint); margin: 14px 0 0; line-height: 1.5; }

/* A password field you can check before you commit to it, and the one link
   people look for when the field refuses them. */
/* The box around the input alone, so "Show" is centred on the field and not
   on the field and its label together - which is what left it riding high. */
.pw-box { position: relative; }
.pw-box input { padding-right: 58px; width: 100%; }
.pw-peek {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: none; padding: 4px 8px; cursor: pointer; line-height: 1;
  color: var(--text-faint); font-size: var(--fs-sm);
}
.pw-peek:hover { color: var(--brand); }
.auth-help { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-help button, .auth-row .auth-link {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--brand); font-size: var(--fs-sm); text-decoration: underline;
}
/* "Remember me" on the left, "Forgot password?" on the right - mirrored in Arabic. */
.auth-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: -2px;
}
.auth-remember {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: var(--fs-sm); color: var(--text); user-select: none;
}
.auth-remember input {
  width: 15px; height: 15px; margin: 0; padding: 0; flex: 0 0 auto;
  accent-color: var(--brand); cursor: pointer;
}
/* Burgundy is the right focus colour on a working screen, but on a sign-in
   card a dark red ring around an empty username reads as a rejection before
   anybody has typed anything. Gold says the same thing without the accusation;
   red on this screen now means only that something was actually wrong. */
.auth-card input:focus, .auth-card select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 169, 149, .22);
}
.auth-card input:focus-visible, .auth-card button:focus-visible {
  outline: 2px solid var(--accent); box-shadow: none;
}
.auth-card .field.invalid input { border-color: var(--red); }
/* A phone, or a short laptop screen: the card packs tighter so the button is
   in reach, and whatever still does not fit scrolls (.auth-screen above). */
@media (max-width: 560px), (max-height: 720px) {
  .auth-screen { padding: 14px 12px 28px; }
  .auth-card { padding: 18px 16px 16px; }
  .auth-logo { width: 56px; height: 56px; }
  .auth-brand { font-size: 24px; margin-top: 6px; }
  .demo-person { padding: 6px 8px; }
  .demo-person em { font-size: 11px; }
  .demo-people-list { gap: 4px; }
}

/* The sign-in screen in two halves, the way Xero lays theirs out (Ahmad,
   28 October 2026): the form on a plain page at the start side, the brand
   drawn large on ink across the other half (authArt), nothing to read there.
   Under 900px the drawing steps aside and the form has the screen. The card
   keeps its class, so the focus, demo-door and dark-theme rules above still
   reach it; here it only loses the box around it. */
.auth-screen.auth-split {
  display: grid; grid-template-columns: minmax(400px, 44%) 1fr; align-items: stretch;
  padding: 0; background: var(--surface);
}
.auth-screen.auth-split::before { content: none; }
.auth-side { display: flex; flex-direction: column; padding: 22px 56px 20px; background: var(--surface); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-top-brand { display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 15px; font-weight: var(--fw-bold); letter-spacing: 3px; color: var(--text); }
.auth-top-brand img { width: 32px; height: 32px; }
.auth-split .auth-lang { position: static; min-width: 34px; height: 30px; border-radius: 8px; }
.auth-screen.auth-split .auth-card {
  width: 100%; max-width: 380px; margin: 11vh 0 auto; padding: 0; text-align: start;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  animation: auth-rise .5s ease-out both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.auth-split .auth-title { font-size: 28px; font-weight: var(--fw-bold); letter-spacing: -.2px; }
.auth-split .auth-sub { margin: 8px 0 26px; font-size: var(--fs-base); }
.auth-split .auth-form { gap: 16px; }
.auth-split .field label { font-weight: var(--fw-medium); margin-bottom: 6px; }
/* Filled fields that turn white when you are in them. The edge keeps the
   field border's 3:1 (--input-border): the fill alone does not show where a
   field is (Codex, 28 October 2026). */
.auth-split .field input, .auth-split .field select {
  height: 48px; border-radius: 10px; padding-inline: 14px; font-size: 15px;
  background-color: var(--bg); border: 1px solid var(--input-border);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
/* The room the Show button needs, which the padding above took back */
.auth-split .pw-box input { padding-inline-end: 64px; }
.auth-split .field input:focus, .auth-split .field select:focus {
  background-color: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(0,169,149,.16);
}
/* A person and a lock at the start of the two sign-in fields */
.auth-split #f_username, .auth-split #f_password {
  padding-inline-start: 44px; background-repeat: no-repeat; background-size: 18px 18px;
  background-position: left 14px center;
}
[dir="rtl"] .auth-split #f_username, [dir="rtl"] .auth-split #f_password { background-position: right 14px center; }
.auth-split #f_username { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8F96' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='4'/><path d='M4 21c0-4 4-6 8-6s8 2 8 6'/></svg>"); }
.auth-split #f_password { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8F96' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='11' width='14' height='10' rx='2.5'/><path d='M8 11V7.5a4 4 0 0 1 8 0V11'/></svg>"); }
.auth-split .auth-row .auth-link { text-decoration: none; font-weight: var(--fw-medium); }
.auth-split .auth-row .auth-link:hover { text-decoration: underline; }
.auth-split .auth-submit {
  height: 48px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: var(--fw-bold);
  background: linear-gradient(135deg, #00897A, #00695E); border: 0;
  box-shadow: 0 10px 22px rgba(0,119,106,.28); transition: transform .15s ease, box-shadow .15s ease;
}
.auth-split .auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(0,119,106,.34); }
.auth-foot { margin-top: 28px; font-size: var(--fs-xs); color: var(--text-faint); }
/* Set into the page with rounded corners rather than run to its edge, and
   lit by soft clouds of the brand's teals over the ink (the Pinterest boards
   Ahmad pointed at, 28 October 2026). */
/* It holds still at the height of the window while a long form beside it -
   the demo door with its six people - scrolls, rather than stretching to the
   form's length and sliding away with it. */
.auth-art {
  position: sticky; top: 14px; align-self: start; height: calc(100vh - 28px); height: calc(100dvh - 28px);
  overflow: hidden; margin: 14px; border-radius: 28px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 24px 60px rgba(16,43,54,.18);
  background:
    radial-gradient(55% 45% at 18% 12%, rgba(0,194,168,.42), transparent 70%),
    radial-gradient(45% 40% at 88% 18%, rgba(10,110,124,.60), transparent 72%),
    radial-gradient(55% 45% at 82% 88%, rgba(46,211,188,.26), transparent 72%),
    radial-gradient(40% 35% at 10% 92%, rgba(0,119,106,.45), transparent 72%),
    linear-gradient(152deg, #17394a 0%, #102B36 52%, #0a1c24 100%);
}
.auth-art-shapes { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art-brand { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.auth-art-brand img { width: min(460px, 74%); height: auto;
  filter: drop-shadow(0 10px 30px rgba(0,169,149,.35)); }
.auth-art-brand span { margin-top: -18px; font-family: "Tajawal", var(--font-ui); font-weight: 700;
  font-size: 40px; color: #8FF0E0; text-shadow: 0 6px 24px rgba(0,169,149,.35); }
.auth-art .f { transform-box: fill-box; animation: auth-float 6s ease-in-out infinite alternate; }
.auth-art .f2 { animation-duration: 7.5s; animation-delay: -2s; }
.auth-art .f3 { animation-duration: 5.5s; animation-delay: -1s; }
.auth-art .f4 { animation-duration: 8s; animation-delay: -3s; }
.auth-art .f5 { animation-duration: 9s; animation-delay: -4s; }
@keyframes auth-float { from { transform: translateY(0); } to { transform: translateY(-12px); } }
@media (prefers-reduced-motion: reduce) {
  .auth-art .f, .auth-screen.auth-split .auth-card { animation: none; }
}
/* The sign-in screen stays light whatever theme the person chose (Ahmad,
   28 October 2026: "بلا منه الدارك"). The light values go back on the screen
   itself, so everything inside it reads them; the brand half is ink anyway.
   They copy :root's light set, and move with it. */
:root[data-theme="dark"] .auth-screen.auth-split {
  color-scheme: light; color: var(--text);
  --bg: #F3F7F7; --surface: #ffffff; --surface-2: #f8fbfb; --border: #dfe7e8; --border-strong: #c3d0d2;
  --input-border: #728c96; --row-hover: #eef4f5;
  --text: #102B36; --text-dim: #4a5f68; --text-faint: #5b7079;
  --brand: #00776A; --brand-dark: #005A50; --brand-soft: #e6f6f3;
  --accent: #0A6E7C; --accent-soft: #e7f2f4; --accent-line: #c3dde2;
  --green: #146c42; --green-soft: #e4f4ec; --green-line: #b9e2cd;
  --red: #b4232a; --red-soft: #fceaeb; --red-line: #f2c3c5;
  --amber: #7a5408; --amber-soft: #fdf3dc; --amber-line: #f0dcae;
  --shadow: 0 1px 2px rgba(16, 43, 54, .06), 0 4px 16px rgba(16, 43, 54, .08);
}
/* A phone or a narrow window: the brand half becomes a band across the top
   with the wordmark alone, the language button sits on its corner, and the
   form has the rest. */
@media (max-width: 900px) {
  .auth-screen.auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-art { order: -1; position: relative; top: auto; height: 168px; margin: 10px 10px 0; border-radius: 22px; }
  .auth-art-shapes { display: none; }
  .auth-art-brand img { width: 220px; }
  .auth-art-brand span { font-size: 26px; margin-top: -10px; }
  .auth-top-brand { display: none; }
  .auth-split .auth-lang { position: absolute; top: 14px; right: 14px; z-index: 2;
    background: rgba(255,255,255,.10); color: #ffffff; border-color: rgba(255,255,255,.22); }
  [dir="rtl"] .auth-split .auth-lang { right: auto; left: 14px; }
  .auth-side { padding: 0 20px 18px; }
  .auth-screen.auth-split .auth-card { margin: 28px auto auto; }
  .auth-foot { text-align: center; }
}

.sidebar-foot { display: flex; flex-direction: column; gap: 8px; }
.session-user { display: flex; align-items: center; gap: 9px; }
.session-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(145deg, var(--brand-pure), var(--brand-dark)); color: #fff;
  display: grid; place-items: center; font-weight: var(--fw-bold); font-size: 12px; flex: 0 0 28px;
}
.session-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.session-text b { color: var(--side-strong); font-size: 12px; font-weight: var(--fw-medium);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-text em { color: var(--side-muted); font-size: 11px; font-style: normal; }
/* Three buttons in Arabic are wider than the menu: the last one wraps rather
   than being cut at the edge (28/10). */
.session-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.session-actions button {
  flex: 1; background: transparent; border-color: var(--side-edge); color: var(--side-text); font-size: 11px;
  justify-content: center; padding: 4px 6px;
}
.session-actions button:hover { background: var(--sidebar-2); border-color: var(--side-muted); color: #fff; }
/* ---------------------------------------------------------------------
   Permissions inside a module

   A long list of small choices, so it folds. A group opens by itself when
   something in it has been withheld - the one state worth seeing without
   being asked for.
   --------------------------------------------------------------------- */
.perm-group { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
  background: var(--surface); }
.perm-group > summary { cursor: pointer; padding: 9px 12px; list-style: none;
  display: flex; align-items: baseline; gap: 10px; user-select: none; }
.perm-group > summary::-webkit-details-marker { display: none; }
.perm-group > summary::before { content: "\25B8"; color: var(--text-faint);
  font-size: 11px; transition: transform .12s ease; }
.perm-group[open] > summary::before { transform: rotate(90deg); }
/* Right to left, the closed arrow points into the text from the other side. */
[dir="rtl"] .perm-group > summary::before { content: "\25C2"; }
[dir="rtl"] .perm-group[open] > summary::before { transform: rotate(-90deg); }
.perm-group > summary:hover { background: var(--bg); }
.perm-group[open] > summary { border-bottom: 1px solid var(--border); }
.tick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 2px 14px; padding: 10px 12px 12px; }
.tick { display: flex; align-items: center; gap: 8px; padding: 4px 2px;
  font-size: 12.5px; cursor: pointer; border-radius: 4px; }
.tick:hover { background: var(--bg); }
.tick input { margin: 0; flex: 0 0 auto; }
.tick > span:first-of-type { flex: 1 1 auto; }
/* Unticked is the exception, so it is the one that gets colour. */
.tick:has(input:not(:checked)) > span:first-of-type { color: var(--red);
  text-decoration: line-through; }
@media (max-width: 640px) { .tick-grid { grid-template-columns: 1fr; } }

/* ------------------------- Two-step sign-in --------------------------- */
/* The picture a phone camera has to read. It stays black on white in dark
   mode as well - the contrast is part of what makes it scannable, and a QR
   code inverted to grey on charcoal is one most phones will not take. */
.qr-holder { display: flex; justify-content: center; margin: 4px 0 14px; }
.qr-holder svg { width: 200px; height: 200px; background: #fff;
  padding: 8px; border-radius: 8px; border: 1px solid var(--border); }
.two-step-steps { margin: 0 0 14px; padding-left: 18px; font-size: 13px;
  color: var(--muted); }
.two-step-steps li { margin: 3px 0; }
/* --brand, not --accent: there is no --accent. This pointed at nothing and the
   step numbers fell back to the text colour. On a white dialog, the darker
   brand teal is the one meant for white. */
.two-step-steps li::marker { color: var(--brand); font-weight: 600; }
/* The secret, for somebody whose camera will not focus. Spaced in fours and
   in a fixed pitch, because it is being copied character by character. */
.secret-text { display: inline-block; margin-top: 4px; padding: 5px 9px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  font-family: var(--mono, ui-monospace, monospace); font-size: 13px;
  letter-spacing: 1px; user-select: all; }
/* Six digits, read off a phone and typed straight back. Wide and spaced so a
   transposed pair is visible before the button is pressed. */
.code-input { font-size: 22px; letter-spacing: 6px; text-align: center;
  font-family: var(--mono, ui-monospace, monospace); padding: 10px 8px; }
.auth-who { text-align: center; margin: -4px 0 12px; font-weight: 600;
  color: var(--muted); font-size: 13px; }
.code-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px;
  margin: 14px 0; }
.code-grid code { padding: 7px 10px; background: var(--bg); border-radius: 5px;
  border: 1px solid var(--border); font-size: 15px; letter-spacing: 1.5px;
  text-align: center; user-select: all; }
@media (max-width: 480px) { .code-grid { grid-template-columns: 1fr; } }


/* --------------------------- Finding a screen -------------------------- */
/*
   Built from the panel's own parts rather than from a generic form field, so
   it reads as one more piece of the menu:

       the resting fill is the menu's own hover tint, and the border is the
       same hairline that divides the brand block from the list;
       the text is the link colour, the placeholder and the glass are the
       icon colour, so an empty box is exactly as loud as an unlit icon;
       focus lights it in the brand teal - the colour that already means
       "here" on this panel, down the edge of the page you are on.

   It stands on margin, not padding, so the box around it is the field and
   nothing else - which is what lets the shortcut chip centre on it exactly.
*/
.nav-find {
  position: relative;
  /* Room above: it used to sit hard against the NARROW bar and read as part
     of it. */
  margin: 14px 12px 8px;
}
.nav-find input {
  display: block; width: 100%; height: 34px; box-sizing: border-box;
  /* Glass on the leading side, room for the shortcut on the trailing one.
     Logical sides, so Arabic mirrors itself without a rule of its own. */
  padding-inline: 32px 58px;
  font: inherit; font-size: var(--fs-sm); color: var(--side-text);
  background: var(--side-hover)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238fa8b1' stroke-width='2.4' stroke-linecap='round'><circle cx='10.5' cy='10.5' r='6.5'/><path d='M20 20l-4.6-4.6'/></svg>")
    no-repeat 11px 50% / 14px 14px;
  border: 1px solid var(--side-line); border-radius: var(--r-md);
  outline: none; -webkit-appearance: none; appearance: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
html[dir="rtl"] .nav-find input { background-position: calc(100% - 11px) 50%; }
.nav-find input::placeholder { color: var(--side-muted); opacity: 1; }
.nav-find input:hover {
  background-color: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .13);
}
.nav-find input:focus {
  color: #fff; background-color: rgba(255, 255, 255, .08);
  border-color: var(--brand-pure);
  box-shadow: 0 0 0 3px rgba(0, 169, 149, .20);
  /* The glass lights up with the border. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2300A995' stroke-width='2.4' stroke-linecap='round'><circle cx='10.5' cy='10.5' r='6.5'/><path d='M20 20l-4.6-4.6'/></svg>");
}
/* Once something is typed the shortcut chip has gone, so the trailing room
   shrinks to what the clear cross needs. */
.nav-find:focus-within input,
.nav-find input:not(:placeholder-shown) { padding-inline-end: 30px; }

/* The shortcut, as a key cap sitting in the field. Seen while the box is
   idle, gone the moment it is used - by then it has done its job. The words
   come from the page, so a Mac shows the Command key and not Ctrl. */
.nav-find::after {
  content: attr(data-key);
  position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%);
  padding: 2px 6px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .12); border-bottom-width: 2px;
  font-size: 10px; line-height: 1.3; letter-spacing: .3px; color: var(--side-muted);
  pointer-events: none; transition: opacity .12s;
}
.nav-find:focus-within::after,
.nav-find:has(input:not(:placeholder-shown))::after { opacity: 0; }

/* The browser's own clear cross is black and vanishes on this panel; this is
   the same cross in the icon colour. */
.nav-find input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  width: 14px; height: 14px; opacity: .75;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a7bcc4' stroke-width='2.6' stroke-linecap='round'><path d='M6 6l12 12M18 6L6 18'/></svg>")
    center / 11px 11px no-repeat;
}
.nav-find input::-webkit-search-cancel-button:hover { opacity: 1; }

/* Said in the same voice as the links it stands in for. */
.nav-empty {
  padding: 10px 16px 4px; font-size: var(--fs-sm); color: var(--side-muted);
}

/* While searching, what did not match steps out of the way entirely - the
   menu becomes the result list rather than growing a second one beside it. */
.nav .search-hidden { display: none !important; }
/* Headings stay as labels but stop looking like buttons: nothing folds while
   a search is open, so the chevron would be promising something it will not
   do. The chevron is ::after - hiding ::before, as this first did, hid
   nothing at all. */
.nav.searching .nav-group { cursor: default; color: var(--side-label); }
.nav.searching .nav-group::after { visibility: hidden; }
/* Where Enter will take you. Drawn with the same edge and the same teal as
   the page you are on, only fainter - related, and still not the same thing:
   one says "you are here", the other "Enter goes here". */
.nav a.search-pick {
  background: rgba(0, 169, 149, .16); color: #fff;
  border-left-color: rgba(0, 169, 149, .7);
}
.nav a.search-pick::before { color: var(--brand-pure); }

/* Folded to its icons there is no room to type, so the box goes with it.
   Ctrl+K unfolds the panel before putting the cursor here. */
#app.rail .nav-find, #app.rail .nav-empty { display: none; }


/* ============================= The dark theme =============================
   A set of books is read for six hours at a time, and for some of those hours
   a white page is the brightest thing in the room.

   Built on the tokens rather than beside them: every rule above already asks
   for --surface, --text or --border, so the theme is those answers changed
   and very little else. It is chosen on <html data-theme> by a line in the
   page head that runs before anything is painted, so somebody on the dark
   theme never sees a white flash on the way in, and it follows the
   computer's own setting until somebody picks with the button beside the
   language one.

   Screen only. Paper is white, and a page printed from a dark screen would
   otherwise come out as pale ink on nothing.

   Every value was measured before it was written: body text 13.7:1 on a card,
   the faintest text 6.1:1, each status colour 6.9:1 or better on its own
   tinted ground, each chart series 4.8:1 or better against the card. The
   fills - buttons, badges - are deliberately left out: a button stays dark
   teal with white on it, because a light teal button cannot carry white text.
   ========================================================================== */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;              /* native pickers, scrollbars, checkboxes */
    --bg: #0d171c;
    --surface: #15232a;
    --surface-2: #1b2c34;
    --border: #24343c;
    --border-strong: #3a4d56;
    --input-border: #5f7b88;         /* 3.6:1 on a card, was 1.8 */
    --row-hover: #1e313a;
    --text: #e6eef0;
    --text-dim: #b3c3c9;
    --text-faint: #8ea3ab;
    --brand: #2ec7b0;
    --brand-dark: #5ad4c1;
    --brand-soft: #0f3833;
    --accent: #5cc6d4;
    --accent-soft: #11303a;
    --accent-line: #1e4a55;
    --green: #5fd39a;
    --green-soft: #10301f;
    --green-line: #1f5236;
    --red: #ff8a85;
    --red-soft: #3b1719;
    --red-line: #6a2a2d;
    --amber: #f2bd57;
    --amber-soft: #36290e;
    --amber-line: #5e4819;
    --slate: #a9c3df;
    --slate-soft: #1b2834;
    --shadow: 0 1px 2px rgba(0, 0, 0, .40), 0 4px 16px rgba(0, 0, 0, .35);
    --topbar-glass: rgba(21, 35, 42, .88);
    --chart-teal: #2CC4AD;
    --chart-ink: #D3E1E6;
    --chart-amber: #EDB44A;
    --chart-blue: #78A2E8;
    --chart-clay: #EC7F57;
    --chart-grey: #7E9098;
    --chart-grid: #24343c;
    --chart-axis: #8ea3ab;
    --chart-dot: #15232a;
  }
  /* The one card that was painted white by hand rather than by token. */
  :root[data-theme="dark"] .auth-card { background: var(--surface); }
  /* The mark on the sign-in card has an ink arrow, drawn for a white card; on
     a dark one the arrow vanishes and the A points nowhere. The app's own
     mark - white arrow on its ink tile, the one the sidebar wears - is the
     version drawn for dark ground. */
  :root[data-theme="dark"] .auth-logo { content: url("/static/assets/accova-mark-app.svg"); }
}

/* The switch, in the top bar beside the language one: a moon while the page
   is light, a sun while it is dark - it shows where a press would take you. */
.theme-toggle { padding: 0; width: 34px; justify-content: center; }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }


/* ----------------------- Colours on printed documents ------------------- */
/* A scrap of letterhead under the colour pickers, so a colour is chosen by
   looking at a letterhead rather than at a swatch. Paper is white whatever the
   screen is doing, so the sample is white in the dark theme as well. */
.doc-sample {
  margin: 4px 0 14px; padding: 14px 18px; max-width: 420px;
  background: #fff; color: #000; border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
.doc-sample-name { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--doc-ink); }
.doc-sample-tag { font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  margin-top: 3px; min-height: 12px; color: var(--doc-title); }
.doc-sample-title { font-size: 20px; font-weight: 700; text-align: right; margin-top: 6px;
  color: var(--doc-title); }
.doc-sample-contact { font-size: 12px; color: #000; }
.doc-sample-contact i { font-style: normal; margin-inline-end: 4px; color: var(--doc-detail); }
/* A colour field is a swatch, not a text box: the full-width field every other
   input gets turned it into a long coloured bar. */
.field input[type="color"] { width: 64px; height: 36px; padding: 3px; cursor: pointer; }


/* ============================== Polish ================================= */
/* The things that made the screens look assembled rather than designed:
   headings that could not sort, filter bars that did not say they were
   filters, fields that stood at different heights because their labels were
   different lengths, figures broken over two lines, a list of approvers
   squeezed to one line and a half. Kept together, after everything else, so
   each rule here wins over the older one it corrects. */

/* ---- Every table sorts by its headings ---- */
table.grid thead th.sortable { cursor: pointer; user-select: none; }
table.grid thead th.sortable::after {
  content: "\2195"; display: inline-block; margin-inline-start: 5px;
  font-size: 11px; line-height: 1; opacity: .3; transform: translateY(-1px);
}
table.grid thead th.sortable:hover { color: var(--text); }
table.grid thead th.sortable:hover::after { opacity: .75; }
table.grid thead th[aria-sort="ascending"]::after { content: "\25B2"; opacity: 1; color: var(--brand); font-size: 9px; }
table.grid thead th[aria-sort="descending"]::after { content: "\25BC"; opacity: 1; color: var(--brand); font-size: 9px; }
table.grid thead th[aria-sort="ascending"], table.grid thead th[aria-sort="descending"] { color: var(--text); }
table.grid thead th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ---- A row that opens something looks as if it does ---- */
table.grid tbody tr.clickable:hover > td { background: var(--brand-soft); }
table.grid tbody tr.clickable > td:first-child { position: relative; }
table.grid tbody tr.clickable:hover > td:first-child::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 3px; background: var(--brand-pure);
}

/* ---- Figures, dates and numbers stay on one line ---- */
.nowrap, table.grid td.num, table.grid td.nowrap { white-space: nowrap; }

/* ---- Filter bars ---- */
.filters.filter-bar { align-items: flex-start; column-gap: 12px; row-gap: 12px; }
.filter-badge {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  margin-top: 20px; height: 34px; padding: 0 12px;
  border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand);
  /* In the same case as every other label and button: in capitals it was the
     one word on the page shouting. */
  font-size: var(--fs-sm); font-weight: var(--fw-bold); letter-spacing: 0; text-transform: none;
}
.filter-badge svg { flex: 0 0 auto; }
/* On a phone the badge has a row of its own. The drop that lines it up with
   the labelled fields beside it on a desk left an empty band at the top of
   every filter card instead. */
@media (max-width: 720px) {
  .filter-badge { margin-top: 0; }
  /* Folded until asked for (core.js markFilterBar): the badge alone, with an
     arrow that says it opens. */
  .filters.filter-bar:not(.open) > :not(.filter-badge) { display: none; }
  .filters.filter-bar .filter-badge { cursor: pointer; }
  .filters.filter-bar .filter-badge::after { content: "\25BE"; margin-inline-start: 2px; }
  .filters.filter-bar.open .filter-badge::after { content: "\25B4"; }
}
.filters.filter-bar > button, .filters.filter-bar > .btn {
  margin-top: 20px; align-self: flex-start; height: 34px;
}
.filters.filter-bar > .check-field {
  margin-top: 20px; height: 34px; display: flex; align-items: center; gap: 6px;
}
.filters.filter-bar .field .hint { max-width: 280px; }
/* Excel, PDF and Print sit apart from Apply, at the far end of the bar. */
.filters.filter-bar > .btn-primary + button:not(.btn-primary) { margin-inline-start: auto; }

/* ---- Choosing a period ---- */
.period-presets { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }
.period-presets .preset {
  height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12px;
  /* The choices not taken stay quiet - plain words, no frame - so the one in
     force is what the eye finds, and the row stops competing with the figures. */
  background: transparent; border-color: transparent; color: var(--text-dim);
  font-weight: var(--fw-medium); box-shadow: none;
}
.period-presets .preset:not(.active):hover {
  background: var(--brand-soft); color: var(--brand); border-color: transparent;
}
.period-presets .preset.active {
  background: var(--brand-fill); border-color: var(--brand-fill); color: #fff;
}
.period-filter .period-presets-field { flex: 0 1 auto; min-width: 0; }
.period-card { margin-bottom: 14px; }

/* ---- Forms: labels, fields and hints each on their own line across a row ----
   A two-line label pushed its field down, and the row of fields came out at
   three heights. Each field now takes three rows of the form's own grid -
   label, control, hint - so every label, and so every box, lines up. */
@supports (grid-template-rows: subgrid) {
  .form-grid > .field:not(.check-field):not(:has(> :nth-child(4))) {
    display: grid; grid-row: span 3; grid-template-rows: subgrid;
    row-gap: 4px; align-content: start;
  }
  .form-grid > .field:not(.check-field) > label { align-self: end; }
  .form-grid > .check-field { grid-row: span 3; align-self: start; padding-top: 24px; }
}

/* ---- A list to choose several from shows several ---- */
.field select[multiple] { height: auto; min-height: 88px; padding: 4px; }
.field select[multiple] option { padding: 3px 6px; border-radius: var(--r-sm); }

/* ---- The way back from a line that was opened ---- */
.page-back {
  flex: 0 0 auto; white-space: nowrap; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis;
}

/* The front page's quick buttons no longer have anything after them. */
.quick-create:last-child { border-inline-end: 0; padding-inline-end: 0; margin-inline-end: 0; }
/* ---- The menu's icons are drawn, not typed ---- */
.nav a[style*="--nav-icon"]::before {
  content: ""; flex: 0 0 16px; width: 16px; height: 16px;
  background: var(--side-muted); opacity: .9;
  -webkit-mask: var(--nav-icon) center / 16px 16px no-repeat;
  mask: var(--nav-icon) center / 16px 16px no-repeat;
}
.nav a[style*="--nav-icon"]:hover::before,
.nav a.active[style*="--nav-icon"]::before { background: #fff; opacity: 1; }
#app.rail .nav a[style*="--nav-icon"]::before {
  width: 18px; height: 18px; flex-basis: 18px;
  -webkit-mask-size: 18px 18px; mask-size: 18px 18px;
}
/* Icons inside the page - the report groups, the filter badge. */
svg.ico { flex: 0 0 auto; vertical-align: -3px; }
.card-head h2 svg.ico { margin-inline-end: 8px; color: var(--brand); vertical-align: -2px; }
/* The signed-in person's name, faintly across every screen (auth.js). */
#screenMark { position: fixed; inset: 0; pointer-events: none; z-index: 2147483000;
  background-repeat: repeat; }
@media print { #screenMark { display: none; } }

/* ---------------------- Design review, 13 October 2026 ----------------------
   On a phone the buttons in the top bar are pressed with a thumb: 44 px, the
   size a finger can hit without catching its neighbour. */
@media (max-width: 720px) {
  .topbar .icon-btn, .topbar .lang-toggle, .topbar .theme-toggle {
    min-width: 44px; min-height: 44px;
  }
}
/* Seven of those and their gaps come to 380px: on a 375px phone the seventh, the
   theme, went down to a line of its own. Narrower by a little, the same height,
   and the back button still fits beside them. */
@media (max-width: 400px) {
  .topbar { column-gap: 4px; padding-inline: 8px; }
  .topbar .icon-btn, .topbar .lang-toggle, .topbar .theme-toggle { min-width: 40px; }
}
/* Arabic letters carry less ink than Latin ones at the same size, so an
   Arabic screen set at the English sizes read a size smaller. One pixel up,
   on every size the screens are built from. */
:root[dir="rtl"] { --fs-xs: 13px; --fs-sm: 14px; --fs-base: 15px; --fs-md: 16px; }
[dir="rtl"] body { font-size: 15px; }

/* An icon that points a way turns round on an Arabic page (core.js MIRRORED_ICONS). */
[dir="rtl"] svg.ico-dir, [dir="rtl"] .nav a.ico-dir::before { transform: scaleX(-1); }

/* ---------------- Settings in tabs, approvals as short lines ----------------
   (Ahmad, 15 October 2026) The settings were one page of fifteen cards; the
   approvals seventeen rows of two lists of every person each. */
.set-tabs {
  position: sticky; top: -20px; z-index: 6; flex-wrap: wrap; padding: 0 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.set-tabs button { padding: 12px 14px; }
.set-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-inline-start: 6px; vertical-align: 2px; }
.set-pane[hidden] { display: none; }

.ap-overview { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-dim); font-size: var(--fs-sm); }
.ap-overview.on { background: var(--brand-soft); border-color: var(--accent-line);
  color: var(--brand-dark); font-weight: var(--fw-medium); }
.ap-row + .ap-row { border-top: 1px solid var(--border); }
.ap-line { display: grid; grid-template-columns: minmax(150px, 210px) minmax(170px, 220px) 1fr auto;
  grid-template-areas: "doc mode sum open"; gap: 12px; align-items: center; padding: 10px 16px; }
.ap-doc { grid-area: doc; font-weight: var(--fw-bold); }
.ap-mode { grid-area: mode; width: 100%; }
.ap-sum { grid-area: sum; font-size: var(--fs-sm); min-width: 0; }
.ap-open { grid-area: open; }
.ap-open[hidden] { display: none; }
.ap-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 24px; padding: 12px 16px 14px; background: var(--surface-2);
  border-top: 1px dashed var(--border); }
.ap-detail[hidden], .ap-part[hidden] { display: none; }
.ap-label { display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium);
  color: var(--text-dim); margin-bottom: 5px; }
.ap-amount { display: flex; align-items: center; gap: 8px; }
.ap-amount-in { max-width: 180px; direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }
.ap-cur { color: var(--text-dim); font-size: var(--fs-sm); }
.ap-big { align-self: end; }
.ap-big button { background: none; border: none; padding: 6px 0; color: var(--brand);
  font-weight: var(--fw-medium); cursor: pointer; }
.ap-big button:hover { text-decoration: underline; }
.ap-big button[hidden] { display: none; }
.ap-warn { grid-column: 1 / -1; font-size: var(--fs-sm); }
.ap-warn:empty { display: none; }
.ap-warn .btn-sm { margin-top: 6px; }

.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pp-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px;
  padding-inline-start: 10px; border-radius: var(--r-pill); background: var(--brand-soft);
  color: var(--brand-dark); font-size: var(--fs-sm); }
.pp-chip button { border: none; background: none; color: inherit; width: 20px; height: 20px;
  padding: 0; border-radius: 50%; line-height: 1; font-size: 15px; cursor: pointer; }
.pp-chip button:hover { background: rgba(16, 43, 54, .1); }
.pp-chip.pp-warn { background: var(--amber-soft); color: var(--amber); }
.pp-none { color: var(--text-dim); font-size: var(--fs-sm); }
.pp-add { max-width: 240px; }
.pp-add[hidden] { display: none; }

@media (max-width: 760px) {
  .ap-line { grid-template-columns: 1fr auto; grid-template-areas: "doc open" "mode mode" "sum sum"; }
  .set-tabs { top: -12px; }
  .set-tabs button { padding: 10px; }
}

/* Cash forecast (18 October 2026): the accounts counted, and a table whose
   first column stays put while thirteen weeks scroll past it. */
.cf-accs { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.cf-acc { display: inline-flex; align-items: center; gap: 8px; }
.cf-acc .muted { font-variant-numeric: tabular-nums; }
.cf-table td:first-child, .cf-table th:first-child {
  position: sticky; left: 0; z-index: 1; white-space: nowrap; background: var(--surface); }
.cf-table thead th:first-child { z-index: 2; background: var(--surface-2); }
.cf-table .group-row td:first-child { background: var(--surface-2); }
[dir="rtl"] .cf-table td:first-child, [dir="rtl"] .cf-table th:first-child { left: auto; right: 0; }
.cf-table td.num, .cf-table th.num { white-space: nowrap; }
.cf-seen { display: flex; gap: 10px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.cf-switch { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 8px; }
.cf-act { white-space: nowrap; }
.cf-act .btn-sm + .btn-sm { margin-inline-start: 4px; }
.cf-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Print, Excel and PDF as small pictures (core.js iconizeExports): the file
   kinds as people know them - a sheet with a green XLS or a red PDF band -
   and the printer, on no frame of their own until the pointer is over one. */
.btn-export {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; min-width: 40px; height: 38px; padding: 0; line-height: 0;
  background: transparent; border-color: transparent; box-shadow: none;
}
.btn-export.btn-sm { width: 34px; min-width: 34px; height: 32px; }
.btn-export .file-ico { width: 28px; height: 28px; }
.btn-export.btn-sm .file-ico { width: 24px; height: 24px; }
.btn-export-ink { color: var(--text-dim); }
.btn-export:hover, .btn-export:focus-visible {
  background: var(--surface-2); border-color: var(--border);
}
.btn-export:hover .file-ico { transform: translateY(-1px); }
.btn-export-ink:hover { color: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
  .btn-export .file-ico { transition: transform .12s ease; }
}
/* The three sit together at the end of a filter bar. */
.filters .btn-export + .btn-export { margin-inline-start: -4px; }

/* Many reminders at once: one line per customer as each goes. */
.rem-log { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.rem-log li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.rem-log li.ok { color: var(--text); }

/* Company setup (setup.js): the steps down the side, the step beside them. */
.setup-wrap { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .setup-wrap { grid-template-columns: 1fr; } }
.setup-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.setup-rail button {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: start;
  padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; height: auto; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere; min-width: 0;
}
.setup-rail small { display: block; color: var(--text-dim); font-size: 12px; font-weight: normal; margin-top: 2px; }
.setup-rail .is-here button { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 169, 149, .12); }
.setup-n {
  flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--surface-2); color: var(--text-dim); font-weight: 700;
}
.setup-rail .is-done .setup-n { background: var(--brand-fill); color: #fff; }
.setup-nav { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.setup-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.setup-kind { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.setup-kind.is-chosen { border-color: var(--brand); background: var(--brand-soft); }
.setup-kind h3 { margin: 0 0 6px; font-size: 16px; }
.setup-kind p { margin: 0 0 8px; color: var(--text-dim); font-size: 13px; }
.setup-kind ul { margin: 6px 0; padding-inline-start: 18px; font-size: 12.5px; }
.setup-kind button { margin-top: 8px; }
.setup-logo { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.setup-logo .art-frame { width: 160px; height: 70px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: var(--r-md); }
.setup-logo .art-frame img { max-width: 150px; max-height: 64px; }
.setup-fact { padding: 6px 0; }

/* History: a clock in the top bar with the number of lines (attachments.js),
   and one line under the record with the last thing done. The number is grey:
   it counts, it does not call for attention. */
.history-btn { position: relative; }
.history-count {
  position: absolute; top: 0; inset-inline-end: -2px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 10px; font-weight: 700; line-height: 13px; text-align: center;
}
.history-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 16px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text-dim);
  font-size: var(--fs-sm, 13px);
}
.history-strip .ico { color: var(--text-dim); }
.history-strip .spacer { flex: 1; }
.history-table td:nth-child(2) { width: 100%; }
@media print { .history-strip, .history-btn { display: none; } }
/* Attachments: the files named under the record, each opening at a press. */
.attach-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 280px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); text-decoration: none;
}
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip:hover { border-color: var(--brand); color: var(--brand); }
.attach-table td:first-child { width: 100%; }
@media print { .attach-strip, #attachBtn { display: none; } }

/* Recently opened (auth.js): a list under its button in the top bar. */
.recent-panel {
  position: fixed; z-index: 60; width: 360px; max-width: calc(100vw - 16px);
  max-height: 70vh; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
.recent-head { padding: 6px 10px 8px; font-weight: 700; color: var(--text-dim); font-size: var(--fs-sm, 13px); }
.recent-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: none; border-radius: 8px; background: none; color: var(--text);
  text-align: start; cursor: pointer; font: inherit;
}
.recent-item:hover, .recent-item:focus-visible { background: var(--surface-2); }
.recent-item .ico { color: var(--brand); flex: none; }
.recent-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-when { color: var(--text-dim); font-size: 12px; flex: none; }
.recent-empty { padding: 10px; color: var(--text-dim); }
@media print { .recent-panel { display: none; } }

/* Since your last visit (ledger.js dashWhatsNew): one line on the front page. */
.whatsnew {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--border);
  border-inline-start: 3px solid var(--brand); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.whatsnew .ico { color: var(--brand); }
.whatsnew-lead { font-weight: 700; }
.whatsnew-people { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-dim); }
.whatsnew-people strong { color: var(--text); font-weight: 600; }
.whatsnew .spacer { flex: 1; }
.whatsnew-table td:nth-child(5) { width: 100%; }
@media print { .whatsnew { display: none; } }
/* The demonstration's Try card and sample-data notes stay on the screen. */
@media print { .vat-demo, .einv-sample { display: none !important; } }

/* Sending on WhatsApp (share.js). */
.whatsapp-btn .file-ico { width: 24px; height: 24px; }
.share-form .field + .field, .share-form .share-link-line { margin-top: 12px; }
.share-form textarea, .share-form input { width: 100%; }
.share-link-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.share-link-line .btn-sm { margin-inline-start: auto; }
.warn-text { color: var(--amber); }   /* --warn never existed; the fallback stayed dark brown in the dark theme */

/* Follow-ups on the customer's statement (followups.js). */
.follow-table td:nth-child(4) { width: 100%; }

/* The morning summary previewed as the email lays it out (reports.js). */
.morning-preview { background: #fff; color: #13343b; border-radius: 8px; padding: 12px; }

/* A long list of customers to tick, with a search above it (costrules.js). */
.pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; margin-top: 6px; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.pick-row:hover { background: var(--surface-2); }
.pick-row .muted { margin-inline-start: auto; font-size: 12px; }

/* A subscription's lines (subscriptions.js): room for a long description. */
.sub-lines td:nth-child(2) { width: 42%; }
.sub-lines textarea { width: 100%; min-width: 240px; }
.sub-lines .sub-item { min-width: 150px; max-width: 220px; }
.sub-lines input[type="number"] { width: 84px; }
.sub-lines input[type="text"] { width: 96px; }

/* Cheques written out (21 October 2026): the fields a payment shows when it is
   paid by cheque, the cheques under a payment, and a leaf's layout drawn to scale. */
.cheque-box:empty { display: none; }
.cheque-box { border-inline-start: 3px solid var(--brand-soft); padding-inline-start: 10px; margin-top: 4px; }
.cheque-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.layout-part { margin-top: 10px; }
.layout-preview { overflow-x: auto; padding: 6px 0; }
.leaf-preview { position: relative; background: #fbfdfd; border: 1px solid var(--line, #d5dde0);
  border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); color: #1b2b31; font-family: Arial, Tahoma, sans-serif;
  background-image: repeating-linear-gradient(0deg, transparent 0 calc(10% - 1px), #eef3f4 calc(10% - 1px) 10%); }
.leaf-preview .lp { position: absolute; white-space: nowrap; overflow: hidden; outline: 1px dotted var(--brand, #0f766e); }
.leaf-preview .lp.num { text-align: right; font-weight: 700; }
.leaf-preview .lp.cross { transform: rotate(-28deg); transform-origin: left top; border-top: 1px solid #1b2b31;
  border-bottom: 1px solid #1b2b31; font-size: 70%; font-weight: 700; outline: none; padding: 1px 6px; }

/* ==========================================================================
   One design language for every screen (Ahmad, 28 October 2026: "بلش فيهم
   كلهم و فرجيني قبل و بعد"). The sign-in screen set the tone - rounder
   corners, soft depth, a teal gradient on the button that matters, a touch
   of gold - and this carries it to the rest: buttons, fields, cards, the
   page title, the menu, tables, empty lists and the wait for a page.
   ========================================================================== */
:root {
  --radius: 12px; --r-md: 8px; --r-lg: 10px;
  --shadow: 0 1px 2px rgba(16, 43, 54, .05), 0 6px 20px rgba(16, 43, 54, .06);
  /* Gold (named --gilt: --gold once meant teal here, and a guard keeps it
     retired), spent sparingly: the mark beside a page's title and where you are
     in the menu. The coins and the rising arrow on the sign-in drawing. */
  --gilt: #F2B441; --gilt-deep: #C98A22; --gilt-soft: #FDF3DC; --gilt-ink: #7A5408;
  --blue-soft: #E8F0FB; --blue-ink: #2F5FA8;
}
@media screen {
  :root[data-theme="dark"] {
    --shadow: 0 1px 2px rgba(0, 0, 0, .40), 0 6px 20px rgba(0, 0, 0, .30);
    --gilt-soft: #36290e; --gilt-ink: #f2bd57;
    --blue-soft: #16253a; --blue-ink: #8db4ef;
  }
}

/* All of it on screen only: paper keeps its own rules (the print block above),
   so a printed report gains no drawings and no roomier rows (Codex). */
@media screen {
/* Buttons: the same corners as the fields, a gentle change on hover, and the
   one button that matters on a screen in the sign-in's teal gradient. */
button, .btn {
  border-radius: var(--r-md);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #00897A, #00695E); border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 119, 106, .22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #00957F, #005F55); border-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 119, 106, .28); transform: translateY(-1px);
}
.btn-primary:active { transform: none; box-shadow: 0 2px 6px rgba(0, 119, 106, .22); }
@media (prefers-reduced-motion: reduce) { .btn-primary:hover { transform: none; } }

/* Fields: the same corners, a touch taller in a form. */
input, select, textarea {
  border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.field input, .field select { height: 36px; }

/* Cards: rounder (the radius token), a softer shadow (the shadow token), and
   a little more air in the heading. */
.card-head { padding: 13px 18px; }

/* The mark beside every page's title, in gold. */
.topbar h1::before { background: linear-gradient(180deg, var(--gilt), var(--gilt-deep)); width: 4px; }

/* The menu: each entry a rounded pill set in from the edge; where you are
   keeps the teal and gets a gold edge, drawn inside the pill. */
.nav a { margin: 1px 8px; padding: 7px 10px; border-radius: 10px; border-left-color: transparent; }
.nav a.active { border-left-color: transparent; box-shadow: inset 3px 0 0 var(--gilt); }
[dir="rtl"] .nav a { border-right-color: transparent; }
[dir="rtl"] .nav a.active { border-right-color: transparent; box-shadow: inset -3px 0 0 var(--gilt); }
/* Folded to its icons, the pill sits centred in the rail: no edge to make room for. */
#app.rail .nav a { margin: 1px 6px; border-left-width: 0; border-right-width: 0; }

/* Tables: a calmer heading (no capitals, which Arabic does not have anyway),
   a little more room in a row, and the row under the mouse in the brand's
   pale teal. */
table.grid thead th { text-transform: none; letter-spacing: .2px; font-weight: var(--fw-bold);
  font-size: 12px; padding: 10px 14px; }
table.grid tbody td { padding: 10px 14px; }
table.grid tbody tr:hover { background: var(--brand-soft); }
.pinned-grid table.grid tbody tr:hover td.pinned { background: var(--brand-soft); }

/* An empty list: a small drawing above the sentence, in the sign-in's
   colours, instead of a line of grey text alone. */
.empty::before {
  content: ""; display: block; width: 112px; height: 84px; margin: 0 auto 10px;
  background: url("/static/assets/empty-state.svg") center / contain no-repeat;
}
.empty { color: var(--text-dim); }

/* The wait for a page: the shape of a page in soft grey, gently moving, in
   place of a word (core.js, the route loader). */
.loading.skeleton { padding: 4px 0; text-align: start; }
.skeleton .sk-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px;
  margin-bottom: 18px; }
.skeleton .sk {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 37%, var(--border) 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite;
}
.skeleton .sk-kpi { height: 112px; }
.skeleton .sk-bar { height: 52px; margin-bottom: 14px; }
.skeleton .sk-card { height: 320px; }
@keyframes sk-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton .sk { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The front page's four figures each wear a small icon in a tile. */
.kpi .kpi-icon, .metric .kpi-icon {
  position: absolute; top: 14px; inset-inline-end: 14px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
}
.kpi .kpi-icon svg, .metric .kpi-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.kpi .kpi-icon.is-gold, .metric .kpi-icon.is-gold { background: var(--gilt-soft); color: var(--gilt-ink); }
.kpi .kpi-icon.is-ink, .metric .kpi-icon.is-ink { background: var(--surface-2); color: var(--text-dim); }
.kpi .kpi-label { padding-inline-end: 42px; }
@media (max-width: 560px) {
  .kpi .kpi-icon { width: 28px; height: 28px; top: 10px; inset-inline-end: 10px; border-radius: 8px; }
  .kpi .kpi-icon svg { width: 15px; height: 15px; }
  .kpi .kpi-label { padding-inline-end: 34px; }
}
/* The head of the menu, the way the sign-in names the product: the mark beside
   both names, the company in a soft pill under them. Lower than the stacked
   block it replaces, so more of the menu shows. */
.brand { align-items: stretch; text-align: start; padding: 14px 14px 12px; }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; }
.brand-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.brand-name { font-size: 15px; letter-spacing: 3.5px; margin-top: 0; padding-left: 0; }
.brand-name-ar { font-family: "Tajawal", var(--font-ui); font-weight: 700; font-size: 17px;
  color: #8FF0E0; margin-top: 4px; }
.brand-sub { max-width: none; margin-top: 11px; padding: 5px 10px; border-top: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .06); color: var(--side-text); font-size: 11.5px; text-align: center; }
#app.rail .brand-row { justify-content: center; }
#app.rail .brand-names { display: none; }
#app.rail .brand-mark { width: 34px; height: 34px; }

/* Modals and the notes that pop up: the same corners and depth as the cards. */
.modal-backdrop { background: rgba(16, 43, 54, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* Not overflow: hidden - a list that drops out of a field in a modal would be cut at its edge. */
.modal { border-radius: 16px; box-shadow: 0 24px 60px rgba(16, 43, 54, .28); }
.modal-head { padding: 15px 20px; }
.modal-head h2 { font-weight: var(--fw-bold); }
.modal-foot { padding: 12px 20px; border-radius: 0 0 16px 16px; }
.toast { border-radius: 12px; box-shadow: 0 14px 34px rgba(16, 43, 54, .24); }
/* The line across the top of an invoice: who, how much, what is left, where
   it stands (trading.js). */
.doc-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  margin: -4px 0 16px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); border: 1px solid var(--border); }
.doc-hero > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.doc-hero-label { font-size: 11.5px; color: var(--text-dim); font-weight: var(--fw-medium); }
.doc-hero-party { flex: 1 1 220px; }
.doc-hero-party strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-hero-figure strong { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.doc-hero-figure strong.neg { color: var(--red); }
.doc-hero-status { margin-inline-start: auto; }
.doc-hero-sub { display: block; margin-top: 2px; font-size: 11.5px; font-weight: var(--fw-normal);
  color: var(--text-faint); letter-spacing: 0; }
.kpi-spark.is-flat .line { stroke: var(--accent); }
.kpi-spark.is-flat .area { fill: var(--accent); }
/* A phone: the page's title gets a row of its own - beside six icons it was
   cut to "Go..." - and the four figures fit their cards, currency and all. */
@media (max-width: 560px) {
  /* A row of tabs wider than the phone wraps to a second row: scrolled
     sideways, the last tab sat past the edge with nothing to say so (28/10). */
  .tabs { flex-wrap: wrap; row-gap: 0; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; }
  .topbar .title-block { order: 8; flex: 1 1 100%; }
  .kpi .kpi-value { font-size: 18px; letter-spacing: -.4px; }
  .kpi .kpi-value .cur { margin-left: 4px; }
  [dir="rtl"] .kpi .kpi-value .cur { margin-left: 4px; margin-right: 0; }
}
/* A wide screen with a long row of buttons (an invoice carries eight): the
   date line gave way without clipping, and its words ran under the page's
   title. It now yields first and is cut at its own edge; the title keeps its
   room. A phone puts the date on a row of its own already. */
@media (min-width: 721px) {
  .today-line { flex: 0 1000 auto; overflow: hidden; }
  /* Out of the row, not only out of sight: hidden, it still held 331-468px
     and the page's title was cut beside empty space - "Treasury Accou…"
     (sweep, 29 October 2026). auth.js measures it again as the bar changes. */
  .today-line.squeezed { display: none; }
}
/* Status badges: a dot before the word and a colour each - draft amber,
   registered blue, posted green, cancelled red - so a list reads at a glance.
   Only a word that means cancelled is struck through: the red chip also says
   "urgent", "overdue", "expired", and those were struck too (Ahmad, 28/10). */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px 2px 8px;
  white-space: nowrap; font-family: var(--font-ui); }
.chip-draft::before, .chip-registered::before, .chip-posted::before, .chip-cancelled::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.chip-registered { background: var(--blue-soft); color: var(--blue-ink); }
.chip-struck { text-decoration: line-through; text-decoration-thickness: 1px; }

/* The quick-create buttons on the front page carry their icons. */
.quick-create .btn { gap: 6px; }
.qc-ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* The menu's search: a clearer box, and the entry Enter would open marked as
   the menu marks where you are. */
.nav-find input { border-radius: 10px; }
.nav a.search-pick { background: rgba(0, 169, 149, .22); color: #fff; box-shadow: inset 3px 0 0 var(--gilt); }
[dir="rtl"] .nav a.search-pick { box-shadow: inset -3px 0 0 var(--gilt); }
.nav.searching .nav-group { font-size: 11px; letter-spacing: .4px; opacity: .75; }

/* All Reports: each report a card of its own with its module's icon, Excel
   and PDF to hand, the whole card opening it. */
.report-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.report-tile { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; min-height: 58px; }
.report-tile:hover, .report-tile:focus-visible { border-color: var(--brand); box-shadow: 0 6px 18px rgba(16, 43, 54, .08);
  transform: translateY(-1px); outline: none; }
.report-tile-ico { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.report-tile-ico svg { width: 17px; height: 17px; }
.report-tile-name { flex: 1 1 auto; min-width: 0; font-weight: var(--fw-medium); line-height: 1.3; }
.report-tile-actions { display: flex; gap: 4px; flex: 0 0 auto; opacity: .55; transition: opacity .15s ease; }
.report-tile:hover .report-tile-actions, .report-tile:focus-within .report-tile-actions { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .report-tile:hover { transform: none; } }

/* Compact rows, each person's choice (the rows button in the top bar). */
:root[data-density="compact"] table.grid tbody td { padding: 5px 10px; }
:root[data-density="compact"] table.grid thead th { padding: 7px 10px; }
:root[data-density="compact"] table.grid { font-size: 13px; }
.density-toggle { padding: 0; width: 34px; justify-content: center; }
.density-toggle svg { width: 16px; height: 16px; }
.density-toggle.is-on { color: var(--brand); background: var(--brand-soft); }
.metric { position: relative; }
.metric:has(.kpi-icon) .label { padding-inline-end: 42px; }

/* A long invoice: while the lines run past the screen, the net total waits
   at its foot as one thin strip; scrolled down to it, the whole box is back
   (documents.js; the card is clipped, not scrolled, so the box can stick;
   -20px undoes .content's padding). The box keeps its size when stuck - only
   hidden, and see-through to the lines - or it would jump in and out of
   being stuck. A browser that cannot tell "stuck" keeps the box where it was. */
@supports (container-type: scroll-state) {
  .card:has(#invTotal) { overflow: clip; }
  .card-body:has(> .doc-totals #invTotal) {
    position: sticky; bottom: -20px; z-index: 5; container-type: scroll-state; pointer-events: none;
  }
  @media (max-width: 720px) { .card-body:has(> .doc-totals #invTotal) { bottom: -12px; } }
  #docTotalsForm, .doc-totals:has(#invTotal) { pointer-events: auto; }
  @container scroll-state(stuck: bottom) {
    /* Table rows do not take the query's styles, so the box is clipped to
       its last 42px - the net total's row - instead of its rows hidden. */
    #docTotalsForm { visibility: hidden; }
    .doc-totals:has(#invTotal) { pointer-events: none; position: relative; z-index: 0;
      clip-path: inset(calc(100% - 42px) -16px -16px -16px); }
    .doc-totals:has(#invTotal)::before {
      content: ''; position: absolute; z-index: -1; inset-inline: -16px; bottom: -16px; height: 58px;
      background: var(--surface); border-top: 1px solid var(--border);
      box-shadow: 0 -10px 24px rgba(16, 43, 54, .08);
    }
    /* A paper in another currency: its line in the books' currency (20px)
       stays in the strip under the net total (15 November 2026). */
    .doc-totals:has(#invTotal):has(tr.fx-equiv:not([hidden])) { clip-path: inset(calc(100% - 62px) -16px -16px -16px); }
    .doc-totals:has(#invTotal):has(tr.fx-equiv:not([hidden]))::before { height: 78px; }
  }
}
.doc-totals tr.grand td { font-size: 17px; font-weight: var(--fw-bold); color: var(--brand); }
.doc-totals tr.fx-equiv td { padding: 0 10px 4px; height: 20px; box-sizing: border-box; font-size: 12px;
  line-height: 16px; font-weight: var(--fw-normal); color: var(--text-faint); }

/* The one search for everything (cmdk.js, Ctrl+K). */
.cmdk-shade { position: fixed; inset: 0; z-index: 300; background: rgba(16, 43, 54, .38);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk { width: 100%; max-width: 620px; background: var(--surface); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(16, 43, 54, .35); overflow: hidden; border: 1px solid var(--border); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cmdk-input svg { width: 20px; height: 20px; fill: none; stroke: var(--text-faint); stroke-width: 2; stroke-linecap: round; flex: 0 0 auto; }
.cmdk-input input { border: 0; box-shadow: none; padding: 6px 0; font-size: 16px; background: transparent; }
.cmdk-input input:focus { box-shadow: none; }
.cmdk-input input::-webkit-search-cancel-button { display: none; }
.cmdk-input kbd { font: inherit; font-size: 11px; color: var(--text-faint); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; }
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11.5px; font-weight: var(--fw-bold); color: var(--text-faint); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cmdk-item.is-at { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--gilt); }
[dir="rtl"] .cmdk-item.is-at { box-shadow: inset -3px 0 0 var(--gilt); }
.cmdk-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-note { flex: 0 0 auto; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.cmdk-empty { padding: 18px; text-align: center; color: var(--text-faint); }

/* The new company's wizard: where you are marked in gold, a chosen kind of
   business lifted and ticked. */
.setup-rail button { border-radius: var(--r-lg); transition: border-color .15s ease, box-shadow .15s ease; }
.setup-rail .is-here button { box-shadow: inset 3px 0 0 var(--gilt), 0 0 0 3px rgba(0, 169, 149, .12); }
[dir="rtl"] .setup-rail .is-here button { box-shadow: inset -3px 0 0 var(--gilt), 0 0 0 3px rgba(0, 169, 149, .12); }
.setup-kind { border-radius: var(--r-lg); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; position: relative; }
.setup-kind:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(16, 43, 54, .08); transform: translateY(-1px); }
.art-frame .muted { color: #5b7079; }   /* the frame is always light; the dark theme's faint grey vanished on it */
.setup-kind.is-chosen::after { content: "✓"; position: absolute; top: 10px; inset-inline-end: 12px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand-fill); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .setup-kind:hover { transform: none; } }
/* On a phone a small button was 25px tall - a thumb missed it. Everything a
   finger presses is at least 32px there; the text stays the same size, so a
   table row grows a little and nothing else moves (28/10). */
@media (max-width: 720px) {
  .btn-sm, .icon-btn, .pw-peek, .auth-link, a.btn { min-height: 32px; }
  .btn-sm { padding-block: 5px; }
  /* min-height does nothing on an inline box, and a link drawn as a small button
     is one. */
  a.btn-sm { display: inline-flex; align-items: center; }
  /* A link in a sentence: padding on an inline box grows what a thumb can hit and
     moves nothing around it. No weight of its own, so any class that sets its own
     padding wins (3 November 2026, the crawl's links under 28px). */
  :where(.content) a:where(:not(.btn, .btn-sm)) { padding-block: 6px; }
  /* Figure tiles (.metrics: employees, treasury, schedules) stood one under
     the other on a phone, each a wide box with one number in it; two across,
     as the front page's are. */
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metrics .metric { padding: 12px; }
  .metrics > .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* The update bar: its words above its two buttons, not squeezed beside them
     one word to a line. */
  .update-bar { flex-wrap: wrap; width: calc(100vw - 24px); max-width: none; }
  .update-bar span { flex: 1 1 100%; }
  /* Esc is not a key a phone has. */
  .cmdk-input kbd { display: none; }
  /* A wide table scrolls inside its card. No column is squeezed to a letter a
     line, and a shadow at the edge says there is more that way; it fades out
     when the edge is reached (the two near gradients scroll with the table). */
  table.grid th, table.grid td { min-width: 64px; }
  table.lines { min-width: 720px; }
  .table-wrap {
    background:
      linear-gradient(to right, var(--surface) 40%, rgba(255, 255, 255, 0)) 0 0 / 36px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 40%, rgba(255, 255, 255, 0)) 100% 0 / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(16, 43, 54, .22), rgba(16, 43, 54, 0)) 0 0 / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(16, 43, 54, .22), rgba(16, 43, 54, 0)) 100% 0 / 14px 100% no-repeat scroll;
  }
  table.grid, table.lines { background: transparent; }
  /* The first column stays while the rest scrolls, so a figure found far to
     the right still has its number or its name beside it. A table that pins
     its own columns (the payroll register) keeps its widths; a group row
     spanning the table is left alone. */
  .table-wrap:not(.pinned-grid) table.grid:not(:has(td:first-child input[type="checkbox"])) th:first-child,
  .table-wrap:not(.pinned-grid) table.grid:not(:has(td:first-child input[type="checkbox"])) td:first-child:not([colspan]) {
    position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface);
    max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    box-shadow: 1px 0 0 var(--border-strong);
  }
  [dir="rtl"] .table-wrap:not(.pinned-grid) table.grid:not(:has(td:first-child input[type="checkbox"])) th:first-child,
  [dir="rtl"] .table-wrap:not(.pinned-grid) table.grid:not(:has(td:first-child input[type="checkbox"])) td:first-child:not([colspan]) {
    box-shadow: -1px 0 0 var(--border-strong);
    /* A code cell runs left to right (.mono), and its "inline start" was the
       left edge: the first column stuck to the wrong side (sweep, 29/10). */
    right: 0; left: auto;
  }
  .table-wrap:not(.pinned-grid) table.grid:not(:has(td:first-child input[type="checkbox"])) thead th:first-child,
  .table-wrap:not(.pinned-grid) table.grid:not(:has(td:first-child input[type="checkbox"])) tfoot td:first-child { background: var(--surface-2); z-index: 3; }
}
} /* the screen-only design block */

/* Phones (sweep, 29 October 2026). The menu's "narrow" switch belongs to a
   desktop's side rail; on a phone the menu is a drawer and the switch was a
   22px strip to miss. The dialog's close button is a full fingertip wide. */
@media (max-width: 720px) {
  .rail-toggle { display: none; }
  .modal-head .icon-btn { min-width: 40px; min-height: 40px; }
}

/* A new journal entry on a phone: its lines as cards, the account across the
   top and the debit and credit side by side under it. As a table the two
   figures sat off the screen to one side (sweep, 29 October 2026); the
   boxes say what they are in their placeholders. */
@media (max-width: 720px) {
  #jeLines { min-width: 0 !important; width: 100%; }
  #jeLines thead { display: none; }
  #jeLines, #jeLines tbody { display: block; }
  #jeLines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    padding: 8px 0; border-bottom: 1px solid var(--border); }
  #jeLines td { display: block; padding: 0; border: none; width: auto !important; }
  #jeLines td:first-child, #jeLines td:has(> input[data-line="description"]) { grid-column: 1 / -1; }
  #jeLines td:last-child { grid-column: 1 / -1; justify-self: end; }
  #jeLines td select, #jeLines td input { width: 100%; }
}

/* The VAT return, drawn as the FTA's form VAT201 (9 November 2026, vatreturn.js):
   a band for each of its three parts, the box number in a chip, the figures on
   the decimal with a copy button each, a total row shaded as the form's is. */
.vat-due { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
  margin-top: 10px; font-size: var(--fs-base); }
.vat-due .hint { flex-basis: 100%; margin: 0; }
.vat-sec { margin: 14px 0 6px; padding: 7px 12px; border-radius: 6px; font-weight: var(--fw-bold);
  letter-spacing: .02em; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.vat-sec:first-child { margin-top: 0; }
table.vat-form td { vertical-align: middle; }
table.vat-form td.num { white-space: nowrap; }
.vat-box { display: inline-block; min-width: 30px; padding: 2px 7px; border-radius: 999px; text-align: center;
  font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; background: var(--surface-2);
  border: 1px solid var(--border); }
.vat-box.vat-flag { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.vat-fig { font-variant-numeric: tabular-nums; }
.vat-copy { padding: 2px 4px; margin-inline-start: 4px; vertical-align: middle; opacity: .55; }
.vat-copy:hover, .vat-copy:focus-visible { opacity: 1; }
td.vat-na { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); }
tr.vat-total td { font-weight: var(--fw-bold); background: var(--surface-2); }
.vat-open { margin-inline-start: 8px; font-size: 12px; white-space: nowrap; }
.vat-sub { font-size: 13px; margin: 16px 0 6px; }
.vat-note { margin-top: 12px; margin-bottom: 0; }
.vat-empty h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.vat-empty p { margin: 0 0 12px; max-width: 70ch; line-height: 1.6; }
.vat-empty .btn { margin-inline-end: 8px; }
.vat-source { margin-top: 4px; }
/* How a sales line at 0% is taxed sits under its rate, not beside it. */
#invLines td .vat-treat { display: block; width: 100%; margin-top: 4px; font-size: 12px; padding-inline: 4px; }
.vat-line-hint { margin: 6px 14px 0; }
.vat-self { text-align: end; margin: 6px 0 0; }
/* Trying the UAE VAT return in the public demonstration (9 November 2026). */
.vat-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.vat-demo-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.vat-demo-card .btn-primary { margin-top: 2px; }
.demo-bar a.demo-vat { font-weight: var(--fw-bold); }
/* The demonstration's ready UAE scenarios (10 November 2026): the whole list, its note inside the card. */
.vat-scenarios { scroll-margin-top: 96px; }
.vat-scenarios .table-wrap { max-height: none; overflow: visible; overflow-x: auto; }
.vat-scenarios .hint { margin: 10px 14px 12px; }
.vat-scenarios .card-body p { max-width: 80ch; line-height: 1.6; }

/* UAE e-invoicing (9 November 2026, einvoice.js) */
.einv-list { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.6; }
.einv-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.einv-rules summary { cursor: pointer; margin-top: 8px; }
.einv-sub { margin: 10px 0 0; font-size: 13px; }
/* ZATCA e-invoicing, phase 2 (14 November 2026, zatca.js) */
.zatca-doc { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.zatca-doc .details { flex: 1 1 380px; min-width: 0; }
.zatca-qr { width: 132px; height: 132px; background: #fff; border: 1px solid var(--border, #d0d7de); border-radius: 6px; padding: 4px; }
.zatca-qr-sm { width: 76px; height: 76px; background: #fff; border-radius: 4px; }
.zatca-msgs { margin: 8px 0 0; padding-inline-start: 20px; line-height: 1.55; font-size: 12.5px; }
.zatca-checks { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.zatca-card .btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }