/* Forge's design tokens (docs/DESIGN.md, "Design system"): direction B, "Bright & open". The workspace, Settings and
   the sign-in page share this file. A calm grey ground, white cards that float on soft layered shadows, one refined
   blue accent, and status colours kept for real status. Light and Dark each have their own values; System follows
   the device. Every component reads the role names below, never a raw colour. */
/* Inter (OFL, brand/font-licenses.txt): the one face, upright and variable, from the official release. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-variable.woff2?v=693b77d4f32e") format("woff2");
}
:root {
  color-scheme: light;
  /* ---- Shape ---- one radius per kind of thing: a card, a control, a small tag, a pill for status. */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;
  --radius: var(--r-lg);
  --control-radius: var(--r-md);
  --radius-xs: var(--r-xs);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-pill: var(--r-pill);
  /* ---- Space ---- a 4px base. */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* ---- Type ---- Inter, seven sizes: 12/13/14/16/20/24/32px. Every other name is a role that points at one of them.
     Nothing is set smaller than 12px. Numbers are tabular; money is right-aligned. */
  --body-face: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --type-12: .75rem;
  --type-13: .8125rem;
  --type-14: .875rem;
  --type-16: 1rem;
  --type-20: 1.25rem;
  --type-24: 1.5rem;
  --type-32: 2rem;
  --type-34: var(--type-32);
  --type-tiny: var(--type-12);
  --type-micro: var(--type-12);
  --type-meta: var(--type-13);
  --type-ui: var(--type-14);
  --type-title: var(--type-16);
  --type-body: var(--type-16);
  --type-lead: var(--type-20);
  /* Headings: the page title, a card's title and a field or column label (sentence case, never capitals). */
  --type-h1: var(--type-24);
  --type-section: var(--type-16);
  --type-label: var(--type-12);
  /* A headline figure: a KPI tile's number. A figure inside a card row uses --type-20. */
  --type-number: var(--type-32);

  /* ---- Motion ---- one system (docs/DESIGN.md, "Motion"). Three durations and two curves; exits run faster than
     entrances. Under prefers-reduced-motion every duration below collapses (see the end of this block). */
  --dur-1: 120ms;   /* hover, press, colour, small fades, exits */
  --dur-2: 200ms;   /* menus, popovers, list changes, cross-fades */
  --dur-3: 280ms;   /* drawers, the sidebar, modals, sheets */
  --ease-standard: cubic-bezier(.2, 0, 0, 1);      /* ease-out: things arriving and settling */
  --ease-emphasized: cubic-bezier(.3, 0, 0, 1);    /* larger moves: drawers, the sidebar, sheets */
  --ease-exit: cubic-bezier(.4, 0, 1, 1);          /* leaving: quick and out of the way */
  --ease-out: var(--ease-standard);

  /* Stacking, from a raised piece of a card up to the skip link. */
  --z-raised: 1;
  --z-header: 2;
  --z-tooltip: 3;
  --z-popover: 4;
  --z-nav: 4;
  --z-menu: 5;
  --z-toast: 5;
  --z-bar: 6;
  --z-bar-open: 7;
  --z-rail-open: 8;
  /* The dim behind a sheet, drawer or dialog covers the rail and the tab bar, so nothing outside the overlay looks live. */
  --z-scrim: 9;
  --z-sheet: 9;
  --z-skip: 10;

  /* ---- Surfaces ---- one calm ground, white cards on soft shadow. */
  --ground: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;     /* inner wells */
  --surface-hover: #F3F5F8; /* a row or card under the pointer: visible on white without reading as selection */
  --sunken: #F1F3F6;        /* segmented tracks, tags */
  --overlay: #FFFFFF;       /* menus, popovers, drawers, dialogs */
  --line: rgb(16 24 40 / 7%);
  --line-strong: rgb(16 24 40 / 13%);
  /* A field's edge keeps 3:1 against the surface it sits on (WCAG 1.4.11). */
  --field-rule: #8A919E;

  /* ---- Ink ---- */
  --ink: #141821;
  --ink-2: #525A68;
  /* The faintest text still reads 4.5:1 on every light ground and on the selection tint (a selected row's metadata). */
  --ink-3: #666D7B;
  --ink-inv: #FFFFFF;

  /* ---- The one accent: Forge blue ---- the single filled primary per view, selection, links, a chart's focus. */
  --accent: #3A5FD9;
  --accent-strong: #2F4CB4;
  --accent-fill: #3A5FD9;
  --accent-fill-h: #3253C4;
  --accent-soft: #EEF2FE;
  --accent-soft-2: #E0E8FE;

  /* ---- Charts ---- an ordinal ramp of the accent; the period a chart is about takes --viz-3. */
  --viz-1: #93B0F8;
  --viz-2: #6A8FF2;
  --viz-3: #3A5FD9;
  --viz-4: #283F8C;
  --viz-track: #E8EDFC;
  --grid: #ECEEF2;
  --axis: #C9CDD5;

  /* ---- Status ---- reserved for real status, always with a word. */
  --danger: #C8322B;
  --danger-soft: #FDEEEC;
  --warning: #A85A06;
  --warning-soft: #FDF3E3;
  --success: #0F7A55;
  --success-soft: #E8F6EF;
  --neutral-dot: #A2A8B3;

  /* The brand mark is the only orange on screen. */
  --forge: #FF7843;

  /* ---- Elevation ---- depth, not lines. */
  --e-1: 0 0 0 1px rgb(16 24 40 / 4.5%), 0 1px 2px rgb(16 24 40 / 4%), 0 2px 8px -2px rgb(16 24 40 / 5%);
  --e-2: 0 0 0 1px rgb(16 24 40 / 5%), 0 2px 4px rgb(16 24 40 / 4%), 0 8px 24px -6px rgb(16 24 40 / 10%);
  --e-3: 0 0 0 1px rgb(16 24 40 / 6%), 0 12px 24px -8px rgb(16 24 40 / 14%), 0 24px 56px -12px rgb(16 24 40 / 16%);
  --e-control: 0 0 0 1px rgb(16 24 40 / 9%), 0 1px 2px rgb(16 24 40 / 6%);
  --e-primary: inset 0 1px 0 rgb(255 255 255 / 16%), 0 0 0 1px #2F50C2, 0 1px 2px rgb(30 50 140 / 30%), 0 2px 6px -1px rgb(58 95 217 / 30%);

  /* Avatars: six tones hashed from an id (avatarTone in app.js, tone in staff-page.ts), the same in both themes. */
  --av-1: #5B72D6; --av-2: #2E968A; --av-3: #8A68D1; --av-4: #C7628A; --av-5: #B9822F; --av-6: #4F8F5E;

  /* ---- Role names the components read ---- */
  --paper: var(--surface);
  --raised: var(--overlay);
  --raised-border: transparent;
  --soft: var(--sunken);
  --subtle: var(--surface-2);
  --secondary: var(--ink-2);
  --faint-ink: var(--ink-3);
  --rule: var(--line-strong);
  --hairline: var(--line);
  --control-rule: var(--line-strong);
  --strong-rule: #A2A8B3;
  --primary: var(--accent-fill);
  --primary-hover: var(--accent-fill-h);
  --on-primary: #FFFFFF;
  --accent-dark: var(--accent-strong);
  --orange: var(--forge);
  --steel: var(--accent);
  --steel-bright: var(--accent);
  --cobalt: var(--accent);
  --cobalt-tint: var(--accent-soft);
  --cobalt-rule: var(--accent-soft-2);
  --indigo: var(--accent);
  --indigo-tint: var(--accent-soft);
  --indigo-rule: var(--accent-soft-2);
  --emerald: var(--success);
  --emerald-bright: var(--success);
  --focus: var(--accent);
  /* The keyboard ring: the accent at 45%, 2px, drawn once outside the control. */
  --focus-ring: rgb(58 95 217 / 45%);
  /* Selection (the open row in a list, selected text) is the accent's softest tint. */
  --selection-bg: var(--accent-soft);
  --selection-rule: var(--accent-soft-2);
  --selected-text-bg: var(--accent-soft-2);
  --danger-ink: var(--danger);
  --hero: var(--surface-2);
  --hero-hover: var(--sunken);

  /* Status roles: due and overdue are danger, late is warning, gone quiet is danger, steady is success. A badge is a
     soft fill with its word; it has no outline, so each *-rule matches its fill. */
  --neutral-ink: var(--ink-2);
  --neutral-tint: var(--sunken);
  --neutral-rule: var(--sunken);
  --due-ink: var(--danger);
  --due-tint: var(--danger-soft);
  --due-rule: var(--danger-soft);
  --late-ink: var(--warning);
  --late-tint: var(--warning-soft);
  --late-rule: var(--warning-soft);
  --quiet-ink: var(--danger);
  --quiet-tint: var(--danger-soft);
  --quiet-rule: var(--danger-soft);
  --steady-ink: var(--success);
  --steady-tint: var(--success-soft);
  --steady-rule: var(--success-soft);

  /* Pipeline stages step along the chart ramp; a lost deal is status. */
  --stage-talking: var(--viz-1);
  --stage-quoted: var(--viz-2);
  --stage-trial: var(--viz-3);
  --stage-yes: var(--viz-4);
  --stage-lost: var(--danger);

  --prior-bar: var(--viz-1);
  --chart-accent: var(--viz-3);
  --chart-muted: var(--viz-1);
  --chart-muted-hover: var(--viz-2);
  --chart-track: var(--viz-track);
  --chart-hover: rgb(58 95 217 / 5%);
  --sales-bar: linear-gradient(90deg, rgb(58 95 217 / 12%), rgb(58 95 217 / 5%));
  --notification: #1C2028;
  --notification-text: #FFFFFF;
  --shadow: rgb(16 24 40 / 14%);
  --shadow-soft: rgb(16 24 40 / 6%);
  --popover-shadow: var(--e-3);
  --card-shadow: var(--e-1);
  --card-shadow-hover: var(--e-2);
  --control-shadow: var(--e-control);
  --primary-shadow: var(--e-primary);
  /* One dim behind every dialog, drawer and sheet, rail and tab bar included. Nothing is blurred. */
  --backdrop: rgb(13 15 19 / 32%);
  --avatar-1: var(--av-1); --avatar-2: var(--av-2); --avatar-3: var(--av-3);
  --avatar-4: var(--av-4); --avatar-5: var(--av-5); --avatar-6: var(--av-6);

  /* The sidebar is light, on the ground itself: no dark rail and no edge. The current page is a raised white row. */
  --rail: var(--ground);
  --rail-bg: var(--ground);
  --rail-ink: var(--ink);
  --rail-muted: var(--ink-2);
  --rail-rule: var(--line);
  --rail-control: var(--surface);
  --rail-current: var(--surface);
  --rail-hover: rgb(16 24 40 / 4%);
  --rail-accent: var(--accent);
  --rail-focus: var(--focus-ring);
  --rail-logo: none;
  --rail-scheme: light;
  --login-dot: transparent;
  --page-dot: transparent;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23727987' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23727987' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}
/* Dark is designed with its own values, not inverted: a near-black ground, cards a clear step above it, a lighter
   accent for text and a deeper one for fills. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0D0F13;
  --surface: #171A20;
  --surface-2: #1C2027;
  --surface-hover: #222731;
  --sunken: #111419;
  --overlay: #20242C;
  --line: rgb(255 255 255 / 7%);
  --line-strong: rgb(255 255 255 / 13%);
  --field-rule: #6B7280;
  --ink: #ECEEF2;
  --ink-2: #A6ADBA;
  --ink-3: #8A92A1;
  --ink-inv: #0D0F13;
  --accent: #7B9BF6;
  --accent-strong: #A3BAFA;
  --accent-fill: #4568E0;
  /* Hover deepens the fill, so white keeps 4.5:1 on it. */
  --accent-fill-h: #3D5FD6;
  --accent-soft: rgb(123 155 246 / 13%);
  --accent-soft-2: rgb(123 155 246 / 20%);
  --viz-1: #3B4F8F;
  --viz-2: #5A7BE6;
  --viz-3: #7B9BF6;
  --viz-4: #B4C7FB;
  --viz-track: rgb(123 155 246 / 14%);
  --grid: #252932;
  --axis: #3A3F49;
  --danger: #F27A70;
  --danger-soft: rgb(242 122 112 / 13%);
  --warning: #F0AE4A;
  --warning-soft: rgb(240 174 74 / 13%);
  --success: #4CC995;
  --success-soft: rgb(76 201 149 / 13%);
  --neutral-dot: #5E6572;
  --e-1: 0 0 0 1px rgb(255 255 255 / 6%), 0 1px 2px rgb(0 0 0 / 30%), 0 2px 8px -2px rgb(0 0 0 / 25%);
  --e-2: 0 0 0 1px rgb(255 255 255 / 7%), 0 2px 4px rgb(0 0 0 / 30%), 0 8px 24px -6px rgb(0 0 0 / 45%);
  --e-3: 0 0 0 1px rgb(255 255 255 / 8%), 0 12px 24px -8px rgb(0 0 0 / 50%), 0 24px 56px -12px rgb(0 0 0 / 55%);
  --e-control: 0 0 0 1px rgb(255 255 255 / 9%), 0 1px 2px rgb(0 0 0 / 30%);
  --e-primary: inset 0 1px 0 rgb(255 255 255 / 16%), 0 0 0 1px #3D5FD4, 0 1px 2px rgb(0 0 0 / 40%), 0 2px 6px -1px rgb(69 104 224 / 35%);
  --strong-rule: #5E6572;
  --focus-ring: rgb(123 155 246 / 55%);
  --chart-hover: rgb(123 155 246 / 7%);
  --sales-bar: linear-gradient(90deg, rgb(123 155 246 / 18%), rgb(123 155 246 / 7%));
  --notification: #ECEEF2;
  --notification-text: #0D0F13;
  --shadow: rgb(0 0 0 / 44%);
  --shadow-soft: rgb(0 0 0 / 28%);
  --backdrop: rgb(0 0 0 / 55%);
  --rail-hover: rgb(255 255 255 / 5%);
  --rail-current: var(--surface);
  --rail-scheme: dark;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A6ADBA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23A6ADBA' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}
/* Reduced motion: movement goes; a short fade may stay where it explains a change. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; }
}

:root { background: var(--ground); }
.forge-lockup { display: inline-flex; align-items: center; gap: .5rem; }
.forge-mark { display: block; flex: none; border-radius: var(--r-sm); }

/* ---- Sign-in: one white card on the calm ground, the Humphries wordmark quietly beneath it ---- */
.login-page { box-sizing: border-box; display: grid; align-content: center; justify-items: center; min-height: 100svh; margin: 0; padding: 2rem 1rem; font: var(--type-14)/1.5 var(--body-face); font-feature-settings: "cv11", "ss03"; letter-spacing: -.006em; color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
.login-page * { box-sizing: border-box; }
.login-page main { display: flex; flex-direction: column; width: min(25rem,100%); }
.login-page header { display: flex; justify-content: center; padding-bottom: 1.25rem; }
.login-page header:has(> .brand-mark) { order: 2; padding: 1.75rem 0 0; }
.login-page .brand-mark { display: block; width: auto; height: 24px; }
/* The Humphries wordmark in one solid colour, black on light and white on dark (the brand's rule): never tinted. */
:root[data-theme="dark"] .login-page .brand-mark[data-ink="black"], :root:not([data-theme="dark"]) .login-page .brand-mark[data-ink="white"] { display: none; }
/* High contrast follows the system's own light or dark, whatever Forge's theme says. */
@media (forced-colors: active) and (prefers-color-scheme: light) { .login-page .brand-mark[data-ink="black"] { display: block !important; } .login-page .brand-mark[data-ink="white"] { display: none !important; } }
@media (forced-colors: active) and (prefers-color-scheme: dark) { .login-page .brand-mark[data-ink="white"] { display: block !important; } .login-page .brand-mark[data-ink="black"] { display: none !important; } }
.login-page section { display: flex; flex-direction: column; min-width: 0; padding: 2.5rem 2.25rem 2.25rem; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--e-2); text-align: center; animation: forge-rise var(--dur-3) var(--ease-standard) both; }
@keyframes forge-rise { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@media (forced-colors: active) { .login-page section { border: 1px solid CanvasText; } }
.login-page h1 { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin: 0 0 .5rem; font-size: var(--type-24); font-weight: 600; letter-spacing: -.022em; line-height: 1.2; }
.login-page h1 .forge-mark { width: 3rem; height: 3rem; border-radius: 12px; box-shadow: 0 1px 2px rgb(255 120 67 / 35%); }
.login-page p { font-size: var(--type-14); margin: 0 0 1.25rem; color: var(--ink-2); line-height: 1.5; }
.login-page .login-lead { align-self: center; max-width: 18.5rem; margin-bottom: 1.6rem; font-size: var(--type-16); line-height: 1.5; }
.login-lead span { white-space: nowrap; }
.login-page form { margin-top: .9rem; text-align: start; }
.login-page p[role="alert"] { padding: .55rem .8rem; border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-weight: 550; }
.login-page label { font-size: var(--type-13); font-weight: 500; color: var(--ink); }
.login-page input, .login-page select { min-width: 0; border: 0; border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; box-shadow: inset 0 0 0 1px var(--field-rule), 0 1px 2px rgb(16 24 40 / 4%); transition: box-shadow var(--dur-1) var(--ease-standard); }
.login-page input:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px rgb(58 95 217 / 28%); }
.login-page input { margin: .4rem 0 1rem; padding: .55rem .8rem; width: 100%; min-height: 2.75rem; }
/* Primary actions: the passphrase button, and a page's own link out, such as "Open Forge" on a missing invoice. */
.login-page button, .login-page section > a:not(.ms-button) { display: block; width: 100%; min-height: 2.75rem; padding: .6rem .9rem; border: 0; border-radius: var(--r-md); font: 550 var(--type-16)/1.5 var(--body-face); color: var(--on-primary); background: var(--primary); box-shadow: var(--primary-shadow); text-align: center; text-decoration: none; cursor: pointer; transition: background-color var(--dur-1) var(--ease-standard), transform var(--dur-1) var(--ease-standard); }
@media (hover:hover) { .login-page button:hover, .login-page section > a:not(.ms-button):hover { background: var(--primary-hover); } }
.login-page :is(button,a):active { transform: scale(.98); }
.login-page :focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Microsoft's sign-in button: the four-square symbol, 21px with a 12px gap, 41px tall, light or dark. */
.login-page .ms-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-md); background: #ffffff; box-shadow: var(--e-control); color: #3b3b3b; font: 600 15px/1.25 "Segoe UI", system-ui, -apple-system, sans-serif; text-decoration: none; transition: background-color var(--dur-1) ease; }
.login-page .ms-button svg { flex: none; }
@media (hover:hover) { .login-page .ms-button:hover { background: #f3f3f3; } }
:root[data-theme="dark"] .login-page .ms-button { border-color: #2f2f2f; background: #2f2f2f; color: #ffffff; }
@media (hover:hover) { :root[data-theme="dark"] .login-page .ms-button:hover { border-color: #3b3b3b; background: #3b3b3b; } }

.login-notice { margin: -.35rem 0 1.35rem; padding: .8rem .95rem; border-radius: var(--r-md); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); text-align: start; }
.login-notice strong { display: block; margin-bottom: .2rem; font-size: var(--type-14); font-weight: 600; line-height: 1.35; }
.login-page .login-notice p { margin: 0; color: var(--ink); font-size: var(--type-13); }
.login-page .login-notice .login-account { margin-top: .45rem; color: var(--ink-2); font-size: var(--type-13); overflow-wrap: anywhere; }
.login-notice[data-tone="error"] { background: var(--danger-soft); box-shadow: none; }
.login-notice[data-tone="error"] strong { color: var(--danger); }
.login-notice[data-tone="pending"] { background: var(--warning-soft); box-shadow: none; }
.login-notice[data-tone="pending"] strong { color: var(--warning); }
.login-notice[data-tone="info"] { background: var(--accent-soft); box-shadow: none; }
.login-notice[data-tone="info"] strong { color: var(--accent-strong); }

.login-page .login-other { margin: .35rem 0 -.75rem; }
.login-page .login-other a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .5rem; border-radius: var(--r-md); color: var(--accent); font-size: var(--type-14); font-weight: 500; }

@media (max-width: 34rem) {
  .login-page { padding-block: 1.25rem; }
  .login-page header:has(> .brand-mark) { padding-top: 1.4rem; }
  .login-page .brand-mark { height: 20px; }
  .login-page section { padding: 2rem 1.25rem 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { .login-page section { animation: none; } }
