/* NEXBLD design tokens.

   Structure, typography and spacing follow the Augen Pro reference: clinical
   light canvas, weight-350 type at every size, hierarchy from scale not weight,
   hairline borders, no drop shadows, large soft radii, generous vertical
   rhythm.

   The accent palette is ours, not Augen's — Signal Blue is replaced by the
   NEXBLD warm set (amber, warm near-black, and the existing state colours).
   Same rule applies though: accents are text and border only, never fills,
   except where a fill is the control itself. */

/* Inter, self-hosted (SIL OFL) so EVERY visitor gets the site face — the
   stack led with Inter but nothing served it, so most saw their system font.
   The variable file carries weights 100-900, including the system's 350. */
@font-face {
  font-family: "Inter";
  src: url("InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- surfaces (Augen structure, warm-neutral cast) --- */
  --canvas: #fdfdfd;          /* page — surgical white dominates; the void is
                                 the design, not a backdrop for cards */
  --panel: #ffffff;           /* the barest lift, used sparingly */
  --recess: #f8f8fa;          /* rare recessed band — use once per page at most;
                                 today that is the strip behind the header */
  --dark: #0a0a09;            /* dark bands, footer */
  --dark-2: #6b665e;          /* warm end of the NEXBLD gradient */

  /* --- type --- */
  --ink: #0f1012;             /* primary text */
  --ink-strong: #020201;      /* emphasis */
  /* Darkened a few shades on 2026-08-26 (Rodney): the muted greys read as
     washed-out on the light canvas, and secondary text that cannot be read
     comfortably is not secondary, it is decoration. --steel gains ~2:1 of
     contrast, --ash clears 4.5:1 on --canvas so tertiary labels are legible
     rather than merely present. */
  --steel: #4a4a4a;           /* muted body, captions (was #5e5e5e) */
  --ash: #626262;             /* disabled, tertiary labels (was #7a7a7a) */

  /* --- accents (ours). Text + border, never a background fill. --- */
  --accent: #aa210f;          /* the house red (Rodney, 2026-08-30) */
  --accent-bright: #aa210f;   /* on dark surfaces only — the same value as
                                 --nx-gold below, folded together 2026-08-26:
                                 two ambers a shade apart is the drift the
                                 gold was meant to end */
  /* THE gold. One "you are here" colour across the app: the current page in
     the dark header and the open division/step in a workflow rail. Picked by
     Rodney on the live page (2026-08-26). It is tuned for the dark chrome,
     where it measures ~7.5:1; on the white canvas it is ~2.2:1, so use it as
     a MARKER (a rule, a border, a short nav label the border also marks) and
     never for body text — that is what --accent is for. */
  /* Renamed in spirit, not in name: every "gold" marker is the house RED
     since 2026-08-30. The variable keeps its name because forty files hold
     it; its meaning is "the current/selected marker colour". */
  --nx-gold: #aa210f;
  --ok: #16a34a;
  /* chart blue scale — matches the reference dashboard */
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  /* Navy: primary buttons on tenant pages, summary bars, PDF table heads.
     Tokenised 2026-09-08 (was 13 literals). */
  --navy: #1d2a4d;
  /* The one notice band (PSR snapshot banner): tokenised 2026-09-08. */
  --amber-bg: #fdf7ec;
  --amber-line: #f0e2c4;
  --amber-ink: #7a5b1e;
  /* The schedule calendar's colours (Rodney's image, 2026-10-07): the yellow
     of today's badge and the Business Add button, the orange of meetings and
     Today's bars, the slate of secondary calendar text. */
  --amber-500: #f5b301;
  --amber-600: #e0a300;      /* the primary button's hover */
  --orange-500: #f97316;
  --slate-ink: #51607d;
  /* Text-safe state colours (2026-09-08): --ok and --warn are dots and large
     figures; small text needs these to clear 4.5:1 on white. */
  --ok-ink: #15803d;
  --caution-ink: #b45309;
  --blue-500: #3b82f6;
  --blue-300: #93c5fd;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;         /* the tint behind a blue-marked card */
  /* A field holding focus: the sign-in boxes' line and fill (index.html
     .auth-field:focus-within), shared by every input since 2026-09-11. */
  --field-focus-line: #8fb3da;
  --field-focus-fill: #eaf2fb;
  --grey-track: #e8e8ec;
  --warn: #dc2626;
  --info: #3b82f6;

  /* --- borders: hairlines only --- */
  /* Also darkened 2026-08-26. Hairlines are the whole elevation system here
     (no drop shadows above the boxed row), so when they are too faint the
     structure stops reading as structure. Still hairlines — the weights are
     unchanged, only the ink. */
  --hair: 0.5px solid rgba(0, 0, 0, 0.16);
  --hair-strong: 1px solid rgba(0, 0, 0, 0.22);
  --hair-dark: 0.5px solid rgba(255, 255, 255, 0.14);

  /* --- type scale (size builds hierarchy; weight stays 350) --- */
  --t-caption: 11px;  /* 11, not 10: functional text under 11px fails on phones (audit 2026-09-07) */
  --t-label: 12px;
  --t-small: 13px;
  --t-ui: 14px;
  --t-body: 16px;
  --t-sub: 18px;
  --t-head: 27px;
  --t-display: 40px;

  --w-light: 300;   /* big figures: quieter than the text around them */
  --w-book: 350;
  --w-regular: 400;
  --track: -0.02em;

  /* --- spacing --- */
  --s-4: 4px;   --s-6: 6px;   --s-10: 10px; --s-11: 11px;
  --s-22: 22px; --s-30: 30px; --s-34: 34px; --s-50: 50px;
  --s-69: 69px; --s-94: 94px;

  /* --- radii --- */
  --r-hair: 2px;
  --r-nav: 10px;
  --r-tile: 26px;
  --r-card: 40px;    /* moderated from Augen's 54px: at dashboard tile size a
                        54px radius reads as a lozenge, not a card */
  --r-pill: 9999px;

  /* Full-bleed pages (Rodney, 2026-08-24): content spans the viewport with
     the side padding as the only margin. One token widens the header bar,
     main and footer together. */
  --page-max: none;
  /* Side gutters for full-bleed pages — 30px, doubled 2026-08-24, doubled
     again 2026-08-25 (Rodney). Header bar, main and footer all read this one
     token. It collapses on narrow screens below, where 120px of gutter would
     leave the content less room than the margins. */
  /* 80px since 2026-09-04 (was 120): tried on the sub dashboards, kept. It
     still steps down on narrow screens in shell.css. */
  --page-pad: 80px;
  /* ONE corner radius for every button and button-like control (Rodney,
     2026-08-24: the full-round PSR pill was too much). */
  --radius: 8px;

  /* THE CARD (Rodney, 2026-09-02, rolled out from the Team dashboard). White,
     NO border, and a slight shadow instead — a deliberate reversal of the
     hairline-only rule in docs/frontend-style.md, which assumed a white page.
     The page is --recess now, so a card is separated by being lighter than its
     ground and lifted off it rather than by being outlined on it.
     Two shadow layers: a tight one for the edge and a wide soft one for the
     lift. A single blur at this opacity reads as a smudge. */
  /* TWO distances and no more (Rodney, 2026-09-04, rolled out from the sub
     dashboards). Every gap between page furniture reads one of these, so the
     site cannot drift back to the four numbers it had:

       --gap    card to card, across and down. The page's own rhythm.
       --edge   header to the first card, last card to the footer. Wider on
                purpose: the chrome is a different kind of neighbour. */
  --gap: var(--s-22);
  --edge: var(--s-30);

  --card-radius: 14px;
  --card-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 8px 24px -8px rgba(17, 24, 39, 0.12);
  --header-h: 56px;    /* header bar; the grey band behind it matches */
  --section-gap: 52px;
}

/* Reset. tokens.css is the base for admin pages, which do NOT load style.css;
   without this, width:100% plus padding overflows its container (the settings
   inputs ran 43px past the dialog edge). */
.nx-app, .nx-app *, .nx-app *::before, .nx-app *::after { box-sizing: border-box; }
/* Spacing is stated by the component, never inherited from the browser: the UA
   puts a margin above every h1-h4, p, ul and ol, which stacks on top of the
   padding a section already declares and pushes everything down the page. */
.nx-app :where(h1, h2, h3, h4, p, ul, ol, figure) { margin: 0; padding: 0; }
.nx-modal, .nx-modal * { box-sizing: border-box; }

.nx-app {
  margin: 0;                 /* the UA's 8px kept the header band off the top */
  font-family: Inter, "PP Neue Montreal", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  font-weight: var(--w-book);
  letter-spacing: var(--track);
  font-size: var(--t-body);
  line-height: 1.2;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* Nothing in this system goes above 400. */
.nx-app h1, .nx-app h2, .nx-app h3, .nx-app h4, .nx-app strong, .nx-app b {
  font-weight: var(--w-book);
  letter-spacing: var(--track);
}

/* ONE RULE FOR `hidden`, because the attribute is only as strong as the UA
   stylesheet that implements it — any author `display` on an element (and this
   file gives one to nearly everything) outranks it, so `node.hidden = true`
   silently does nothing. Eleven separate one-off `.thing[hidden]{display:none}`
   patches had accumulated before this existed; the last of them let the name
   and password LABELS stay on screen for somebody joining a second company
   (Rodney, 2026-09-17) while their inputs vanished. !important because the
   point is that nothing outranks it. */
[hidden] { display: none !important; }

/* THE COLOURED BUTTON, RAISED (Rodney, 2026-10-23: "elevate them a little —
   some indent shadow, a subtle glow on hover"). One recipe for every amber
   primary, wherever its colour is set (shell .nx-btn.primary, the schedule's
   .nxsg-btn, the client estimate's .nxev-btn, the landing's gold and chosen
   plan, the sign-in pop-up). Built from box-shadows alone, because each family
   sets its colour with the `background` shorthand, which would wipe a
   gradient: a light top edge and a darker amber lip below (the "indent"), a
   short drop shadow; hover lifts a pixel and glows amber; press sinks into an
   inset; the keyboard gets a navy ring; no movement for reduced motion. */
:root {
  --btn-rest: inset 0 1px 0 rgb(255 255 255 / 0.45), inset 0 -2px 0 rgb(122 91 30 / 0.22),
    0 1px 2px rgb(17 24 39 / 0.14), 0 3px 8px -3px rgb(245 179 1 / 0.45);
  --btn-hover: inset 0 1px 0 rgb(255 255 255 / 0.5), inset 0 -2px 0 rgb(122 91 30 / 0.22),
    0 2px 4px rgb(17 24 39 / 0.14), 0 0 0 3px rgb(245 179 1 / 0.16), 0 8px 20px -6px rgb(245 179 1 / 0.7);
  --btn-press: inset 0 2px 5px rgb(122 91 30 / 0.38), 0 1px 1px rgb(17 24 39 / 0.1);
}
.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxlp-btn.gold,
.nxlp-plan[aria-checked="true"] .nxlp-planbtn, .nxau-primary {
  box-shadow: var(--btn-rest);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.18s ease, transform 0.12s ease;
}
:is(.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxlp-btn.gold,
    .nxlp-plan[aria-checked="true"] .nxlp-planbtn, .nxau-primary):hover:not(:disabled) {
  box-shadow: var(--btn-hover);
  transform: translateY(-1px);
}
:is(.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxlp-btn.gold,
    .nxlp-plan[aria-checked="true"] .nxlp-planbtn, .nxau-primary):active:not(:disabled) {
  box-shadow: var(--btn-press);
  transform: translateY(0);
}
:is(.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxlp-btn.gold,
    .nxlp-plan[aria-checked="true"] .nxlp-planbtn, .nxau-primary):focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
:is(.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxau-primary):disabled { box-shadow: none; transform: none; }
/* A form Save in its saved/unsaved colours (savestate.js, pale green / pale
   red) keeps the lift but not the amber glow, which would read as a third state. */
.nx-btn.primary.nx-save:is(.saved, .unsaved) { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 1px 2px rgb(17 24 39 / 0.1); }
.nx-btn.primary.nx-save:is(.saved, .unsaved):hover:not(:disabled) { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), 0 3px 8px -2px rgb(17 24 39 / 0.18); }
@media (prefers-reduced-motion: reduce) {
  :is(.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxlp-btn.gold,
      .nxlp-plan[aria-checked="true"] .nxlp-planbtn, .nxau-primary) { transition: background-color 0.15s, box-shadow 0.18s; transform: none; }
  :is(.nx-btn.primary, .nxsg-btn.primary, .nxev-btn.primary, .nxlp-btn.gold,
      .nxlp-plan[aria-checked="true"] .nxlp-planbtn, .nxau-primary):hover:not(:disabled) { transform: none; }
}

/* A phone (a touch screen): every text box at 16px or more (Rodney, 2026-10-28,
   "pages zoom in a little and I can zoom out"). iPhone Safari zooms the page in
   when a box under 16px is tapped and leaves it zoomed; at 16px it does not. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea { font-size: max(16px, 1em) !important; }
}
