/* ===========================================================================
   SeerDynamics Vendor Portal - site.css
   ---------------------------------------------------------------------------
   Hand-written stylesheet. No CSS framework, no build step, no CDN.
   The visual language follows the "Vendor Portal F&O - Standalone" reference:
   Microsoft Fluent / Dynamics 365 F&O - black shell bar, white ribbon,
   48px icon rail, 2px corner radius, Segoe UI type ramp.

   Sections
     1  Design tokens
     2  Reset & base
     3  Layout shell (top bar, ribbon, rail, content)
     4  Typography & page headers
     5  Cards, KPI tiles, panels
     6  Data tables & list views
     7  Status pills & badges
     8  Buttons
     9  Forms & wizard
     10 Modals, drawers, toasts
     11 Timeline, empty states, misc
     12 Login & public pages
     13 Responsive
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1  DESIGN TOKENS
   --------------------------------------------------------------------------- */
:root {
  /* Brand & accent (v15: unified to the CLM-reference blue -- was Fluent
     #0078d4. This single token drives every legacy link/button/tab color
     site-wide, so the swap re-skins auth pages, the register wizard and
     every list/detail screen at once without touching those files. */
  --accent:           #2563eb;
  --accent-hover:     #1d4ed8;
  --accent-pressed:   #1e40af;
  --accent-light:     #eff6ff;
  --accent-border:    #bfdbfe;
  --brand-navy:       #1b3a6b;
  --brand-teal:       #038387;
  --brand-purple:     #8764b8;
  --brand-gold:       #c19c00;

  /* Neutrals (Fluent grey ramp) */
  --shell:            #000000;
  --surface:          #ffffff;
  --canvas:           #ffffff;
  --hover:            #f3f2f1;
  --divider:          #f3f2f1;
  --border:           #edebe9;
  --border-strong:    #d2d0ce;
  --input-border:     #8a8886;
  --text:             #201f1e;
  --text-muted:       #605e5c;
  --text-subtle:      #8a8886;
  --text-invert:      #ffffff;

  /* Semantic */
  --success:          #107c10;
  --success-bg:       #dff6dd;
  --warning:          #8a6a1f;
  --warning-bg:       #fff4ce;
  --danger:           #a4262c;
  --danger-bg:        #fde7e9;
  --info:             #2563eb;
  --info-bg:          #eff6ff;
  --purple-fg:        #5c2e91;
  --purple-bg:        #f0e8fa;

  /* Geometry */
  --radius:           2px;
  --radius-lg:        4px;
  --rail-w:           48px;
  --rail-expanded-w:  220px;
  --shell-h:          44px;
  --ribbon-h:         40px;

  /* Elevation (Fluent depth ramp) */
  --shadow-2:         0 1.6px 3.6px rgba(0,0,0,.13), 0 .3px .9px rgba(0,0,0,.11);
  --shadow-8:         0 3.2px 7.2px rgba(0,0,0,.13), 0 .6px 1.8px rgba(0,0,0,.11);
  --shadow-16:        0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.11);
  --shadow-64:        0 25.6px 57.6px rgba(0,0,0,.22), 0 4.8px 14.4px rgba(0,0,0,.18);

  /* Type */
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Cascadia Mono', Consolas, 'Courier New', monospace;

  /* Business Central palette - dashboard, registration wizard and the
     Vendors screens use this; everything else still reads the Fluent/F&O
     tokens above until it gets converted in a later pass. */
  --bc-teal:            #0f6e71;
  --bc-teal-dark:       #0a5254;
  --bc-teal-light:      #e3f1f1;
  --bc-teal-text:       #106b70;
  --bc-underline-olive: #8a7a1f;
  --bc-underline-green: #107c10;
  --bc-underline-teal:  #0f6e71;
  --bc-underline-danger:#a4262c;
}

/* ---------------------------------------------------------------------------
   2  RESET & BASE
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-border); color: #004578; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Visible keyboard focus everywhere -- accessibility baseline. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------
   3  LAYOUT SHELL
   --------------------------------------------------------------------------- */

/* --- Top shell bar (black, sticky) --- */
.shell-bar {
  height: var(--shell-h);
  background: var(--shell);
  display: flex;
  align-items: center;
  padding: 0 10px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.shell-bar__waffle,
.shell-bar__icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  color: #fff;
  background: none; border: none; padding: 0;
  flex-shrink: 0;
  position: relative;
}
.shell-bar__waffle:hover,
.shell-bar__icon:hover { background: rgba(255,255,255,.12); }

.shell-bar__brand {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
}
.shell-bar__brand:hover { text-decoration: none; }
.shell-bar__logo { height: 18px; width: auto; object-fit: contain; flex-shrink: 0; }
.shell-bar__brand-text { font-size: 14px; font-weight: 600; white-space: nowrap; }

.shell-bar__sep {
  width: 1px; height: 20px;
  background: rgba(255,255,255,.25);
  margin: 0 4px;
  flex-shrink: 0;
}
.shell-bar__app {
  padding: 0 12px;
  font-size: 14px; font-weight: 600;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.shell-bar__spacer { flex: 1; }

.shell-bar__search {
  width: 340px; max-width: 32vw;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border-radius: var(--radius);
  padding: 6px 10px;
  margin-right: 14px;
}
.shell-bar__search input {
  border: none; outline: none; background: none;
  font-size: 12.5px; color: #fff; width: 100%;
  font-family: inherit;
}
.shell-bar__search input::placeholder { color: #c8c6c4; }

.shell-bar__actions { display: flex; align-items: center; gap: 2px; }

.shell-bar__dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #000;
}

.shell-bar__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #5b5fc7; color: #fff;
  font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; flex-shrink: 0;
}

/* --- Flyout menus (notifications, profile) --- */
.flyout-anchor { position: relative; }
.flyout {
  position: absolute; right: 0; top: 40px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-16);
  border: 1px solid var(--border);
  overflow: hidden;
  color: var(--text);
  z-index: 250;
}
.flyout--notif { width: 360px; }
.flyout--profile { width: 240px; }
.flyout[hidden] { display: none; }

/* v10: the sidebar's profile menu is anchored to a button pinned at the very
   bottom of the viewport, so opening downward (the default) would run the
   menu off-screen. Opening upward instead — like Claude's account menu —
   keeps it fully visible regardless of window height. */
.flyout-anchor--up .flyout { top: auto; bottom: calc(100% + 8px); }

.flyout__head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13.5px;
  display: flex; justify-content: space-between; align-items: center;
}
.flyout__count {
  font-weight: 700; font-size: 10.5px;
  color: var(--accent); background: var(--accent-light);
  padding: 2px 8px; border-radius: 10px;
}
.flyout__item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px; line-height: 1.5;
  color: var(--text-muted);
  text-decoration: none;
}
.flyout__item:last-child { border-bottom: none; }
.flyout__item:hover { background: var(--hover); text-decoration: none; }
.flyout__item strong { color: var(--text); font-weight: 600; }
.flyout__item--unread { background: #fbfcfe; border-left: 3px solid var(--accent); }
.flyout__time { font-size: 10.5px; color: var(--text-subtle); margin-top: 3px; }
.flyout__foot {
  padding: 10px 16px; text-align: center;
  font-size: 12px; font-weight: 600;
  border-top: 1px solid var(--border);
}
.flyout__user { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.flyout__user-name { font-weight: 600; font-size: 13px; }
.flyout__user-sub { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }
.flyout__menu { padding: 6px 4px; display: flex; flex-direction: column; }
.flyout__menu a, .flyout__menu button {
  padding: 9px 12px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text);
  cursor: pointer; border-radius: var(--radius);
  background: none; border: none; text-align: left;
  font-family: inherit;
}
.flyout__menu a:hover, .flyout__menu button:hover { background: var(--hover); text-decoration: none; }

/* --- Ribbon / command bar --- */
.ribbon {
  min-height: var(--ribbon-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  position: sticky; top: var(--shell-h);
  z-index: 190;
}
.ribbon__crumb { font-size: 11.5px; color: var(--text-subtle); }
.ribbon__crumb a { color: var(--text-subtle); }
.ribbon__crumb b { color: var(--text); font-weight: 600; }
.ribbon__spacer { flex: 1; }
.ribbon__actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

/* --- Body split: rail + content --- */
.app-body { display: flex; }

.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--shell-h) - var(--ribbon-h));
  display: flex; flex-direction: column; align-items: center;
  padding-top: 6px;
  position: relative;
}
.rail__toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #484644;
  margin-bottom: 6px;
  background: none; border: none;
}
.rail__toggle:hover { background: var(--hover); }

.rail__link {
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 10px 2px;
  cursor: pointer;
  color: #484644;
  border-left: 3px solid transparent;
  font-size: 9px; font-weight: 600;
  text-decoration: none;
  text-align: center;
  position: relative;
}
.rail__link:hover { background: var(--hover); text-decoration: none; }
.rail__link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
}
.rail__badge {
  position: absolute; top: 6px; right: 8px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 15px;
}

.rail__flyout {
  position: absolute; left: var(--rail-w); top: 0;
  width: var(--rail-expanded-w);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 4px 0 14px rgba(0,0,0,.12);
  z-index: 150;
  padding: 8px;
}
.rail__flyout[hidden] { display: none; }
.rail__flyout a {
  display: block;
  padding: 9px 12px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  border-radius: var(--radius);
}
.rail__flyout a:hover { background: var(--hover); text-decoration: none; }
.rail__flyout a.is-active { color: var(--accent); }
.rail__flyout .rail__group {
  border-top: 1px solid var(--border);
  margin-top: 6px; padding-top: 6px;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 60px;
}
.content--wide { padding: 20px 20px 60px; }

/* ---------------------------------------------------------------------------
   4  TYPOGRAPHY & PAGE HEADERS
   --------------------------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
h4 { font-size: 13px; }
p  { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.page-head {
  display: flex; align-items: flex-start;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head__text { min-width: 0; }
.page-head__title { font-size: 20px; font-weight: 600; }
.page-head__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.section-title {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
  margin: 24px 0 10px;
}
.section-title:first-child { margin-top: 0; }

.muted    { color: var(--text-muted); }
.subtle   { color: var(--text-subtle); }
.small    { font-size: 11.5px; }
.strong   { font-weight: 600; }
.mono     { font-family: var(--font-mono); }
.nowrap   { white-space: nowrap; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

/* --- Hero banner (dashboard greeting) --- */
.hero {
  height: 150px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #0b2545 0%, #0f3d5f 45%, #0a5a6b 100%);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  display: flex; align-items: flex-end;
  padding: 20px 26px;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 26px);
}
.hero__inner { position: relative; }
.hero__title { color: #fff; font-size: 22px; font-weight: 600; }
.hero__sub { color: #bcd6e8; font-size: 12.5px; margin-top: 4px; }
.hero--admin { background: linear-gradient(120deg, #17263d 0%, #24406b 50%, #3b2a63 100%); }

/* --- Quick launch tiles ---
   v12: each tile is now its own bordered/shadowed card (using the same
   --app-* tokens as the .app-kpi tiles right below this row), so it reads as
   a row of distinct tiles against the white page background instead of
   floating icons with no visible boundary. */
.quicklaunch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.quicklaunch__item {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding: 16px 8px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  color: var(--text);
  text-align: center;
}
.quicklaunch__item:hover {
  border-color: var(--app-border-strong);
  text-decoration: none;
}
.quicklaunch__icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.quicklaunch__label { font-size: 12px; font-weight: 600; }
.bg-accent { background: var(--accent); }
.bg-navy   { background: var(--brand-navy); }
.bg-teal   { background: var(--brand-teal); }
.bg-purple { background: var(--brand-purple); }
.bg-gold   { background: var(--brand-gold); }
.bg-green  { background: var(--success); }
.bg-red    { background: var(--danger); }

/* ---------------------------------------------------------------------------
   5  CARDS, KPI TILES, PANELS
   --------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card + .card { margin-top: 12px; }

.card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.card__title { font-weight: 600; font-size: 14px; }
.card__sub { font-size: 11.5px; color: var(--text-subtle); margin-top: 2px; }
.card__link { font-size: 12px; font-weight: 600; color: var(--accent); }
.card__body { padding: 16px 18px; }
.card__body--flush { padding: 4px 18px 12px; }
.card__body--tight { padding: 10px 12px; }
.card__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: #ffffff;
  flex-wrap: wrap;
}

/* KPI tiles */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: block;
  color: var(--text);
}
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.kpi__label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
}
.kpi__value { font-size: 26px; font-weight: 600; margin-top: 8px; line-height: 1.1; }
.kpi__value--sm { font-size: 17px; }
.kpi__note { font-size: 11px; font-weight: 600; color: var(--text-subtle); margin-top: 6px; }
.kpi__note--up   { color: var(--success); }
.kpi__note--down { color: var(--danger); }
.kpi--accent { border-top: 3px solid var(--accent); }
.kpi--warning { border-top: 3px solid #c19c00; }
.kpi--danger { border-top: 3px solid var(--danger); }
.kpi--success { border-top: 3px solid var(--success); }

/* Two- and three-column dashboard grids */
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 > *, .grid-3 > *, .grid-2-even > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row--tight { gap: 4px; }
.row--between { justify-content: space-between; }

/* Definition list used on every detail page */
.deflist { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 24px; }
.deflist--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.deflist__label {
  font-size: 10.5px; font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .35px;
}
.deflist__value { font-size: 13px; margin-top: 3px; word-break: break-word; }

/* Bar meter used for spend / performance breakdowns */
.meter { margin-bottom: 12px; }
.meter:last-child { margin-bottom: 0; }
.meter__head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.meter__track { height: 6px; background: var(--divider); border-radius: 3px; overflow: hidden; }
.meter__fill { height: 100%; background: var(--accent); border-radius: 3px; }
.meter__fill--teal { background: var(--brand-teal); }
.meter__fill--gold { background: var(--brand-gold); }
.meter__fill--purple { background: var(--brand-purple); }
.meter__fill--danger { background: var(--danger); }

/* --- Insight cards ---------------------------------------------------------
   A single, uniform "box" type for dashboards: a compact analytics grid where
   every widget shares the same card shell, so a screen can hold many small
   panels (KPI groups, status breakdowns, mini bar charts) without the page
   turning into a tall stack of full-width hero/table sections. */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}
.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 14px 16px 16px;
}
.insight-card--wide { grid-column: span 2; }
.insight-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.insight-card__title {
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.insight-card__link { font-size: 11px; font-weight: 600; color: var(--accent); flex-shrink: 0; }
.insight-card__empty { font-size: 12px; color: var(--text-subtle); padding: 6px 0; }

/* v12: tightened padding/chip size so a short "Needs your attention" list
   (2-3 rows) doesn't leave the main dashboard column looking sparse next to
   the fuller side panel. */
.insight-row {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0;
}
.insight-row + .insight-row { border-top: 1px solid var(--divider); }
.insight-chip {
  flex-shrink: 0;
  min-width: 26px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--brand-navy);
  color: #fff;
  font-size: 11px; font-weight: 700;
  text-align: center;
  line-height: 1.5;
}
.insight-chip--accent  { background: var(--accent); }
.insight-chip--success { background: var(--success); }
.insight-chip--warning { background: var(--brand-gold); }
.insight-chip--danger  { background: var(--danger); }
.insight-row__label {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.insight-row--link { color: inherit; }
a.insight-row--link:hover { text-decoration: none; }
a.insight-row--link:hover .insight-row__label { color: var(--accent); }
.insight-row > .pill { flex-shrink: 0; }
.insight-row__meta {
  flex-shrink: 0;
  font-size: 11px; color: var(--text-subtle);
  white-space: nowrap;
}

/* Compact bar meter used inside an insight card (spend-by-vendor, etc.) */
.insight-bar { margin-bottom: 9px; }
.insight-bar:last-child { margin-bottom: 0; }
.insight-bar__head {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; margin-bottom: 4px;
}
.insight-bar__head span:last-child { color: var(--text-subtle); flex-shrink: 0; }
.insight-bar__track { height: 5px; background: var(--divider); border-radius: 3px; overflow: hidden; }
.insight-bar__fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------------------------------------------------------------------------
   6  DATA TABLES & LIST VIEWS
   --------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-subtle);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
}
.table td {
  padding: 11px 8px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f3f9fd; }
.table__link { color: var(--accent); font-weight: 600; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.muted { color: var(--text-muted); font-size: 12px; }
.table--compact td { padding: 8px; }
.table--lines th { background: #ffffff; }
.table tfoot td {
  padding: 10px 8px;
  font-weight: 600;
  border-top: 1px solid var(--border-strong);
  border-bottom: none;
  background: #ffffff;
}

/* Filter bar above list views */
.filterbar {
  display: flex; gap: 8px; align-items: flex-end;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}
.filterbar .field { margin-bottom: 0; }
.filterbar .field__input,
.filterbar .field__select { min-width: 150px; }
.filterbar__spacer { flex: 1; }

/* Pagination */
.pager {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.pager__info { color: var(--text-muted); margin-right: auto; }
.pager__link {
  min-width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-weight: 600;
}
.pager__link:hover { background: var(--hover); text-decoration: none; }
.pager__link.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager__link.is-disabled { color: var(--text-subtle); pointer-events: none; opacity: .5; }

/* Tabs */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs__item {
  padding: 9px 14px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs__item:hover { color: var(--text); text-decoration: none; background: var(--hover); }
.tabs__item.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------------------
   7  STATUS PILLS & BADGES
   --------------------------------------------------------------------------- */
/* v15: CLM reference renders status/risk values as a coloured dot + plain
   text (no filled chip background) rather than a solid badge. Only the
   presentation changed here -- status.pill() still emits the same
   `<span class="pill pill--tone">label</span>` markup everywhere, so no
   view or service code needed to change. */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.pill::before {
  content: ''; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pill--neutral { color: var(--text-muted); }
.pill--info    { color: var(--info); }
.pill--success { color: var(--success); }
.pill--warning { color: var(--warning); }
.pill--danger  { color: var(--danger); }
.pill--purple  { color: var(--purple-fg); }

.badge {
  display: inline-block;
  min-width: 18px; padding: 1px 6px;
  border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; text-align: center;
}
.badge--muted { background: var(--border-strong); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 11.5px;
}
.chip__remove { cursor: pointer; color: var(--text-subtle); font-weight: 700; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-navy); color: #fff;
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }

/* Inline alerts */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  border-left: 3px solid;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert__body { flex: 1; }
.alert strong { font-weight: 600; }
.alert--info    { background: var(--info-bg);    border-color: var(--info); }
.alert--success { background: var(--success-bg); border-color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: #c19c00; }
.alert--danger  { background: var(--danger-bg);  border-color: var(--danger); }

/* ---------------------------------------------------------------------------
   8  BUTTONS
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  min-height: 32px;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }

.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--primary:active { background: var(--accent-pressed); }

.btn--default { border-color: var(--input-border); }
.btn--default:hover { background: var(--hover); }

.btn--danger { border-color: var(--input-border); color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); }

.btn--success { background: var(--success); color: #fff; border-color: var(--success); }
.btn--success:hover { filter: brightness(1.08); }

.btn--subtle { color: var(--accent); padding: 5px 10px; background: none; min-height: 28px; }
.btn--subtle:hover { background: var(--hover); }

.btn--sm { padding: 4px 10px; font-size: 11.5px; min-height: 26px; }
.btn--block { width: 100%; }

/* Ribbon command buttons */
.cmd {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  background: none; border: none;
  cursor: pointer; font-family: inherit;
}
.cmd:hover { background: var(--hover); text-decoration: none; }
.cmd--muted { color: var(--text-muted); }

/* ---------------------------------------------------------------------------
   9  FORMS & WIZARD
   --------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 20px;
}
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.field { margin-bottom: 16px; }
.field__label {
  display: block;
  font-size: 12px; font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 11px; color: var(--text-subtle); margin-top: 4px; }
.field__error { font-size: 11.5px; color: var(--danger); margin-top: 4px; font-weight: 600; }

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  min-height: 32px;
}
.field__textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field__input:hover, .field__select:hover, .field__textarea:hover { border-color: var(--text); }
.field__input:focus, .field__select:focus, .field__textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.field__input:disabled, .field__select:disabled, .field__textarea:disabled,
.field__input[readonly] {
  background: var(--hover);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
}
.field.has-error .field__input,
.field.has-error .field__select,
.field.has-error .field__textarea { border-color: var(--danger); }

.field__select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23605e5c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
  padding-right: 28px;
}

.field__static {
  padding: 7px 0;
  font-size: 13px;
  min-height: 32px;
}

/* Checkbox / radio */
.check {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px;
  margin-bottom: 8px;
  cursor: pointer;
}
.check input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.check__text { line-height: 1.5; }

.field-inline { display: flex; gap: 8px; align-items: center; }

/* Multi-select category picker */
.checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 16px;
}

/* File upload dropzone */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  background: #ffffff;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-light); }
.dropzone__icon { color: var(--text-subtle); margin-bottom: 6px; }
.dropzone__title { font-size: 12.5px; font-weight: 600; }
.dropzone__hint { font-size: 11px; color: var(--text-subtle); margin-top: 3px; }
.dropzone input[type="file"] { display: block; margin: 10px auto 0; font-size: 12px; }

/* Wizard stepper */
.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.stepper__step {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--text-subtle);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.stepper__step:hover { text-decoration: none; }
.stepper__num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--divider); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.stepper__step.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.stepper__step.is-active .stepper__num { background: var(--accent); color: #fff; }
.stepper__step.is-done { color: var(--success); }
.stepper__step.is-done .stepper__num { background: var(--success-bg); color: var(--success); }

/* Form action bar */
.form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  flex-wrap: wrap;
}
.form-actions--split { justify-content: space-between; }

/* Repeatable line-item editor.
   v9 fix: the v8 shell rewrite moved these editors' tables from `.table` to
   `.app-table.table--lines` (invoice-new, po-new, rfq-new, rfq-respond) but
   this rule was never updated to match, so bare inputs/selects inside them
   rendered with no styling at all. `.table--lines` is added below alongside
   the original `.table` selector so both class names style correctly. */
.lines-editor .table input,
.lines-editor .table select,
.lines-editor .table--lines input,
.lines-editor .table--lines select {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit; font-size: 12.5px;
  min-height: 28px;
}
.lines-editor .table input:focus,
.lines-editor .table--lines input:focus { border-color: var(--accent); outline: none; }
.lines-editor .table input.num,
.lines-editor .table--lines input.num { text-align: right; }

/* Readonly/disabled fields (v9: description/unit price/tax on invoice lines
   are server-derived and shown but not editable — only quantity is). */
.lines-editor .table input[readonly],
.lines-editor .table input:disabled,
.lines-editor .table--lines input[readonly],
.lines-editor .table--lines input:disabled {
  background: var(--hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Totals block */
.totals { margin-left: auto; width: 280px; max-width: 100%; }
.totals__row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 12.5px;
}
.totals__row--grand {
  border-top: 1px solid var(--border-strong);
  margin-top: 4px; padding-top: 10px;
  font-size: 15px; font-weight: 600;
}

/* ---------------------------------------------------------------------------
   10  MODALS, DRAWERS, TOASTS
   --------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--surface);
  width: 560px; max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-64);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.modal--lg { width: 820px; }
.modal--sm { width: 420px; }
.modal__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.modal__title { font-size: 15px; font-weight: 600; }
.modal__close {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--hover);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  font-size: 13px; color: var(--text-muted);
}
.modal__close:hover { background: var(--border); }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-wrap: wrap;
}

/* Toast */
.toast-host {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-16);
  font-size: 12.5px; font-weight: 500;
  display: flex; gap: 10px; align-items: center;
  animation: toast-in .18s ease-out;
}
.toast--success { background: #0b5c0b; }
.toast--danger  { background: #8b1f24; }
.toast--warning { background: #715014; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Page loader */
.loader-host {
  position: fixed; inset: 0;
  background: rgba(250,249,248,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.loader-host[hidden] { display: none; }
.loader-badge {
  position: relative;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.loader-badge__logo {
  position: absolute;
  width: 26px; height: auto; object-fit: contain;
  animation: pulse 1.1s ease-in-out infinite;
}
.spinner {
  width: 56px; height: 56px;
  border: 3px solid var(--accent-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: .55; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* Idle-timeout warning */
.idle-warning {
  position: fixed; bottom: 24px; left: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #c19c00;
  box-shadow: var(--shadow-16);
  border-radius: var(--radius);
  padding: 14px 18px;
  z-index: 400;
  max-width: 340px;
}
.idle-warning[hidden] { display: none; }
.idle-warning__title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.idle-warning__text { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

/* ---------------------------------------------------------------------------
   11  TIMELINE, EMPTY STATES, MISC
   --------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: '';
  position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 1px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 18px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -22px; top: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border-strong);
}
.timeline__dot--done    { border-color: var(--success); }
.timeline__dot--active  { border-color: var(--accent); }
.timeline__dot--danger  { border-color: var(--danger); }
.timeline__title { font-size: 12.5px; font-weight: 600; }
.timeline__meta { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }
.timeline__body { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.55; }

/* Approval flow strip (registration workflow) */
.flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin-bottom: 18px; }
.flow__node {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px; font-weight: 600;
}
.flow__node.is-done   { border-color: var(--success); color: var(--success); background: var(--success-bg); }
.flow__node.is-active { border-color: var(--accent);  color: var(--accent);  background: var(--accent-light); }
.flow__node.is-rejected { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.flow__arrow { color: var(--text-subtle); padding: 0 8px; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty__icon { color: var(--border-strong); margin-bottom: 10px; }
.empty__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty__text { font-size: 12.5px; max-width: 420px; margin: 0 auto 14px; }

/* File attachment list */
.filelist { display: flex; flex-direction: column; gap: 6px; }
.fileitem {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12.5px;
}
.fileitem__icon { color: var(--danger); flex-shrink: 0; }
.fileitem__name { font-weight: 600; }
.fileitem__meta { font-size: 11px; color: var(--text-subtle); }
.fileitem__spacer { flex: 1; }

/* Comparison table highlight (RFQ evaluation) */
.is-best { background: var(--success-bg) !important; font-weight: 600; }
.is-worst { color: var(--danger); }

/* Print */
@media print {
  .shell-bar, .ribbon, .rail, .form-actions, .toast-host, .loader-host { display: none !important; }
  .content { padding: 0; }
  .card { border-color: #ccc; box-shadow: none; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------------------
   12  LOGIN & PUBLIC PAGES
   ---------------------------------------------------------------------------
   Matches the supplied sign-in design: full-bleed backdrop, centred frosted
   card, Microsoft SSO above a local username/password form.

   The backdrop image is optional. Drop a file at public/img/login-bg.jpg and
   it is used automatically; if it is missing the CSS gradient below shows
   through unchanged, so the page never renders broken.
   --------------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(56,128,220,.55) 0%, rgba(10,32,72,0) 60%),
    linear-gradient(160deg, #071a3d 0%, #0b2e63 42%, #0a1c3f 100%);
  background-size: cover;
  background-position: center;
}
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('/img/login-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: 0;
}
/* Subtle vignette so the card always has contrast, whatever the artwork. */
.auth-page::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(4,16,38,.15) 0%, rgba(4,16,38,.55) 100%);
  z-index: 1;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 380px; max-width: 100%;
  background: rgba(238, 243, 250, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  padding: 30px 32px 22px;
}

.auth-card__brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; margin-bottom: 4px;
}
.auth-card__logo { height: 42px; width: auto; object-fit: contain; }
.auth-card__context {
  font-size: 11px; color: #5d6b83;
  text-align: center; margin-bottom: 20px;
}

.auth-card__title {
  font-size: 22px; font-weight: 600;
  text-align: center; color: #16223c;
}
.auth-card__sub {
  font-size: 12.5px; color: #5d6b83;
  text-align: center; margin: 4px 0 20px;
}

/* Microsoft SSO button */
.btn-ms {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 16px;
  background: #ffffff;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: #2f3d57;
  cursor: pointer;
  text-decoration: none;
}
.btn-ms:hover { background: #f7f9fc; border-color: #b9c4d6; text-decoration: none; }
.ms-logo { width: 17px; height: 17px; flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  font-size: 11.5px; color: #6b7890;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(0,0,0,.12);
}

.auth-field { margin-bottom: 14px; }
.auth-field__label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: #46536e; margin-bottom: 6px;
}
.auth-field__input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #dfe5ee;
  border-radius: 6px;
  background: #f2f5f9;
  font-family: inherit; font-size: 13.5px;
  color: #16223c;
}
.auth-field__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,120,212,.16);
}
.auth-field__input::placeholder { color: #97a2b6; }

.btn-signin {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(95deg, #4a63e7 0%, #7a5cf0 100%);
  color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-signin:hover { filter: brightness(1.07); }
.btn-signin:active { filter: brightness(.95); }

.auth-link {
  display: block; text-align: center;
  margin-top: 16px;
  font-size: 12.5px; color: #3b6bd4; font-weight: 500;
}

.auth-secured {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 20px; padding-top: 6px;
  font-size: 11px; color: #6b7890;
}
.auth-secured__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.6);
}

.auth-alert {
  padding: 10px 13px;
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.auth-alert--danger  { background: #fde7e9; color: #8b1f24; border-color: #a4262c; }
.auth-alert--success { background: #dff6dd; color: #0b5c0b; border-color: #107c10; }
.auth-alert--info    { background: #eff6fc; color: #1b4d80; border-color: #0078d4; }

.auth-note {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,.55);
  border: 1px dashed rgba(0,0,0,.14);
  border-radius: 6px;
  font-size: 11px; color: #4d5b75; line-height: 1.6;
}
.auth-note b { color: #16223c; }

/* Wide card variant for vendor self-registration */
.auth-card--wide { width: 720px; }
.auth-card--wide .auth-card__title { text-align: left; }
.auth-card--wide .auth-card__sub { text-align: left; }

/* ---------------------------------------------------------------------------
   13  RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .shell-bar__search { display: none; }
  .shell-bar__brand-text { display: none; }
  .content { padding: 16px 14px 60px; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-grid, .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .deflist--2col { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .insight-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .insight-card--wide { grid-column: span 1; }
  .totals { width: 100%; }
  .hero { height: auto; padding: 18px; }
  .hero__title { font-size: 18px; }
  .modal { max-height: 94vh; }
  .card__head { padding: 12px 14px; }
  .card__body { padding: 14px; }
  .filterbar { padding: 12px 14px; }
}

@media (max-width: 560px) {
  .rail {
    position: fixed; bottom: 0; left: 0; right: 0;
    width: 100%; min-height: 0;
    flex-direction: row; justify-content: space-around;
    border-right: none; border-top: 1px solid var(--border);
    padding: 0; z-index: 180;
    box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  }
  .rail__toggle { display: none; }
  .rail__link { border-left: none; border-top: 3px solid transparent; padding: 8px 2px; }
  .rail__link.is-active { border-left-color: transparent; border-top-color: var(--accent); }
  .rail__flyout { left: 0; right: 0; bottom: 100%; top: auto; width: auto; }
  .content { padding-bottom: 80px; }
  .page-head__actions { width: 100%; margin-left: 0; }
  .auth-card { padding: 24px 20px 18px; }
  .table th, .table td { padding: 9px 6px; font-size: 12px; }
}

/* ---------------------------------------------------------------------------
   14  BUSINESS CENTRAL SHELL & COMPONENTS
   ---------------------------------------------------------------------------
   Applied to the app shell (all authenticated pages), both dashboards, the
   registration wizard, and the Vendors screens as of v7. Everything else
   still uses the shell-bar/rail/ribbon/kpi-grid/insight-card components
   above until it is converted in a later pass - both sets of components
   are safe to have loaded at once, they just aren't both in use on any one
   screen yet.
   --------------------------------------------------------------------------- */

/* --- App bar: company name + horizontal primary nav, replaces the rail --- */
.appbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 0;
  position: sticky;
  top: var(--shell-h);
  z-index: 190;
}
.appbar__title {
  font-size: 15px; font-weight: 700; letter-spacing: .2px;
  color: var(--text); margin-bottom: 10px;
}
.appbar__nav {
  display: flex; gap: 20px; flex-wrap: wrap;
  overflow-x: auto;
}
.appbar__nav-item {
  position: relative;
  padding: 0 1px 10px;
  font-size: 13px; font-weight: 600;
  color: var(--bc-teal-text);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.appbar__nav-item:hover { text-decoration: none; color: var(--bc-teal-dark); }
.appbar__nav-item.is-active { color: var(--text); border-bottom-color: var(--bc-teal); font-weight: 700; }
.appbar__badge {
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center;
}

/* --- Dashboard: headline banner --- */
.bc-headline { margin: 20px 0 26px; }
.bc-headline__eyebrow {
  font-size: 11px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.bc-headline__title { font-size: 28px; font-weight: 300; color: var(--text); line-height: 1.2; max-width: 640px; }
.bc-headline__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

.bc-section-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 28px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.bc-section-title:first-of-type { margin-top: 0; }

/* --- Dashboard: "Activities" row - a handful of headline metrics --- */
.bc-activities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 26px;
  margin-bottom: 8px;
}
.bc-activity { display: block; color: var(--text); }
.bc-activity:hover { text-decoration: none; }
.bc-activity__label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.bc-activity__value { font-size: 32px; font-weight: 300; color: var(--text); line-height: 1.1; }
.bc-activity__bar { height: 3px; width: 68%; max-width: 120px; margin-top: 12px; border-radius: 2px; background: var(--border-strong); }
.bc-activity__bar--olive  { background: var(--bc-underline-olive); }
.bc-activity__bar--green  { background: var(--bc-underline-green); }
.bc-activity__bar--teal   { background: var(--bc-underline-teal); }
.bc-activity__bar--danger { background: var(--bc-underline-danger); }
.bc-activity__link { display: flex; align-items: center; gap: 2px; margin-top: 9px; font-size: 12px; font-weight: 600; color: var(--bc-teal-text); }

/* --- Dashboard: "Ongoing X" teal tile groups --- */
.bc-tile-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  margin-top: 4px;
}
.bc-tile-group__title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.bc-tile-row { display: flex; flex-wrap: wrap; gap: 10px; }
.bc-tile {
  background: var(--bc-teal);
  color: #fff;
  border-radius: var(--radius);
  width: 122px; min-height: 96px;
  padding: 10px 12px 9px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.bc-tile:hover { text-decoration: none; color: #fff; filter: brightness(1.07); }
.bc-tile__label { font-size: 10.5px; font-weight: 600; opacity: .92; line-height: 1.3; }
.bc-tile__value { font-size: 25px; font-weight: 300; margin: 4px 0 6px; }
.bc-tile__foot { display: flex; justify-content: flex-end; opacity: .85; }
.bc-tile--camera {
  align-items: center; justify-content: center;
  background: var(--hover); color: var(--text-muted);
}
.bc-tile--camera:hover { color: var(--text-muted); background: var(--border); }

/* --- Business Central style ribbon: icon+label command tabs --- */
.bc-ribbon {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.bc-ribbon__cmd {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 12.5px; font-weight: 600;
  color: var(--text);
  background: none; border: none; cursor: pointer;
  font-family: inherit;
}
.bc-ribbon__cmd:hover { background: var(--hover); text-decoration: none; }
.bc-ribbon__cmd--primary { color: var(--bc-teal-text); }
.bc-ribbon__sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* --- Business Central style data table (list screens) --- */
.bc-table-wrap { width: 100%; overflow-x: auto; }
.bc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bc-table th {
  text-align: left; font-weight: 600; color: var(--text);
  padding: 9px 10px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.bc-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.bc-table tbody tr:hover { background: var(--bc-teal-light); }
.bc-table tbody tr.is-selected { background: var(--bc-teal-light); }
.bc-table td.num, .bc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bc-table__link { color: var(--text); font-weight: 600; }
.bc-table__link:hover { color: var(--bc-teal-text); }

/* --- Business Central style detail/edit screen: tabs + grid + side panel --- */
.bc-detail { display: flex; gap: 0; align-items: flex-start; }
.bc-detail__main { flex: 1; min-width: 0; }
.bc-detail__panel {
  width: 300px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 0 0 0 20px;
  margin-left: 20px;
}
.bc-detail__panel-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.bc-panel-section { margin-bottom: 20px; }
.bc-panel-section__title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
  margin-bottom: 8px;
}
.bc-panel-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12px; }
.bc-panel-row__label { color: var(--text-subtle); }
.bc-panel-row__value { color: var(--text); font-weight: 600; text-align: right; }
.bc-panel-empty { font-size: 11.5px; color: var(--text-subtle); padding: 4px 0; }

.bc-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-x: auto; }
.bc-tabs__item {
  padding: 9px 14px; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.bc-tabs__item:hover { color: var(--text); text-decoration: none; background: var(--hover); }
.bc-tabs__item.is-active { color: var(--bc-teal-text); border-bottom-color: var(--bc-teal); }

@media (max-width: 1100px) {
  .bc-detail { flex-direction: column; }
  .bc-detail__panel { width: 100%; border-left: none; border-top: 1px solid var(--border); padding: 16px 0 0; margin: 20px 0 0; }
}
@media (max-width: 820px) {
  .appbar { padding: 10px 14px 0; }
  .bc-activities { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; }
  .bc-headline__title { font-size: 22px; }
}

/* --- BC palette applied to the public registration wizard only ------------
   Wrap a register/*.ejs page's content in <div class="bc-auth">...</div>.
   Login, forgot-password and account pages are untouched and keep the
   existing blue/purple accent until they are converted in a later pass. */
.bc-auth .auth-field__input:focus {
  border-color: var(--bc-teal);
  box-shadow: 0 0 0 3px rgba(15,110,113,.16);
}
.bc-auth .btn-signin { background: linear-gradient(95deg, var(--bc-teal) 0%, var(--bc-teal-dark) 100%); }
.bc-auth .auth-link { color: var(--bc-teal-text); }
.bc-auth .auth-alert--info { background: var(--bc-teal-light); border-color: var(--bc-teal); color: var(--bc-teal-dark); }
.bc-auth .stepper__step.is-active { color: var(--bc-teal-text); border-bottom-color: var(--bc-teal); }
.bc-auth .stepper__step.is-active .stepper__num { background: var(--bc-teal); }
.bc-auth .stepper__step.is-done { color: var(--bc-underline-green); }
.bc-auth .stepper__step.is-done .stepper__num { background: var(--bc-teal-light); color: var(--bc-teal-dark); }
.bc-auth .field__input:focus, .bc-auth .field__select:focus, .bc-auth .field__textarea:focus {
  border-color: var(--bc-teal);
  box-shadow: inset 0 0 0 1px var(--bc-teal);
}
.bc-auth a { color: var(--bc-teal-text); }

/* ---------------------------------------------------------------------------
   15  APP SHELL (sidebar nav) & MODERN COMPONENTS
   ---------------------------------------------------------------------------
   Third design pass (v8), now the primary direction for the whole portal:
   a collapsible left sidebar (replacing both the old icon rail and the v7
   Business Central top nav), a blue accent, rounded-lg cards, and pill
   status badges. Applied screen-by-screen; anything not yet converted still
   renders fine using the F&O or Business Central component classes above -
   all three sets can be loaded at once with no conflicts.
   --------------------------------------------------------------------------- */
:root {
  --app-accent:        #2563eb;
  --app-accent-hover:  #1d4ed8;
  --app-accent-light:  #eff6ff;
  --app-accent-border: #bfdbfe;
  --app-radius:        10px;
  --app-radius-sm:     8px;
  --app-border:        #e5e7eb;
  --app-border-strong: #d1d5db;
  --app-text:          #111827;
  --app-text-muted:    #6b7280;
  --app-text-subtle:   #9ca3af;
  --app-surface:       #ffffff;
  --app-hover:         #f3f4f6;
  --app-sidebar-w:     252px;
  --app-sidebar-w-collapsed: 68px;
  --app-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);

  /* v15: CLM-style re-skin additions -- colourful icon-square palette for
     KPI/cue tiles, and the extra tones referenced by the new topbar/pills. */
  --icon-blue:    #2563eb;
  --icon-orange:  #f97316;
  --icon-red:     #ef4444;
  --icon-green:   #16a34a;
  --icon-teal:    #0891b2;
  --icon-purple:  #7c3aed;
  --icon-navy:    #1e3a8a;
  --app-topbar-h: 52px;
}

/* v15: best-effort dark theme -- flips the shared surface/text/border
   tokens (both the legacy Fluent-era names and the newer --app-* shell
   names) so the sidebar/topbar/cards/tables re-theme together. Status
   colours, chart colours and brand accents are left as-is by design. */
[data-theme="dark"] {
  --surface:        #16181d;
  --canvas:         #101114;
  --hover:          #21242b;
  --divider:        #2a2e37;
  --border:         #2a2e37;
  --border-strong:  #3a3f4b;
  --text:           #e8eaed;
  --text-muted:     #9aa1ad;
  --text-subtle:    #6b7280;

  --app-surface:       #16181d;
  --app-hover:         #21242b;
  --app-border:        #2a2e37;
  --app-border-strong: #3a3f4b;
  --app-text:          #e8eaed;
  --app-text-muted:    #9aa1ad;
  --app-text-subtle:   #6b7280;
  --app-accent-light:  #172554;
}
[data-theme="dark"] body { background: var(--app-surface); color: var(--app-text); }
[data-theme="dark"] .loader-badge,
[data-theme="dark"] .idle-warning { background: var(--app-surface); color: var(--app-text); }

/* --- Shell layout ------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; background: var(--app-surface); }

.app-sidebar {
  width: var(--app-sidebar-w);
  flex-shrink: 0;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: width .15s ease;
}
.app-shell.is-collapsed .app-sidebar { width: var(--app-sidebar-w-collapsed); }
.app-shell.is-collapsed .app-sidebar__brand-text,
.app-shell.is-collapsed .app-sidebar__badge,
.app-shell.is-collapsed .app-sidebar__section-label,
.app-shell.is-collapsed .app-nav__label,
.app-shell.is-collapsed .app-nav__badge,
.app-shell.is-collapsed .ai-chip,
.app-shell.is-collapsed .app-sidebar__search,
.app-shell.is-collapsed .app-sidebar__foot-label,
.app-shell.is-collapsed .app-sidebar__user-text,
.app-shell.is-collapsed .app-sidebar__more { display: none; }
.app-shell.is-collapsed .app-nav__item,
.app-shell.is-collapsed .app-sidebar__foot-item { justify-content: center; }
.app-shell.is-collapsed .app-sidebar__head { justify-content: center; }
.app-shell.is-collapsed .app-sidebar__user { justify-content: center; padding: 8px 0; }

/* v11: collapsed rail keeps BOTH the logo and the collapse toggle visible and
   usable (stacked, since the icon-rail is too narrow to fit them side by
   side) instead of hiding the logo altogether — matching Claude's collapsed
   sidebar, which never leaves the top area empty. */
.app-shell.is-collapsed .app-sidebar__head .flyout-anchor { display: none; }
.app-shell.is-collapsed .app-sidebar__head-left {
  flex-direction: column; justify-content: center; width: 100%; gap: 10px;
}
.app-shell.is-collapsed .app-sidebar__brand { justify-content: center; }
.app-shell.is-collapsed .app-sidebar__logo { height: 18px; }

.app-sidebar__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 14px;
}
.app-sidebar__head-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.app-sidebar__collapse-btn svg { transition: transform .15s ease; }
.app-shell.is-collapsed .app-sidebar__collapse-btn svg { transform: rotate(180deg); }
.app-sidebar__brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; color: var(--app-text); }
.app-sidebar__brand:hover { text-decoration: none; }
.app-sidebar__logo { height: 22px; width: auto; flex-shrink: 0; display: block; }
.app-sidebar__brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.app-sidebar__brand-text strong { font-size: 13.5px; font-weight: 700; color: var(--app-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar__brand-text small { font-size: 11px; color: var(--app-text-muted); }
.app-sidebar__icon-btn {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--app-text-muted);
  background: none; border: none; cursor: pointer; position: relative;
}
.app-sidebar__icon-btn:hover { background: var(--app-hover); color: var(--app-text); }
.app-sidebar__icon-btn .dot {
  position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff;
}

.app-sidebar__search {
  display: flex; align-items: center; gap: 8px;
  background: var(--app-hover);
  border-radius: var(--app-radius-sm);
  padding: 8px 10px;
  margin-bottom: 14px;
  color: var(--app-text-subtle);
}
.app-sidebar__search input {
  border: none; outline: none; background: none;
  font-size: 12.5px; color: var(--app-text); width: 100%; font-family: inherit;
}
.app-sidebar__search input::placeholder { color: var(--app-text-subtle); }
.app-sidebar__search kbd {
  font-family: inherit; font-size: 10.5px; color: var(--app-text-subtle);
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
}

.app-sidebar__badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; color: var(--app-text-muted);
  background: var(--app-hover); border-radius: 999px;
  padding: 4px 10px; margin: 0 4px 16px; width: fit-content;
}

.app-sidebar__section-label {
  font-size: 10.5px; font-weight: 700; color: var(--app-text-subtle);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 0 8px; margin: 18px 0 4px;
}
.app-sidebar__section-label:first-child { margin-top: 0; }

.app-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.app-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: var(--app-radius-sm);
  font-size: 13px; font-weight: 500; color: var(--app-text-muted);
  white-space: nowrap;
}
.app-nav__item:hover { background: var(--app-hover); text-decoration: none; color: var(--app-text); }
.app-nav__item.is-active { background: var(--app-accent-light); color: var(--app-accent); font-weight: 600; }
.app-nav__item svg { flex-shrink: 0; }
.app-nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app-nav__badge {
  flex-shrink: 0; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--app-hover); color: var(--app-text-muted);
  font-size: 10.5px; font-weight: 700; line-height: 19px; text-align: center;
}
.app-nav__item.is-active .app-nav__badge { background: #dbeafe; color: var(--app-accent); }
.app-nav__chevron { flex-shrink: 0; color: var(--app-text-subtle); }

/* v15: sidebar footer is now a plain Settings / Help & Support / Logout
   list (CLM reference), not a user-profile chip -- the user's identity
   moved to the topbar avatar chip instead (see .app-topbar__user below). */
.app-sidebar__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--app-border); display: flex; flex-direction: column; gap: 1px; }
.app-sidebar__foot-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 8px; margin: 0;
  border-radius: var(--app-radius-sm); position: relative;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--app-text-muted);
  text-align: left; text-decoration: none; white-space: nowrap;
}
.app-sidebar__foot-item:hover { background: var(--app-hover); color: var(--app-text); text-decoration: none; }
.app-sidebar__foot-item svg { flex-shrink: 0; }
.app-sidebar__foot-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* --- Topbar (v15) ----------------------------------------------------------
   Breadcrumb (left) + theme toggle / notifications / user chip (right),
   sitting above the page-head title block -- matches the CLM reference. */
.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.app-topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.app-topbar__icon-btn {
  width: 34px; height: 34px; flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--app-text-muted);
  background: var(--app-surface); border: 1px solid var(--app-border);
  cursor: pointer;
}
.app-topbar__icon-btn:hover { background: var(--app-hover); color: var(--app-text); }
.app-topbar__icon-btn .dot {
  position: absolute; top: 3px; right: 3px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--app-surface);
}
.app-topbar__user {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: inherit; color: inherit; text-align: left;
}
.app-topbar__user:hover { background: var(--app-hover); }
.app-topbar__avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--app-accent); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.app-topbar__user-text { line-height: 1.25; text-align: left; display: none; }
.app-topbar__user-text strong { display: block; font-size: 13px; font-weight: 600; color: var(--app-text); }
.app-topbar__user-text small { font-size: 11.5px; color: var(--app-text-muted); }
.app-topbar__chevron { color: var(--app-text-subtle); display: none; }
@media (min-width: 640px) {
  .app-topbar__user-text, .app-topbar__chevron { display: block; }
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* v11: was capped at max-width:1360px, left-aligned inside .app-main with no
   auto margin — on wide monitors this left a large blank strip down the
   right side of every page. Raised the cap well past typical screen widths
   so the content fills the available space; the inner grids (.app-kpis,
   .app-detail, tables) are already responsive and reflow fine at any width. */
.app-content { flex: 1; padding: 28px 32px 60px; max-width: 1920px; width: 100%; }

/* --- Page header ---------------------------------------------------------*/
.app-crumb { font-size: 12.5px; color: var(--app-text-muted); }
.app-crumb a { color: var(--app-text-muted); }
.app-crumb a:hover { color: var(--app-accent); }
.app-page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.app-page-head__title { font-size: 24px; font-weight: 700; color: var(--app-text); letter-spacing: -.2px; }
.app-page-head__sub { font-size: 13px; color: var(--app-text-muted); margin-top: 4px; }
.app-page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Compact pages (list / master pages pass `compact: true` to the header partial): a slimmer top bar and the title,
   sub-line and actions on one row, so the data starts higher on the screen. */
.app-content.is-compact { padding: 10px 24px 16px; display: flex; flex-direction: column; }
/* a list card with .list-fill stretches to the bottom of the window, so its footer (rows per page, pager) sits at the
   bottom of the screen however few rows there are */
.is-compact .list-fill { flex: 1 1 auto; display: flex; flex-direction: column; }
.is-compact .list-fill > .mm-foot, .is-compact .list-fill > .um-foot { margin-top: auto; }
.is-compact .mm-layout, .is-compact .um-layout { flex: 1 1 auto; display: flex; flex-direction: column; }
.is-compact .app-topbar { margin-bottom: 6px; }
.is-compact .app-topbar__icon-btn { width: 30px; height: 30px; }
.is-compact .app-topbar__avatar { width: 28px; height: 28px; font-size: 11px; }
.is-compact .app-topbar__user { padding: 2px 8px 2px 2px; }
.is-compact .app-page-head { margin-bottom: 10px; gap: 10px 16px; align-items: center; flex-wrap: nowrap; }
.is-compact .app-page-head > div:first-child { flex: 1 1 0; display: flex; align-items: baseline; gap: 4px 14px; min-width: 0; }
.is-compact .app-page-head__title { font-size: 20px; flex: none; white-space: nowrap; }
.is-compact .app-page-head__sub { margin: 0; font-size: 12.5px; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-compact .app-page-head__actions { flex: none; margin-left: 0; }
@media (max-width: 900px) {
  .app-content.is-compact { padding: 10px 12px 40px; }
  .is-compact .app-page-head { flex-wrap: wrap; }
  .is-compact .app-page-head > div:first-child { flex-wrap: wrap; }
  .is-compact .app-page-head__sub { white-space: normal; flex: 1 1 100%; }
}

/* --- Buttons -------------------------------------------------------------*/
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--app-radius-sm);
  border: 1px solid var(--app-border-strong);
  background: var(--app-surface); color: var(--app-text);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.app-btn:hover { background: var(--app-hover); text-decoration: none; }
.app-btn--primary { background: var(--app-accent); border-color: var(--app-accent); color: #fff; }
.app-btn--primary:hover { background: var(--app-accent-hover); border-color: var(--app-accent-hover); }
.app-btn--icon { padding: 8px; }

/* --- Filter bar ------------------------------------------------------------*/
.app-filterbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.app-field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.app-field__label { font-size: 12px; font-weight: 600; color: var(--app-text-muted); }
.app-field__input, .app-field__select {
  padding: 8px 11px; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm);
  background: var(--app-surface); color: var(--app-text);
  font-family: inherit; font-size: 13px; min-height: 36px;
}
.app-field__input:focus, .app-field__select:focus { outline: none; border-color: var(--app-accent); box-shadow: 0 0 0 3px var(--app-accent-light); }
.app-field__select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 13px;
  padding-right: 30px;
}

/* --- Table -----------------------------------------------------------------*/
.app-table-wrap { width: 100%; overflow-x: auto; }
.app-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.app-table th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--app-text-subtle);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 14px; border-bottom: 1px solid var(--app-border); white-space: nowrap;
}
.app-table td { padding: 14px 14px; border-bottom: 1px solid var(--app-border); vertical-align: middle; color: var(--app-text); }
.app-table tbody tr:last-child td { border-bottom: none; }
.app-table tbody tr:hover { background: #fafafa; }
.app-table td.num, .app-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.app-table__link { color: var(--app-text); font-weight: 600; }
.app-table__link:hover { color: var(--app-accent); }
.app-table__row-menu { color: var(--app-text-subtle); background: none; border: none; cursor: pointer; padding: 4px; border-radius: 6px; }
.app-table__row-menu:hover { background: var(--app-hover); }

/* --- Tabs ------------------------------------------------------------------*/
.app-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--app-border); margin-bottom: 22px; overflow-x: auto; }
.app-tabs__item {
  padding: 0 0 12px; font-size: 13.5px; font-weight: 600; color: var(--app-text-muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.app-tabs__item:hover { color: var(--app-text); text-decoration: none; }
.app-tabs__item.is-active { color: var(--app-text); border-bottom-color: var(--app-accent); }

/* --- KPI cards (v15: icon square + info dot + trend pill, CLM reference) ---*/
.app-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 16px; }
.app-kpi { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); padding: 16px 18px; }
.app-kpi__label { font-size: 12px; font-weight: 600; color: var(--app-text-muted); margin-bottom: 8px; }
.app-kpi__value { font-size: 24px; font-weight: 700; color: var(--app-text); line-height: 1.1; }

.app-kpi__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.app-kpi__icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.app-kpi__info { color: var(--app-text-subtle); }
.app-kpi__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--app-text-subtle); }
.app-kpi__foot a { font-weight: 600; }
.trend-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.trend-pill--up   { background: var(--success-bg); color: var(--success); }
.trend-pill--down { background: var(--danger-bg);  color: var(--danger); }
.trend-pill svg { flex-shrink: 0; }

/* Compact horizontal KPI (second row in the CLM reference dashboard). */
.app-kpis--compact { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 26px; }
.app-kpi--compact { display: flex; align-items: center; gap: 12px; }
.app-kpi--compact .app-kpi__icon { width: 34px; height: 34px; border-radius: 9px; }
.app-kpi--compact .app-kpi__value { font-size: 19px; }
.app-kpi--compact .app-kpi__label { margin-bottom: 2px; }

/* --- Chart cards (v15: Chart.js line/donut/bar, CLM reference) --------------*/
.chart-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; margin-bottom: 26px; align-items: stretch; }
.chart-card { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); padding: 20px 22px; }
.chart-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.chart-period-form { display: inline-flex; flex-shrink: 0; }
.chart-card__title { font-size: 14.5px; font-weight: 700; color: var(--app-text); }
.chart-card__sub { font-size: 12px; color: var(--app-text-muted); margin-top: 2px; }
.chart-card__select {
  padding: 6px 26px 6px 10px; border: 1px solid var(--app-border); border-radius: var(--app-radius-sm);
  background: var(--app-surface); color: var(--app-text); font-family: inherit; font-size: 12.5px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
}
.chart-card__legend { display: flex; gap: 16px; margin: 10px 0 6px; flex-wrap: wrap; }
.chart-card__legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--app-text-muted); }
.chart-card__legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-card__big { font-size: 22px; font-weight: 700; color: var(--app-text); margin-top: 2px; }
.chart-canvas-wrap { position: relative; width: 100%; height: 260px; margin-top: 12px; }
.chart-canvas-wrap--sm { height: 190px; }
.chart-canvas-wrap--donut { height: 200px; display: flex; align-items: center; justify-content: center; }
.chart-donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.chart-donut-center__value { font-size: 22px; font-weight: 700; color: var(--app-text); line-height: 1.1; }
.chart-donut-center__label { font-size: 11px; color: var(--app-text-muted); margin-top: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px 18px; margin-top: 16px; }
.chart-legend__row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--app-text-muted); }
.chart-legend__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-legend__row strong { color: var(--app-text); }
@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr; } }

/* --- Detail two-column layout ------------------------------------------------*/
.app-detail { display: flex; gap: 32px; align-items: flex-start; }
.app-detail__main { flex: 1.7; min-width: 0; }
.app-detail__panel { flex: 1; min-width: 260px; max-width: 320px; }
.app-panel-section { margin-bottom: 26px; }
.app-panel-section__title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 10.5px; font-weight: 700; color: var(--app-text-subtle);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px;
}
.app-panel-section__link { font-size: 11px; font-weight: 700; color: var(--app-accent); text-transform: uppercase; letter-spacing: .3px; }
.app-panel-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--app-border); }
.app-panel-section > .app-panel-row:first-of-type { border-top: none; padding-top: 0; }
.app-panel-row__text { min-width: 0; }
.app-panel-row__title { font-size: 13px; font-weight: 600; color: var(--app-text); }
.app-panel-row__meta { font-size: 12px; color: var(--app-text-muted); margin-top: 2px; }
.app-panel-row a.app-panel-row__title:hover { color: var(--app-accent); text-decoration: none; }
.app-panel-empty { font-size: 12.5px; color: var(--app-text-subtle); }

/* --- Pagination ----------------------------------------------------------------*/
.app-pager { display: flex; align-items: center; gap: 16px; padding: 16px 2px; font-size: 12.5px; color: var(--app-text-muted); flex-wrap: wrap; }
.app-pager__pages { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.app-pager__link {
  min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; color: var(--app-text-muted); font-weight: 600;
}
.app-pager__link:hover { background: var(--app-hover); text-decoration: none; }
.app-pager__link.is-active { background: var(--app-accent); color: #fff; }
.app-pager__link.is-disabled { color: var(--app-text-subtle); pointer-events: none; opacity: .5; }
.app-pager__size { border: 1px solid var(--app-border); border-radius: var(--app-radius-sm); padding: 6px 10px; font-size: 12.5px; color: var(--app-text-muted); background: var(--app-surface); }

/* --- Checkgrid (procurement categories, etc.) -----------------------------------*/
.app-checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; }
.app-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--app-text); cursor: pointer; }
.app-check input { width: 15px; height: 15px; accent-color: var(--app-accent); }

@media (max-width: 1100px) {
  .app-detail { flex-direction: column; }
  .app-detail__panel { max-width: none; width: 100%; }
}
@media (max-width: 820px) {
  .app-sidebar { position: fixed; z-index: 250; left: 0; top: 0; box-shadow: var(--shadow-16); }
  .app-content { padding: 20px 16px 60px; }
  .app-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* =====================================================================
   Dashboard layout switcher (v14) -- lets presales flip between the
   Modern / Activities / Executive presentations of the same data.
   ===================================================================== */
.layout-switcher {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; background: var(--app-hover);
  border: 1px solid var(--app-border); border-radius: var(--app-radius-sm);
}
.layout-switcher__label {
  font-size: 10.5px; font-weight: 700; color: var(--app-text-subtle);
  text-transform: uppercase; letter-spacing: .4px;
  padding: 0 8px 0 6px;
}
.layout-switcher__btn {
  font-size: 12px; font-weight: 600; color: var(--app-text-muted);
  padding: 6px 12px; border-radius: 6px; text-decoration: none;
  white-space: nowrap;
}
.layout-switcher__btn:hover { background: var(--app-surface); color: var(--app-text); text-decoration: none; }
.layout-switcher__btn.is-active { background: var(--app-accent); color: #fff; }

/* =====================================================================
   Activities layout (v14) -- BC-style cue tiles + activity queues.
   ===================================================================== */
.dash-cues {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.dash-cue-group {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--app-radius); box-shadow: var(--app-shadow);
  border-top: 3px solid var(--app-accent);
  padding: 14px 16px 6px;
}
.dash-cue-group--vendors     { border-top-color: #2563eb; }
.dash-cue-group--procurement { border-top-color: #7c3aed; }
.dash-cue-group--finance     { border-top-color: #059669; }
.dash-cue-group--compliance  { border-top-color: #d97706; }
.dash-cue-group__head {
  font-size: 10.5px; font-weight: 700; color: var(--app-text-subtle);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}
.dash-cue-row { display: flex; flex-wrap: wrap; gap: 6px 0; }
.dash-cue {
  flex: 1 1 50%; min-width: 96px;
  padding: 4px 8px 12px; text-decoration: none; color: inherit;
  border-radius: 6px;
}
.dash-cue:hover { background: var(--app-hover); text-decoration: none; }
.dash-cue__value { font-size: 21px; font-weight: 700; color: var(--app-text); line-height: 1.2; }
.dash-cue__label { font-size: 11.5px; color: var(--app-text-muted); margin-top: 2px; }

.dash-activities {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px 28px;
}
.dash-activity-group {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--app-radius); box-shadow: var(--app-shadow);
  padding: 14px 0 6px;
}
.dash-activity-group__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--app-text);
  padding: 0 16px 10px; border-bottom: 1px solid var(--app-border);
  margin-bottom: 4px;
}
.dash-activity-group__head svg { flex-shrink: 0; color: var(--app-accent); }
.dash-activity-group__head .app-panel-section__link { margin-left: auto; }
.dash-activity-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; text-decoration: none; color: inherit;
  border-top: 1px solid var(--app-border);
}
.dash-activity-group > .dash-activity-row:first-of-type,
.dash-activity-group > .dash-activity-row:first-child { border-top: none; }
.dash-activity-row:hover { background: var(--app-hover); text-decoration: none; }
.dash-activity-row__icon { flex-shrink: 0; color: var(--app-text-subtle); display: inline-flex; }
.dash-activity-row__text { flex: 1 1 auto; min-width: 0; }
.dash-activity-row__title { font-size: 13px; font-weight: 600; color: var(--app-text); display: block; }
.dash-activity-row__meta { font-size: 11.5px; color: var(--app-text-muted); margin-top: 2px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   Executive layout (v14) -- hero KPI cards + CSS-only donut rings.
   ===================================================================== */
.dash-hero-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.dash-hero {
  display: block; text-decoration: none; color: inherit;
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--app-radius); box-shadow: var(--app-shadow);
  padding: 18px 20px;
}
.dash-hero:hover { border-color: var(--app-border-strong); text-decoration: none; }
.dash-hero__label { font-size: 12px; font-weight: 600; color: var(--app-text-muted); margin-bottom: 8px; }
.dash-hero__value { font-size: 30px; font-weight: 700; color: var(--app-text); line-height: 1.1; }
.dash-hero__of { font-size: 17px; font-weight: 600; color: var(--app-text-subtle); }
.dash-hero__note { font-size: 12px; color: var(--app-text-subtle); margin-top: 8px; }

.dash-attention {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 26px;
}
.dash-attention__item {
  font-size: 12.5px; color: var(--app-text); text-decoration: none;
  background: var(--app-accent-light); border: 1px solid var(--app-accent-border);
  border-radius: 999px; padding: 6px 14px;
}
.dash-attention__item:hover { background: var(--app-accent-border); text-decoration: none; }
.dash-attention__item strong { color: var(--app-accent-hover); }

.dash-ring-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin-bottom: 30px;
}
.dash-ring-card {
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: var(--app-radius); box-shadow: var(--app-shadow);
  padding: 16px 18px;
}
.dash-ring-card__title { font-size: 12.5px; font-weight: 700; color: var(--app-text); margin-bottom: 14px; }
.dash-ring-card__body { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.dash-ring {
  flex-shrink: 0; width: 108px; height: 108px; border-radius: 50%;
  position: relative;
}
.dash-ring::after {
  content: ''; position: absolute; inset: 16px;
  background: var(--app-surface); border-radius: 50%;
}
.dash-ring-legend { flex: 1 1 160px; min-width: 140px; display: flex; flex-direction: column; gap: 2px; }
.dash-ring-legend__row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; text-decoration: none; color: inherit;
  font-size: 12px;
}
.dash-ring-legend__row:hover { text-decoration: none; }
.dash-ring-legend__row .strong { margin-left: auto; font-weight: 700; color: var(--app-text); }
.dash-ring-legend__dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; }
.dash-ring-legend__label { color: var(--app-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 820px) {
  .dash-cue { flex: 1 1 100%; }
  .dash-ring-card__body { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------------------
   14  SIGN-IN PAGE (v20) -- light two-column hero (pitch copy + feature strip
   + logistics illustration on the left, plain white sign-in card on the
   right) with a simple bordered footer strip. Self-contained (own
   <html>/<body>, not the shared .auth-page/.auth-card shell) so
   forgot-password / reset-password / register / accept-invite, which still
   use the original centered-card layout, are completely unaffected.
   --------------------------------------------------------------------------- */
.login3-body { margin: 0; font-family: var(--font); background: linear-gradient(160deg, #f5f7fb 0%, #eef1f8 60%, #eceffa 100%); }
.login3-page { min-height: 100vh; display: flex; flex-direction: column; }

.login3-top { display: flex; align-items: center; justify-content: space-between; padding: 30px 60px 0; }
.login3-logo { height: 46px; width: auto; display: block; }

.login3-lang { position: relative; }
.login3-lang summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--app-text-muted);
  padding: 9px 16px; border: 1px solid var(--app-border); border-radius: 999px;
  background: #fff; box-shadow: var(--app-shadow);
}
.login3-lang summary::-webkit-details-marker { display: none; }
.login3-lang__menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--app-border); border-radius: 10px;
  box-shadow: var(--app-shadow); padding: 6px; min-width: 120px; z-index: 5;
}
.login3-lang__option { display: block; padding: 6px 10px; border-radius: 6px; font-size: 12.5px; color: var(--app-text); }
.login3-lang__option.is-active { background: var(--app-accent-light); color: var(--app-accent); font-weight: 600; }

.login3-hero {
  flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  gap: 64px; max-width: 1320px; width: 100%; margin: 0 auto;
  padding: 34px 60px 40px;
}

.login3-left { flex: 1; max-width: 620px; padding-top: 16px; }
.login3-rule { width: 60px; height: 4px; background: var(--app-accent); border-radius: 2px; margin-bottom: 18px; }
.login3-title { font-size: 42px; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; color: #0f172a; margin: 0 0 16px; }
.login3-title span { color: var(--app-accent); }
.login3-sub { font-size: 15px; color: var(--app-text-muted); line-height: 1.6; max-width: 480px; margin: 0 0 32px; }

.login3-features { display: flex; gap: 22px; margin-bottom: 28px; }
.login3-feature { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.login3-feature__icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--app-accent-light); color: var(--app-accent);
  margin-bottom: 12px;
}
.login3-feature b { font-size: 14px; color: #0f172a; margin-bottom: 6px; }
.login3-feature small { font-size: 11.5px; color: var(--app-text-muted); line-height: 1.45; max-width: 128px; }

.login3-illustration { border-radius: 0 16px 16px 0; overflow: hidden; margin-left: -60px; }
.login3-illustration img { width: 100%; display: block; }

.login3-card {
  width: 520px; max-width: 100%;
  background: #fff; border-radius: 20px;
  padding: 40px 44px 34px;
  box-shadow: 0 20px 50px rgba(30,41,90,.12), 0 2px 10px rgba(30,41,90,.06);
  text-align: center;
}
.login3-card__avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--app-accent-light); color: var(--app-accent);
}
.login3-card__title { font-size: 24px; font-weight: 800; color: #0f172a; margin: 0 0 6px; }
.login3-card__sub { font-size: 13px; color: var(--app-text-muted); margin: 0 0 26px; }

.login3-field { margin-bottom: 16px; text-align: left; }
.login3-field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--app-text); margin-bottom: 6px; }
.login3-field__control { position: relative; display: flex; align-items: center; }
.login3-field__icon { position: absolute; left: 14px; color: var(--app-text-subtle); display: flex; pointer-events: none; }
.login3-field__input {
  width: 100%; padding: 12px 40px 12px 40px;
  border: 1px solid var(--app-border); border-radius: 10px;
  font-family: inherit; font-size: 13.5px; color: var(--app-text); background: #fff;
}
.login3-field__input:focus { outline: none; border-color: var(--app-accent); box-shadow: 0 0 0 3px var(--app-accent-light); }
.login3-field__input::placeholder { color: var(--app-text-subtle); }
.login3-field__eye {
  position: absolute; right: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: none; background: none; border-radius: 6px;
  color: var(--app-text-subtle); cursor: pointer;
}
.login3-field__eye:hover { background: var(--app-hover); color: var(--app-text-muted); }

.login3-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 20px; font-size: 12.5px; }
.login3-remember { display: inline-flex; align-items: center; gap: 7px; color: var(--app-text-muted); cursor: pointer; }
.login3-remember input { accent-color: var(--app-accent); }
.login3-forgot { color: var(--app-accent); font-weight: 600; }

.login3-submit {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border: none; border-radius: 10px;
  background: var(--app-accent); color: #fff;
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
}
.login3-submit:hover { background: var(--app-accent-hover); }
.login3-submit:active { filter: brightness(.95); }

.login3-divider { position: relative; text-align: center; margin: 22px 0; height: 1px; background: var(--app-border); }
.login3-divider span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; font-size: 11px; font-weight: 700; color: var(--app-text-subtle);
  border: 1px solid var(--app-border); border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}

.login3-ms {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; background: #fff; border: 1px solid var(--app-border); border-radius: 10px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--app-text);
  text-decoration: none; margin-bottom: 14px;
}
.login3-ms:hover { background: var(--app-hover); text-decoration: none; }
.login3-ms .ms-logo { width: 17px; height: 17px; flex-shrink: 0; }

.login3-newvendor {
  display: flex; align-items: flex-start; gap: 14px; text-align: left;
  margin-top: 6px; padding: 18px 20px;
  background: var(--app-accent-light); border: 1px solid var(--app-accent-border); border-radius: 14px;
}
.login3-newvendor__icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--app-accent);
}
.login3-newvendor__body { flex: 1; }
.login3-newvendor__body p { font-size: 13.5px; font-weight: 600; color: #0f172a; margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--app-accent-border); }
.login3-newvendor__body a { font-size: 13px; font-weight: 700; color: var(--app-accent); display: inline-flex; align-items: center; gap: 5px; }

.login3-footer {
  background: #fff; border-top: 1px solid var(--app-border);
  padding: 18px 60px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.login3-footer__links { display: flex; gap: 30px; flex-wrap: wrap; }
.login3-footer__links a { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--app-text-muted); text-decoration: none; }
.login3-footer__links a:hover { color: var(--app-text); }
.login3-footer__copy { font-size: 12px; color: var(--app-text-subtle); }

@media (max-width: 980px) {
  .login3-hero { flex-direction: column; gap: 36px; padding: 24px 24px 0; }
  .login3-card { width: 100%; }
  .login3-illustration { margin-left: 0; border-radius: 16px; }
  .login3-top { padding: 20px 24px 0; }
  .login3-footer { padding: 18px 24px; justify-content: center; text-align: center; }
  .login3-features { flex-wrap: wrap; row-gap: 20px; }
  .login3-feature { flex: 1 1 40%; }
}

/* ---- AI feel: sparkle icon, AI chip in the menu, "AI AGENT" pill on page headings --------------------------- */
.ai-chip{margin-left:auto;font-size:9.5px;font-weight:800;letter-spacing:.07em;padding:1px 6px;border-radius:999px;background:linear-gradient(135deg,#dbeafe,#ede9fe);color:#4338ca;line-height:1.5}
.app-nav__item.is-active .ai-chip{background:linear-gradient(135deg,#bfdbfe,#ddd6fe)}
.app-nav__item[href="/admin/sourcing"] svg{color:#7c3aed}
.app-page-head__title .ai-spark{display:inline-flex;vertical-align:-3px;margin-right:8px;color:#6d4aff}
.ai-pill{display:inline-flex;align-items:center;gap:4px;margin-left:10px;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.06em;color:#fff;vertical-align:4px;background:linear-gradient(135deg,#2563eb,#7c3aed)}
.ai-pill svg{width:11px;height:11px}