/* ============================================================================
   Nocturne — FashionDot ERP design system
   Ported from the FashionDot Support redesign mockup.

   Everything is driven by CSS custom properties. Light/dark switches by
   setting  data-theme="light" | "dark"  on <body class="fd">, and the
   surface / corner / action feel by data-surface, data-corner, data-action.
   No colour is hard-coded outside the token blocks below.
   ========================================================================= */

/* ---------------------------------------------------------------- tokens */
.fd {
  /* base palette — dark is the default ground */
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  --color-neutral-100: #f3f5fe;
  --color-neutral-500: #9397ab;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  /* FashionDot orange — subtle-lighter pass requested over the original #d98d3a */
  --color-accent: #dca467;
  --color-accent-100: #fdf1e4;
  --color-accent-800: #5a3c17;
  --color-accent-2: #e0a24a;
  --color-accent-2-100: #fdf1e4;
  --color-accent-2-800: #5a3c17;

  --shadow-sm: 0 0 0 1px var(--color-neutral-800);
  --shadow-md: 0 0 0 1px var(--color-neutral-700), 0 6px 18px rgba(0, 0, 0, .55);
  --shadow-lg: 0 0 0 1px var(--color-neutral-500), 0 16px 40px rgba(0, 0, 0, .65);

  --font-heading: "Inter", system-ui, sans-serif;
  --font-heading-weight: 500;
  --font-body: "Inter", system-ui, sans-serif;

  --space-1: 2.8px;  --space-2: 5.6px;  --space-3: 8.4px;
  --space-4: 11.2px; --space-6: 16.8px; --space-8: 22.4px;

  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 14px;

  /* aliases the components read — all resolved from the tokens above */
  --bg: var(--color-bg);
  --bg-2: #12131c;
  --surface: var(--color-surface);
  --surface-2: color-mix(in srgb, var(--color-surface) 90%, white 4%);
  --surface-3: var(--color-neutral-800);
  --border: var(--color-divider);
  --border-2: var(--color-neutral-700);
  --text: var(--color-text);
  --text-2: color-mix(in srgb, var(--color-text) 70%, transparent);
  --text-3: color-mix(in srgb, var(--color-text) 50%, transparent);
  --accent: var(--color-accent);
  --accent-2: var(--color-accent-2);
  --accent-soft: color-mix(in srgb, var(--color-accent) 13%, transparent);
  --accent-line: color-mix(in srgb, var(--color-accent) 34%, transparent);

  /* semantic roles — Nocturne ships mono-accent, these extend it */
  --ok: #45c98a;     --ok-soft: color-mix(in srgb, #45c98a 14%, transparent);
  --warn: #e0a83c;   --warn-soft: color-mix(in srgb, #e0a83c 14%, transparent);
  --danger: #ef6b6b; --danger-soft: color-mix(in srgb, #ef6b6b 14%, transparent);
  --info: #6ea8f0;   --info-soft: color-mix(in srgb, #6ea8f0 14%, transparent);

  --shadow: var(--shadow-md);
  --hover: color-mix(in srgb, var(--color-text) 7%, transparent);
  --scrim: color-mix(in srgb, var(--color-neutral-900) 55%, transparent);

  --logo-plate: #f2f2f4;
  --logo-pad: 4px 7px;
  --logo-blend: normal;
  --logo-radius: var(--radius-sm);

  /* ink for text on a solid accent fill — clears both themes */
  --on-accent: #1a1b24;

  box-sizing: border-box;
}

.fd[data-theme="light"] {
  --color-bg: #f3f3f6;
  --color-surface: #ffffff;
  --color-text: #1a1b24;
  --color-divider: color-mix(in srgb, #1a1b24 12%, transparent);

  --color-neutral-100: #23242c;
  --color-neutral-500: #848693;
  --color-neutral-700: #c2c4cf;
  --color-neutral-800: #e2e3ea;
  --color-neutral-900: #f1f1f5;

  --color-accent: #d4924a;
  --color-accent-100: #8a5220;
  --color-accent-800: #f7e6d0;
  --color-accent-2: #a9691f;
  --color-accent-2-100: #8a5220;
  --color-accent-2-800: #f7e6d0;

  --shadow-sm: 0 1px 2px rgba(20, 20, 30, .06);
  --shadow-md: 0 1px 2px rgba(20, 20, 30, .05), 0 8px 20px rgba(20, 20, 30, .08);
  --shadow-lg: 0 2px 4px rgba(20, 20, 30, .06), 0 20px 44px rgba(20, 20, 30, .12);

  --bg-2: #ebebef;
  --surface-2: #f7f7f9;
  --surface-3: #eeeef3;
  --border-2: #d2d2dc;
  --text-2: color-mix(in srgb, var(--color-text) 68%, transparent);
  --text-3: color-mix(in srgb, var(--color-text) 48%, transparent);
  --accent-soft: color-mix(in srgb, var(--color-accent) 10%, transparent);
  --accent-line: color-mix(in srgb, var(--color-accent) 30%, transparent);

  --ok: #1f9d63;     --ok-soft: color-mix(in srgb, #1f9d63 10%, transparent);
  --warn: #b8791a;   --warn-soft: color-mix(in srgb, #b8791a 10%, transparent);
  --danger: #d64545; --danger-soft: color-mix(in srgb, #d64545 10%, transparent);
  --info: #2f6fd0;   --info-soft: color-mix(in srgb, #2f6fd0 10%, transparent);

  --hover: color-mix(in srgb, var(--color-text) 4%, transparent);
  --logo-plate: #ffffff;
  --logo-blend: multiply;
}

/* feel tweaks — flip these on <body> to retune the whole app */
.fd[data-surface="flat"]     { --shadow-sm: none; }
.fd[data-surface="elevated"] { --shadow-sm: var(--shadow-lg); }
.fd[data-corner="sharp"]     { --radius-sm: 2px; --radius-md: 4px;  --radius-lg: 6px; }
.fd[data-corner="round"]     { --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px; }
.fd[data-action="solid"] .fd-btn-primary {
  background: var(--color-accent); border-color: var(--color-accent); color: var(--on-accent);
}
.fd[data-action="solid"] .fd-btn-primary:hover  { filter: brightness(1.08); }
.fd[data-action="solid"] .fd-btn-primary:active { filter: brightness(.92); }

/* ------------------------------------------------------------------ base */
.fd *, .fd *::before, .fd *::after { box-sizing: border-box; }

html, body { height: 100%; }
body.fd {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}

/* Element resets are scoped to .fd-page — the wrapper ERP-authored pages use —
   so pages ported in from the standalone attendance app keep their own
   headings, links and images. Only the shell chrome below is styled globally. */
.fd-page h1, .fd-page h2, .fd-page h3,
.fd-page h4, .fd-page h5, .fd-page h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -.015em; margin: 0 0 var(--space-2);
}
.fd-page h1 { font-size: 22px; }
.fd-page h2 { font-size: 18px; }
.fd-page h3 { font-size: 16px; }
.fd-page h4 { font-size: 14px; }
.fd-page h5 { font-size: 13px; }
.fd-page h6 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.fd-page p  { margin: 0 0 var(--space-3); }
.fd-page a  { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
.fd-page a:hover { color: var(--accent-2); }
.fd-page img { display: block; max-width: 100%; }

/* shell links carry their own colour; this only kills the default underline */
.fd-rail a, .fd-side a, .fd-head a { text-decoration: none; }

.fd :focus { outline: none; }
.fd :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fd ::selection { background: var(--accent-soft); }

.fd ::-webkit-scrollbar { width: 9px; height: 9px; }
.fd ::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
.fd ::-webkit-scrollbar-track { background: transparent; }

.fd-text-muted { color: var(--text-3); }
.fd-text-2     { color: var(--text-2); }

/* THE TYPE STEPS, AS CLASSES.
 *
 * Rule 1 of the type pattern is that a page author writes the class, never the
 * number. Every step already has a class where a component owns it -- .fd-tag
 * is 11, .fd-table th is 12, an h4 is 14. These five are for the places no
 * component covers: a count under a pager, a hint under a field, the second
 * line in a table cell. Demo carried 267 hand-typed font-size declarations
 * before they existed, in seven different values.
 *
 * .fd-text-sub is .fd-text-muted and 11px in one class, because
 * class="fd-text-muted" style="font-size:11px" was typed 27 times in Demo
 * alone and is the single commonest shape of the fault.
 */
.fd-text-card  { font-size: 15px; }   /* card-title step, outside a card head */
.fd-text-lead  { font-size: 14px; }   /* lead-in, large secondary */
.fd-text-base  { font-size: 13px; }   /* the base, where something else moved it */
.fd-text-label { font-size: 12px; }   /* field label, small print */
.fd-text-note  { font-size: 11px; }   /* eyebrow, supporting line */
.fd-text-sub   { font-size: 11px; color: var(--text-3); }  /* 2nd line in a cell */
.fd-text-meta  { font-size: 10.5px; }  /* tiny meta -- the smallest step */

/* A Phosphor glyph sitting beside 13px text. 71 of Demo's 267 were this.
 *
 * NOT .fd-ico. That name is already the KPI tile's icon, which renders 17px
 * through `.fd-kpi .fd-ico` -- a bare `.fd-ico { font-size: 13px }` loses to it
 * inside a tile and wins everywhere else, so it would have shrunk any KPI icon
 * that had been lifted out of `.fd-kpi` on any of the 280 pages that load this
 * file. Caught by measuring the rendered page, not by reading the file.
 */
.fd-glyph      { font-size: 13px; }

/* Freestanding rules fade to transparent at both ends — a Nocturne signature. */
.fd-hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: linear-gradient(to right,
    transparent, var(--border) 48px,
    var(--border) calc(100% - 48px), transparent);
}

/* --------------------------------------------------------------- buttons */
.fd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 13px; line-height: 1.2; color: var(--text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);

  /* A label on one line, always. Buttons sit in flex rows -- toolbars, dialog
     actions, filter bars -- where the browser is free to shrink them below
     their content and break "Record purchase" over two lines, which makes one
     button taller than the one beside it and the whole row ragged. nowrap
     stops the break; flex: none stops the shrink that causes it. */
  white-space: nowrap;
  flex: none;
  min-height: 34px;
  vertical-align: middle;
}
/* The icon keeps its size when the row is tight, rather than squashing to a
   sliver and pulling the label off centre. */
.fd-btn > i { flex: none; line-height: 1; }
.fd-btn:disabled { opacity: .45; cursor: not-allowed; }
.fd-btn-primary { color: var(--accent); border-color: var(--accent); }
.fd-btn-primary:hover  { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fd-btn-primary:active { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.fd-btn-secondary { border-color: var(--border); }
.fd-btn-secondary:hover  { background: color-mix(in srgb, var(--text) 7%, transparent); }
.fd-btn-secondary:active { background: color-mix(in srgb, var(--text) 14%, transparent); }
/* The destructive variant. An outline rather than a filled red button: this
   sits next to New question and Import, and a solid red block in a toolbar
   draws the eye to the one control nobody should click by reflex. The colour
   is on the text and the border, so it reads as "careful" rather than "press
   me". --danger already flips between the two themes. */
.fd-btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.fd-btn-danger:hover  { background: var(--danger-soft); border-color: var(--danger); }
.fd-btn-danger:active { background: color-mix(in srgb, var(--danger) 22%, transparent); }

/* The constructive counterpart to .fd-btn-danger, and it exists for the same
   reason: some rows offer an undo and a destroy side by side -- Restore and
   Delete in the Recycle Bin -- and the pair only reads at a glance when the
   safe one is as clearly marked as the dangerous one. Outline, not filled, so
   it matches every other button in a toolbar. --ok already carries a value for
   both themes, right next to --danger. */
.fd-btn-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.fd-btn-ok:hover  { background: var(--ok-soft); border-color: var(--ok); }
.fd-btn-ok:active { background: color-mix(in srgb, var(--ok) 22%, transparent); }

/* Reversible, but the operator should look twice -- Hold, Cancel Order, Revoke.
   Between .fd-btn-ok and .fd-btn-danger in weight, and --warn already carries a
   value for both themes beside the other two. */
.fd-btn-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.fd-btn-warn:hover  { background: var(--warn-soft); border-color: var(--warn); }
.fd-btn-warn:active { background: color-mix(in srgb, var(--warn) 22%, transparent); }

.fd-btn-ghost { color: var(--accent); }
.fd-btn-ghost:hover  { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fd-btn-ghost:active { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* THE SIZE VARIANT, and it is the one the module was missing most.
   469 of the inline style= overrides on Support buttons were padding or
   font-size -- a labelled button in a table row, shrunk by hand, differently
   each time. One class instead, so a row of them agrees with itself. */
.fd-btn-sm { font-size: 12px; min-height: 28px; padding: 4px calc(var(--space-3) * .9); }
.fd-btn-icon  { width: 32px; height: 32px; padding: 0; }
.fd-btn-block { width: 100%; margin-top: var(--space-2); }

/* ----------------------------------------------------------------- forms */
.fd-field > label {
  display: block; font-size: 12px; margin-bottom: 5px; color: var(--text-2);
}
.fd-input {
  width: 100%; min-height: 34px; padding: 6px 10px; font: inherit; font-size: 13px;
  color: var(--text); caret-color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.fd-input:hover { border-color: color-mix(in srgb, var(--text) 45%, transparent); }
.fd-input:focus-visible { border-color: var(--accent); outline-offset: 0; }
textarea.fd-input { min-height: 90px; resize: vertical; }
select.fd-input { cursor: pointer; }

/* ----------------------------------------------------------------- cards */
.fd-card {
  display: flex; flex-direction: column; gap: var(--space-2);margin-top:20px;
  padding: var(--space-6); border-radius: var(--radius-md); background: var(--surface);
}
.fd-card-kicker {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.fd-card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 15px; line-height: 1.2;
}
.fd-card-body { margin: 0; font-size: 13px; opacity: .8; flex: 1; }
.fd-card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.fd-elev-sm { box-shadow: var(--shadow-sm); }
.fd-elev-md { box-shadow: var(--shadow-md); }
.fd-elev-lg { box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ tags */
.fd-tag {
  display: inline-flex; align-items: center; font-size: 11px; letter-spacing: .02em;
  padding: 3px 10px; border-radius: calc(var(--radius-md) * .75);
  /* "Last completed: Introduction" broke inside its own pill before this. */
  white-space: nowrap;
}
.fd-tag-accent  { background: var(--color-accent-800);   color: var(--color-accent-100); }
.fd-tag-neutral { background: var(--color-neutral-800);  color: var(--color-neutral-100); }
.fd-tag-outline { border: 1px solid var(--accent); color: var(--accent); }
.fd-tag-ok      { background: var(--ok-soft);     color: var(--ok); }
.fd-tag-warn    { background: var(--warn-soft);   color: var(--warn); }
.fd-tag-danger  { background: var(--danger-soft); color: var(--danger); }
.fd-tag-info    { background: var(--info-soft);   color: var(--info); }

/* ---------------------------------------------------------------- tables */
.fd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fd-table th {
  /* 12px, not 11. .fd-table-bar th was already 12 and the two disagreed with
     nothing to say which a new table should use; settled by the team on
     2026-09-10 -- see docs/ui-consistency-standard.md.

     What this line reaches: every table the design system is in charge of.
     Demo's .fd-table-head moves 11 -> 12; CRM's and Support's .fd-table-bar
     was 12 already. What it does NOT reach is a table whose page invented a
     class of its own -- .custom-gridview on CRM's Products and .custom-grid on
     Support's Software Task List both set 13px from a <style> block in the
     page and still win. Those are on the list to retire, and until they are,
     the heading size is settled in two of the four places it is set. */
  text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid transparent; white-space: nowrap;
}
.fd-table td { padding: var(--space-3) var(--space-2); border-bottom: 1px solid transparent; }
/* Row rules are painted on the row so the end-fade spans the whole row, not each cell. */
.fd-table thead tr {
  background: linear-gradient(to right,
    transparent, var(--border) 48px,
    var(--border) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.fd-table tbody tr {
  background: linear-gradient(to right,
    transparent, color-mix(in srgb, var(--text) 8%, transparent) 48px,
    color-mix(in srgb, var(--text) 8%, transparent) calc(100% - 48px), transparent)
    no-repeat bottom / 100% 1px;
}
.fd-table tbody tr:hover {
  background:
    linear-gradient(color-mix(in srgb, var(--text) 4%, transparent),
                    color-mix(in srgb, var(--text) 4%, transparent)) no-repeat 0 0 / 100% 100%,
    linear-gradient(to right,
      transparent, color-mix(in srgb, var(--text) 8%, transparent) 48px,
      color-mix(in srgb, var(--text) 8%, transparent) calc(100% - 48px), transparent)
      no-repeat bottom / 100% 1px;
}
.fd-table .fd-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- the solid-header variant
   A MODIFIER, not a replacement: class="fd-table fd-table-bar". The base still
   supplies the layout, the cell padding and fd-sel / fd-num / fd-act; this
   swaps the quiet header for a solid accent bar with white type.

   Why a modifier rather than editing .fd-table itself: that class is shared by
   Attendance, CRM and Demo, and changing it restyles three other people's
   modules from a Support decision. Opting in per table costs one token and
   decides nothing for anybody else.

   Lifted from .demo-grid in ServiceList.aspx, which is where this look already
   existed, minus three things that were page-specific and do not belong in a
   shared class:
     * table-layout: fixed   -- ServiceList sizes its columns from JS. Forcing
                                it here would collapse every auto-sized table.
     * display: none on rows -- that page's JS pagination hiding its own rows.
     * border-bottom: var(--info) -- an INFORMATIONAL-state colour used as a
                                rule, which is why those row lines read blue.
                                --border is the token for a border. Swap it
                                back on this one line if the blue was wanted. */
.fd-table-bar { border-collapse: separate; border-spacing: 0; }
.fd-table-bar th {
  background: var(--accent); color: var(--on-accent);
  padding: 12px 15px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
  border: none; border-right: 1px solid rgb(255 255 255 / .2);
  vertical-align: middle; transition: background .2s;
}
.fd-table-bar th:first-child { border-top-left-radius: 8px; }
.fd-table-bar th:last-child  { border-right: none; border-top-right-radius: 8px; }
/* The header bar replaces the base's gradient rules -- a fading hairline under
   a solid block of colour reads as a rendering fault. */
.fd-table-bar thead tr,
.fd-table-bar tbody tr { background-image: none; }
.fd-table-bar tbody td { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.fd-table-bar tbody tr:hover { background: var(--surface-2); }
/* Sortable headers: the affordance ServiceList had, kept because a solid bar
   invites a click in a way the quiet header does not. */
.fd-table-bar th.fd-sortable { cursor: pointer; }
.fd-table-bar th.fd-sortable:hover { background: var(--warn); }

/* ---------------------------------------------------------------- dialog */
/* A dialog opened FROM another dialog. Every backdrop is z-index 90, so which
   one paints on top is decided by document order alone -- and the one opened
   second is not reliably the one written second. This says which is in front
   rather than leaving it to where the markup happens to sit. */
.fd-dialog-backdrop.fd-dialog-over { z-index: 95; }

.fd-dialog-backdrop {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: var(--space-4); background: var(--scrim);

  /* Many pages open a dialog with style.display = 'flex' instead of 'grid'. place-items does
     nothing on a flex container, so the dialog sat in the top-left corner (WhatsApp Broadcasts,
     25 Nov 2026). These two centre it either way. */
  justify-content: center; align-items: center;

  /* The backdrop is fixed, so anything taller than the window used to hang off
     the edge with no way to reach it: the page behind cannot scroll to a fixed
     element. The overlay scrolls instead, and overscroll-behavior stops that
     scroll running on into the list underneath once the dialog bottoms out. */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.fd-dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-6); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-lg);

  /* Never taller than the window, and scrolling inside when its content is.
     dvh rather than vh so a phone's collapsing address bar does not leave the
     Save button under it. */
  max-height: calc(100vh - var(--space-4) * 2);
  max-height: calc(100dvh - var(--space-4) * 2);
  overflow-y: auto;
}
.fd-dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px;
}
.fd-dialog-body { font-size: 13px; opacity: .85; }
.fd-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ============================================================================
   App shell — sidebar + header + content, matching the mockup layout
   ========================================================================= */

.fd-shell { display: flex; height: 100vh; min-height: 640px; }

/* ------------------------------------------------------------ module rail */
/* The four ERP modules live here. Picking one swaps the whole sidebar —
   the modules deliberately do not share a menu. */
.fd-rail {
  width: 68px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 6px; background: var(--bg-2); border-right: 1px solid var(--border);
}
.fd-rail-logo {
  width: 40px; height: 40px; flex-shrink: 0; margin-bottom: 6px;
  border-radius: 10px; background: var(--logo-plate);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fd-rail-logo img { width: 34px; height: auto; mix-blend-mode: var(--logo-blend); }

.fd-rail-item {
  width: 100%; padding: 8px 2px 6px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-3); text-decoration: none; text-align: center;
}
.fd-rail-item i { font-size: 19px; }
.fd-rail-item span {
  font-size: 9.5px; font-weight: 600; letter-spacing: .01em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fd-rail-item:hover { background: var(--hover); color: var(--text); }
.fd-rail-item.fd-is-active { background: var(--accent-soft); color: var(--accent); }
.fd-rail-foot { margin-top: auto; }

/* the module name replaces the logo at the top of the sidebar */
.fd-side-title {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px; letter-spacing: -.01em;
}
.fd-side-title i { font-size: 16px; color: var(--accent); flex-shrink: 0; }
.fd-side-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.fd-nav-collapsed .fd-side-title span { display: none; }

/* ---------------------------------------------------------------- sidebar */
.fd-side {
  width: 232px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .16s ease;
}
body.fd-nav-collapsed .fd-side { width: 56px; }

.fd-side-head {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
}
.fd-logo {
  display: flex; align-items: center; min-width: 0;
  padding: var(--logo-pad); border-radius: var(--logo-radius); background: var(--logo-plate);
}
.fd-logo img { height: 24px; width: auto; mix-blend-mode: var(--logo-blend); }
body.fd-nav-collapsed .fd-logo { padding: 0; background: transparent; }
body.fd-nav-collapsed .fd-logo img { height: 26px; border-radius: 6px; }

.fd-side-toggle {
  margin-left: auto; width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent; color: var(--text-3);
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fd-side-toggle:hover { background: var(--hover); color: var(--text); }
/* The way back out. This rule used to be `display: none`, which took the only
   control that reopens the menu off the screen the moment it was closed --
   collapse once and the sidebar stayed collapsed for good, unless you knew to
   clear localStorage.

   Collapsed, the head holds the button alone and centres it: the module name
   has no room at 56px, and the module rail to its left already says which
   module this is. The icon is mirrored so it points the way it will go. */
body.fd-nav-collapsed .fd-side-head { padding: 0; gap: 0; justify-content: center; }
body.fd-nav-collapsed .fd-side-title { display: none; }
body.fd-nav-collapsed .fd-side-toggle { margin-left: 0; }
body.fd-nav-collapsed .fd-side-toggle i { transform: scaleX(-1); }

/* relative, because the palette list hangs from whichever box was used and
   this is now one of the two. */
.fd-side-search { padding: 10px 12px 6px; position: relative; }
body.fd-nav-collapsed .fd-side-search { display: none; }

/* In the sidebar the list opens to the RIGHT of its box: the sidebar is 232px
   and the list is 380, so right:0 -- correct in the header, where the box is
   at the far right -- would hang it off the left of the window. */
.fd-side-search .fd-pal-list { left: 0; right: auto; top: calc(100% + 2px); }

/* The sidebar box carries a real input now rather than a label, so the text
   cursor belongs to the input and the box stops pretending to be a button. */
.fd-search-btn { cursor: default; }
.fd-side-search-input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 12px; color: var(--text); cursor: text;
}
.fd-side-search-input::placeholder { color: var(--text-3); }
.fd-search-btn:focus-within { border-color: var(--accent); }
.fd-search-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-3); font: inherit; font-size: 12px; cursor: pointer; text-align: left;
}
.fd-search-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.fd-kbd {
  font-size: 10px; font-weight: 600; padding: 1px 5px;
  border-radius: 4px; border: 1px solid var(--border-2); color: var(--text-3);
}

.fd-nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.fd-nav-group { display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; }
.fd-nav-group-title {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 7px 8px 5px; background: transparent; border: none; color: var(--text-3);
  font: inherit; font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; cursor: pointer;
}
/* Its own class, and it has to stay its own class. This was .fd-line, which is
   also the row of a person in the dashboard lists further down this file --
   display flex, padding 10px 12px, border-top. The rule here is the more
   specific of the two so height and background were this one's, but padding and
   the border came from the other, and a 1px hairline with 20px of padding and a
   border on top is not a hairline. It drew a filled grey block beside every
   group heading in the sidebar, on every page in the application. */
.fd-nav-group-title .fd-nav-rule {
  flex: 1; height: 1px; background: linear-gradient(to right, var(--border), transparent);
}
body.fd-nav-collapsed .fd-nav-group-title { justify-content: center; padding: 7px 0 5px; }
body.fd-nav-collapsed .fd-nav-group-title .fd-nav-rule,
body.fd-nav-collapsed .fd-nav-group-title span:not(.fd-nav-rule) { display: none; }

.fd-nav-item {
  position: relative; display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 6px 8px; border-radius: 7px; border: none; background: transparent;
  color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left;
}
.fd-nav-item:hover { background: var(--hover); color: var(--text); }
.fd-nav-item.fd-is-active { background: var(--accent-soft); color: var(--accent); }
.fd-nav-item.fd-is-active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px; background: var(--accent);
}
.fd-nav-item i { font-size: 15px; flex-shrink: 0; width: 16px; text-align: center; }
.fd-nav-item .fd-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-nav-item .fd-tag { font-weight: 600; border-radius: 20px; padding: 1px 7px; font-size: 10px; }
body.fd-nav-collapsed .fd-nav-item { justify-content: center; padding: 7px 0; }
body.fd-nav-collapsed .fd-nav-item .fd-label,
body.fd-nav-collapsed .fd-nav-item .fd-tag { display: none; }

/* The account chip, and the menu it opens.

   It carried a caret-up-down from the start and opened nothing -- a control
   that says it is a menu and is not. The only working way out of the
   application was a Logout item inside the Attendance module's own nav, left
   over from when that module was a standalone application; the other three
   modules had none, so signing out depended on which module you were in.
   Sign out belongs to the shell, so it lives here. */
.fd-side-menu-wrap { position: relative; flex-shrink: 0; }
.fd-side-foot {
  width: 100%; flex-shrink: 0; padding: 10px 12px;
  border-top: 1px solid var(--border); border-left: 0; border-right: 0; border-bottom: 0;
  display: flex; align-items: center; gap: 9px;
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.fd-side-foot:hover { background: var(--hover); }

/* The sidebar chip is a label now, not a button: sign out moved to the avatar
   in the header, so there is nothing here to press. */
.fd-side-foot-static { cursor: default; }
.fd-side-foot-static:hover { background: none; }

/* THE ACCOUNT MENU, IN THE HEADER.
   Same markup and same JavaScript as the chip that used to hold it at the foot
   of the sidebar -- these rules only move it: hard right of the header, and
   opening DOWNWARDS. .fd-side-menu opens upwards, which is right above a chip
   at the bottom of a rail and off the top of the window up here. */
.fd-user-wrap { margin-left: 2px; }
.fd-user-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px 3px 3px; border: 1px solid transparent; border-radius: 999px;
  background: none; font: inherit; color: inherit; cursor: pointer;
}
.fd-user-btn:hover { background: var(--hover); border-color: var(--border); }
.fd-side-menu-wrap.fd-is-open .fd-user-btn { background: var(--hover); border-color: var(--border); }
/* .fd-side-menu IS MATCHED TOO, and it is written further down this file, so a
   plain .fd-user-menu loses every property they share -- which is all four
   edges. That is how the menu came to hang off the right of the window: it kept
   left:8px right:8px bottom:100% from the sidebar rule and stretched between
   them, 60px wide with a 216px minimum. Both classes, so this wins on
   specificity wherever it sits. */
.fd-side-menu.fd-user-menu {
  top: calc(100% + 8px); bottom: auto;
  left: auto; right: 0;
  min-width: 216px; width: max-content;
  /* Never wider than the window, however narrow the phone. */
  max-width: calc(100vw - 24px);
  padding: 6px;
  /* Above every page's sticky table headers. The 40 it inherited lost to
     Master Registry's pinned ACTIONS header (z-index 110), which sat on top of
     Sign out and left only the name showing. Page modals sit far higher. */
  z-index: 1300;
}
/* Who this is, above the one thing the menu does. The name left the header
   itself on purpose -- eight children in that row already wrap on a laptop. */
.fd-user-head {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.fd-user-head .fd-who { min-width: 0; }
.fd-user-head .fd-who b { display: block; font-size: 12.5px; font-weight: 600; }
.fd-user-head .fd-who span {
  display: block; font-size: 10.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fd-side-menu {
  display: none; position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px);
  z-index: 40; padding: 5px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.fd-side-menu-wrap.fd-is-open .fd-side-menu { display: block; }
.fd-side-menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text); text-decoration: none; white-space: nowrap;
}
.fd-side-menu a:hover { background: var(--hover); }
/* The account chip when it is a link to your own profile. It has to be written
   AFTER .fd-side-menu a and with the element on the front: both selectors are
   (0,1,1), so order is what decides, and the generic menu-item rule would
   otherwise take the head's own padding and its bottom border away. */
a.fd-user-head {
  padding: 8px 10px 10px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; white-space: normal;
}
a.fd-user-head:hover { background: var(--hover); }
.fd-side-menu i { font-size: 15px; color: var(--text-3); }
/* The rule that was here nudged the account menu clear of the collapsed icon
   rail. There is no menu in the sidebar any more -- it is the avatar in the
   header -- and left unscoped it would have dragged THAT menu to the left edge
   of the window whenever the rail was collapsed. */
.fd-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft);
  border: 1px solid var(--accent-line); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--accent);
}
.fd-side-foot .fd-who { min-width: 0; flex: 1; }
.fd-side-foot .fd-who b { display: block; font-size: 12px; font-weight: 600; }
.fd-side-foot .fd-who span { display: block; font-size: 10.5px; color: var(--text-3); }

/* The build line, under the account chip. Shell chrome, so it lives here with
   the rest of the sidebar rather than in one page. Deliberately quiet: it is
   for the moment somebody asks "which build is this", and furniture the rest
   of the time. Full detail is in its title attribute. */
.fd-side-build {
  flex-shrink: 0; padding: 6px 12px 8px;
  font-size: 10px; letter-spacing: .02em; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--border); cursor: default;
}
/* 56px of rail has no room for it, and half a version number read as a bug. */
body.fd-nav-collapsed .fd-side-build { display: none; }
body.fd-nav-collapsed .fd-side-foot { justify-content: center; padding: 10px 0; }
body.fd-nav-collapsed .fd-side-foot .fd-who,
body.fd-nav-collapsed .fd-side-foot > i { display: none; }

/* ----------------------------------------------------------------- header */
.fd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.fd-head {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding-inline: 18px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.fd-crumb { display: flex; align-items: center; gap: 7px; min-width: 0; }

/* The way back, added with the crumb links. A target in its own right at 28px
   rather than the 10px glyph inside it: on a phone this is the only way out of
   a screen two levels in, because the sidebar there is a drawer that has to be
   opened first. */
.fd-crumb-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0; margin-right: 2px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  font-size: 13px; text-decoration: none;
}
.fd-crumb-back:hover { background: var(--surface-3); color: var(--text-1); }
.fd-crumb-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* A crumb that leads somewhere has to look like it does, without turning the
   bar into a row of blue links: the same size and colour it already had, with
   the underline kept for hover. */
a.fd-grp { text-decoration: none; color: var(--text-3); }
a.fd-grp:hover { color: var(--text-1); text-decoration: underline; }
a.fd-grp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.fd-crumb .fd-grp  { font-size: 12px; color: var(--text-3); white-space: nowrap; }
/* Was .fd-page, which is also the page wrapper 40 lines down. One name for
   two things: the breadcrumb was inheriting the wrapper's padding, flex and
   max-width and standing 79px tall inside a 56px header, clipped. */
.fd-crumb .fd-crumb-leaf { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fd-head-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; height: 32px;
  padding: 0 10px; width: 280px; flex-shrink: 0; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-3); font: inherit; font-size: 12px;
  line-height: 1; cursor: pointer;
}
/* the placeholder must stay on one line — it is wider than the box on a
   narrow viewport and would otherwise wrap out of the header */
.fd-head-search .fd-txt {
  flex: 1; min-width: 0; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fd-head-search i, .fd-head-search .fd-kbd { flex-shrink: 0; }
.fd-head-search:hover { border-color: var(--border-2); color: var(--text-2); }
.fd-search-btn > span:not(.fd-kbd) {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fd-seg {
  display: flex; align-items: center; gap: 2px; padding: 2px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
}
.fd-seg button {
  height: 24px; padding: 0 8px; border-radius: 6px; border: none; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 600;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
}
.fd-seg button.fd-is-on { background: var(--accent-soft); color: var(--accent); }
.fd-seg button:not(.fd-is-on):hover { color: var(--text); }
.fd-seg button.fd-icon { width: 26px; padding: 0; }

/* Interface-language picker. Shaped like .fd-seg so the header still reads as
   one row of controls, but it is a real <select>: the languages come from
   core_language and there can be six of them, which is two buttons too many. */
.fd-lang {
  display: inline-flex; align-items: center; gap: 5px; height: 30px;
  padding: 0 8px 0 9px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-3);
}
.fd-lang-select {
  /* appearance:none, or Windows draws the control itself -- a white box with a
     black arrow, sitting inside a dark pill. The caret beside it is ours. */
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  height: 24px; border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-2);
  padding: 0 2px; max-width: 120px;
}
.fd-lang .fd-lang-caret { font-size: 11px; color: var(--text-3); pointer-events: none; }

/* --------------------------------------------------- screen search box */
/* The results hang under the header input they belong to. There was a
   full-window dialog here first; it also showed on every page load, because
   .fd-pal-overlay set display:flex and an author rule beats the browser's own
   [hidden] { display: none }. Nothing here sets display on a [hidden] element
   for exactly that reason. */
.fd-head-search-wrap { position: relative; margin-left: auto; flex-shrink: 0; }
.fd-head-search-wrap .fd-head-search { margin-left: 0; }
.fd-head-search-input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 12px; color: var(--text); cursor: text;
}
.fd-head-search-input::placeholder { color: var(--text-3); }
.fd-head-search:focus-within { border-color: var(--accent); }

.fd-pal-list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 1200;
  width: 380px; max-width: calc(100vw - 32px); max-height: 52vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.fd-pal-empty { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.fd-pal-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; text-decoration: none; color: var(--text-2);
}
.fd-pal-item:hover { background: var(--hover); }
/* The arrow-key selection. Not :hover — the mouse can be sitting anywhere
   while somebody types, and two highlighted rows read as a bug. */
.fd-pal-item.fd-is-on { background: var(--accent-soft); }
.fd-pal-item.fd-is-on .fd-pal-label { color: var(--accent); }
.fd-pal-icon { font-size: 15px; color: var(--text-3); flex-shrink: 0; }
.fd-pal-label { font-size: 12.5px; font-weight: 600; color: var(--text); flex: 1; }
.fd-pal-where { font-size: 10.5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
/* A customer row opens the lead; this opens their journey instead. */
.fd-pal-journey {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-3); cursor: pointer; font-size: 14px;
}
.fd-pal-journey:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* A heading over the recents, and over what follows them. Only drawn when
   there are recents to separate -- a heading over one undivided list is
   furniture. */
.fd-pal-head {
  padding: 9px 14px 4px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
}

/* An ACTION rather than a screen. The accent is on the icon alone: the row is
   still a row, and a palette where half the entries are a different colour
   reads as two lists rather than one ordered by what you want. */
.fd-pal-do .fd-pal-icon { color: var(--accent); }
.fd-pal-do .fd-pal-where { color: var(--accent); }
.fd-lang-select:hover { color: var(--text); }
.fd-lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The list itself is drawn by the OS, which does not read our tokens -- naming
   both here is what stops a white-on-white list in dark mode. */
.fd-lang-select option { background: var(--surface); color: var(--text); }

/* The header's menu button. Only drawn where the sidebar is a drawer -- above
   900px the sidebar is a panel and its own toggle is reachable. */
.fd-head-menu {
  display: none; flex-shrink: 0; width: 30px; height: 30px; margin-right: 2px;
  align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
}
.fd-head-menu:hover { border-color: var(--accent); color: var(--accent); }
.fd-bell { position: relative; width: 32px; height: 32px; }
.fd-bell .fd-dot {
  position: absolute; top: 5px; right: 6px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}

/* ------------------------------------------------------------- assistant */
/* A floating bot the user drags where they like. fixed, not absolute: it is
   .fd-content that scrolls, and a bot that scrolls away with a long report is a
   bot nobody can reach from the bottom of one. */
/* The dock is the BUTTON and nothing else -- 46x46, with the panel hung off it
   absolutely. It held the panel in normal flow first, which made its box 360px
   wide whenever the panel was open: the drag offset was then measured from the
   panel's edge instead of the bot's, so grabbing the bot made it jump, and the
   clamp would not let it near the right of the window. */
.fd-ai-dock {
  position: fixed; right: 22px; bottom: 22px; z-index: 1400;
  width: 46px; height: 46px;
}
.fd-ai-btn {
  width: 46px; height: 46px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--accent);
  box-shadow: var(--shadow-md); cursor: grab;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  /* the browser's own drag and text-select fight a pointer drag */
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.fd-ai-btn:hover { border-color: var(--accent); }
.fd-ai-dragging .fd-ai-btn { cursor: grabbing; box-shadow: var(--shadow-lg); }

/* The panel sits above the bot by default and flips below it when the bot has
   been parked in the top half — .fd-ai-top and .fd-ai-left are set by the drag
   handler from which quadrant it was dropped in. */
.fd-ai-panel {
  position: absolute; bottom: calc(100% + 10px); right: 0;
  width: 380px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
/* Parked in the top half, it opens downward; parked left, it opens rightward.
   Either way the panel stays inside the window instead of off the edge the bot
   was dropped against. */
.fd-ai-top .fd-ai-panel { bottom: auto; top: calc(100% + 10px); }
.fd-ai-left .fd-ai-panel { right: auto; left: 0; }
/* display:flex above would beat the browser's own [hidden] { display: none },
   so the attribute has to be answered here. The command palette shipped with
   exactly this fault and was open on every page load until it was caught. */
.fd-ai-panel[hidden] { display: none; }

.fd-ai-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); flex-shrink: 0;
}
.fd-ai-head-text { min-width: 0; }
.fd-ai-clear {
  flex-shrink: 0; width: 26px; height: 26px; border: 0; cursor: pointer;
  border-radius: 7px; background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.fd-ai-clear:hover { background: var(--hover); color: var(--text); }
.fd-ai-head-title { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); }
/* Said on the panel, not only in the code: somebody will ask it to approve
   something, and the honest place to answer that is before they type. */
.fd-ai-head-sub { display: block; margin-top: 2px; font-size: 10.5px; color: var(--text-3); }

.fd-ai-body { flex: 1; min-height: 0; padding: 12px 14px; overflow-y: auto; }
.fd-ai-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.fd-ai-q {
  margin: 0 0 6px auto; padding: 7px 10px; max-width: 85%; width: fit-content;
  border-radius: 10px 10px 2px 10px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; overflow-wrap: anywhere;
}
.fd-ai-a {
  margin: 0 0 12px; padding: 8px 10px;
  border-radius: 10px 10px 10px 2px; background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.fd-ai-wait { color: var(--text-3); font-style: italic; }

.fd-ai-box {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 9px 10px 9px 14px; border-top: 1px solid var(--border);
}
.fd-ai-input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 12.5px; color: var(--text);
}
.fd-ai-input::placeholder { color: var(--text-3); }
.fd-ai-send {
  flex-shrink: 0; width: 28px; height: 28px; border: 0; cursor: pointer;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.fd-ai-send:hover { background: var(--accent); color: var(--on-accent); }

/* The bell's panel. Anchored to .fd-bell-wrap, which is the only thing that
   position:relative is on -- the header itself scrolls nothing, so a fixed
   panel would sit still while the page moved under it. */
.fd-bell-wrap { position: relative; display: inline-flex; }
.fd-bell-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1200;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.fd-bell-head {
  display: flex; align-items: baseline; gap: 6px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.fd-bell-head-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.fd-bell-head-sub { font-size: 11px; color: var(--text-3); }

/* Ten items is about three screens of panel; past that it scrolls rather than
   running off the bottom of the window. */
.fd-bell-list { max-height: 380px; overflow-y: auto; }
.fd-bell-empty { padding: 22px 14px; text-align: center; font-size: 12px; color: var(--text-3); }

.fd-bell-item {
  display: block; padding: 10px 14px; text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.fd-bell-item:last-child { border-bottom: 0; }
.fd-bell-item:hover { background: var(--hover); }
.fd-bell-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fd-bell-kind {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.fd-bell-when { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.fd-bell-item-title {
  margin-top: 5px; font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere;
}
.fd-bell-item-detail {
  margin-top: 2px; font-size: 11.5px; color: var(--text-2);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- content */
.fd-content { flex: 1; overflow: auto; background: var(--bg); }
.fd-page {
  padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 20px;
  max-width: 1560px;
}

.fd-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.fd-page-head .fd-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); }

/* KPI strip — the four-up row the mockup uses at the top of every list */
.fd-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding-bottom: 20px;
}
/* A KPI tile carries .fd-card AND .fd-kpi, and both set display:flex. .fd-card
   sets flex-direction: column and .fd-kpi did not set it back, so column won on
   all 15 pages that use one: the icon stacked above the number instead of
   sitting beside it, and align-items:center -- meant to centre the icon against
   the text vertically -- centred both horizontally instead. Stating the
   direction is the whole fix. */
.fd-kpi {
  display: flex; flex-direction: row; align-items: center;
  gap: 12px; padding: 14px 16px;
}
.fd-kpi .fd-ico {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-size: 17px; flex-shrink: 0;
}
.fd-kpi .fd-ico.fd-accent { background: var(--accent-soft); color: var(--accent); }
.fd-kpi .fd-ico.fd-ok     { background: var(--ok-soft);     color: var(--ok); }
.fd-kpi .fd-ico.fd-warn   { background: var(--warn-soft);   color: var(--warn); }
.fd-kpi .fd-ico.fd-danger { background: var(--danger-soft); color: var(--danger); }
.fd-kpi .fd-ico.fd-info   { background: var(--info-soft);   color: var(--info); }
.fd-kpi .fd-val { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.fd-kpi .fd-lbl { font-size: 11.5px; color: var(--text-3); }

/* saved-view pills + filter chips, straight from the list pattern */
.fd-views { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fd-view {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer;
}
.fd-view:hover { border-color: var(--border-2); color: var(--text); }
.fd-view.fd-is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.fd-view .fd-n { font-size: 10.5px; font-weight: 600; opacity: .75; }

.fd-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* active filter chips — "Branch: Coimbatore ×" */
.fd-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fd-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px;
  border-radius: 20px; border: 1px dashed var(--border-2); background: transparent;
  color: var(--text-2); font-size: 11.5px;
}
.fd-chip.fd-is-set { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.fd-chip b { font-weight: 600; }
.fd-chip .fd-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer; font-size: 11px;
}
.fd-chip .fd-x:hover { background: color-mix(in srgb, var(--text) 12%, transparent); }

/* leading select column + trailing row-action column */
.fd-table .fd-sel { width: 34px; }
/* The action column sizes to whatever it holds. A fixed 40px fitted one
   26px icon and not two, so every row carrying an edit and a delete broke
   them onto separate lines and stood twice as tall as its neighbours.
   width:1% is the table trick for shrink-to-content; nowrap keeps the
   icons on one line however many a screen adds later. */
.fd-table .fd-act { width: 1%; white-space: nowrap; text-align: right; }
/* asp:CheckBox puts CssClass on a WRAPPING SPAN rather than on the input
   whenever the control carries attributes and no Text. A rule written for the
   input therefore styled an empty span and left the browser's own checkbox
   sitting beside it, half a line out. Both shapes are matched here, and the
   span is flattened so it adds nothing of its own. */
input.fd-check,
.fd-check > input[type="checkbox"],
.fd-checklist input[type="checkbox"] {
  width: 15px; height: 15px; border-radius: 4px; cursor: pointer; flex: none;
  border: 1px solid var(--border-2); background: var(--surface);
  appearance: none; -webkit-appearance: none; position: relative;
  display: inline-block; vertical-align: -3px; margin: 0;
}
input.fd-check:checked,
.fd-check > input[type="checkbox"]:checked,
.fd-checklist input[type="checkbox"]:checked {
  border-color: var(--accent); background: var(--accent);
}
input.fd-check:checked::after,
.fd-check > input[type="checkbox"]:checked::after,
.fd-checklist input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
span.fd-check {
  display: inline-flex; align-items: center; flex: none;
  width: auto; height: auto; border: 0; background: none; border-radius: 0;
}
/* The "Add new" / "Choose existing" toggle beside a picker. Three copies of
   the same inline style sat on DemoResources -- one class, so the next screen
   that needs one does not invent a fourth. */
/* A grid cell that opens its row -- the customer's name on DemoChat. Not
   .fd-row-act, which is the 26px icon box the action column uses. */
.fd-row-open { font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer; }
.fd-row-open:hover { text-decoration: underline; }

/* A tag rendered as a LinkButton would otherwise be underlined. */
a.fd-tag { text-decoration: none; }

.fd-field-toggle {
  font-size: 11px; font-weight: 600; color: var(--accent);
  text-decoration: none; cursor: pointer;
}
.fd-field-toggle:hover { color: var(--accent-2); text-decoration: underline; }

.fd-row-act {
  width: 26px; height: 26px; border: none; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.fd-row-act:hover { background: var(--hover); color: var(--text); }

/* empty / loading states */
.fd-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 56px 20px; color: var(--text-3); text-align: center;
}
.fd-empty i { font-size: 30px; opacity: .5; }

/* dashboard: recent activity beside the attention list, stacking when narrow */
.fd-dash-split {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start;
}
@media (max-width: 1200px) {
  .fd-dash-split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* THE SIDEBAR IS A DRAWER HERE, not a panel that happens to be fixed.
     It was `position: fixed` with no left offset and nothing to close it, so at
     375px it stood at left:0 covering the rail AND 180 of the 323px left for
     the page -- measured in the browser, not guessed. Collapsing it only
     narrowed it to 56px, which still sat on top of the rail.

     Closed is now off-canvas, so the page gets the whole width beside the rail.
     Open slides it in over the page with a scrim. On this width "collapsed"
     means shut, and the header toggle is what opens and shuts it. */
  .fd-side {
    position: fixed; top: 0; bottom: 0; left: 68px; height: auto;
    width: 232px; max-width: calc(100vw - 68px); z-index: 60;
    /* -100% is not enough when the drawer also sits at left:68px -- it slides
       by its own width and still leaves 45px of itself on screen, which is
       exactly what it did. It has to clear its own width AND the offset. */
    transform: translateX(calc(-100% - 76px)); transition: transform .18s ease;
    box-shadow: var(--shadow-lg);
  }
  body:not(.fd-nav-collapsed) .fd-side { transform: translateX(0); }
  /* No slide on the first paint. The drawer's shut state is applied by script
     once <body> exists, so without this every page load at this width showed
     the menu swing out and back before settling. */
  body:not(.fd-ready) .fd-side { transition: none; }
  .fd-head-menu { display: flex; }
  /* 56px was the desktop icon-rail idea of collapsed; here it is simply shut. */
  body.fd-nav-collapsed .fd-side { width: 232px; }

  /* The scrim, as a pseudo-element so the shell needs no new markup. The tap
     that closes it is handled in fdNav's own document listener. */
  body:not(.fd-nav-collapsed) .fd-shell::after {
    content: ""; position: fixed; inset: 0; z-index: 55; background: var(--scrim);
  }

  /* Dialogs are written with a pixel width -- width:750px, width:550px -- and
     no cap, so on a 375px phone they ran off both sides. max-width bounds the
     used width whatever the inline width says, so one rule reaches all of them
     without editing six pages. */
  .modal-card, .modal-container, .fd-modal { max-width: calc(100vw - 24px); }
  /* It used to be display:none here. That was fine while it was a button that
     opened a dialog -- the sidebar carried its own way in. It is the search
     itself now, and the sidebar button focuses it, so hiding it left that
     button doing nothing on a narrow screen. It shrinks instead, and the
     keyboard hint goes, which is what was taking the width. */
  .fd-head-search { width: auto; min-width: 0; flex: 1; }
  .fd-head-search .fd-kbd { display: none; }

  /* THE HEADER WRAPS FROM HERE DOWN, and that is the whole fix.

     It was one 56px row holding eight children with `height: 56px` and no
     wrap. Five of them cannot shrink -- the DEV badge, the branch pill, the
     language pill, the theme switch and the bell are each a fixed width -- so
     the two that can took the entire squeeze. Measured at 375px: the
     breadcrumb 0px wide, the search box 0px wide, and the row STILL ran 182px
     past the right edge of the screen. That is the reported screenshot -- a
     crumb clipped to nothing, the DEV badge sitting on the bell, the language
     picker and the theme switch off the side.

     Wrapping is also what the legacy Attendance shell does: from 1024px down
     it stacks this same header into rows, branch pill on its own line and the
     search full width under it (its Content/Site.master.css). Same shape here,
     so the two applications read the same on a phone.

     height has to become auto, or the extra rows are drawn outside a box that
     is still 56px tall. */
  .fd-head {
    flex-wrap: wrap; height: auto; min-height: 56px;
    padding-block: 8px; column-gap: 10px; row-gap: 8px;
  }

  /* module > group > leaf is three nowrap spans and two carets: 202px of the
     323px a 375px phone has beside the rail. The module is already named by the
     rail and the group by the sidebar, so the leaf alone says what the other
     two repeat.

     It also grows to fill the row, and that is what holds the badge, pills,
     switch and bell against the right edge -- the `margin-left: auto` that did
     that job belongs to the search box, which has left this row. */
  .fd-crumb .fd-grp,
  .fd-crumb > i { display: none; }
  .fd-crumb { flex: 1 1 60px; min-width: 0; }

  /* A full-width row of its own, not a sliver at the end of the first one. At
     768px the other seven children leave it 87px, which is a search box you
     cannot read your own typing in. order:1 drops it below them and leaves
     every other child in the order it has on a desktop. */
  .fd-head-search-wrap { order: 1; flex: 1 1 100%; min-width: 0; margin-left: 0; }

  /* The avatar alone. The caret beside it is 17px of a row that is already
     counted to the pixel, and the menu opens on the avatar just the same. */
  .fd-user-btn > i { display: none; }
  .fd-user-btn { padding: 3px; }
  .fd-side-menu.fd-user-menu { min-width: 200px; }
  .fd-pal-list { width: min(380px, calc(100vw - 32px)); }
}

/* On a phone the rail is charging desktop rent for a strip of icons: 68px of
   375 is 18% of the screen, permanently, and the page beside it is left 307px
   to hold things like the attendance calendar's seven columns. Trimming the
   chrome -- padding, gap, icon size -- gives the page back 16px without
   changing what the rail is or how it behaves, and it reads the same because
   everything in it scales together.

   This is a trim, not the answer. The rail keeps its full desktop structure at
   a size where the sidebar beside it has already become an overlay; making it
   a drawer too is the change that would actually return the width, and that is
   a decision for the shell across all four modules rather than one this page
   can take. */
@media (max-width: 575.98px) {
  /* PHONE: THE RAIL BECOMES A BOTTOM BAR. A 52px strip down the left of a 375px
     screen leaves the page 232px once the sidebar gutter is counted -- under two
     thirds of the screen for tables, cards and the attendance calendar. Laid
     along the bottom the same links cost 56px of height instead, which a phone
     has to spare, and sit under the thumb. order moves it below .fd-main
     without touching the markup. */
  .fd-shell { flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
  .fd-main { order: 1; min-height: 0; }
  .fd-rail {
    order: 2; width: 100%; height: calc(56px + env(safe-area-inset-bottom, 0px)); flex-shrink: 0; flex-direction: row; justify-content: flex-start;
    gap: 4px; padding: 6px 8px; overflow-x: auto; position: relative; z-index: 50;
    border-right: 0; border-top: 1px solid var(--border);
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
  }
  .fd-rail-logo { display: none; }
  .fd-rail-item { width: auto; min-width: 64px; flex: 1 0 auto; padding: 4px 8px; }
  .fd-rail-foot { margin-top: 0; margin-left: auto; }
  .fd-ai-dock { bottom: 76px; right: 14px; }
  /* the drawer starts where the narrowed rail ends */
  .fd-side { left: 0; bottom: 0; max-width: 100vw; }
  body.fd-nav-collapsed .fd-side { transform: translateX(calc(-100% - 60px)); }
  .fd-rail-item i { font-size: 18px; }

  .fd-head { padding-inline: 12px; column-gap: 6px; }
  /* Two header rows, not three: the avatar had been wrapping onto a row of its
     own because the breadcrumb held 107px it does not need (it truncates), and
     the language pill had a full row to itself beside nothing. Search and the
     pill now share row two. */
  .fd-crumb { flex: 1 1 0; min-width: 0; }
  .fd-crumb .fd-leaf, .fd-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fd-head-search-wrap { flex: 1 1 0; min-width: 150px; }
  .fd-lang { flex: 0 0 112px; }
  .fd-page { padding: 16px 14px 28px; }

  /* The two pickers share the last row. The basis is 110px rather than their
     own widths because the branch pill asks for 128 and the language pill for
     99: 237 of the 244 a 320px phone has left beside the rail, one pixel of bad
     luck away from taking a row each. They stretch to whatever is going, so on
     an employee's screen -- where BindBranches hides the branch pill, because
     BranchHelper locks an employee to their own branch -- the language pill
     has the row to itself. */
  .fd-lang { order: 2; flex: 1 1 110px; min-width: 0; }
  /* max-width:120px on the select is a desktop cap; here the pill is the cap.
     Centred because the pill is now wider than its text, and a label pinned
     left under a centred icon reads as a mistake. */
  .fd-lang-select {
    min-width: 0; width: 100%; max-width: none;
    text-align: center; text-align-last: center;
  }
}

/* dashboard: the catalogue strips and the activity rail beside them.
   Every colour, radius and shadow below is an existing token -- these rules
   describe layout only, so the dashboard follows the theme rather than
   carrying one of its own. */
.fd-dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.fd-dash-rail { position: sticky; top: 20px; min-width: 0; }
@media (max-width: 1200px) {
  .fd-dash-rail { position: static; }
}

/* one row that scrolls sideways: a product belongs beside its neighbours, and
   wrapping ten of them into a grid turns a shelf into a wall */
.fd-strip {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 0 12px 14px; scroll-snap-type: x proximity;
}
.fd-strip-card {
  flex: 0 0 auto; display: block; scroll-snap-align: start;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--surface);
}
.fd-strip-card:hover { border-color: var(--accent); }
.fd-strip-thumb {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-3); overflow: hidden;
}
.fd-strip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* the two bottom corners the portal puts run time and date in. --scrim rather
   than a hand-mixed black so it holds up when the theme changes underneath */
.fd-strip-chip {
  position: absolute; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--radius-sm);
  background: var(--scrim); color: #fff; font-size: 10.5px;
}
.fd-strip-chip i { font-size: 11px; }

.fd-feed { display: flex; flex-direction: column; max-height: 620px; overflow-y: auto; }
.fd-feed-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 12px; text-decoration: none; color: inherit;
  border-top: 1px solid var(--border);
}
.fd-feed-item:first-child { border-top: 0; }
.fd-feed-item:hover { background: var(--hover); }
.fd-feed-avatar {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
}

/* the one mark that says a card plays rather than opens */
.fd-strip-play {
  position: absolute; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-md); pointer-events: none;
}
.fd-strip-play i { font-size: 16px; margin-left: 2px; }

/* a row of tick boxes that wraps, for a short fixed list of labels */
/* asp:CheckBoxList writes the input and its label as SIBLINGS, with a <br>
   between rows. A flex container therefore made the box, the text and the
   break three separate items, so a tick ended up on one line and its own
   label on the next. Inline flow pairs them; the control's own <br> does the
   stacking when RepeatDirection is Vertical. */
.fd-checklist { display: block; line-height: 2; }
.fd-checklist > input[type="checkbox"] + label {
  margin: 0 16px 0 6px;
}
.fd-checklist label {
  font-size: 12.5px; color: var(--text-2); cursor: pointer;
  display: inline; vertical-align: middle;
}

/* a heading row inside a table, for rows gathered under something */
.fd-group-row td {
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; letter-spacing: .02em; padding: 8px 12px;
}

/* a row of bars, for a small distribution that needs no charting library */
.fd-bars {
  display: flex; align-items: flex-end; gap: 4px;
  height: 120px; margin-top: 12px; padding-bottom: 16px;
}
.fd-bar {
  flex: 1 1 0; height: 100%; position: relative;
  display: flex; align-items: flex-end;
}
.fd-bar-fill {
  width: 100%; background: var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 0;
}
.fd-bar-tick {
  position: absolute; bottom: -16px; left: 0; right: 0;
  text-align: center; font-size: 9.5px; color: var(--text-3);
}

/* one line of advice: a tag saying how urgent, then what to do about it */
.fd-advice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.fd-advice:first-of-type { border-top: 0; padding-top: 2px; }

/* two or three panels behind one row of tabs */
.fd-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.fd-tab {
  padding: 8px 16px; font-size: 13px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none;
}
.fd-tab:hover { color: var(--text); }
.fd-tab-on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Phosphor ships no spinner animation, and the CRM screens ported from
   CRM_Project used FontAwesome's fa-spin on their busy indicators. Declared
   once here so a converted page keeps a turning icon rather than a frozen one. */
@keyframes ph-spin { to { transform: rotate(360deg); } }
.ph-spin { display: inline-block; animation: ph-spin 1s linear infinite; }

/* A table wider than the page scrolls inside its own card rather than
   pushing the whole layout sideways. */
.fd-table-scroll { overflow-x: auto; }

/* An inline progress meter, for a row that has to say how far through
   something somebody got without spending a whole column on it. */
.fd-meter {
  height: 6px; width: 100%; border-radius: 999px;
  background: var(--surface-2); overflow: hidden; margin-bottom: 3px;
}
.fd-meter-fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* Two cards abreast that stack when there is no room for two. The
   Analysis screen puts its booked and given charts here. */
.fd-strip2 {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Filter rows are written inline on a dozen screens as a flex row of
   fd-field boxes and a button. The fields carry a label above them and the
   button does not, so aligning to the end puts the button on the same line
   as the inputs rather than level with their labels. */
.fd-toolbar > .fd-btn, .fd-dialog-actions > .fd-btn { flex: none; }

/* .fd-page a is (0,1,1) and .fd-btn is (0,1,0), so the link rule won and
   every asp:LinkButton -- which renders as an anchor, and nearly every
   button in this application is one -- came out accent-coloured whatever
   variant it carried. Primary, secondary and ghost were the same colour and
   told apart only by a border. These re-state the variants at a weight that
   beats the link rule.

   Ghost also lost its tighter padding above: three buttons in a row with two
   paddings between them read as one of them being out of line. It is already
   the quiet one by having no border. */
.fd-page a.fd-btn { color: var(--text); }
.fd-page a.fd-btn-primary, .fd-page a.fd-btn-ghost { color: var(--accent); }
.fd-page a.fd-btn:hover { text-decoration: none; }

/* Bulk import, the shape Attendance already uses: a note explaining the
   template, then two choices of equal weight -- take the sample, or send a
   file. Written here rather than on the page because three Demo screens want
   it and Attendance had it only as page-local css. */
.fd-import-note {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 22px 18px; border-radius: var(--radius-md);
  border: 1px dashed var(--border); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2);
}
.fd-import-note i { font-size: 26px; color: var(--accent); }
.fd-import-note p { margin: 0; max-width: 34ch; }

.fd-import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .fd-import-actions { grid-template-columns: 1fr; } }
.fd-import-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 10px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 13px; color: var(--text); background: transparent;
}
.fd-import-btn i { font-size: 18px; }
.fd-import-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.fd-page a.fd-import-btn { color: var(--text); }
.fd-import-btn.is-primary, .fd-page a.fd-import-btn.is-primary {
  color: var(--accent); border-color: var(--accent);
}
.fd-import-btn.is-primary:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.fd-import-chosen { font-size: 12px; color: var(--text-3); text-align: center; }

/* Something held back until it is asked for -- the expected answer on the
   Q&A table. details/summary rather than a script: it opens on click and on
   Enter, and it works on a tablet, which hover does not. */
.fd-reveal > summary {
  cursor: pointer; color: var(--accent); font-size: 12px; list-style: none;
}
.fd-reveal > summary::-webkit-details-marker { display: none; }
.fd-reveal[open] > summary { display: none; }
.fd-reveal > span { font-size: 13px; color: var(--text-2); }

/* A document shown but not handed over. The watermark repeats so a crop
   still carries it, and lets pointer events through so the reader can
   still scroll and search. The veil covers the document when the window
   is not in front. Neither stops a screenshot -- see the note on the
   viewer for what they are for. */
.fd-guarded { position: relative; -webkit-user-select: none; user-select: none; }
.fd-guard-mark {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: space-around;
  justify-content: space-around; gap: 8px; padding: 24px;
}
.fd-guard-mark span {
  font-size: 12px; letter-spacing: .04em; white-space: nowrap;
  color: color-mix(in srgb, var(--text) 16%, transparent);
  transform: rotate(-24deg);
}
.fd-guard-veil {
  position: absolute; inset: 0; display: none; align-items: center;
  justify-content: center; text-align: center; gap: 8px;
  background: var(--surface); border-radius: var(--radius-md);
  color: var(--text-3); font-size: 13px;
}
.fd-guard-veil i { font-size: 28px; display: block; margin-bottom: 6px; }
.fd-guarded.is-veiled .fd-guard-veil { display: flex; }
@media print { .fd-guarded { display: none !important; } }

/* -------------------------------------------------------------- page loader ---- */
/* One shared overlay, wired once in Site.Master to cover both classic full
   postbacks/navigations and UpdatePanel async postbacks. Starts fully
   transparent and non-interactive; the script that owns it only adds
   .fd-loader-on once a request has run long enough to be worth announcing. */
.fd-loader {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px;
  background: var(--scrim);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.fd-loader.fd-loader-on { opacity: 1; pointer-events: auto; }

/* The mark, and the four modules turning round it.

   This is the four-orbit plate the loader carried once, brought back at the
   owner's request but rebuilt to the constraint that removed it: it is drawn
   over every navigation, so ONLY transform and opacity animate here. No filter,
   no shadow, no gradient animates on a moving part -- the discs orbit and so
   carry no shadow at all; the compositor moves flat layers and repaints nothing.

   The four discs are the four modules (Attendance, CRM, Support, Demo). Each
   lights in turn, and the caption names whichever is lit. Colours come from the
   theme's --accent, so it reads on the light scrim's white haze and the dark
   scrim alike. */
.fd-loader-orbit { position: relative; width: 200px; height: 200px; }

.fd-loader-ring {
  position: absolute; inset: 30px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 42%, transparent);
  animation: fd-lo-spin 22s linear infinite;
}
/* The orbit turns; each disc counter-turns by the same amount, so an icon rides
   round the ring without ever tipping over. */
.fd-loader-track { position: absolute; inset: 0; animation: fd-lo-spin 13s linear infinite; }
.fd-lo-sat {
  position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px;
  transform: rotate(var(--a)) translate(72px) rotate(calc(-1 * var(--a)));
}
.fd-lo-spin { width: 100%; height: 100%; animation: fd-lo-spin-rev 13s linear infinite; }
.fd-lo-disc {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  opacity: .5; transform: scale(.88);           /* dimmed until its turn */
  animation: fd-lo-spot 12s ease-in-out infinite;
}
.fd-lo-disc svg { width: 52%; height: 52%; color: #fff; }
.fd-lo-sat.s1 .fd-lo-disc { animation-delay: 0s; }
.fd-lo-sat.s2 .fd-lo-disc { animation-delay: 3s; }
.fd-lo-sat.s3 .fd-lo-disc { animation-delay: 6s; }
.fd-lo-sat.s4 .fd-lo-disc { animation-delay: 9s; }

.fd-lo-core {
  position: absolute; top: 50%; left: 50%; width: 74px; height: 74px; margin: -37px;
  border-radius: 20px; background: var(--accent); color: #fff;
  display: grid; place-items: center;
  animation: fd-lo-beat 3s ease-in-out infinite;
}
.fd-lo-core svg { width: 38px; height: 38px; }

.fd-loader-cap { position: relative; margin: 0; text-align: center; font-family: var(--font-heading); }
/* The four names occupy one line's height and cross-fade in step with the discs. */
.fd-lo-mods { position: relative; display: block; height: 18px; }
.fd-lo-mods span {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); opacity: 0;
  animation: fd-lo-label 12s ease-in-out infinite;
}
.fd-lo-mods .l2 { animation-delay: 3s; }
.fd-lo-mods .l3 { animation-delay: 6s; }
.fd-lo-mods .l4 { animation-delay: 9s; }
.fd-lo-brand {
  display: block; margin-top: 8px;
  font-size: 18px; font-weight: 600; letter-spacing: -0.012em; color: var(--text);
}

@keyframes fd-lo-spin { to { transform: rotate(360deg); } }
@keyframes fd-lo-spin-rev { to { transform: rotate(-360deg); } }
@keyframes fd-lo-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fd-lo-spot {
  0%, 100% { opacity: .5; transform: scale(.88); }
  5%       { opacity: 1;  transform: scale(1.1); }
  18%      { opacity: .5; transform: scale(.88); }
}
@keyframes fd-lo-label {
  0%   { opacity: 0; transform: translateY(5px); }
  4%   { opacity: 1; transform: translateY(0); }
  20%  { opacity: 1; transform: translateY(0); }
  25%  { opacity: 0; transform: translateY(-5px); }
  100% { opacity: 0; }
}

/* Asked to keep still: nothing turns or pulses. The four discs sit at full
   strength round the mark and the first module name stays shown -- enough to say
   the page has not frozen, with nothing in motion. */
@media (prefers-reduced-motion: reduce) {
  .fd-loader-ring, .fd-loader-track, .fd-lo-spin { animation: none; }
  .fd-lo-disc { animation: none; opacity: 1; transform: none; }
  .fd-lo-core { animation: none; }
  .fd-lo-mods span { animation: none; }
  .fd-lo-mods .l1 { opacity: 1; }
}

/* --------------------------------------------------------------- live chat */
/* Two panes: pick a person on the left, talk to them on the right. The list
   is the narrower one -- a name and a line of what they said needs far less
   room than the conversation does, and the old five-column table gave them
   equal weight.

   Its own block rather than fd-dash-split, which is 1.4fr 1fr the other way
   round for the dashboard and is not this. */
.fd-chat {
  display: grid; grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 16px; align-items: start;
}
@media (max-width: 900px) { .fd-chat { grid-template-columns: 1fr; } }

.fd-chat-list { padding: 0; overflow: hidden; }
.fd-chat-list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.fd-chat-list-count {
  margin-left: auto; font-weight: 600; font-size: 11.5px;
  color: var(--text-3);
}
.fd-chat-people { display: flex; flex-direction: column; max-height: 62vh; overflow-y: auto; }

/* A row, not a link in a cell: the whole row is the target, which is what
   everybody tries to click. */
.fd-chat-person {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text); cursor: pointer;
}
.fd-chat-person:hover { background: var(--surface-2); text-decoration: none; }
.fd-chat-person.is-open { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.fd-chat-person-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fd-chat-person-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none;
}
.fd-chat-when { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

.fd-chat-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--surface);
  font-weight: 700; font-size: 13px;
}
.fd-chat-name {
  font-weight: 600; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fd-chat-preview {
  font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The thread is a column: a header that stays, a log that scrolls, and a
   reply bar at the bottom that does not move when the log grows. */
.fd-chat-thread { display: flex; flex-direction: column; gap: 0; padding: 0; }
.fd-chat-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.fd-chat-head-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fd-chat-head .fd-btn { flex: none; }

.fd-chat-log {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 14px; min-height: 220px; max-height: 52vh; overflow-y: auto;
}
.fd-chat-bubble {
  max-width: 78%; align-self: flex-start;
  padding: 8px 11px; border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--border);
}
.fd-chat-bubble.is-ours {
  align-self: flex-end; background: var(--accent);
  color: var(--surface); border-color: transparent;
}
.fd-chat-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.fd-chat-stamp { font-size: 10.5px; opacity: .7; margin-top: 3px; }

.fd-chat-closed {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}
.fd-chat-reply {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.fd-chat-reply .fd-input { flex: 1; min-height: 44px; resize: vertical; }

/* A button that has been pressed and is waiting. Not disabled -- an anchor
   cannot be -- so it stops taking clicks and says why. */
.fd-btn.is-busy { pointer-events: none; opacity: .6; cursor: default; }

/* A header band. Opt-in, because it is not how the rest of the ERP draws a
   table and one module deciding for four is not this file's job -- add the
   class to a table that wants it.

   The tint sits on the cells, not the row: .fd-table thead tr already carries
   a background, and it is the gradient that paints the rule under the header.
   Setting one on the row would replace the other. */
.fd-table-head thead th {
  /* The module's amber at full strength -- not mixed down, because every
     version that thinned it read as faded rather than as a header.

     The ink is what makes that safe. A saturated amber wants DARK text on it:
     white on #d4924a is about 2.6:1 and these headings are 12px uppercase, so
     the first bright version was unreadable in daylight. A deep brown ink on
     the same band is about 6:1, and it holds on the night theme too, where the
     accent is lighter still. */
  background: var(--accent);
  color: #2a1c0c;
}
/* The card behind one of these tables, drawn so it reads as one. In daylight
   --surface is #ffffff against a #f3f3f6 ground with a six per cent shadow --
   a five per cent step, so the table looked like it was sitting on the page
   rather than in a panel, and the header band was the only edge on screen.

   :has keeps it to cards holding one of these tables. No other module's card
   moves, and no markup had to change to say which is which. */
.fd-card:has(.fd-table-head) { border: 1px solid var(--border); }

/* The control that opens the column picker, sitting in the header band.
   It was a bare gear in .fd-row-act, which is --text-3 -- the faintest ink
   there is -- and it only grew a background on hover. On the amber band it
   read as nothing at all, so somebody who did not already know the option
   existed had no way to find out.

   A label, and an outline, because an icon alone is only discoverable to
   somebody already looking for it. The ink is the band's, so it holds on
   both themes without a second rule. */
/* The action column stays put while the grid scrolls sideways. On the widest
   grids -- Register User is fourteen columns -- the control sat past the right
   edge, so the thing somebody was told to look for was off screen until they
   scrolled. Head and body both, or the rows slide out from under the header. */
.fd-table-head thead th.fd-act,
.fd-table-head tbody td.fd-act { position: sticky; right: 0; z-index: 1; }
.fd-table-head thead th.fd-act { background: var(--accent); }
.fd-table-head tbody td.fd-act { background: var(--surface); }

.fd-col-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: #2a1c0c; background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(42, 28, 12, .38); border-radius: 999px;
  padding: 4px 7px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.fd-col-btn:hover { background: rgba(255, 255, 255, .55); text-decoration: none; }
.fd-col-btn i { font-size: 13px; }
.fd-page a.fd-col-btn { color: #2a1c0c; }

.fd-table-head thead th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.fd-table-head thead th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

/* ── Demo and SalesIQ: white ink on a deeper band ─────────────────────────

   ASKED FOR, 12 October 2026: white text in the table header and on the
   buttons, and buttons that are actually filled.

   WHITE DOES NOT WORK ON THE BAND AS IT IS, and the comment forty lines up
   says so from the last time it was tried: white on --accent (#d4924a) is
   2.62:1, and these headings are 12px uppercase. The band has to come down
   to carry white ink, so this sets its own colour rather than asking for a
   contrast that is not there.

     #d4924a  white 2.62:1   the band today, with its dark brown ink at 6.3
     #a4611c  white 4.88:1   this

   ONE VALUE FOR BOTH THEMES, on purpose. The existing darker tokens flip --
   --color-accent-2 is #a9691f in daylight and #e0a24a at night, where white
   would be back at 2.3:1. What sits on this band is always white, so the
   band is always the same.

   TWO MODULES, BECAUSE THE OTHER THREE ARE SOMEBODY ELSE'S SCREENS and they
   are being worked on. data-module comes off CurrentModule.Key in
   Site.master. To take it everywhere later, delete the two selectors and
   leave the rules -- or add the other keys: crm, sup, att.

   NOT EVERY BUTTON IS FILLED. Only the primary one. Cancel, Delete and
   Restore sit beside it in the same toolbars, and a row of solid blocks
   tells somebody nothing about which one to press -- which is the reasoning
   already written on .fd-btn-danger and .fd-btn-ok, kept here. */
/* #9f5d1a is now ONLY the ghost-button ink in the light theme (4.68:1 on the page).
   The header band and the filled button went back to the module amber on 14 Oct 2026:
   the darker band had changed the background, which was not what was asked. One value, because a second amber a shade apart is a thing to get
   wrong later and nobody would see which was which. */
.fd { --accent-strong: #9f5d1a; }

/* BOTH HEADER CLASSES, because the two modules do not share one. Demo writes
   class="fd-table fd-table-head" and SalesIQ writes "fd-table fd-table-bar"
   -- 23 tables each. Styling one and not the other is how half the screens
   change and the person who asked has to come back and say so.

   .fd-table-bar is also CRM's and Support's, which is exactly why these
   selectors carry data-module. Its own comment says it draws 'a solid accent
   bar with white type' while the code sets --on-accent, which is #1a1b24 --
   the comment has been describing something the file does not do. */
.fd[data-module="demo"] .fd-table-head thead th,
.fd[data-module="siq"]  .fd-table-head thead th,
.fd[data-module="demo"] .fd-table-head thead th.fd-act,
.fd[data-module="siq"]  .fd-table-head thead th.fd-act,
.fd[data-module="demo"] .fd-table-bar th,
.fd[data-module="siq"]  .fd-table-bar th {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(60, 35, 8, .35);
}

/* The column-picker control rides on that band, so its ink moves with it.
   It was a brown outline chosen to read on the lighter amber; on this one it
   is the faintest thing in the header. */
.fd[data-module="demo"] .fd-col-btn,
.fd[data-module="siq"]  .fd-col-btn,
.fd[data-module="demo"] .fd-page a.fd-col-btn,
.fd[data-module="siq"]  .fd-page a.fd-col-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .55);
}
.fd[data-module="demo"] .fd-col-btn:hover,
.fd[data-module="siq"]  .fd-col-btn:hover { background: rgba(255, 255, 255, .3); }

/* The primary button, filled. .fd-btn ships transparent and every variant
   only colours its text and border, so this is the one that changes. */
.fd[data-module="demo"] .fd-btn-primary,
.fd[data-module="siq"]  .fd-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.fd[data-module="demo"] .fd-btn-primary:hover,
.fd[data-module="siq"]  .fd-btn-primary:hover { filter: brightness(1.1); background: var(--accent); }
.fd[data-module="demo"] .fd-btn-primary:active,
.fd[data-module="siq"]  .fd-btn-primary:active { filter: brightness(.92); background: var(--accent); }
/* An <a> inside .fd-page is coloured by a rule of its own; without this the
   link-buttons in a toolbar keep the accent ink and vanish into the fill. */
.fd[data-module="demo"] .fd-page a.fd-btn-primary,
.fd[data-module="siq"]  .fd-page a.fd-btn-primary { color: #ffffff; }

/* The ghost button -- Refresh, and the toolbar links beside it -- carries the
   accent as ink on no background at all. Measured in the running page: on the
   daylight ground (#f3f3f6) that is 2.37:1, which is what somebody means when
   they say a button cannot be read.

   LIGHT THEME ONLY, and that is the whole reason this rule is split out. At
   night the same button is 8.01:1 against a dark ground and wants no help;
   putting this ink there would take it DOWN to 3.61. The theme is on the body
   as data-theme, so the rule can say which one it means. */
.fd[data-module="demo"][data-theme="light"] .fd-btn-ghost,
.fd[data-module="siq"][data-theme="light"]  .fd-btn-ghost,
.fd[data-module="demo"][data-theme="light"] .fd-page a.fd-btn-ghost,
.fd[data-module="siq"][data-theme="light"]  .fd-page a.fd-btn-ghost { color: var(--accent-strong); }

/* ── charts on the Demo dashboard ────────────────────────────────────────
   Appended, not woven in: every rule below is new and none of the ~280 other
   pages carries one of these classes.

   Five hues for the one chart whose colour says WHICH rather than HOW MUCH.
   They are not eyeballed -- run against both surfaces this stylesheet has:

     node scripts/validate_palette.js "#3987e5,#d95926,#199e70,#c98500,#d55181" \
          --mode dark  --surface "#232532"
     node scripts/validate_palette.js "#3987e5,#d95926,#199e70,#c98500,#d55181" \
          --mode light --surface "#ffffff"

   Both report ALL CHECKS PASS: the lightness band, the chroma floor, adjacent
   CVD separation (worst pair 8.4), the normal-vision floor (19.3) and contrast
   against the surface. One set serves both modes, which is why there is no
   second block under the light theme.

   Slots are fixed. A sixth category takes slot 6 -- it never recycles slot 1,
   because a filter that drops a series must not repaint the survivors. */
.fd {
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-3: #199e70;
  --chart-4: #c98500;
  --chart-5: #d55181;

  /* One hue, four steps, light to dark down the funnel. The ramp tracks the
     STAGE, not the number, so a step that is larger than the one above it is
     still darker: what is being shown is the order of the journey. */
  --funnel-1: #f2d0a8;
  --funnel-2: #e5b27b;
  --funnel-3: #dca467;
  --funnel-4: #b8834a;
}

/* the line under the heading that says what is waiting */
.fd-today {
  display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline;
  font-size: 14px; color: var(--text-2); margin: 4px 0 0;
}
.fd-today b { color: var(--text); font-weight: 600; }
.fd-today .fd-n { color: var(--accent); font-weight: 700; font-size: 16px; }

/* the second line on a KPI tile — what moved, or what the number is of */
.fd-kpi .fd-note { font-size: 11px; color: var(--text-3); }
.fd-kpi .fd-note.fd-is-late { color: var(--danger); font-weight: 600; }

/* a card heading with a count beside it */
.fd-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px;
}
.fd-card-head h2 {
  font-size: 13.5px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 8px;
}

/* one person per row: initial, who, how late, when */
.fd-line {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-top: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.fd-line:hover { background: var(--hover); }
.fd-line .fd-who { flex: 1; min-width: 0; }
.fd-line .fd-nm { font-weight: 600; font-size: 13px; }
.fd-line .fd-sub {
  font-size: 11.5px; color: var(--text-3);
  /* display:block, or this is an inline span and overflow/ellipsis do nothing: a long
     line ("Tailoring CAD - new customer ...") ran 544px wide inside a 330px card at 375px. */
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fd-line .fd-when {
  font-size: 11px; color: var(--text-3); white-space: nowrap;
  flex: none; text-align: right;
}

/* how far people get. Values sit above their own bar rather than in a column,
   so a four-figure count and a one-figure count do not push the bars apart. */
.fd-funnel { padding: 2px 12px 12px; }
.fd-funnel-row {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 7px 0;
}
.fd-funnel-row .fd-fl { font-size: 12.5px; color: var(--text-2); }
.fd-funnel-row .fd-fv {
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.fd-funnel-track {
  grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2);
}
.fd-funnel-track span { display: block; height: 100%; border-radius: 4px; }
.fd-funnel-note { grid-column: 1 / -1; font-size: 11px; color: var(--text-3); }
.fd-funnel-note b { color: var(--danger); font-weight: 600; }

/* what people ask about. Each bar is named on its left, so identity never
   rests on colour alone and the chart needs no legend box. */
.fd-splits { display: flex; flex-direction: column; gap: 9px; padding: 2px 12px 14px; }
.fd-split {
  display: grid; grid-template-columns: minmax(72px, 96px) 1fr auto;
  align-items: center; gap: 10px;
}
.fd-split .fd-sl {
  font-size: 12px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fd-split .fd-sv {
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.fd-split-track { height: 6px; border-radius: 3px; background: var(--surface-2); }
.fd-split-track span { display: block; height: 100%; border-radius: 3px; }

/* The funnel ramp is chosen for its mode, not flipped into it. The dark steps
   above run light-to-dark on #232532; dropped onto white they vanish --
   #f2d0a8 is 1.46:1 against #ffffff, which is no bar at all. These four are
   the same hue re-stepped for the light ground: each is at least 3:1 against
   both the card (#ffffff) and the track (#f7f7f9), and each is darker than the
   one above it, so the ramp still reads as a sequence.

     #c08033  3.29 : 1     #a56a28  4.48 : 1
     #88551e  6.24 : 1     #663f14  9.19 : 1

   The five categorical hues need no such block: all five already clear 3:1 on
   both grounds, which is why one set serves both modes and this one does not. */
.fd[data-theme="light"] {
  --funnel-1: #c08033;
  --funnel-2: #a56a28;
  --funnel-3: #88551e;
  --funnel-4: #663f14;
}

/* ── drilling from a figure into the people behind it ────────────────────
   Engagement carries two views and every number on the first one is a way
   into the second. These are the marks that say so. */

/* A card that is a link. .fd-kpi already lays the tile out; this only makes
   it look and behave like something you can press.

   display:block on the two lines is not decoration -- they are <span> inside
   an <a>, and an inline box ignores the layout .fd-kpi .fd-val expects. */
.fd-kpi-pick { position: relative; cursor: pointer; }
.fd-kpi-pick:hover { border-color: var(--accent-line); background: var(--hover); }
.fd-kpi-pick.fd-is-on { border-color: var(--accent); background: var(--accent-soft); }
.fd-kpi-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The link is the whole tile and carries only its own words. Nothing may be
   nested inside a LinkButton: the parser sets Text from the whitespace before
   the first child, and LinkButton's Text setter calls Controls.Clear() -- so
   markup inside renders once and is wiped on the next postback.

   font-size: 0 rather than display:none or a negative indent: the words stay in
   the accessibility tree, where "Show the Not started people" is the only thing
   telling a screen reader that a number is a link. */
.fd-stretch {
  position: absolute; inset: 0; border-radius: inherit;
  font-size: 0; color: transparent; text-decoration: none;
}

/* A funnel step's name is the link, not the whole row: the row is a grid of
   four parts and an anchor cannot wrap them without breaking it. */
.fd-funnel-link { color: inherit; text-decoration: none; }
.fd-funnel-link:hover { color: var(--accent); text-decoration: underline; }
.fd-funnel-row.fd-is-on .fd-fl,
.fd-funnel-row.fd-is-on .fd-fv { color: var(--accent); font-weight: 700; }

/* The filter in force above the table, and the way out of it. Without the
   second, a drill-down is a trap: the list is short, nothing says why, and
   the only way back is the browser's Back button. */
.fd-filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.fd-filterbar .fd-what { font-size: 12.5px; color: var(--text-2); }
.fd-filterbar .fd-what b { color: var(--text); }
a.fd-clear {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 20px; border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--accent); font-size: 11.5px; text-decoration: none; white-space: nowrap;
}
a.fd-clear:hover { border-color: var(--accent); }


/* -- Pager ---------------------------------------------------------------
   One row under a table: what is on screen, the page numbers, the size.

   Added for the Demo lists, which were bounded by a LIMIT and rendering
   whatever came back -- Trainee activity showed 200 of 3,297 and said nothing
   about the other 3,097. The arithmetic is in Core/Pager.vb; this is only how
   it looks, and it is here rather than on one screen because five screens need
   the same row and a sixth will.

   Wraps rather than scrolls: on a narrow screen the numbers drop under the
   count, which is readable, where a sideways scrollbar on a pager is not. */

.fd-pager {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 4px 4px;
  font-size: 12.5px; color: var(--text-2);
}
.fd-pager-info { margin-right: auto; font-variant-numeric: tabular-nums; }

/* The rows picker sits above the table on its own, so the row has nothing
   to push apart and a border under it instead of padding over nothing. */
.fd-pager-top { justify-content: flex-end; padding: 8px 8px 10px; }


.fd-pager-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.fd-pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 28px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-1);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  text-decoration: none; cursor: pointer;
}
.fd-pager-btn:hover { border-color: var(--accent); color: var(--accent); }

/* The page you are on is not a button -- pressing it does nothing, so it does
   not offer to be pressed. */
.fd-pager-btn.fd-is-on {
  background: var(--accent); border-color: var(--accent); color: #fff;
  cursor: default; font-weight: 600;
}
.fd-pager-btn.fd-is-on:hover { color: #fff; }

.fd-pager-btn.fd-is-off { opacity: .4; pointer-events: none; }

.fd-pager-gap {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 28px; color: var(--text-3); user-select: none;
}

.fd-pager-size { display: flex; align-items: center; gap: 6px; }
.fd-pager-size select {
  height: 28px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-1); font-size: 12.5px;
}

@media (max-width: 560px) {
  .fd-pager-info { margin-right: 0; width: 100%; }
}


/* ── column filter ────────────────────────────────────────────────────────
   The funnel in a table heading, and the dialog it opens. Added with the
   Demo lists' filters; the sizing follows .fd-col-btn, which is the gear in
   the same row of headings. fd-is-on is the pager's and is reused rather
   than given a second name. */

/* The selector carries `a` on purpose: `.fd-page a { color: var(--accent) }`
   is 0,1,1 and a bare `.fd-col-filter` is 0,1,0, so the accent won. On this
   table the heading's BACKGROUND is that same accent -- rgb(220,164,103) --
   so the funnel was drawn in exactly the colour behind it and was invisible
   on every screen it had been added to. Inheriting the heading's own text
   colour is right whatever a header is styled as, in either theme. */
a.fd-col-filter,
.fd-page a.fd-col-filter {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; margin-left: 4px; vertical-align: middle;
    border-radius: 4px;
    opacity: .7; transition: opacity .12s, background .12s;
    color: inherit;
}
.fd-page a.fd-col-filter:hover { opacity: 1; background: rgba(127, 127, 127, .22); }

/* A funnel that is filtering says so, because a list quietly showing a
   subset is the fault this whole feature is meant to avoid. Full strength and
   a ring, both drawn in the heading's own colour so they read on any header. */
.fd-page a.fd-col-filter.fd-is-on {
    opacity: 1; background: rgba(127, 127, 127, .28);
    box-shadow: inset 0 0 0 1px currentColor;
}

/* The value list scrolls; the dialog does not, so Reset/Close/Apply stay put
   however many values a column has. */
.fd-filter-values {
    max-height: 240px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 8px; margin-bottom: 10px;
}


/* ── column filter popup ──────────────────────────────────────────────────
   Under the funnel it was opened from, not centred. A filter belongs to one
   column, and a dialog in the middle of the screen makes the reader find the
   column again to know what they are filtering.

   Placed by the small script beside the panel, which reads data-anchor: the
   popup is one control reused by every column, so the server names the funnel
   and the browser does the arithmetic. Left at 0,0 until then so a page that
   somehow renders it without the script does not drop it over the table. */

.fd-col-popup {
    position: absolute; top: 0; left: 0; z-index: 1200;
    min-width: 240px; max-width: 320px;
    /* var(--surface), not --surface-1. There is no --surface-1 in this
       stylesheet, so the first version resolved to nothing and the popup was
       transparent -- the same fault as reaching for --text-3 on the funnel.
       .fd-dialog above uses --surface; this is the same surface. */
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
    padding: 12px;
}

/* The value list scrolls; the buttons do not, so Reset/Close/Apply stay put
   however many values a column has. */
.fd-col-popup .fd-filter-values {
    max-height: 210px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 8px; margin-bottom: 10px;
}
.fd-col-popup .fd-dialog-actions { margin-top: 0; }

/* Column resizer -- Content/columnresize.js. New class names only; nothing
   above is touched, because ~280 pages read this file. */
.fd-col-grip {
    position: absolute;
    top: 0;
    right: -3px;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    /* Invisible until it is wanted. A grid of vertical rules down a table is
       a heavier thing to look at than the table is worth. */
    background: transparent;
    touch-action: none;
    z-index: 1;
}
.fd-col-grip::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 3px;
    width: 1px;
    background: var(--accent);
    opacity: 0;
    transition: opacity .12s ease;
}
.fd-col-grip:hover::after,
.fd-col-grip.fd-is-dragging::after { opacity: 1; }

/* Widened past the card, the card scrolls sideways -- not the page. */
.fd-table-resizing { overflow-x: auto; }

/* .fd-table .fd-act is width:1%, which a fixed layout reads literally: 1% of
   the table, eight pixels, with the icons spilling out of it. Under a resized
   table it is the one column left with no width, which is what lets it take up
   whatever the others have not. Three class names so it outranks the two-class
   rule above it. */
.fd-table-resizing .fd-table .fd-act { width: auto; }

/* ------------------------------------------- narrow-screen corrections */
/* The .fd-content prefix is not decoration: a page's own stylesheet loads
   AFTER nocturne, so a bare .req-grid here loses to the page's .req-grid on
   order alone. Two classes beats one, and rule 7 rules out !important. */
/* Nine Attendance screens measured at 375px, each spilling past the column
   for the same handful of reasons: a flex or grid child that will not shrink
   (min-width:auto is the default), a row that will not wrap, or a caption
   with no wrap point. Every rule below is inside the media query, so nothing
   about the desktop layout changes.

   They are here rather than in a page stylesheet because nocturne is the one
   sheet every page loads, and these nine sit across four different ones. */
@media (max-width: 900px) {

  /* Dashboard, empDashboard: .fd-dash-split is a grid whose column measured
     332px inside a 314px page -- the grid item's own content held it open. */
  .fd-dash-split, .fd-dash-main, .fd-dash-rail { min-width: 0; }
  .fd-dash-split > *, .fd-dash-main > *, .fd-dash-rail > * { min-width: 0; }
  .att-chart, .att-panel-head, .att-panel-body { min-width: 0; max-width: 100%; }

  /* OfficialRegistry: .header-right stood 570px in a 314px header, nowrap,
     even though the controls inside it already wrap. */
  .page-header .header-right { min-width: 0; max-width: 100%; flex-wrap: wrap; }

  /* RequestsNotification: cards 340px in a 266px grid. */
  .fd-content .req-grid { min-width: 0; }
  .fd-content .req-grid > *, .fd-content .notif-card, .fd-content .notif-info { min-width: 0; max-width: 100%; }

  /* WorkReportLedger: the view switch is one 340px row in a 290px box. */
  .fd-content .view-switch { flex-wrap: wrap; max-width: 100%; min-width: 0; }

  /* AdminTimeline: an audit diff is one long unbroken string -- 936px of it
     in a 230px cell. It needs somewhere to break, not somewhere to scroll. */
  .at-diff, .at-old, .at-new { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

  /* AdvanceLog, BranchLedger: the list is a grid with min-width:1600px in a
     323px container that does not scroll. Squashing 1600px of columns into
     323 would make it unreadable, so the container scrolls instead -- the
     same answer Attendance.aspx's own grid already uses. :has is how the
     rule finds only those containers; a browser without it is left exactly
     as it is today, which is no worse. */
  .container:has(> .list-header), .container:has(> .list-row) { overflow-x: auto; }

  /* Holidays: .list-header is a grid of fixed columns -- 220 250 100 74 160
     120 = 924px of them inside a 312px card. Its own card scrolls, like the
     other wide lists above. */
  .fd-content .holidays-list-card { overflow-x: auto; }

  /* RequestsNotification: .req-grid's column is a hard 340px. */
  .fd-content .req-grid { grid-template-columns: 1fr; }

  /* OfficialRegistry: 491px of tabs in a 314px container. Tabs scroll
     sideways rather than wrap -- wrapping them onto three lines pushes the
     page content below the fold before it has said anything. */
  .fd-content .tab-navigation { overflow-x: auto; max-width: 100%; }
  /* and the registry table itself is overflow-x:hidden -- the columns past
     314px were not squashed, they were CLIPPED, with no way to reach them
     on a phone at all. Scrolling shows them; hiding them loses them. */
  .fd-content .registry-container { overflow-x: auto; }

  /* A form field that will not shrink runs past the screen: measured at 380px
     against a 375px phone. A text input has no reason to hold a width open. */
  .fd-content .modern-input, .fd-content .form-input, .fd-content .filter-input {
    min-width: 0; max-width: 100%;
  }

  /* A wide ledger scrolls sideways -- that is right; squashing ten columns
     into 266px is not. What was missing is any sign that it scrolls. Measured
     at 375px, nineteen employee-portal ledgers hide between 350 and 1,660px of
     table with nothing on screen to say so.

     Attendance.aspx already answers this with a "Swipe left or right" line, so
     this is that same line rather than a new idea -- as a sticky pseudo-element
     so it stays at the left edge while the table moves under it, and so no page
     markup has to change. */
  .fd-content .table-responsive::before,
  .fd-content .table-container::before {
    content: "↔  Swipe to see more columns";
    position: sticky; left: 0;
    display: block; width: max-content; padding: 2px 2px 8px;
    font-size: 11px; font-weight: 600; color: var(--text-3);
  }
  .tab-navigation::-webkit-scrollbar { height: 3px; }
}

/* A required field a server-side save found empty.
   The re-audit asked for "modal lists the fields, red-outline each" on four
   forms -- New Lead, Create Ticket, Demo Form and Quotation -- so the class is
   here rather than on one page, and the outline is on the control the operator
   has to answer, not on its wrapper. It is removed by the first change or
   keystroke in the field; see ShowMandatoryGaps.

   --danger is the token, so this follows light and dark with everything else.
   No layout properties: an outline draws outside the box, so a field that turns
   red does not move the grid around it. */
.fd .fd-invalid,
.fd .form-control.fd-invalid,
.fd select.fd-invalid,
.fd textarea.fd-invalid {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
  background: var(--danger-soft);
}
.fd .fd-invalid:focus { outline-color: var(--danger); }

/* The list a dropdown opens (13 Oct 2026). A select takes the theme's text colour, and its
   options took that colour too -- on the browser's own WHITE list. Light text on white, in night
   mode, on every screen that has a dropdown (Salary Ledger, Deduction Ledger, Work Report Ledger,
   ...). The options get the theme's surface and text, so the list reads in both themes.

   Options only, deliberately. color-scheme on the select itself would also flip its default
   text colour, and a select a page paints white with no colour of its own would go white on
   white. A select's own background is left to the page. */
.fd option,
.fd optgroup {
  background-color: var(--surface);
  color: var(--text);
}

/* ------------------------------------------------ ledger tables on a phone */
/* One shape for every ledger below 769px: the table keeps its columns and the
   wrapper scrolls it sideways. Cells do not wrap -- a wrapped name or date made
   each row three lines tall and the table read as a column of fragments -- the
   long ones (a reason, a remark) are cut at 260px with an ellipsis, and the
   first column stays put while the rest moves, so a row is never a set of
   figures with no name on them. */
@media (max-width: 768px) {
  .fd-content .table-responsive table:not(.mobile-cards),
  .fd-content .table-container table:not(.mobile-cards) { width: max-content; min-width: 100%; }
  .fd-content .table-responsive table:not(.mobile-cards) th,
  .fd-content .table-responsive table:not(.mobile-cards) td,
  .fd-content .table-container table:not(.mobile-cards) th,
  .fd-content .table-container table:not(.mobile-cards) td {
    white-space: nowrap; padding-inline: 14px;
  }
  .fd-content .table-responsive table:not(.mobile-cards) td,
  .fd-content .table-container table:not(.mobile-cards) td {
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; padding-block: 10px;
  }
  /* a name or a date inside its own span/div carries its own white-space */
  .fd-content .table-responsive table:not(.mobile-cards) td *,
  .fd-content .table-container table:not(.mobile-cards) td * { white-space: nowrap; }
  /* a cell written as several lines with <br> (Request Details) is one line here,
     so every row is the same height; the parts keep a gap between them */
  .fd-content .table-responsive table:not(.mobile-cards) td br,
  .fd-content .table-container table:not(.mobile-cards) td br { display: none; }
  .fd-content .table-responsive table:not(.mobile-cards) td br + b,
  .fd-content .table-container table:not(.mobile-cards) td br + b { margin-left: 10px; }
  .fd-content .table-responsive table:not(.mobile-cards) td > div[style*="min-width"],
  .fd-content .table-container table:not(.mobile-cards) td > div[style*="min-width"] { min-width: 0 !important; }
  .fd-content .table-responsive table:not(.mobile-cards) tr > :first-child,
  .fd-content .table-container table:not(.mobile-cards) tr > :first-child {
    position: sticky; left: 0; z-index: 2; background: var(--surface); width: 1%;
    box-shadow: 1px 0 0 var(--border);
  }
  /* a GridView's pager is one cell spanning the row: it wraps, and it must not
     stretch the first column or stick */
  .fd-content .table-responsive table:not(.mobile-cards) td[colspan],
  .fd-content .table-container table:not(.mobile-cards) td[colspan],
  .fd-content .table-responsive table:not(.mobile-cards) td[colspan] *,
  .fd-content .table-container table:not(.mobile-cards) td[colspan] * { white-space: normal; max-width: none; }
  /* its nested page-number table is wider than the first column and, with the
     cell spanning the row, was handed to column one (238px for an S.No) */
  .fd-content .table-responsive table:not(.mobile-cards) td[colspan],
  .fd-content .table-container table:not(.mobile-cards) td[colspan] { contain: inline-size; }
  .fd-content .table-responsive table:not(.mobile-cards) tr > td[colspan]:first-child,
  .fd-content .table-container table:not(.mobile-cards) tr > td[colspan]:first-child { position: static; width: auto; box-shadow: none; }
  .fd-content .table-responsive table:not(.mobile-cards) thead tr > :first-child,
  .fd-content .table-container table:not(.mobile-cards) thead tr > :first-child { z-index: 3; background: var(--surface-2, var(--surface)); }
}

/* Responsive (27 Oct 2026): the group of buttons beside a page title is often written
   <div style="display:flex; gap:..."> with no wrap, so on a phone it ran past the screen
   (CreateTicket: 2724px, ServiceList: 775px). Wrapping costs nothing when it fits. */
.fd-page-head > div[style*="display: flex"],
.fd-page-head > div[style*="display:flex"] { flex-wrap: wrap; min-width: 0; max-width: 100%; }

/* Responsive (27 Oct 2026): AdvanceLog and BranchLedger lists are grids with min-width 1600px. The
   rule above scrolls them on a phone; at 1280px they were cut ("Monthly Rent" 389px past the edge),
   so the container scrolls at every width. */
.container:has(> .list-header), .container:has(> .list-row) { overflow-x: auto; }

/* Responsive (28 Oct 2026): about 45 pages set .fd-content { overflow: hidden } so a list or form scrolls
   inside itself. On a phone the header, filters and form stack taller than the screen and whatever is
   below the fold could not be reached. Below 992px the content area scrolls; pages whose inner box
   already fits are not affected (nothing overflows, so no scrollbar). */
@media (max-width: 992px) {
  main.fd-content { overflow-y: auto !important; overflow-x: hidden; }
}
