/* ARABIC-WEBFONT-01 — self-hosted IBM Plex Sans Arabic (Arabic subset only).
   The browser downloads a weight only when Arabic text actually renders
   (unicode-range gate), so Latin-only pages cost nothing. The font stacks
   below keep Inter first for Latin and "IBM Plex Sans Arabic" second, so
   Arabic glyphs stop falling back to Tahoma/Arial with mismatched metrics.
   CSP note: font-src is 'self' — these files must stay self-hosted.
   Use literal font-face weights: descriptors do not resolve CSS variables. */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-500.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-600.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* The former legacy :root block (lines 43-102) was removed in wave D1: every
   token it defined has an identical later definition (the consolidated :root
   at ~2829 for --lt-* and aliases, the ~4237 alias layer for --lt-brand-*,
   and the ~4197 radius layer) — computed values are unchanged. */


[hidden] {
  display: none !important;
}

.lookup-result-empty {
    color: var(--work-body-muted);
    font-size: 0.88rem;
    padding: 0.65rem;
}

html[data-theme="dark"] .lookup-result-empty {
    color: var(--work-text-dim);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: var(--work-weight-800);
  letter-spacing: 0;
}

.brand span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.14;
}

.brand.with-logo {
  align-items: center;
  gap: 9px;
  font-size: var(--work-text-xl);
}

.brand.with-logo span {
  max-width: 190px;
}

.brand::before {
  content: "W";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--work-accent-bright-rgb), 0.98), rgba(var(--work-primary-rgb), 0.92));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  box-shadow: var(--work-shadow-lift);
}

.brand.with-logo::before {
  display: none;
}

.brand-logo {
  width: 46px;
  height: 46px;
  padding: 5px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(33, 12, 55, 0.2);
}

.brand-sub {
  margin: 0 8px 24px 58px;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-600);
}

.nav a {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 9px 11px;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-weight: var(--work-weight-700);
  text-align: start;
  cursor: pointer;
  transition: background var(--work-motion-interactive) ease, border-color var(--work-motion-interactive) ease, transform var(--work-motion-interactive) ease, color var(--work-motion-interactive) ease;
}

.nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(97, 196, 207, 0.56);
  box-shadow: 0 0 0 4px rgba(97, 196, 207, 0.06);
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.topbar {
  position: relative;
  z-index: var(--work-z-shell-bar);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  min-height: 76px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(76, 38, 110, 0.09);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(76, 38, 110, 0.06);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: var(--work-weight-800);
  letter-spacing: 0;
  color: var(--work-body-text);
}

.topbar-pagebar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.topbar-pagebar .page-kicker {
  flex: 0 0 auto;
}

.topbar-pagebar h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-pagebar h1::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-inline-end: 10px;
  vertical-align: middle;
  background: var(--work-body-muted);
  border-radius: 999px;
}

.app-breadcrumbs {
  margin: -8px 0 18px;
  padding: 0 4px;
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-700);
}

.app-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-breadcrumbs li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  line-height: 1.45;
}

.app-breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--work-breadcrumb-separator);
  font-weight: var(--work-weight-800);
}

.app-breadcrumbs a {
  color: var(--work-primary);
  text-decoration: none;
}

.app-breadcrumbs a:hover {
  color: var(--work-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-breadcrumbs span[aria-current="page"] {
  color: var(--work-body-text);
}

.subtle {
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
}

.rtl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--work-body-muted);
  background: rgba(76, 38, 110, 0.06);
  border: 1px solid rgba(76, 38, 110, 0.08);
  border-radius: 999px;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
}

.panel,
.stat {
  position: relative;
  overflow: hidden;
  background: var(--work-body-surface);
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-lg);
  box-shadow: var(--work-shadow-lg);
}

.panel::before,
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--work-gradient-card);
}

/* WORK-GRID-BASE-01 (2026-08-19) — the .grid primitive was missing: cols-*
   rules set grid-template-columns but nothing set display:grid, so every
   .grid.cols-* block silently stacked as a single column. One base rule
   activates the intended multi-column layout; the existing container queries
   keep the responsive collapse. */
.grid {
  display: grid;
  gap: var(--work-space-9);
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  padding: 18px;
  min-height: 116px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--work-primary);
  font-size: 32px;
  line-height: 1;
}

.required-label::after {
  content: " *";
  display: inline;
  margin-inline-start: 3px;
  color: var(--work-danger-alt);
  font-size: 1.05em;
  font-weight: var(--work-weight-800);
  line-height: 1;
}

.choice-card-group-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card-group-compact {
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  color: var(--work-body-text);
  background: var(--work-control-bg);
  border: 1px solid var(--work-control-border);
  border-radius: var(--work-radius-md);
  box-shadow: var(--work-shadow-xs);
  cursor: pointer;
  transition: border-color var(--work-motion-fast) ease, box-shadow var(--work-motion-fast) ease, transform var(--work-motion-fast) ease, background var(--work-motion-fast) ease;
}

.choice-card-compact {
  min-height: 64px;
  align-items: center;
}

.choice-card input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  padding: 0;
  color: var(--work-primary);
  background: #fff;
  border: 1.5px solid rgba(76, 38, 110, 0.36);
  border-radius: 999px;
  box-shadow: none;
}

.choice-card input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 999px;
  transform: scale(0);
  transition: transform 0.14s ease;
}

.choice-card input[type="radio"]:checked {
  border-color: currentColor;
}

.choice-card input[type="radio"]:checked::before {
  transform: scale(1);
}

.choice-card input[type="radio"]:focus {
  outline: none;
  box-shadow: none;
}

.choice-card-title {
  color: var(--work-primary);
  font-weight: var(--work-weight-800);
  line-height: 1.25;
}

.choice-card:has(input[type="radio"]:checked) {
  background: rgba(97, 196, 207, 0.12);
  border-color: rgba(76, 38, 110, 0.5);
  box-shadow: inset 0 0 0 1px rgba(76, 38, 110, 0.12);
}

.choice-card:focus-within {
  outline: none;
  border-color: rgba(76, 38, 110, 0.58);
  box-shadow: inset 0 0 0 2px rgba(97, 196, 207, 0.36);
}

.choice-card:has(input[type="radio"]:not(:disabled)):hover {
  transform: translateY(-1px);
  border-color: rgba(76, 38, 110, 0.48);
}

.choice-card:has(input[type="radio"]:disabled) {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 760px){
  .choice-card-group-3 {
    grid-template-columns: 1fr;
  }
}

input[type="date"],
.date-picker-input {
  cursor: pointer;
}

/* ===================================================================
 * Governed custom date picker (theme wave E1). Shared platform component;
 * semantic tokens only, both themes, RTL-first. Progressive enhancement:
 * without JS the native input[type="date"] above keeps working.
 * =================================================================== */
.date-picker {
  position: relative;
  /* WORK-FIELD-ALIGN-01 (2026-08-19) — block-level flex: inline-flex made the
     picker ride the parent text line box, pushing date fields ~8px below
     select fields in mixed rows (recurring misalignment). */
  display: flex;
  align-items: stretch;
  width: 100%;
}

.date-picker-field {
  width: 100%;
  /* WORK-DATE-PICKER-PORTAL-01 (2026-08-20) — reserve the calendar toggle's
     strip so it never covers the value. The enhanced input is forced dir=ltr,
     so padding-inline-end resolves to the physical right, where the toggle
     sits in LTR documents; the RTL override below moves it to the left. */
  padding-inline-end: 40px;
}

[dir="rtl"] .date-picker-field {
  padding-right: 11px;
  padding-left: 40px;
}

.date-picker-toggle {
  position: absolute;
  inset-inline-end: 6px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  /* WORK-ICON-BUTTON-MIN-HEIGHT-01 (2026-08-20) — reset the global
     button { min-height: 40px }; it overrode this fixed height and stretched
     the toggle into a 28x40 slab inside the 44px field. */
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: var(--work-radius-xs);
  background: transparent;
  color: var(--work-body-muted);
  cursor: pointer;
}

.date-picker-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("/assets/icons/calendar.svg?v=20260731-date-picker-01") center / contain no-repeat;
  mask: url("/assets/icons/calendar.svg?v=20260731-date-picker-01") center / contain no-repeat;
}

.date-picker-toggle:hover,
.date-picker-toggle:active {
  color: var(--work-accent-strong, var(--work-primary));
  background: var(--work-accent-soft);
  /* WORK-ICON-BUTTON-MIN-HEIGHT-01 companion (2026-08-20) — the global
     button:hover/active transform lift (translateY) overrides this button's
     load-bearing translateY(-50%) centering: the toggle visibly slid ~13px
     down past the field's bottom border on hover. Re-assert the centering. */
  transform: translateY(-50%);
}

.date-picker-toggle:focus-visible {
  outline: 2px solid var(--work-focus-ring);
  outline-offset: 1px;
}

.date-picker-popover {
  /* WORK-DATE-PICKER-PORTAL-01 (2026-08-20) — the popover is portaled to
     <body> by date-picker.js and positioned fixed from the field's viewport
     rect, so it must sit above every modal/backdrop layer (the same layering
     contract as .app-select-list). */
  position: fixed;
  z-index: var(--work-z-max);
  min-width: 284px;
  padding: 12px;
  background: var(--work-body-surface);
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-md);
  box-shadow: var(--work-shadow-lg);
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.date-picker-title {
  font-size: var(--work-text-base);
  font-weight: var(--work-weight-700);
  color: var(--work-body-text);
}

.date-picker-nav {
  width: 30px;
  height: 30px;
  min-height: 0; /* WORK-ICON-BUTTON-MIN-HEIGHT-01 — keep the fixed 30px box. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--work-control-border);
  border-radius: var(--work-radius-xs);
  background: var(--work-control-bg);
  color: var(--work-body-text);
  cursor: pointer;
}

.date-picker-nav::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("/assets/icons/arrow-left.svg?v=20260731-date-picker-01") center / contain no-repeat;
  mask: url("/assets/icons/arrow-left.svg?v=20260731-date-picker-01") center / contain no-repeat;
}

.date-picker-next::before {
  transform: scaleX(-1);
}

[dir="rtl"] .date-picker-prev::before {
  transform: scaleX(-1);
}

[dir="rtl"] .date-picker-next::before {
  transform: none;
}

.date-picker-nav:hover {
  color: var(--work-accent-strong, var(--work-primary));
  border-color: var(--work-accent-strong, var(--work-primary));
  transform: none; /* the global button:hover lift must not move calendar chrome */
}

.date-picker-nav:focus-visible {
  outline: 2px solid var(--work-focus-ring);
  outline-offset: 1px;
}

.date-picker-weekdays,
.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-picker-weekday {
  padding: 4px 0;
  text-align: center;
  font-size: var(--work-text-xs);
  font-weight: var(--work-weight-600);
  color: var(--work-body-muted);
}

.date-picker-cell {
  display: flex;
}

.date-picker-day {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0; /* WORK-ICON-BUTTON-MIN-HEIGHT-01 — keep the square cell contract. */
  padding: 0;
  border: none;
  border-radius: var(--work-radius-xs);
  background: transparent;
  color: var(--work-body-text);
  font-size: var(--work-text-md);
  cursor: pointer;
}

.date-picker-day:hover {
  background: var(--work-accent-soft);
  transform: none; /* the global button:hover lift must not move grid cells */
}

.date-picker-day:focus-visible {
  outline: 2px solid var(--work-focus-ring);
  outline-offset: 1px;
}

.date-picker-day.is-selected {
  background: var(--work-accent-strong, var(--work-primary));
  color: #ffffff;
  font-weight: var(--work-weight-700);
}

.date-picker-day.is-today {
  box-shadow: inset 0 0 0 1px var(--work-accent-bright);
}

.date-picker-day.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.date-picker-today,
.date-picker-clear {
  min-height: 0; /* WORK-ICON-BUTTON-MIN-HEIGHT-01 — compact footer buttons. */
  padding: 5px 12px;
  border: 1px solid var(--work-control-border);
  border-radius: var(--work-radius-xs);
  background: var(--work-control-bg);
  color: var(--work-body-text);
  font-size: var(--work-text-sm);
  cursor: pointer;
}

.date-picker-today:hover,
.date-picker-clear:hover {
  color: var(--work-accent-strong, var(--work-primary));
  border-color: var(--work-accent-strong, var(--work-primary));
}

.date-picker-today:focus-visible,
.date-picker-clear:focus-visible {
  outline: 2px solid var(--work-focus-ring);
  outline-offset: 1px;
}

.date-picker-today:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .date-picker-popover {
    min-width: 260px;
  }
}

.app-select {
  position: relative;
  display: grid;
  gap: 6px;
  /* WORK-FIELD-ALIGN-01 (2026-08-19) — no bottom margin here: .field owns the
     vertical rhythm. The stray 8px made select fields taller than sibling
     date/text fields, the recurring mixed-row misalignment. */
}

.app-select:focus-within {
  z-index: var(--work-z-field-focus);
}

.app-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.app-select-input {
  padding-inline-end: 42px;
  cursor: text;
  text-align: start;
  direction: inherit;
}

.app-select.is-disabled {
  opacity: 0.72;
}

.app-select.is-disabled::after {
  opacity: 0.5;
}

.app-select::after {
  content: "";
  position: absolute;
  top: 18px;
  inset-inline-end: 14px;
  width: 8px;
  height: 8px;
  border-inline-end: 2px solid var(--work-body-muted);
  border-bottom: 2px solid var(--work-body-muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.app-select-list {
  position: fixed;
  z-index: var(--work-z-max);
  max-height: 260px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid rgba(76, 38, 110, 0.18);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(76, 38, 110, 0.16);
  direction: inherit;
}

.app-select-option {
  display: block;
  width: 100%;
  justify-content: flex-start;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--work-body-text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
  text-align: start;
  direction: inherit;
}

.app-select-option:hover,
.app-select-option.is-active {
  color: #fff;
  background: var(--work-primary);
  box-shadow: none;
  transform: none;
}

.app-select-empty {
  padding: 10px;
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
}

.app-multiselect {
  position: relative;
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.app-multiselect:focus-within {
  z-index: var(--work-z-field-focus);
}

.app-multiselect-native {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.app-multiselect-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 40px 10px 12px;
  color: var(--work-body-text);
  background: #fff;
  border: 1px solid rgba(76, 38, 110, 0.2);
  border-radius: 12px;
  box-shadow: none;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
  text-align: start;
  direction: inherit;
  cursor: pointer;
}

.app-multiselect-control:hover,
.app-multiselect-control:focus {
  border-color: rgba(97, 196, 207, 0.75);
  box-shadow: 0 0 0 3px rgba(97, 196, 207, 0.18);
  transform: none;
}

.app-multiselect.is-disabled {
  opacity: 0.72;
}

.app-multiselect::after {
  content: "";
  position: absolute;
  top: 22px;
  inset-inline-end: 16px;
  width: 8px;
  height: 8px;
  border-inline-end: 2px solid var(--work-body-muted);
  border-bottom: 2px solid var(--work-body-muted);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.app-multiselect-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-multiselect-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: #0f4d58;
  background: rgba(97, 196, 207, 0.2);
  border: 1px solid rgba(97, 196, 207, 0.38);
  border-radius: 999px;
  font-size: var(--work-text-xs);
  font-weight: var(--work-weight-800);
  white-space: nowrap;
}

.app-multiselect-list {
  position: fixed;
  z-index: var(--work-z-max);
  max-height: 320px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid rgba(76, 38, 110, 0.18);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(76, 38, 110, 0.16);
  direction: inherit;
}

.app-multiselect-search {
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 8px 10px;
  direction: inherit;
}

.app-multiselect-options {
  display: grid;
  gap: 4px;
}

.app-multiselect-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--work-body-text);
  background: transparent;
  border-radius: 10px;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
  cursor: pointer;
}

.app-multiselect-option:hover,
.app-multiselect-option.is-active,
.app-multiselect-option[aria-selected="true"] {
  color: #fff;
  background: var(--work-primary);
}

.app-multiselect-option input {
  margin: 0;
  accent-color: var(--work-primary);
  /* Decorative indicator: clicks land on the option row (the label), which
     toggles the checkbox natively without a second interactive target. */
  pointer-events: none;
}

.app-multiselect-empty {
  padding: 10px;
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
}

.phone-number-input {
  display: grid;
  grid-template-columns: minmax(112px, 136px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
}

.phone-number-input .phone-country-code,
.phone-number-input .phone-local-number {
  width: 100%;
  min-width: 0;
  direction: ltr;
  text-align: left;
}

.phone-number-input .phone-country-code {
  padding-inline-end: 28px;
}

.field {
  margin-bottom: 14px;
}

.feature-toggle,
.option-chip,
.danger-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  color: var(--work-body-text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(76, 38, 110, 0.13);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: border-color var(--work-motion-fast) ease, background var(--work-motion-fast) ease, box-shadow var(--work-motion-fast) ease, transform var(--work-motion-fast) ease;
}

.feature-toggle:hover,
.option-chip:hover,
.danger-check:hover {
  background: #fff;
  border-color: rgba(76, 38, 110, 0.25);
  box-shadow: 0 10px 20px rgba(76, 38, 110, 0.07);
}

.danger-check:focus-within {
  outline: 3px solid color-mix(in srgb, var(--work-danger-alt) 58%, white);
  outline-offset: 2px;
}

.option-chip:focus-within {
  outline: 3px solid color-mix(in srgb, var(--work-primary) 58%, white);
  outline-offset: 2px;
}

.toggle-input,
.chip-input,
.danger-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-title,
.chip-title {
  color: #3e2450;
  font-weight: var(--work-weight-800);
}

.toggle-note,
.chip-note {
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-600);
}

.feature-toggle.compact {
  gap: 9px;
  padding: 9px 10px;
}

.feature-toggle.compact .toggle-switch {
  width: 44px;
  height: 24px;
}

.feature-toggle.compact .toggle-switch::after {
  width: 16px;
  height: 16px;
}

.feature-toggle.compact .toggle-input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.feature-toggle.compact .toggle-state {
  min-width: auto;
}

.nested-panel {
  box-shadow: none;
  margin-top: 14px;
}

.grid-spaced,
.state-card-stack {
  margin-top: 14px;
}

.field-spaced {
  margin-top: 12px;
}

.schema-drift-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.schema-drift-alert > div {
  display: grid;
  gap: 4px;
}

.schema-drift-alert strong,
.schema-drift-alert span,
.schema-drift-alert small {
  display: block;
}

.schema-drift-alert small {
  font-size: var(--work-text-xs);
  opacity: 0.78;
}

.schema-drift-alert .button {
  flex: 0 0 auto;
  margin-bottom: 0;
}

@media (max-width: 720px){
  .schema-drift-alert {
    align-items: stretch;
    flex-direction: column;
  }

  .schema-drift-alert .button {
    justify-content: center;
    width: 100%;
  }
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(76, 38, 110, 0.1);
  border-radius: 16px;
}

.timeline-item span {
  display: block;
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-700);
}

.timeline-item p {
  margin-bottom: 0;
}

.rtl-toggle a.active {
  color: #fff;
  background: var(--work-primary);
  border-radius: 999px;
  padding: 3px 7px;
}

.step-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  white-space: nowrap;
}

.step-state-badge.current {
  color: #4a2d5e;
  background: var(--work-primary-soft);
}

.step-state-badge.complete {
  color: #166534;
  background: var(--work-success-surface-alt);
}

.step-state-badge.open {
  color: #075985;
  background: #e0f2fe;
}

.step-state-badge.locked {
  color: #6b7280;
  background: #f3f4f6;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.option-chip {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 999px;
}

.option-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid rgba(76, 38, 110, 0.28);
  border-radius: 999px;
  background: #fff;
}

.option-chip:has(.chip-input:checked) {
  color: #3d2450;
  background: rgba(97, 196, 207, 0.14);
  border-color: rgba(21, 115, 71, 0.24);
  box-shadow: 0 10px 20px rgba(21, 115, 71, 0.07);
}

.option-chip:has(.chip-input:checked)::before {
  background: #157347;
  border-color: #157347;
  box-shadow: 0 0 0 4px rgba(21, 115, 71, 0.12);
}

.danger-check {
  align-items: flex-start;
  max-width: 440px;
  background: #fff7f7;
  border-color: #fecaca;
}

.danger-check::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid #ef9a9a;
  border-radius: 6px;
  background: #fff;
}

.danger-check:has(input:checked) {
  background: #fee2e2;
  border-color: #dc2626;
}

.danger-check:has(input:checked)::before {
  background: #dc2626;
  border-color: #dc2626;
}

.danger-check:has(input:checked)::after {
  content: "";
  position: absolute;
  inset-inline-start: 17px;
  top: 17px;
  width: 12px;
  height: 12px;
  background: #fff;
  -webkit-mask: url("/assets/icons/check.svg") center / contain no-repeat;
  mask: url("/assets/icons/check.svg") center / contain no-repeat;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(76, 38, 110, 0.1);
  text-align: start;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #4d3560;
  background: rgba(187, 211, 238, 0.3);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Arabic guard: letter-spacing breaks Arabic joining — Latin-only spacing. */
[dir="rtl"] th {
  letter-spacing: 0;
}

td {
  color: #443250;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:nth-child(even) {
  background: rgba(187, 211, 238, 0.09);
}

.row-order-cell {
  width: 1%;
  min-width: 106px;
  white-space: nowrap;
}

.row-order-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(76, 38, 110, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.row-order-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: var(--work-weight-800);
  line-height: 1;
}

.row-order-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.row-order-position {
  min-width: 2ch;
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  text-align: center;
}

.row-order-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  color: var(--work-body-muted);
  font-weight: var(--work-weight-800);
}

.system-key-display {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  color: #4a2d5e;
  background: rgba(76, 38, 110, 0.07);
  border: 1px solid rgba(76, 38, 110, 0.12);
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  overflow-wrap: anywhere;
}

.system-key-display.is-preview {
  color: var(--work-body-muted);
  background: rgba(187, 211, 238, 0.18);
  border-style: dashed;
  font-family: inherit;
}

.system-key-display.is-preview:not(.is-empty) {
  color: #4a2d5e;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.line-item-not-applicable {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--work-body-muted);
  background: rgba(187, 211, 238, 0.16);
  border: 1px dashed rgba(76, 38, 110, 0.14);
  border-radius: 999px;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

tbody tr:hover {
  background: rgba(76, 38, 110, 0.08);
}

tr:last-child td {
  border-bottom: 0;
}

.cc-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.cc-suggestion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-md);
  background: rgba(247, 251, 255, 0.86);
  cursor: pointer;
}

.cc-suggestion input {
  width: auto;
}

.cc-suggestion strong,
.cc-suggestion small {
  display: block;
  overflow-wrap: anywhere;
}

.cc-suggestion small {
  color: var(--work-body-muted);
  font-weight: var(--work-weight-700);
}

.document-review-bulk-form {
  display: grid;
  gap: 12px;
}

.brand {
  color: #fff;
}

.brand:hover {
  color: #fff;
}

.business-nav {
  margin-top: 8px;
}

.nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 3px 0 0 var(--work-accent-bright);
}

.page-kicker {
  margin-bottom: 4px;
  color: var(--work-brand-purple);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Arabic guard: letter-spacing breaks Arabic joining — Latin-only spacing. */
[dir="rtl"] .page-kicker {
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu {
  position: relative;
  flex: 0 0 auto;
  z-index: var(--work-z-inline-menu);
}

.user-menu[open] {
  z-index: var(--work-z-menu-layer);
}

.user-menu summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.avatar-initials {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--work-primary), var(--work-accent-bright));
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(76, 38, 110, 0.18);
  font-size: var(--work-text-base);
  font-weight: var(--work-weight-800);
}

.avatar-initials.large {
  width: 48px;
  height: 48px;
}

.avatar-initials.profile {
  width: 78px;
  height: 78px;
  font-size: 24px;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: var(--work-z-menu-layer);
  width: 286px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(76, 38, 110, 0.14);
  border-radius: 20px;
  box-shadow: 0 24px 52px rgba(33, 12, 55, 0.24);
  backdrop-filter: none;
}

.user-menu-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  inset-inline-end: 14px;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.99);
  border-top: 1px solid rgba(76, 38, 110, 0.14);
  border-left: 1px solid rgba(76, 38, 110, 0.14);
  transform: rotate(45deg);
}

.user-menu-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px;
  margin-bottom: 6px;
  background: rgba(187, 211, 238, 0.18);
  border: 1px solid rgba(76, 38, 110, 0.08);
  border-radius: 16px;
}

.user-menu-header .avatar-initials {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  align-self: center;
  color: #fff;
  overflow-wrap: normal;
}

.user-menu-meta {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 1px;
}

.user-menu-header strong,
.user-menu-meta span,
.user-menu-meta small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-menu-header strong {
  color: #362544;
  font-weight: var(--work-weight-800);
}

.user-menu-meta span,
.user-menu-meta small {
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-600);
}

.user-menu-panel a,
.dropdown-logout {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 39px;
  padding: 9px 10px;
  color: #3f3150;
  background: transparent;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  font-size: var(--work-text-base);
  font-weight: var(--work-weight-800);
  text-align: start;
}

.user-menu-panel a:hover,
.dropdown-logout:hover {
  color: var(--work-primary);
  background: rgba(76, 38, 110, 0.07);
  box-shadow: none;
  transform: none;
}

.dropdown-logout {
  color: #991b1b;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-height: 140px;
  padding: 17px;
  overflow: hidden;
  color: var(--work-body-text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--work-body-border);
  border-radius: 18px;
  box-shadow: var(--work-shadow-lg);
}

.metric-card:hover {
  color: var(--work-body-text);
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(76, 38, 110, 0.12);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--work-gradient-card);
}

.metric-card span,
.metric-card small {
  display: block;
}

.metric-card span {
  color: #4b355e;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-800);
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--work-primary);
  font-size: 36px;
  line-height: 1;
}

.metric-card small {
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-600);
}

.metric-card.warning::before {
  background: linear-gradient(90deg, #d99018, #f7c948);
}

.metric-card.success::before {
  background: linear-gradient(90deg, #157347, #41d9a3);
}

.metric-card.danger::before {
  background: linear-gradient(90deg, #b42318, #ef4444);
}

.metric-card.review::before {
  background: linear-gradient(90deg, #2563eb, #61C4CF);
}

.metric-card.neutral::before {
  background: linear-gradient(90deg, #64748b, #a78bfa);
}

.metric-card.total::before {
  background: linear-gradient(90deg, #3f3150, #4C266E);
}

.metric-card.metric-review-card::before {
  background: linear-gradient(90deg, #64748b, #22d3ee);
}

.metric-card.metric-review-card {
  align-content: start;
}

.badge.pre-sales {
  color: #86198f;
  background: #fae8ff;
  border-color: rgba(192, 38, 211, 0.18);
}

.main-category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.customer-edit-pencil-icon {
  font-size: var(--work-text-lg);
  line-height: 1;
}

.badge.cancelled {
  color: #475569;
  background: #e2e8f0;
  border-color: rgba(71, 85, 105, 0.18);
}

.badge.lost {
  color: #7f1d1d;
  background: #fff1f2;
  border-color: rgba(190, 18, 60, 0.22);
}

.entity-search {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.entity-search-input {
  width: 100%;
  box-sizing: border-box;
}

.entity-search-label {
  display: block;
  margin: 0;
}
.entity-search-sublabel {
  margin: 0 0 6px 0;
}

.entity-search-results {
  position: fixed;
  z-index: var(--work-z-max);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-xs);
  background: var(--work-body-surface);
  box-shadow: var(--work-shadow-lg);
}

.entity-search-empty {
  position: fixed;
  z-index: var(--work-z-max);
  box-sizing: border-box;
  max-height: 160px;
  overflow-y: auto;
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--work-body-border);
  border-radius: var(--work-radius-xs);
  color: var(--work-body-muted);
  background: var(--work-shell-bg);
  box-shadow: var(--work-shadow-lg);
}

.entity-search-empty p {
  margin: 0;
}

.entity-search-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: start;
  padding: 8px 12px;
  border: none;
  border-radius: var(--work-radius-xs);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background-color 120ms ease;
}
.entity-search-result:hover,
.entity-search-result:focus {
  background: color-mix(in srgb, var(--work-accent-strong, var(--work-primary)) 16%, transparent);
  outline: none;
}
.entity-search-result.is-active {
  background: color-mix(in srgb, var(--work-accent-strong, var(--work-primary)) 24%, transparent);
  outline: none;
}
.entity-search-result.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.entity-search-result.is-disabled:hover,
.entity-search-result.is-disabled:focus {
  background: transparent;
}
.entity-search-result-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.entity-search-result-primary strong {
  min-width: 0;
  overflow: hidden;
  color: #241231;
  font-size: var(--work-text-base);
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.entity-search-result-code {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--work-text-sm);
  color: var(--work-body-muted);
}
.entity-search-result .badge {
  min-height: 20px;
  padding: 1px 8px;
  font-size: var(--work-text-xs);
  font-weight: var(--work-weight-600);
}
.entity-search-result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  font-size: var(--work-text-sm);
  line-height: 1.5;
  color: rgba(15, 23, 42, 0.72);
}

.entity-search-result mark {
  padding: 0 1px;
  border-radius: 3px;
  color: var(--work-accent-strong, var(--work-primary));
  background: var(--work-accent-soft);
}

.entity-search-more {
  padding: 6px 10px 2px;
  border-top: 1px dashed var(--work-body-border);
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  text-align: center;
}

.entity-search-loading {
  padding: 10px;
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
}

/* Layout-only shell for skeleton rows; visuals come from the shared .work-skeleton classes. */
.entity-search-result-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}

.entity-search-selected-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.entity-search-selected {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 64px;
  padding-block: 10px;
  padding-inline-start: 12px;
  padding-inline-end: 48px;
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-xs);
  color: var(--work-body-text);
  background: var(--work-body-surface);
}

.entity-search-clear {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--work-body-border);
  border-radius: 50%;
  color: var(--work-primary);
  background: var(--work-body-surface);
  font: inherit;
  font-size: var(--work-text-lg);
  line-height: 1;
  cursor: pointer;
}

.entity-search-clear:hover {
  color: var(--work-body-text);
  background: var(--work-shell-bg);
}

.entity-search-clear:focus-visible {
  outline: 2px solid var(--work-focus-ring);
  outline-offset: 2px;
}
.entity-search-selected-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--work-text-sm);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.08);
}
.entity-search-selected-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: var(--work-text-sm);
  color: rgba(15, 23, 42, 0.72);
}

.saved-contact-option[aria-selected="true"] {
  border-color: rgba(22, 163, 74, 0.44);
  background: rgba(22, 163, 74, 0.07);
}

html[data-theme="dark"] .saved-contact-option[aria-selected="true"] {
  border-color: rgba(74, 222, 128, 0.48);
  background: rgba(34, 197, 94, 0.12);
}

html[data-sidebar="collapsed"] .app-shell {
  grid-template-columns: 72px minmax(0, 1fr);
}

html[data-sidebar="collapsed"] .sidebar {
  padding-inline: 8px;
}

html[data-sidebar="collapsed"] .brand span,
html[data-sidebar="collapsed"] .brand-sub,
html[data-sidebar="collapsed"] .nav a,
html[data-sidebar="collapsed"] .nav .nav-group-label,
html[data-sidebar="collapsed"] .nav .nav-section-label,
html[data-sidebar="collapsed"] .sidebar-footer {
  display: none;
}

html[data-sidebar="collapsed"] .brand {
  justify-content: center;
}

html[data-sidebar="collapsed"] .nav .nav-group {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-inline-end: 10px;
  color: var(--work-body-text);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--work-control-border);
  border-radius: 10px;
  cursor: pointer;
  font-size: var(--work-text-lg);
  line-height: 1;
  transition: background var(--work-motion-interactive) ease, border-color var(--work-motion-interactive) ease, color var(--work-motion-interactive) ease;
}

.theme-toggle:hover {
  background: rgba(76, 38, 110, 0.10);
  border-color: rgba(76, 38, 110, 0.36);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--work-brand-purple);
  outline-offset: 2px;
}

.theme-toggle-icon {
  display: none;
}

html[data-theme="dark"] .theme-toggle-icon-sun {
  display: inline-block;
}

html:not([data-theme="dark"]) .theme-toggle-icon-moon {
  display: inline-block;
}

html[data-theme="dark"] code {
  color: #ecd0ff;
  background: rgba(178, 137, 214, 0.18);
}

/* The duplicate dark --lt-* block previously here was removed in wave D1;
   the identical later block (with the --premium-* aliases) owns these tokens
   with unchanged computed values. */


.nav a::before {
  display: none;
}

@keyframes work-nav-attention {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(37, 201, 219, 0.16),
      0 10px 22px rgba(37, 201, 219, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

.nav-icon-dashboard {
  --work-nav-icon-url: url("/assets/icons/dashboard.svg?v=20260605-icons-01");
}

.nav-icon-customers {
  --work-nav-icon-url: url("/assets/icons/customers.svg?v=20260605-icons-01");
}

.nav-icon-procurement {
  --work-nav-icon-url: url("/assets/icons/procurement.svg?v=20260611-procurement-01");
}

.nav-icon-human-resources {
  --work-nav-icon-url: url("/assets/icons/customers.svg?v=20260612-hr-01");
}

.sidebar-toggle:focus-visible,
.theme-toggle:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--work-accent-bright);
  outline-offset: 3px;
}

html[data-sidebar="collapsed"] .sidebar-toggle {
  color: #0f3d45;
  border-color: rgba(97, 196, 207, 0.54);
  box-shadow: 0 15px 30px rgba(37, 201, 219, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars {
  width: 0;
  background: transparent;
}

html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::before,
html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::after {
  width: 12px;
  inset-inline-start: 3px;
}

html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::before {
  top: -4px;
  transform: rotate(35deg);
}

html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::after {
  top: 4px;
  transform: rotate(-35deg);
}

[dir="rtl"] html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::before,
[dir="rtl"] html[data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::after,
html[dir="rtl"][data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::before,
html[dir="rtl"][data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::after {
  transform-origin: center;
}

.theme-toggle {
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(36, 18, 51, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html[data-sidebar="collapsed"] .nav {
  justify-items: center;
  gap: 8px;
}

html[data-sidebar="collapsed"] .nav a,
html[data-sidebar="collapsed"] .nav .nav-group-label {
  display: flex;
  justify-content: center;
  width: 48px;
  min-height: 46px;
  padding: 0;
  border-radius: 14px;
}

html[data-sidebar="collapsed"] .nav .nav-label,
html[data-sidebar="collapsed"] .nav .nav-section-label,
html[data-sidebar="collapsed"] .brand span,
html[data-sidebar="collapsed"] .brand-sub,
html[data-sidebar="collapsed"] .sidebar-footer {
  display: none;
}

html[data-sidebar="collapsed"] .nav a:hover {
  transform: none;
}

html[data-sidebar="collapsed"] .nav .nav-group {
  align-items: center;
  width: 100%;
  margin-top: 4px;
  padding-top: 6px;
}

html[data-sidebar="collapsed"] .nav .nav-group-items {
  justify-items: center;
  gap: 8px;
}

html[data-sidebar="collapsed"] .nav .nav-group-label {
  min-height: 32px;
  opacity: 0.72;
}

@media (max-width: 720px){
  html:not([data-sidebar="expanded"]) .nav a,
  html:not([data-sidebar="expanded"]) .nav .nav-group-label {
    display: flex;
    justify-content: center;
    width: 48px;
    min-height: 46px;
    padding: 0;
  }
  html:not([data-sidebar="expanded"]) .nav .nav-label,
  html:not([data-sidebar="expanded"]) .brand span,
  html:not([data-sidebar="expanded"]) .brand-sub,
  html:not([data-sidebar="expanded"]) .sidebar-footer {
    display: none;
  }
  html:not([data-sidebar="expanded"]) .nav .nav-group,
  html:not([data-sidebar="expanded"]) .nav .nav-group-items {
    align-items: center;
    justify-items: center;
  }
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .user-menu-panel,
html[data-theme="dark"] .state-card,
html[data-theme="dark"] .upload-card,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .app-select-list,
html[data-theme="dark"] .app-multiselect-list {
  color: var(--work-body-text);
  background: var(--work-body-surface);
  border-color: var(--work-body-border);
  box-shadow: var(--work-shadow-xs);
}

html[data-theme="dark"] .topbar {
  background: rgba(24, 27, 37, 0.88);
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] label,
html[data-theme="dark"] .toggle-title,
html[data-theme="dark"] .chip-title,
html[data-theme="dark"] .modal-header h3,
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .upload-card strong {
  color: #f4edf8;
}

html[data-theme="dark"] .subtle,
html[data-theme="dark"] .page-kicker,
html[data-theme="dark"] .toggle-note,
html[data-theme="dark"] .chip-note,
html[data-theme="dark"] .user-menu-meta span,
html[data-theme="dark"] .user-menu-meta small,
html[data-theme="dark"] .timeline-item span,
html[data-theme="dark"] .entity-search-result-meta,
html[data-theme="dark"] .entity-search-selected-meta {
  color: var(--work-body-muted);
}

html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .table-action,
html[data-theme="dark"] .small-button,
html[data-theme="dark"] .modal-close-button {
  color: #f4edf8;
  background: rgba(36, 40, 52, 0.96);
  border-color: var(--work-body-border);
  box-shadow: none;
}

html[data-theme="dark"] th {
  color: #dce7f2;
  background: rgba(42, 46, 60, 0.96);
  border-bottom-color: var(--work-body-border);
}

html[data-theme="dark"] td {
  color: var(--work-body-text);
  border-bottom-color: var(--work-body-border);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(91, 224, 236, 0.08);
}

html[data-theme="dark"] .badge.success,
html[data-theme="dark"] .step-state-badge.complete {
  color: #c6f6d5;
  background: rgba(34, 120, 76, 0.32);
  border-color: rgba(141, 224, 170, 0.34);
}

html[data-theme="dark"] .badge.warning,
html[data-theme="dark"] .step-state-badge.open {
  color: #ffe2a8;
  background: rgba(138, 94, 16, 0.30);
  border-color: rgba(255, 210, 122, 0.34);
}

html[data-theme="dark"] .badge.neutral,
html[data-theme="dark"] .step-state-badge.locked {
  color: #d6dde7;
  background: rgba(115, 126, 145, 0.22);
  border-color: rgba(197, 214, 230, 0.20);
}

html[data-theme="dark"] .alert.warning {
  color: #ffe2a8;
  background: rgba(111, 78, 20, 0.54);
  border-color: rgba(255, 210, 122, 0.34);
}

html[data-theme="dark"] .user-menu-panel::before {
  background: var(--work-body-surface);
  border-color: var(--work-body-border);
}

html[data-theme="dark"] .user-menu-panel a,
html[data-theme="dark"] .dropdown-logout {
  color: var(--work-body-text);
}

html[data-theme="dark"] .user-menu-panel a:hover,
html[data-theme="dark"] .dropdown-logout:hover {
  color: var(--work-accent-bright);
  background: rgba(91, 224, 236, 0.10);
}

html[data-theme="dark"] .rtl-toggle,
html[data-theme="dark"] .feature-toggle,
html[data-theme="dark"] .option-chip,
html[data-theme="dark"] .danger-check,
html[data-theme="dark"] .cc-suggestion,
html[data-theme="dark"] .entity-search-result {
  color: var(--work-body-text);
}

html[data-theme="dark"] .entity-search-result-primary strong {
  color: var(--work-body-text);
}

html[data-theme="dark"][data-sidebar="collapsed"] .sidebar-toggle {
  border-color: rgba(91, 224, 236, 0.64);
}

html[data-theme="dark"] pre,
html[data-theme="dark"] code {
  color: #f0dcff;
  background: rgba(185, 150, 219, 0.14);
  border-color: rgba(185, 150, 219, 0.24);
}

.brand::before {
  content: "L";
  color: #ffffff;
  background: linear-gradient(135deg, rgba(115, 213, 228, 0.96), rgba(119, 86, 145, 0.92));
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 14px 30px rgba(7, 15, 27, 0.24);
}

.brand-sub,
.sidebar-footer {
  color: rgba(242, 247, 251, 0.70);
}

html[dir="rtl"] .nav .nav-link:hover,
html[dir="rtl"] .nav .nav-link.active,
html[dir="rtl"] .nav .nav-group.is-active-group > .nav-group-label {
  box-shadow: inset -3px 0 0 rgba(115, 213, 228, 0.75), 0 10px 22px rgba(7, 15, 27, 0.16);
}

.topbar {
  background: var(--work-topbar-bg);
  border-color: var(--work-shell-border);
  box-shadow: 0 14px 34px rgba(29, 48, 70, 0.08);
  backdrop-filter: blur(14px);
}

.topbar h1,
.panel h2,
.panel h3,
.modal-header h3 {
  color: var(--work-field-text);
}

.subtle,
.page-kicker,
.topbar .subtitle,
.panel p,
.metric-card small,
.settings-card small,
.timeline-item span,
.empty-state {
  color: var(--work-text-dim);
}

/* The duplicate card-surface group previously here was removed in wave D1:
   the later identical-selector group (var(--work-body-text)/--surface/--border) owns
   the same computed surface contract in both themes. */

.panel,
.table-wrap,
.settings-card,
.metric-card {
  border: 1px solid var(--work-shell-border);
}

.panel::before,
.stat::before,
.metric-card::before,
.settings-card::before {
  background: linear-gradient(90deg, var(--work-brand-violet), var(--work-accent-glow));
}

.settings-hero {
  background:
    linear-gradient(135deg, var(--work-brand-soft), var(--work-accent-soft)),
    var(--work-card-bg);
  border-color: var(--work-shell-border);
  box-shadow: var(--work-shadow-lg);
}

.metric-card span,
.settings-card strong {
  color: var(--work-field-text);
}

.metric-card strong {
  color: var(--work-accent-strong);
}

.metric-card {
  overflow: hidden;
}

.metric-card:hover,
.settings-card:hover {
  color: var(--work-field-text);
  border-color: rgba(47, 135, 161, 0.34);
  box-shadow: var(--work-shadow-lg);
}

.feature-toggle,
.option-chip,
.danger-check,
.cc-suggestion {
  color: var(--work-field-text);
  background: var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
}

input,
select,
textarea,
.app-select-input {
  color: var(--work-field-text);
  background: var(--work-control-bg);
  border-color: var(--work-control-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

/* File inputs keep a styled native fallback. JavaScript progressively
   enhances ordinary inputs through the shared .file-picker component. */
input[type="file"] {
  min-height: var(--work-control-height-md, 48px);
  padding: var(--work-space-4) var(--work-space-5);
  border: 1px solid var(--work-control-border);
  border-radius: var(--work-radius-md, 12px);
}
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: var(--work-weight-800);
  min-height: var(--work-control-height-sm, 40px);
  margin: calc(var(--work-space-4) * -1) calc(var(--work-space-5) * -1);
  margin-inline-end: var(--work-space-7);
  padding: 0 var(--work-space-9);
  color: var(--work-text-inverse);
  background: var(--work-primary);
  border: 0;
  border-radius: var(--work-radius-xs);
  cursor: pointer;
  transition:
    background var(--work-motion-fast) var(--work-ease),
    color var(--work-motion-fast) var(--work-ease);
}
input[type="file"]::file-selector-button:hover {
  color: var(--work-text-inverse);
  background: var(--work-primary-hover);
}
input[type="file"]:disabled::file-selector-button {
  cursor: not-allowed;
  opacity: 0.58;
}

.file-picker {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: var(--work-control-height-md, 48px);
  overflow: hidden;
  color: var(--work-field-text);
  background: var(--work-control-bg);
  border: 1px solid var(--work-control-border);
  border-radius: var(--work-radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  transition:
    border-color var(--work-motion-fast) var(--work-ease),
    box-shadow var(--work-motion-fast) var(--work-ease);
}

.file-picker:hover {
  border-color: color-mix(in srgb, var(--work-primary) 55%, var(--work-control-border));
}

.file-picker:focus-within {
  border-color: rgba(47, 135, 161, 0.56);
  box-shadow: var(--work-focus-ring-wide);
}

.file-picker:has(.file-picker__input:disabled) {
  cursor: not-allowed;
  opacity: 0.58;
}

.file-picker:has(.file-picker__input[aria-invalid="true"]),
.file-picker:has(.file-picker__input:user-invalid) {
  border-color: var(--work-danger-alt);
}

.file-picker__input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.file-picker__input:disabled {
  cursor: not-allowed;
}

.file-picker__action,
.file-picker__status {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-inline: var(--work-space-8);
}

.file-picker__action {
  gap: var(--work-space-5);
  min-height: calc(var(--work-control-height-md, 48px) - 2px);
  color: var(--work-text-inverse);
  background: var(--work-primary);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-800);
  white-space: nowrap;
  transition: background var(--work-motion-fast) var(--work-ease);
}

.file-picker__action::before {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  content: "";
  background: currentColor;
  -webkit-mask: url("/assets/icons/upload.svg") center / contain no-repeat;
  mask: url("/assets/icons/upload.svg") center / contain no-repeat;
}

.file-picker:hover .file-picker__action,
.file-picker:focus-within .file-picker__action {
  background: var(--work-primary-hover);
}

.file-picker__status {
  overflow: hidden;
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-600);
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: plaintext;
}

.file-picker.has-files .file-picker__status {
  color: var(--work-body-text);
}

.file-picker--compact {
  min-height: var(--work-control-height-sm, 40px);
  border-radius: var(--work-radius-sm);
}

.file-picker--compact .file-picker__action {
  min-height: calc(var(--work-control-height-sm, 40px) - 2px);
  padding-inline: var(--work-space-7);
}

.file-picker--compact .file-picker__status {
  padding-inline: var(--work-space-7);
}

input:focus,
select:focus,
textarea:focus,
.app-select-input:focus {
  border-color: rgba(47, 135, 161, 0.56);
  box-shadow: var(--work-focus-ring-wide);
}

/* Shared invalid-field state (set via aria-invalid by form scripts). */
html :is(input, select, textarea)[aria-invalid="true"],
html :is(input, select, textarea)[aria-invalid="true"]:focus {
  border-color: var(--work-danger-alt);
}

.choice-card input[type="radio"],
.choice-card input[type="radio"]:focus,
.choice-card input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: none;
  border-radius: 999px;
}

.choice-card:has(input[type="radio"]:checked) {
  box-shadow: none;
}

.choice-card:focus-within {
  box-shadow: none;
}

.table-action,
.small-button,
.modal-close-button {
  color: var(--work-accent-strong);
  background: var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
  box-shadow: 0 8px 18px rgba(29, 48, 70, 0.07);
}

.button.secondary:hover,
button.secondary:hover,
.table-action:hover,
.small-button:hover {
  color: var(--work-field-text);
  border-color: rgba(47, 135, 161, 0.34);
}

th {
  color: var(--work-text-secondary);
  background: rgba(232, 241, 247, 0.78);
  border-bottom-color: var(--work-shell-border);
}

td {
  color: var(--work-field-text);
  border-bottom-color: var(--work-shell-border-soft);
}

tbody tr:nth-child(even) {
  background: rgba(232, 241, 247, 0.30);
}

tbody tr:hover {
  background: var(--work-accent-soft);
}

.step-state-badge {
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.step-state-badge.current {
  color: var(--work-text-secondary);
  background: rgba(88, 116, 145, 0.12);
  border-color: rgba(88, 116, 145, 0.18);
}

.badge.success,
.step-state-badge.complete {
  color: #12613f;
  background: var(--work-success-surface-alt);
  border-color: rgba(21, 115, 71, 0.22);
}

.badge.warning,
.step-state-badge.open {
  color: #7a4c0d;
  background: var(--work-warning-surface-alt);
  border-color: rgba(171, 108, 19, 0.24);
}

.badge.danger,
.badge.error {
  color: #8f1f18;
  background: var(--work-danger-surface-alt);
  border-color: rgba(180, 35, 24, 0.24);
}

.badge.info {
  color: var(--work-info);
  background: var(--work-info-surface);
  border-color: var(--work-info-border);
}

.badge.cancelled {
  color: #435468;
  background: rgba(88, 116, 145, 0.14);
  border-color: rgba(88, 116, 145, 0.22);
}

.alert.warning {
  color: #7a4c0d;
  background: var(--work-warning-surface-alt);
  border-color: rgba(171, 108, 19, 0.24);
}

.alert.info {
  color: var(--work-info);
  background: var(--work-info-surface);
  border-color: var(--work-info-border);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px 24px;
  color: var(--work-text-dim);
  text-align: center;
  background: var(--work-card-bg);
  border-color: var(--work-shell-border);
}

td.table-empty-state-cell {
  padding: 0;
  text-align: center;
}

.table-empty-state-cell > .empty-state {
  width: 100%;
}

.empty-state strong {
  color: var(--work-body-text);
  font-size: var(--work-text-lg);
  font-weight: var(--work-weight-800);
}

.empty-state p {
  max-width: 46ch;
  margin: 0;
  line-height: 1.8;
}

/* Shared empty-state anatomy: icon disc + title + hint + optional actions. */
.empty-state .empty-state-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--work-accent-glow);
  background: var(--work-accent-soft);
  border: 1px solid var(--work-shell-border);
  border-radius: 16px;
}

.empty-state .empty-state-icon::before {
  content: "";
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--work-empty-state-icon-url, url("/assets/icons/documentation.svg?v=20260714-work-actions-01")) center / contain no-repeat;
  mask: var(--work-empty-state-icon-url, url("/assets/icons/documentation.svg?v=20260714-work-actions-01")) center / contain no-repeat;
}

.empty-state .empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

/* sidebar-toggle/theme-toggle base merged into the later winning rule in
   wave D1 (its box-shadow moved there; all other properties were already
   overridden — computed values unchanged). */

.sidebar-toggle:focus-visible,
.theme-toggle:focus-visible,
.nav a:focus-visible,
.table-action:focus-visible,
.small-button:focus-visible,
.button:focus-visible,
button:focus-visible {
  outline: 2px solid var(--work-accent-glow);
  outline-offset: 3px;
  box-shadow: var(--work-focus-ring-wide);
}

.theme-toggle-icon {
  width: 17px;
  height: 17px;
  background: currentColor;
  font-size: 0;
  -webkit-mask: var(--work-theme-icon-url) center / contain no-repeat;
  mask: var(--work-theme-icon-url) center / contain no-repeat;
}

.theme-toggle-icon-sun {
  --work-theme-icon-url: url("/assets/icons/sun.svg?v=20260605-icons-01");
}

.theme-toggle-icon-moon {
  --work-theme-icon-url: url("/assets/icons/moon.svg?v=20260605-icons-01");
}

html[data-theme="dark"] .topbar {
  background: var(--work-topbar-bg);
  border-color: var(--work-shell-border);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .user-menu-panel,
html[data-theme="dark"] .state-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .upload-card,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .app-select-list {
  color: var(--work-field-text);
  background: var(--work-panel-bg);
  border-color: var(--work-shell-border);
  box-shadow: var(--work-shadow-xs);
}

html[data-theme="dark"] .settings-hero {
  background:
    linear-gradient(135deg, rgba(115, 213, 228, 0.08), rgba(198, 163, 221, 0.09)),
    var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
}

html[data-theme="dark"] .metric-card small {
  color: var(--work-text-dim);
}

html[data-theme="dark"] .metric-card strong {
  color: var(--work-accent-glow);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .app-select-input,
html[data-theme="dark"] .app-multiselect-control,
html[data-theme="dark"] .app-multiselect-search {
  color: var(--work-field-text);
  background: var(--work-control-bg);
  border-color: var(--work-control-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] th {
  color: var(--work-text-secondary);
  background: rgba(23, 36, 55, 0.98);
  border-bottom-color: var(--work-shell-border);
}

html[data-theme="dark"] td {
  color: var(--work-field-text);
  border-bottom-color: var(--work-shell-border-soft);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(115, 213, 228, 0.07);
}

html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .table-action,
html[data-theme="dark"] .small-button,
html[data-theme="dark"] .modal-close-button {
  color: var(--work-accent-glow);
  background: var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
}

html[data-theme="dark"] .badge,
html[data-theme="dark"] .badge.neutral,
html[data-theme="dark"] .step-state-badge.current,
html[data-theme="dark"] .step-state-badge.locked {
  color: var(--work-text-secondary);
  background: rgba(149, 166, 185, 0.14);
  border-color: rgba(149, 166, 185, 0.20);
}

html[data-theme="dark"] .badge.success,
html[data-theme="dark"] .step-state-badge.complete {
  color: #bff2cf;
  background: var(--work-success-surface-alt);
  border-color: rgba(125, 218, 158, 0.32);
}

html[data-theme="dark"] .badge.warning,
html[data-theme="dark"] .step-state-badge.open {
  color: #f8d493;
  background: var(--work-warning-surface-alt);
  border-color: rgba(230, 178, 87, 0.32);
}

html[data-theme="dark"] .badge.danger,
html[data-theme="dark"] .badge.error {
  color: #ffc5c0;
  background: var(--work-danger-surface-alt);
  border-color: rgba(238, 137, 131, 0.32);
}

html[data-theme="dark"] .badge.lost {
  color: #fecdd3;
  background: rgba(127, 29, 29, 0.24);
  border-color: rgba(251, 113, 133, 0.28);
}

html[data-theme="dark"] .alert.warning {
  color: #f8d493;
  background: var(--work-warning-surface-alt);
  border-color: rgba(230, 178, 87, 0.32);
}

html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .rtl-toggle,
html[data-theme="dark"] .feature-toggle,
html[data-theme="dark"] .option-chip,
html[data-theme="dark"] .danger-check,
html[data-theme="dark"] .cc-suggestion,
html[data-theme="dark"] .sidebar-toggle,
html[data-theme="dark"] .theme-toggle {
  color: var(--work-field-text);
  background: var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .sidebar-toggle:hover,
html[data-theme="dark"] .theme-toggle:hover {
  color: var(--work-accent-glow);
  background: linear-gradient(180deg, rgba(29, 44, 66, 0.98), rgba(20, 33, 51, 0.98));
  border-color: rgba(115, 213, 228, 0.44);
}

html[data-theme="dark"] pre,
html[data-theme="dark"] code {
  color: #dfefff;
  background: rgba(115, 213, 228, 0.11);
  border-color: rgba(115, 213, 228, 0.18);
}

.brand::before {
  background: linear-gradient(135deg, rgba(97, 196, 207, 0.98), rgba(76, 38, 110, 0.92));
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: var(--work-shadow-lift);
}

.brand-sub {
  color: rgba(255, 255, 255, 0.72);
}

[dir="rtl"] .nav a.active,
html[dir="rtl"] .nav .nav-link:hover,
html[dir="rtl"] .nav .nav-link.active,
html[dir="rtl"] .nav .nav-group.is-active-group > .nav-group-label {
  box-shadow: inset -3px 0 0 var(--work-accent-bright);
}

.topbar {
  background: var(--work-topbar-bg);
  border-color: var(--work-body-border);
  box-shadow: var(--work-shadow-xs);
}

.panel,
.stat,
.metric-card,
.table-wrap,
.modal-card,
.user-menu-panel,
.state-card,
.settings-card,
.upload-card,
.timeline-item,
.app-select-list {
  color: var(--work-body-text);
  background: var(--work-body-surface);
  border-color: var(--work-body-border);
  box-shadow: var(--work-shadow-xs);
}

.sidebar-toggle,
.theme-toggle {
  color: var(--work-body-text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 244, 249, 0.92));
  border-color: rgba(76, 38, 110, 0.18);
  box-shadow: 0 12px 26px rgba(29, 48, 70, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sidebar-toggle:hover,
.theme-toggle:hover {
  color: #241231;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(225, 243, 247, 0.96));
  border-color: rgba(97, 196, 207, 0.60);
}

html[data-theme="dark"] .topbar {
  background: rgba(24, 27, 37, 0.88);
}

html[data-theme="dark"] .sidebar-toggle,
html[data-theme="dark"] .theme-toggle {
  color: #f4edf8;
  background: linear-gradient(180deg, rgba(39, 43, 56, 0.96), rgba(27, 31, 42, 0.96));
  border-color: var(--work-control-border);
}

html[data-theme="dark"] .sidebar-toggle:hover,
html[data-theme="dark"] .theme-toggle:hover {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(48, 53, 68, 0.98), rgba(31, 37, 50, 0.98));
  border-color: rgba(91, 224, 236, 0.54);
}

.theme-toggle-icon {
  width: 22px;
  height: 22px;
}

.theme-toggle {
  min-width: 40px;
  min-height: 40px;
}

html[data-sidebar="collapsed"] .sidebar-edge-toggle {
  inset-inline-end: -22px;
}

.theme-toggle {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  margin-inline-end: 0;
  border-radius: 14px;
}

.theme-toggle-icon {
  width: 26px;
  height: 26px;
}

.topbar-feedback-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  color: #ffffff;
  text-decoration: none;
  font-weight: var(--work-weight-800);
  white-space: nowrap;
  background: linear-gradient(135deg, #4c266e 0%, #287d93 100%);
  border: 1px solid rgba(97, 196, 207, 0.62);
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(43, 22, 63, 0.22);
}

.topbar-documentation-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--work-space-5, 8px);
  height: var(--work-control-height-md, 48px);
  min-height: var(--work-control-height-md, 48px);
  padding-inline: var(--work-space-9, 16px);
  color: var(--work-primary);
  text-decoration: none;
  font-weight: var(--work-weight-800, 800);
  white-space: nowrap;
  background: var(--work-surface-raised);
  border: 1px solid var(--work-border-strong);
  border-radius: var(--work-radius-pill, 999px);
  box-shadow: var(--work-shadow-sm);
  transition: background var(--work-motion-fast) var(--work-ease),
    border-color var(--work-motion-fast) var(--work-ease),
    color var(--work-motion-fast) var(--work-ease),
    transform var(--work-motion-fast) var(--work-ease);
}

.topbar-documentation-action:hover,
.topbar-documentation-action.active {
  color: var(--work-primary-hover);
  background: var(--work-primary-soft);
  border-color: var(--work-primary);
}

.topbar-documentation-action:hover {
  transform: translateY(-1px);
}

.topbar-documentation-action:active {
  color: var(--work-primary-hover);
  background: var(--work-primary-soft);
  border-color: var(--work-primary);
  transform: translateY(0);
}

.topbar-documentation-action:focus-visible {
  outline: var(--work-focus-ring-width, 3px) solid var(--work-focus-ring, var(--work-accent-bright));
  outline-offset: 3px;
}

.topbar-documentation-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("/assets/icons/book-2.svg?v=20260713-work-icons-01") center / contain no-repeat;
  mask: url("/assets/icons/book-2.svg?v=20260713-work-icons-01") center / contain no-repeat;
}

.topbar-feedback-action:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(43, 22, 63, 0.28);
}

.topbar-feedback-action:focus-visible {
  outline: 2px solid var(--work-accent-glow, var(--work-accent-bright));
  outline-offset: 3px;
}

.topbar-feedback-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("/assets/icons/improvement-tickets.svg") center / contain no-repeat;
  mask: url("/assets/icons/improvement-tickets.svg") center / contain no-repeat;
}

html[data-theme="dark"] .topbar-feedback-action {
  color: #ffffff;
  background: linear-gradient(135deg, #4c266e 0%, #287d93 100%);
  border-color: rgba(97, 196, 207, 0.62);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .topbar-feedback-action:hover {
  color: #ffffff;
  border-color: rgba(91, 224, 236, 0.68);
}

/* Dark contrast fix: these components hard-code the light-theme ink #352543
   in shared rules below; override them to the dark reading color here so the
   light theme stays pixel-identical. */
html[data-theme="dark"] .settings-card strong,
html[data-theme="dark"] .detail-item strong,
html[data-theme="dark"] .business-table td strong {
  color: var(--work-field-text);
}

html[data-theme="dark"] .brand::before {
  color: #ffffff;
  background: linear-gradient(135deg, #61C4CF, #8f6bb0);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 14px 30px rgba(97, 196, 207, 0.18);
}

html[data-theme="dark"] .brand,
html[data-theme="dark"] .brand-sub,
html[data-theme="dark"] .sidebar-footer {
  color: rgba(255, 255, 255, 0.86);
}

html[dir="rtl"][data-theme="dark"] .nav .nav-link:hover,
html[dir="rtl"][data-theme="dark"] .nav .nav-link.active,
html[dir="rtl"][data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  box-shadow: inset -3px 0 0 #61C4CF, 0 12px 24px rgba(18, 22, 35, 0.22);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .app-topbar {
  color: var(--work-dark-text);
  background: rgba(19, 30, 46, 0.9);
  border-color: rgba(184, 204, 230, 0.28);
  box-shadow: 0 18px 42px rgba(13, 18, 31, 0.24);
}

html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .metric-card span {
  color: #f4f8ff;
  text-shadow: none;
}

html[data-theme="dark"] .page-kicker {
  color: #d6e0ec;
}

html[data-theme="dark"] .subtle,
html[data-theme="dark"] .metric-card small {
  color: #c7d2df;
}

html[data-theme="dark"] .settings-hero {
  color: var(--work-dark-text);
  background:
    linear-gradient(135deg, rgba(97, 196, 207, 0.22), rgba(76, 38, 110, 0.28)),
    rgba(26, 40, 60, 0.94);
  border-color: rgba(159, 243, 251, 0.26);
  box-shadow: 0 20px 48px rgba(13, 18, 31, 0.22);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .table-wrap {
  color: var(--work-dark-text);
  background: var(--work-dark-panel);
  border-color: var(--work-dark-border);
  box-shadow: 0 16px 34px rgba(13, 18, 31, 0.22);
}

html[data-theme="dark"] .metric-card {
  min-height: 138px;
}

html[data-theme="dark"] .metric-card::before,
html[data-theme="dark"] .panel::before,
html[data-theme="dark"] .stat::before {
  height: 3px;
  background: linear-gradient(90deg, #9ff3fb, #61C4CF, #b996db);
  opacity: 0.95;
}

html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .stat strong {
  color: var(--work-dark-cyan);
  text-shadow: 0 0 18px rgba(97, 196, 207, 0.18);
}

html[data-theme="dark"] .metric-card:hover {
  border-color: rgba(159, 243, 251, 0.38);
  background: linear-gradient(180deg, rgba(34, 50, 74, 0.98), rgba(26, 40, 60, 0.98));
  box-shadow: 0 22px 54px rgba(13, 18, 31, 0.28);
}

html[data-theme="dark"] .business-table th,
html[data-theme="dark"] th {
  color: #f3f8ff;
  background: rgba(23, 36, 55, 0.98);
  border-bottom-color: rgba(184, 204, 230, 0.26);
}

html[data-theme="dark"] .business-table td,
html[data-theme="dark"] td {
  color: #edf4fb;
  border-bottom-color: rgba(184, 204, 230, 0.18);
}

html[data-theme="dark"] .badge {
  color: #f6fbff;
  background: rgba(226, 232, 240, 0.18);
  border-color: rgba(226, 232, 240, 0.28);
  box-shadow: var(--work-shadow-inset-highlight);
}

html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .table-action,
html[data-theme="dark"] .small-button {
  color: #dffbff;
  background: rgba(26, 40, 60, 0.96);
  border-color: rgba(159, 243, 251, 0.24);
  box-shadow: 0 10px 22px rgba(13, 18, 31, 0.16);
}

html[data-theme="dark"] .button.secondary:hover,
html[data-theme="dark"] button.secondary:hover,
html[data-theme="dark"] .table-action:hover,
html[data-theme="dark"] .small-button:hover {
  color: #ffffff;
  background: rgba(34, 50, 74, 0.98);
  border-color: rgba(159, 243, 251, 0.42);
}

.access-matrix-wrap {
  overflow-x: auto;
}

.access-matrix-table th,
.access-matrix-table td {
  min-width: 180px;
  vertical-align: top;
}

.access-matrix-table th:first-child,
.access-matrix-table td:first-child {
  min-width: 220px;
}

.toggle-row.compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-weight: var(--work-weight-700);
}

.toggle-row.compact input[type="checkbox"] {
  inline-size: 18px;
  block-size: 18px;
}

.module-runtime-search {
  display: grid;
  gap: 6px;
  color: #392c48;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

.module-runtime-search input {
  min-height: 42px;
  max-width: 520px;
}

html[data-theme="dark"] .module-runtime-search {
  color: #ffffff;
}

@media (max-width: 1180px){

  .module-runtime-search input {
    max-width: none;
  }
}

@media (max-width: 760px){
}

[dir="rtl"] .app-shell {
  direction: ltr;
  grid-template-columns: minmax(0, 1fr) 280px;
}

[dir="rtl"] .sidebar {
  direction: rtl;
  grid-column: 2;
  grid-row: 1;
}

[dir="rtl"] .content {
  direction: rtl;
  grid-column: 1;
  grid-row: 1;
}

html[dir="rtl"][data-sidebar="collapsed"] .app-shell {
  grid-template-columns: minmax(0, 1fr) 72px;
}

html[data-sidebar="collapsed"] .brand {
  order: 1;
}

html[data-sidebar="collapsed"] .sidebar-edge-toggle {
  position: absolute;
  inset-block-start: 82px;
  inset-inline-end: 15px;
  width: 42px;
  height: 42px;
  margin: 0;
}

html[data-sidebar="collapsed"] .nav {
  order: 3;
}

@media (max-width: 980px){
  [dir="rtl"] .app-shell,
  [dir="rtl"] .sidebar,
  [dir="rtl"] .content {
    direction: rtl;
  }
}

.improvement-ticket-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  color: #ffffff;
  text-decoration: none;
  font-weight: var(--work-weight-800);
  border: 1px solid rgba(97, 196, 207, 0.62);
  border-radius: 999px;
  background: linear-gradient(135deg, #4c266e 0%, #287d93 100%);
  box-shadow: 0 18px 42px rgba(43, 22, 63, 0.28);
}

.improvement-ticket-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 50px rgba(43, 22, 63, 0.34);
}

.improvement-ticket-fab img {
  inline-size: 22px;
  block-size: 22px;
  filter: brightness(0) invert(1);
}

[dir="rtl"] .improvement-ticket-fab {
  right: auto;
  left: 24px;
}

.content-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 34px;
  padding: 14px 4px 0;
  border-top: 1px solid rgba(76, 38, 110, 0.12);
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-600);
}

html[data-theme="dark"] .content-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.improvement-ticket-shell,
.improvement-ticket-list-panel,
.improvement-ticket-detail,
.improvement-ticket-thread,
.ticket-admin-actions {
  border-color: rgba(97, 196, 207, 0.26);
}

.improvement-ticket-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.improvement-ticket-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.improvement-ticket-create,
.ticket-reply-form,
.ticket-admin-form,
.ticket-filter-form {
  display: grid;
  gap: 14px;
}

.ticket-filter-form {
  grid-template-columns: minmax(150px, 220px) minmax(170px, 240px) minmax(220px, 1fr) auto;
  align-items: end;
  margin-top: 18px;
}

.ticket-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ticket-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 150px;
  padding: 10px 12px;
  color: #35144e;
  text-decoration: none;
  border: 1px solid rgba(76, 38, 110, 0.16);
  border-radius: var(--work-radius-xs);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(43, 22, 63, 0.06);
}

.ticket-status-pill.active {
  border-color: rgba(97, 196, 207, 0.62);
  background: linear-gradient(135deg, rgba(97, 196, 207, 0.15), rgba(255, 255, 255, 0.98));
}

.ticket-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  border-radius: 999px;
  border: 1px solid rgba(76, 38, 110, 0.18);
  background: #f7f4fb;
  color: #4c266e;
}

.ticket-status-new {
  color: #124c63;
  background: #eafaff;
  border-color: #8ee5f3;
}

.ticket-status-under_review,
.ticket-status-in_progress {
  color: #57350b;
  background: #fff6df;
  border-color: #f0cf7a;
}

.ticket-status-needs_information {
  color: #861b1b;
  background: #fff0ed;
  border-color: #f1a49a;
}

.ticket-status-completed {
  color: #0f5d42;
  background: #ebfbf4;
  border-color: #78d6aa;
}

.ticket-status-closed,
.ticket-status-archived {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.ticket-meta-grid div,
.ticket-description,
.ticket-message,
.ticket-admin-form {
  border: 1px solid rgba(76, 38, 110, 0.12);
  border-radius: var(--work-radius-xs);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(43, 22, 63, 0.05);
}

.ticket-meta-grid div {
  padding: 12px;
}

.ticket-meta-grid dt {
  margin-bottom: 6px;
  color: #6b5c7e;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  text-transform: uppercase;
}

.ticket-meta-grid dd {
  margin: 0;
  color: #231031;
  overflow-wrap: anywhere;
}

.ticket-description {
  padding: 16px;
}

.ticket-description p,
.ticket-message p {
  margin-bottom: 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.ticket-message-list {
  display: grid;
  gap: 12px;
}

.ticket-message {
  padding: 14px 16px;
}

.ticket-message.internal {
  background: #fff9ed;
  border-color: #edc26f;
}

.ticket-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #6b5c7e;
}

.ticket-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ticket-admin-form {
  padding: 16px;
}

.improvement-ticket-table td {
  vertical-align: middle;
}

html[data-theme="dark"] .ticket-status-pill,
html[data-theme="dark"] .ticket-meta-grid div,
html[data-theme="dark"] .ticket-description,
html[data-theme="dark"] .ticket-message,
html[data-theme="dark"] .ticket-admin-form {
  background: rgba(61, 70, 94, 0.92);
  border-color: rgba(184, 204, 230, 0.22);
}

html[data-theme="dark"] .ticket-status-pill {
  color: #f6fbff;
}

html[data-theme="dark"] .ticket-meta-grid dt,
html[data-theme="dark"] .ticket-message-header {
  color: #c7d8ea;
}

html[data-theme="dark"] .ticket-meta-grid dd {
  color: #f6fbff;
}

@media (max-width: 980px){
  .improvement-ticket-heading,
  .ticket-admin-grid,
  .ticket-filter-form,
  .ticket-meta-grid {
    grid-template-columns: 1fr;
  }

  .improvement-ticket-heading {
    display: grid;
  }
}

.maintenance-super-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.maintenance-mode-fab {
  background: #b91c1c;
  border-color: #7f1d1d;
  color: #fff;
  animation: maintenancePulse 1.4s ease-in-out infinite;
}

.maintenance-mode-fab:hover {
  background: #991b1b;
  color: #fff;
}

.maintenance-mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

@keyframes maintenancePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.46);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(185, 28, 28, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0);
  }
}

html[data-theme="dark"] .maintenance-mode-fab {
  background: #dc2626;
  border-color: #fecaca;
}

.business-table td,
.business-table th,
.metric-card strong {
  font-variant-numeric: tabular-nums;
}

.panel h2,
.section-heading h2 {
  text-wrap: balance;
}

html[data-theme="dark"] .row-order-controls {
  border-color: rgba(185, 246, 255, 0.16);
  background: rgba(70, 79, 106, 0.72);
}

html[data-theme="dark"] .system-key-display {
  color: #dffbff;
  background: rgba(70, 79, 106, 0.72);
  border-color: rgba(185, 246, 255, 0.16);
}

html[data-theme="dark"] .system-key-display.is-preview:not(.is-empty) {
  color: #dffbff;
}

html[data-theme="dark"] .line-item-not-applicable {
  background: rgba(70, 79, 106, 0.64);
  border-color: rgba(185, 246, 255, 0.18);
}

dialog.modal {
  border: 0;
  border-radius: var(--work-radius-xs);
  padding: 0;
  background: transparent;
}

dialog.modal::backdrop {
  background: rgb(21 14 34 / 48%);
}

dialog.modal .modal-card {
  width: min(560px, calc(100vw - 32px));
}

html[dir="rtl"][data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  box-shadow: inset -3px 0 0 #61C4CF, 0 10px 22px rgba(10, 16, 26, 0.16);
}

html[dir="rtl"] .nav .nav-group.is-active-group > .nav-group-label::after {
  background: linear-gradient(270deg, rgba(97, 196, 207, 0.62), rgba(255, 255, 255, 0.08));
}

html[dir="rtl"] .nav .nav-group.is-active-group > .nav-group-label {
  box-shadow: none;
}

html[dir="rtl"][data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label::after {
  background: linear-gradient(270deg, rgba(97, 196, 207, 0.68), rgba(255, 255, 255, 0.08));
}

html[dir="rtl"][data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  box-shadow: none;
}

html[data-sidebar="collapsed"] .nav .nav-group-label {
  border-radius: 0;
}

html[data-sidebar="collapsed"] .nav .nav-group-label::after {
  display: none;
}

.nav-icon-dashboard {
  --work-nav-icon-url: url("/assets/icons/layout-dashboard.svg?v=20260713-work-icons-01");
}

.nav-icon-sales {
  --work-nav-icon-url: url("/assets/icons/briefcase.svg?v=20260713-work-icons-01");
}

.nav-icon-sales-leads {
  --work-nav-icon-url: url("/assets/icons/target-arrow.svg?v=20260713-work-icons-01");
}

.nav-icon-sales-tenders {
  --work-nav-icon-url: url("/assets/icons/file-text.svg?v=20260713-work-icons-01");
}

.nav-icon-customers {
  --work-nav-icon-url: url("/assets/icons/users-group.svg?v=20260713-work-icons-01");
}

.nav-icon-sales-quotations {
  --work-nav-icon-url: url("/assets/icons/file-invoice.svg?v=20260713-work-icons-01");
}

.nav-icon-pmo {
  --work-nav-icon-url: url("/assets/icons/checklist.svg?v=20260713-work-icons-01");
}

.nav-icon-license {
  --work-nav-icon-url: url("/assets/icons/certificate.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement {
  --work-nav-icon-url: url("/assets/icons/shopping-cart.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement-vendors {
  --work-nav-icon-url: url("/assets/icons/building-store.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement-suppliers {
  --work-nav-icon-url: url("/assets/icons/truck-delivery.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement-quotations {
  --work-nav-icon-url: url("/assets/icons/file-description.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement-purchase-orders {
  --work-nav-icon-url: url("/assets/icons/shopping-cart-check.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement-invoices {
  --work-nav-icon-url: url("/assets/icons/receipt.svg?v=20260713-work-icons-01");
}

.nav-icon-procurement-profit {
  --work-nav-icon-url: url("/assets/icons/calculator.svg?v=20260713-work-icons-01");
}

.nav-icon-accounting {
  --work-nav-icon-url: url("/assets/icons/building-bank.svg?v=20260713-work-icons-01");
}

.nav-icon-accounting-receivables {
  --work-nav-icon-url: url("/assets/icons/cash-banknote.svg?v=20260713-work-icons-01");
}

.nav-icon-accounting-payables {
  --work-nav-icon-url: url("/assets/icons/credit-card-pay.svg?v=20260713-work-icons-01");
}

.nav-icon-accounting-statements {
  --work-nav-icon-url: url("/assets/icons/file-report.svg?v=20260713-work-icons-01");
}

.nav-icon-human-resources {
  --work-nav-icon-url: url("/assets/icons/users.svg?v=20260713-work-icons-01");
}

.nav-icon-employees {
  --work-nav-icon-url: url("/assets/icons/user-square-rounded.svg?v=20260713-work-icons-01");
}

.nav-icon-medical-insurance {
  --work-nav-icon-url: url("/assets/icons/shield-check.svg?v=20260829-work-icons-01");
}

.nav-icon-attendance {
  --work-nav-icon-url: url("/assets/icons/clipboard-list.svg?v=20260713-work-icons-01");
}

.nav-icon-employee-requests {
  --work-nav-icon-url: url("/assets/icons/clipboard-check.svg?v=20260713-work-icons-01");
}

.nav-icon-documents {
  --work-nav-icon-url: url("/assets/icons/file-text.svg?v=20260713-work-icons-01");
}

.brand {
  padding-inline-end: 54px;
}

.sidebar-edge-toggle,
html[data-sidebar="collapsed"] .sidebar-edge-toggle {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  margin: 0;
}

html[dir="rtl"] .nav .nav-group.is-active-group > .nav-group-label {
  background: linear-gradient(270deg, rgba(97, 196, 207, 0.18), rgba(255, 255, 255, 0.045));
  box-shadow: inset -3px 0 0 #61c4cf;
}

.nav-group-chevron {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-inline-start: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.72;
  transform: rotate(45deg);
  transition: transform var(--work-motion-fast) ease;
}

.nav-group-label[aria-expanded="false"] .nav-group-chevron {
  transform: rotate(-45deg);
}

html[dir="rtl"] .nav-group-label[aria-expanded="false"] .nav-group-chevron {
  transform: rotate(135deg);
}

html[dir="rtl"][data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::before {
  transform: rotate(-35deg);
}

html[dir="rtl"][data-sidebar="collapsed"] .sidebar-toggle .sidebar-toggle-bars::after {
  transform: rotate(35deg);
}

html[data-sidebar="collapsed"] .brand {
  visibility: hidden;
  pointer-events: none;
}

html[data-sidebar="collapsed"] .nav .nav-group-items,
html[data-sidebar="collapsed"] .nav .nav-section-label,
html[data-sidebar="collapsed"] .nav-group-chevron {
  display: none !important;
}

html[data-sidebar="collapsed"] .nav .nav-group-label {
  display: flex;
  justify-content: center;
  width: 48px;
  min-height: 46px;
  padding: 0;
  border-radius: 12px;
}

html[data-sidebar="collapsed"] .nav .nav-group-label .nav-icon {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
}

@media (prefers-reduced-motion: reduce){
  .nav .nav-group-label,
  .nav-group-chevron {
    transition: none;
  }
}

.action-button--icon,
button.table-action.action-button--icon {
  display: inline-grid;
  position: relative;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(29, 48, 70, 0.08);
  font-size: var(--work-text-lg);
  line-height: 1;
  text-decoration: none;
}

.global-action-tooltip {
  position: fixed;
  position-anchor: --global-action-tooltip-anchor;
  position-area: block-start center;
  position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  position-visibility: anchors-visible;
  z-index: var(--work-z-global-tooltip);
  inset: auto;
  inline-size: max-content;
  max-inline-size: min(22rem, calc(100vw - 16px));
  margin: 8px;
  padding: 6px 9px;
  color: #ffffff;
  background: #172334;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(10, 20, 34, 0.24);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-700);
  line-height: 1.35;
  pointer-events: auto;
  text-align: start;
  white-space: normal;
}

html[dir="rtl"] .action-back::before {
  transform: scaleX(-1);
}

:root {
  color-scheme: light;
  --work-page: #f5f7fc;
  --work-surface: #ffffff;
  --work-surface-raised: #ffffff;
  --work-surface-sunken: #edf1f8;
  --work-text: #2c2438;
  --work-text-muted: #695f77;
  --work-text-inverse: #fbf9ff;
  --work-border: rgba(76, 38, 110, 0.18);
  --work-border-strong: rgba(76, 38, 110, 0.32);
  --work-primary: #4c266e;
  --work-primary-hover: #3e1f59;
  --work-accent: #287d93;
  --work-focus-ring: rgba(97, 196, 207, 0.56);
  --work-action-icon-rest-foreground: var(--work-primary);
  --work-action-icon-rest-surface: var(--work-surface-raised);
  --work-action-icon-rest-border: var(--work-border-strong);
  --work-action-icon-interactive-foreground: #ffffff;
  --work-action-icon-interactive-surface: #4c266e;
  --work-action-icon-interactive-border: #4c266e;
  --work-action-icon-active-surface: #3e1f59;
  --work-success: #14734b;
  --work-warning: #8b5100;
  --work-danger: #ad2330;
  --work-info: #315db8;
  --work-disabled-surface: #e7e2eb;
  --work-disabled-text: #746b7f;
  --work-field-surface: rgba(255, 255, 255, 0.95);
  --work-field-border: rgba(76, 38, 110, 0.26);
  --work-field-text: #3f3150;
  --work-success-foreground: #0d5134;
  --work-success-surface: #e9f7f0;
  --work-success-border: #93d9b6;
  --work-warning-foreground: #6d3f00;
  --work-danger-foreground: #7d1520;
  --work-danger-surface: #ad2330;
  --work-danger-border: #7d1520;
  --work-danger-inverse: #ffffff;
  --work-surface-operational: var(--work-surface);
  --work-surface-operational-text: var(--work-text);
  --work-warning-surface: #fffaf0;
  --work-warning-border: #ebc978;
  --work-warning-text: var(--work-text);
  --work-warning-muted: var(--work-text-muted);
  --work-info-surface: #f2fbfc;
  --work-info-border: #8fd4dc;
  --work-info-text: var(--work-text);
  --work-danger-surface-subtle: #fff5f4;
  --work-danger-surface-soft: #fffafa;
  --work-danger-border-subtle: #e9aaa5;
  --work-danger-text: var(--work-text);
  --work-danger-muted: var(--work-text-muted);
  --work-summary-card-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 252, 0.92));
  --work-summary-card-border: rgba(88, 116, 145, 0.18);
  --work-summary-card-value: var(--work-primary-hover);
  --work-summary-card-success-surface: linear-gradient(135deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.96));
  --work-summary-card-success-border: rgba(22, 163, 74, 0.25);
  --work-summary-card-warning-surface: linear-gradient(135deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.96));
  --work-summary-card-warning-border: rgba(217, 119, 6, 0.28);
  --work-summary-card-danger-surface: linear-gradient(135deg, rgba(254, 242, 242, 0.94), rgba(255, 255, 255, 0.96));
  --work-summary-card-danger-border: rgba(220, 38, 38, 0.24);
  --work-history-timeline-line: linear-gradient(180deg, rgba(76, 38, 110, 0.18), rgba(37, 201, 219, 0.45));
  --work-release-border: var(--work-border);
  --work-release-muted: var(--work-text-muted);
  --work-release-primary: var(--work-primary);
  --work-release-on-primary: var(--work-surface);
  --work-release-surface: var(--work-surface);
  --work-release-surface-soft: color-mix(in srgb, var(--work-surface) 88%, var(--work-primary));
  --work-release-surface-subtle: color-mix(in srgb, var(--work-surface) 94%, var(--work-accent));
  --work-release-success-surface: color-mix(in srgb, var(--work-surface) 95%, var(--work-success));
  --work-release-success-border: color-mix(in srgb, var(--work-success) 42%, var(--work-border));
  --work-release-primary-surface: color-mix(in srgb, var(--work-surface) 94%, var(--work-primary));
  --work-release-primary-strong-surface: color-mix(in srgb, var(--work-surface) 90%, var(--work-primary));
  --work-release-primary-border: color-mix(in srgb, var(--work-primary) 54%, var(--work-border));
  --work-release-primary-shadow: 0 10px 24px color-mix(in srgb, var(--work-primary) 16%, transparent);
  --work-release-primary-focus: color-mix(in srgb, var(--work-primary) 18%, transparent);
  --work-release-primary-subtle: color-mix(in srgb, var(--work-primary) 10%, transparent);
  --work-release-danger-surface: color-mix(in srgb, var(--work-surface) 94%, var(--work-danger));
  --work-release-danger-border: color-mix(in srgb, var(--work-danger) 34%, var(--work-border));
  --work-release-danger-detail-border: color-mix(in srgb, var(--work-danger) 24%, var(--work-border));
  --work-release-danger-focus: color-mix(in srgb, var(--work-danger) 58%, var(--work-surface-raised));
  --work-release-danger-text: var(--work-danger);
  --work-radius-xs: 8px;
  --work-radius-sm: 10px;
  --work-radius-md: 14px;
  --work-radius-lg: 18px;
  --work-radius-pill: 999px;
  --work-text-xs: 11px;
  --work-text-sm: 12px;
  --work-text-md: 13px;
  --work-text-base: 14px;
  --work-text-lg: 16px;
  --work-text-xl: 18px;
  --work-text-2xl: 24px;
  --work-text-3xl: 36px;
  --work-weight-400: 400;
  --work-weight-600: 600;
  --work-weight-700: 700;
  --work-weight-800: 800;
  --work-space-1: 2px;
  --work-space-2: 3px;
  --work-space-3: 4px;
  --work-space-4: 6px;
  --work-space-5: 8px;
  --work-space-6: 10px;
  --work-space-7: 12px;
  --work-space-8: 14px;
  --work-space-9: 16px;
  --work-space-10: 18px;
  --work-space-11: 20px;
  --work-space-12: 24px;
  --work-control-height-sm: 40px;
  --work-control-height-md: 48px;
  --work-control-height-lg: 66px;
  --work-focus-ring-width: 3px;
  --work-shadow-sm: 0 10px 22px rgba(36, 18, 51, 0.08);
  --work-shadow-md: 0 18px 50px rgba(36, 18, 51, 0.12);
  --work-shadow-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --work-shadow-sidebar: 18px 0 36px rgba(33, 12, 55, 0.16);
  --work-shadow-lift: 0 14px 28px rgba(33, 12, 55, 0.22);
  --work-motion-fast: 160ms;
  --work-motion-interactive: 180ms;
  --work-motion-standard: 200ms;
  --work-motion-spinner: 720ms;
  --work-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --work-ease-out: ease-out;
  --work-z-base: 0;
  --work-z-shell: 10;
  --work-z-sticky: 20;
  --work-z-dropdown: 40;
  --work-z-backdrop: 60;
  --work-z-dialog: 70;
  --work-z-toast: 80;
  --work-z-tooltip: 90;
  --work-z-field-focus: 130;
  --work-z-shell-bar: 1000;
  --work-z-inline-menu: 1100;
  --work-z-menu-layer: 1200;
  --work-z-global-tooltip: 1400;
  --work-z-max: 2147483000;
  --work-auth-page-surface: linear-gradient(135deg, rgba(76, 38, 110, 0.1) 25%, transparent 25%) 0 0 / 28px 28px, linear-gradient(225deg, rgba(97, 196, 207, 0.08) 25%, transparent 25%) 0 0 / 28px 28px, radial-gradient(circle at 18% 20%, rgba(97, 196, 207, 0.18), transparent 28%), radial-gradient(circle at 82% 18%, rgba(76, 38, 110, 0.17), transparent 30%), linear-gradient(180deg, #f7fbff, #ffffff 58%, #eef4fb);
  --work-auth-page-image-surface: #101828;
  --work-auth-overlay: radial-gradient(circle at 28% 48%, rgba(255, 255, 255, 0.12), transparent 0 24%), linear-gradient(90deg, rgba(7, 14, 26, 0.58) 0%, rgba(7, 14, 26, 0.26) 42%, rgba(7, 14, 26, 0.08) 100%);
  --work-auth-overlay-z: 1;
  --work-auth-content-z: 2;
  --work-auth-toolbar-surface: rgba(255, 255, 255, 0.7);
  --work-auth-toolbar-border: rgba(255, 255, 255, 0.38);
  --work-auth-toolbar-shadow: 0 10px 24px rgba(8, 18, 34, 0.12);
  --work-auth-control-text: #4b355e;
  --work-auth-card-text: #2f2144;
  --work-auth-card-surface: rgba(250, 248, 252, 0.72);
  --work-auth-card-image-surface: rgba(250, 248, 252, 0.68);
  --work-auth-card-border: rgba(255, 255, 255, 0.54);
  --work-auth-card-shadow: 0 34px 90px rgba(8, 18, 34, 0.34);
  --work-auth-card-image-shadow: 0 34px 90px rgba(8, 18, 34, 0.42);
  --work-auth-contained-surface: rgba(255, 255, 255, 0.94);
  --work-auth-contained-panel-surface: rgba(255, 255, 255, 0.96);
  --work-auth-contained-border: rgba(255, 255, 255, 0.76);
  --work-auth-contained-shadow: 0 34px 90px rgba(8, 18, 34, 0.36);
  --work-auth-contained-divider: rgba(76, 38, 110, 0.1);
  --work-auth-brand-surface: linear-gradient(135deg, rgba(40, 25, 58, 0.58), rgba(130, 86, 74, 0.28)), rgba(15, 23, 42, 0.14);
  --work-auth-brand-border: rgba(255, 255, 255, 0.2);
  --work-auth-brand-text: #ffffff;
  --work-auth-action-surface: rgba(255, 255, 255, 0.78);
  --work-auth-heading: #352543;
  --work-auth-support-text: rgba(62, 45, 76, 0.72);
  --work-auth-brand-muted: rgba(255, 255, 255, 0.72);
  --work-auth-brand-copy: rgba(255, 255, 255, 0.86);
  --work-auth-session-surface: rgba(255, 255, 255, 0.52);
  --work-auth-session-border: rgba(76, 38, 110, 0.16);
  --work-auth-session-label: rgba(76, 38, 110, 0.78);
  --work-auth-session-value: #2e1f44;
  --work-auth-mark-surface: linear-gradient(135deg, rgba(97, 196, 207, 0.98), rgba(76, 38, 110, 0.9));
  --work-auth-mark-border: rgba(255, 255, 255, 0.26);
  --work-auth-mark-shadow: 0 18px 36px rgba(20, 8, 36, 0.22);
  --work-auth-public-overlay: rgba(255, 255, 255, 0.12);
  --work-auth-wordmark-light-opacity: 0;
  --work-auth-logo-surface: rgba(255, 255, 255, 0.94);
  --work-auth-logo-border: rgba(255, 255, 255, 0.28);
  --work-auth-logo-glow: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.62) 54%, rgba(255, 255, 255, 0.18) 78%, rgba(255, 255, 255, 0) 100%);
  --work-auth-logo-shadow: 0 12px 26px rgba(20, 8, 36, 0.08);
  --work-auth-logo-filter: drop-shadow(0 1px 2px rgba(20, 8, 36, 0.1));
  --work-auth-logo-mask: radial-gradient(ellipse at center, #000 0%, #000 64%, rgba(0, 0, 0, 0.7) 82%, transparent 100%);
  --work-auth-warning-text: #92400e;
  --work-auth-warning-surface: #fef3c7;
  --work-auth-warning-border: #fde68a;
  --work-auth-maintenance-surface: rgba(250, 248, 252, 0.9);
  --work-auth-maintenance-border: rgba(76, 38, 110, 0.14);
  --work-auth-microsoft-text: #2f2538;
  --work-auth-microsoft-surface: #ffffff;
  --work-auth-microsoft-border: rgba(76, 38, 110, 0.18);
  --work-auth-microsoft-shadow: 0 16px 34px rgba(76, 38, 110, 0.14);
  --work-auth-microsoft-primary-surface: rgba(255, 255, 255, 0.95);
  --work-auth-microsoft-primary-border: rgba(76, 38, 110, 0.16);
  --work-auth-microsoft-primary-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 18px 34px rgba(76, 38, 110, 0.16);
  --work-auth-microsoft-disabled-text: #5f536b;
  --work-auth-microsoft-disabled-surface: rgba(255, 255, 255, 0.84);
  --work-auth-microsoft-disabled-border: rgba(76, 38, 110, 0.12);
  --work-auth-provider-microsoft-red: #f25022;
  --work-auth-provider-microsoft-green: #7fba00;
  --work-auth-provider-microsoft-blue: #00a4ef;
  --work-auth-provider-microsoft-yellow: #ffb900;
  --work-auth-mfa-panel-surface: rgba(255, 255, 255, 0.76);
  --work-auth-mfa-panel-border: rgba(76, 38, 110, 0.14);
  --work-auth-mfa-code-surface: rgba(76, 38, 110, 0.06);
  --work-auth-mfa-recovery-surface: rgba(220, 252, 231, 0.64);
  --work-auth-mfa-recovery-border: rgba(34, 197, 94, 0.32);
  --work-auth-mfa-contained-panel-surface: rgba(255, 255, 255, 0.76);
  --work-auth-mfa-contained-panel-border: rgba(76, 38, 110, 0.14);
  --work-auth-mfa-contained-code-surface: rgba(76, 38, 110, 0.06);
  --work-auth-mfa-contained-code-text: #2f2144;
  --work-auth-radius-card: 8px;
  --work-auth-radius-logo: 12px;
  --work-tab-list-surface: color-mix(in srgb, var(--work-accent) 12%, var(--work-surface));
  --work-tab-list-border: var(--work-border);
  --work-tab-hover-surface: var(--work-surface);
  --work-tab-hover-border: color-mix(in srgb, var(--work-accent) 80%, var(--work-primary));
  --work-tab-hover-text: var(--work-primary);
  --work-tab-active-surface: var(--work-primary);
  --work-tab-active-border: var(--work-primary);
  --work-tab-active-text: var(--work-text-inverse);
  --work-tab-count-surface: color-mix(in srgb, var(--work-text-inverse) 84%, transparent);
  --work-tab-count-text: var(--work-primary);
  --work-tab-count-active-surface: color-mix(in srgb, var(--work-text-inverse) 18%, transparent);
  --work-tab-count-active-text: var(--work-text-inverse);
  --work-accent-surface: color-mix(in srgb, var(--work-accent) 8%, var(--work-surface));
  --work-accent-border: color-mix(in srgb, var(--work-accent) 26%, transparent);
  --work-body-text: #3f3150;
  --work-body-muted: #776986;
  --work-body-border: rgba(76, 38, 110, 0.14);
  --work-body-surface: rgba(255, 255, 255, 0.96);
  --work-page-background: radial-gradient(circle at top right, rgba(97, 196, 207, 0.14), transparent 24%),
      radial-gradient(circle at top left, rgba(76, 38, 110, 0.14), transparent 26%),
      linear-gradient(180deg, rgba(187, 211, 238, 0.24) 0%, #f7fbff 38%, #ffffff 100%);
  --work-page-tint: #f7fbff;
  --work-accent-bright: #61C4CF;
  --work-danger-alt: #b42318;
  --work-warning-alt: #a15c07;
  --work-success-alt: #157347;
  --work-primary-dark: #43205b;
  --work-brand-purple: var(--work-primary);
  --work-primary-rgb: 76, 38, 110;
  --work-accent-bright-rgb: 97, 196, 207;
  --work-primary-soft: rgba(76, 38, 110, 0.1);
  --work-surface-alt: rgba(187, 211, 238, 0.22);
  --work-surface-strong: #eef4fb;
  --work-card-bg: rgba(255, 255, 255, 0.96);
  --work-control-bg: rgba(255, 255, 255, 0.95);
  --work-control-border: rgba(76, 38, 110, 0.26);
  --work-focus-ring-brand: rgba(76, 38, 110, 0.18);
  --work-shadow-lg: 0 18px 50px rgba(36, 18, 51, 0.08);
  --work-shadow-xs: 0 10px 22px rgba(76, 38, 110, 0.06);
  --work-breadcrumb-separator: rgba(76, 38, 110, 0.44);
  --work-accent-mist: #bbd3ee;
  --work-gradient-btn: linear-gradient(135deg, var(--work-primary), var(--work-brand-purple));
  --work-gradient-card: linear-gradient(90deg, var(--work-primary), var(--work-brand-purple), var(--work-accent-bright));
  --work-shell-gradient: linear-gradient(180deg, rgba(41, 19, 61, 0.98) 0%, rgba(72, 34, 99, 0.98) 52%, rgba(76, 38, 110, 0.96) 100%);
  --work-page-backdrop: var(--work-page-background);
  --work-accent-glow: var(--work-accent-bright);
  --work-accent-strong: var(--work-primary);
  --work-accent-soft: rgba(97, 196, 207, 0.10);
  --work-shell-border: rgba(76, 38, 110, 0.14);
  --work-shell-border-soft: rgba(76, 38, 110, 0.14);
  --work-brand-violet: var(--work-primary);
  --work-brand-soft: rgba(76, 38, 110, 0.10);
  --work-panel-bg: rgba(255, 255, 255, 0.96);
  --work-shell-bg: rgba(255, 255, 255, 0.96);
  --work-shell-bg-strong: rgba(255, 255, 255, 0.96);
  --work-topbar-bg: rgba(255, 255, 255, 0.96);
  --work-text-secondary: #4b355e;
  --work-text-dim: #776986;
  --work-danger-surface-alt: #fee2e2;
  --work-warning-surface-alt: #fef3c7;
  --work-success-surface-alt: #dcfce7;
  --work-info-surface-alt: rgba(97, 196, 207, 0.10);
  --work-focus-ring-wide: 0 0 0 4px rgba(76, 38, 110, 0.18);
  --work-responsive-field-min: 13rem;
  --work-responsive-form-min: 18rem;
}


html[data-theme="dark"] {
  color-scheme: dark;
  --work-page: #0d0a12;
  --work-surface: #17111f;
  --work-surface-raised: #21182b;
  --work-surface-sunken: #120d19;
  --work-text: #f7f2fb;
  --work-text-muted: #c7bdd2;
  --work-text-inverse: #24192e;
  --work-border: rgba(205, 181, 225, 0.22);
  --work-border-strong: rgba(205, 181, 225, 0.38);
  --work-primary: #b98ce1;
  --work-primary-hover: #d0aaef;
  --work-accent: #74dce5;
  --work-action-start: #4c266e;
  --work-action-end: #1f6877;
  --work-focus-ring: rgba(116, 220, 229, 0.66);
  --work-success: #63d69a;
  --work-warning: #f4c76a;
  --work-danger: #ff9ca4;
  --work-info: #9dbdff;
  --work-disabled-surface: #1c2733;
  --work-disabled-text: #bcb0c8;
  --work-field-surface: rgba(34, 42, 56, 0.94);
  --work-field-border: rgba(185, 246, 255, 0.18);
  --work-field-text: #eaf1fb;
  --work-success-foreground: #d5f9e5;
  --work-success-surface: #173a2c;
  --work-success-border: #3f8f66;
  --work-warning-foreground: #fff0c9;
  --work-danger-foreground: #ffe0e2;
  --work-danger-surface: #a82735;
  --work-danger-border: #ffb5bb;
  --work-danger-inverse: #fff8f8;
  --work-surface-operational: #1c1530;
  --work-surface-operational-text: #eaf1fb;
  --work-warning-surface: #352c1f;
  --work-warning-border: #826837;
  --work-warning-text: #fff4d5;
  --work-warning-muted: #f7e8bd;
  --work-info-surface: #16353b;
  --work-info-border: #378b97;
  --work-info-text: #e4fbff;
  --work-danger-surface-subtle: #3d2028;
  --work-danger-surface-soft: #3d2028;
  --work-danger-border-subtle: #a65e69;
  --work-danger-text: #fff2f4;
  --work-danger-muted: #f5d5d8;
  --work-summary-card-surface: linear-gradient(135deg, #21182b, #17111f);
  --work-summary-card-border: var(--work-border-strong);
  --work-summary-card-value: var(--work-primary-hover);
  --work-summary-card-success-surface: linear-gradient(135deg, #1b3a2a, #17111f);
  --work-summary-card-success-border: #4b9d72;
  --work-summary-card-warning-surface: linear-gradient(135deg, #352c1f, #17111f);
  --work-summary-card-warning-border: var(--work-warning-border);
  --work-summary-card-danger-surface: linear-gradient(135deg, #3d2028, #17111f);
  --work-summary-card-danger-border: var(--work-danger-border-subtle);
  --work-history-timeline-line: linear-gradient(180deg, rgba(185, 140, 225, 0.34), rgba(116, 220, 229, 0.58));
  --work-release-danger-text: var(--work-danger-foreground);
  --work-shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.42);
  --work-shadow-md: 0 18px 50px rgba(0, 0, 0, 0.54);
  --work-auth-public-overlay: rgba(4, 8, 16, 0.40);
  --work-auth-wordmark-light-opacity: 1;
  --work-auth-overlay: radial-gradient(circle at 28% 48%, rgba(255, 255, 255, 0.08), transparent 0 24%), linear-gradient(90deg, rgba(4, 8, 16, 0.74) 0%, rgba(4, 8, 16, 0.46) 45%, rgba(4, 8, 16, 0.26) 100%);
  --work-auth-toolbar-surface: rgba(15, 23, 42, 0.64);
  --work-auth-toolbar-border: rgba(255, 255, 255, 0.16);
  --work-auth-toolbar-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --work-auth-control-text: #eef7ff;
  --work-auth-card-text: #f8fbff;
  --work-auth-card-surface: rgba(9, 14, 24, 0.48);
  --work-auth-card-image-surface: rgba(9, 14, 24, 0.48);
  --work-auth-card-border: rgba(255, 255, 255, 0.16);
  --work-auth-card-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --work-auth-card-image-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --work-auth-contained-surface: rgba(15, 23, 42, 0.86);
  --work-auth-contained-panel-surface: rgba(15, 23, 42, 0.78);
  --work-auth-contained-border: rgba(255, 255, 255, 0.16);
  --work-auth-contained-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --work-auth-contained-divider: rgba(185, 246, 255, 0.16);
  --work-auth-brand-surface: linear-gradient(135deg, rgba(40, 25, 58, 0.7), rgba(80, 54, 68, 0.34)), rgba(15, 23, 42, 0.26);
  --work-auth-brand-border: rgba(255, 255, 255, 0.12);
  --work-auth-action-surface: rgba(15, 23, 42, 0.72);
  --work-auth-heading: #f8fbff;
  --work-auth-support-text: rgba(248, 251, 255, 0.68);
  --work-auth-action-eyebrow: #aee9ef;
  --work-auth-microsoft-primary-surface: rgba(255, 255, 255, 0.92);
  --work-auth-microsoft-primary-border: rgba(255, 255, 255, 0.22);
  --work-auth-microsoft-disabled-text: rgba(248, 251, 255, 0.64);
  --work-auth-microsoft-disabled-surface: rgba(255, 255, 255, 0.13);
  --work-auth-microsoft-disabled-border: rgba(255, 255, 255, 0.14);
  --work-auth-mfa-panel-surface: rgba(31, 37, 55, 0.72);
  --work-auth-mfa-panel-border: rgba(185, 246, 255, 0.16);
  --work-auth-mfa-code-surface: rgba(70, 79, 106, 0.72);
  --work-dark-page: linear-gradient(180deg, #0b1420 0%, #101c2c 48%, #0b1420 100%);
  --work-dark-shell: rgba(19, 30, 46, 0.94);
  --work-dark-shell-strong: rgba(26, 40, 60, 0.96);
  --work-dark-panel: linear-gradient(180deg, rgba(24, 38, 58, 0.96), rgba(17, 28, 43, 0.94));
  --work-dark-border: rgba(184, 204, 230, 0.24);
  --work-dark-border-soft: rgba(184, 204, 230, 0.14);
  --work-dark-text: #eaf1fb;
  --work-dark-muted: #c0cad8;
  --work-dark-faint: #9eabbc;
  --work-dark-cyan: #9ff3fb;
  --work-dark-purple: #b996db;
  --work-tab-list-surface: color-mix(in srgb, var(--work-text-inverse) 8%, transparent);
  --work-tab-list-border: var(--work-border);
  --work-tab-hover-surface: color-mix(in srgb, var(--work-text-inverse) 12%, transparent);
  --work-tab-hover-border: color-mix(in srgb, var(--work-accent) 50%, transparent);
  --work-tab-hover-text: var(--work-text);
  --work-tab-active-surface: var(--work-accent);
  --work-tab-active-border: var(--work-accent);
  --work-tab-active-text: var(--work-text-inverse);
  --work-tab-count-surface: color-mix(in srgb, var(--work-surface-sunken) 38%, transparent);
  --work-tab-count-text: var(--work-text-muted);
  --work-tab-count-active-surface: color-mix(in srgb, var(--work-text-inverse) 16%, transparent);
  --work-tab-count-active-text: var(--work-text-inverse);
  --work-accent-surface: color-mix(in srgb, var(--work-accent) 12%, transparent);
  --work-accent-border: color-mix(in srgb, var(--work-accent) 22%, transparent);
  --work-body-text: var(--work-text);
  --work-body-muted: var(--work-text-muted);
  --work-body-border: var(--work-border);
  --work-body-surface: var(--work-surface);
  --work-page-background: linear-gradient(180deg, #0a0710 0%, #0d0a12 42%, #17111f 100%);
  --work-page-tint: var(--work-page);
  --work-accent-bright: var(--work-accent);
  --work-danger-alt: var(--work-danger);
  --work-warning-alt: var(--work-warning);
  --work-success-alt: var(--work-success);
  --work-primary-dark: var(--work-primary-hover);
  --work-brand-purple: var(--work-primary-hover);
  --work-primary-rgb: 185, 140, 225;
  --work-accent-bright-rgb: 116, 220, 229;
  --work-primary-soft: rgba(185, 140, 225, 0.18);
  --work-surface-alt: var(--work-surface-raised);
  --work-surface-strong: var(--work-surface-raised);
  --work-card-bg: var(--work-surface-raised);
  --work-control-bg: var(--work-surface-sunken);
  --work-control-border: var(--work-border-strong);
  --work-focus-ring-brand: var(--work-focus-ring);
  --work-shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.54);
  --work-shadow-xs: 0 10px 22px rgba(0, 0, 0, 0.42);
  --work-breadcrumb-separator: rgba(235, 224, 246, 0.68);
  --work-accent-mist: #7fa4c9;
  --work-gradient-btn: linear-gradient(135deg, var(--work-action-start), var(--work-action-end));
  --work-gradient-card: linear-gradient(90deg, var(--work-primary), var(--work-brand-purple), var(--work-accent-bright));
  --work-shell-gradient: linear-gradient(180deg, #0a0710 0%, #17111f 52%, #21182b 100%);
  --work-page-backdrop: var(--work-dark-page);
  --work-accent-glow: var(--work-dark-cyan);
  --work-accent-strong: var(--work-dark-cyan);
  --work-accent-soft: rgba(91, 224, 236, 0.10);
  --work-shell-border: var(--work-dark-border);
  --work-shell-border-soft: var(--work-dark-border-soft);
  --work-brand-violet: var(--work-dark-purple);
  --work-brand-soft: rgba(185, 150, 219, 0.14);
  --work-panel-bg: var(--work-dark-panel);
  --work-shell-bg: var(--work-dark-shell);
  --work-shell-bg-strong: var(--work-dark-shell-strong);
  --work-topbar-bg: rgba(24, 27, 37, 0.88);
  --work-text-secondary: var(--work-dark-muted);
  --work-text-dim: var(--work-dark-faint);
  --work-danger-surface-alt: rgba(105, 35, 42, 0.54);
  --work-warning-surface-alt: rgba(111, 78, 20, 0.54);
  --work-success-surface-alt: rgba(24, 82, 54, 0.58);
  --work-info-surface-alt: rgba(36, 40, 52, 0.88);
  --work-focus-ring-wide: 0 0 0 4px var(--work-focus-ring);
  --work-responsive-field-min: 13rem;
  --work-responsive-form-min: 18rem;
}


/* Shared base and application shell. Transferred from the legacy app asset. */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--work-body-text);
  background: var(--work-page-background);
  font-family: Inter, "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--work-primary);
  text-decoration: none;
}

a:hover {
  color: #3f1b55;
  text-decoration: none;
}

code {
  color: #4f2870;
  background: rgba(76, 38, 110, 0.08);
  border-radius: 6px;
  padding: 2px 5px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 18px;
  overflow-y: auto;
  color: #f8f4ff;
  background:
    radial-gradient(circle at top left, rgba(var(--work-accent-bright-rgb), 0.16), transparent 15rem),
    var(--work-shell-gradient);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--work-shadow-sidebar);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: var(--work-weight-800);
  letter-spacing: 0;
}

.brand span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.14;
}

.brand.with-logo {
  align-items: center;
  gap: 9px;
  font-size: var(--work-text-xl);
}

.brand.with-logo span {
  max-width: 190px;
}

.brand::before {
  content: "W";
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--work-accent-bright-rgb), 0.98), rgba(var(--work-primary-rgb), 0.92));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  box-shadow: var(--work-shadow-lift);
}

.brand.with-logo::before {
  display: none;
}

.brand-logo {
  width: 46px;
  height: 46px;
  padding: 5px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(33, 12, 55, 0.2);
}

.brand-sub {
  margin: 0 8px 24px 58px;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-600);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a,
.logout-button {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 9px 11px;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-weight: var(--work-weight-700);
  text-align: start;
  cursor: pointer;
  transition: background var(--work-motion-interactive) ease, border-color var(--work-motion-interactive) ease, transform var(--work-motion-interactive) ease, color var(--work-motion-interactive) ease;
}

.nav a::before,
.logout-button::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(97, 196, 207, 0.56);
  box-shadow: 0 0 0 4px rgba(97, 196, 207, 0.06);
}

.nav a:hover,
.logout-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.content {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 24px 28px 50px;
}

.topbar {
  position: relative;
  z-index: var(--work-z-sticky);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  min-height: 76px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(76, 38, 110, 0.09);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(76, 38, 110, 0.06);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: var(--work-weight-800);
  letter-spacing: 0;
  color: var(--work-body-text);
}

.topbar-pagebar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.topbar-pagebar .page-kicker {
  flex: 0 0 auto;
}

.topbar-pagebar h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-pagebar h1::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-inline-end: 10px;
  vertical-align: middle;
  background: var(--work-body-muted);
  border-radius: 999px;
}

.app-breadcrumbs {
  margin: -8px 0 18px;
  padding: 0 4px;
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
}

.app-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-breadcrumbs li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  line-height: 1.45;
}

.app-breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--work-breadcrumb-separator);
  font-weight: var(--work-weight-800);
}

.app-breadcrumbs a {
  color: var(--work-primary);
  text-decoration: none;
}

.app-breadcrumbs a:hover {
  color: var(--work-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-breadcrumbs span[aria-current="page"] {
  color: var(--work-body-text);
}

.skip-to-content {
  position: fixed;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: var(--work-z-tooltip);
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  color: var(--work-text-inverse);
  background: var(--work-primary);
  border-radius: var(--work-radius-sm);
  font-weight: var(--work-weight-800);
  text-decoration: none;
}

.skip-to-content:focus {
  width: auto;
  height: auto;
  padding: 10px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}

#main-content:focus {
  outline: none;
}

.subtle {
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
}

/* Bilingual date-format hint rendered next to native date-input labels
   (the browser's own mm/dd/yyyy hint follows the OS locale, not app locale). */
.date-format-hint {
  color: var(--work-body-muted);
  font-size: 0.85em;
  font-weight: var(--work-weight-400);
  direction: ltr;
  unicode-bidi: isolate;
}

/* Unified advanced-filters disclosure: a no-JS <details> toggle that keeps
   secondary filter fields behind one consistent, quiet control. */
.advanced-filters {
  grid-column: 1 / -1;
  flex-basis: 100%;
}
.advanced-filters > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--work-body-muted);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-800);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.advanced-filters > summary::-webkit-details-marker {
  display: none;
}
.advanced-filters > summary::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("/assets/icons/filter.svg?v=20260714-work-actions-01") center / contain no-repeat;
  mask: url("/assets/icons/filter.svg?v=20260714-work-actions-01") center / contain no-repeat;
}
.advanced-filters > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-inline-start: 2px;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--work-motion-interactive) ease;
}
.advanced-filters[open] > summary {
  color: var(--work-primary);
}
.advanced-filters[open] > summary::after {
  transform: rotate(225deg) translateY(-1px);
}
.advanced-filters .advanced-filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.65rem;
}
.advanced-filters .advanced-filters-grid > * {
  flex: 1 1 11rem;
  min-width: 0;
}

/* Unified filter bar: primary controls inline on one row; secondary fields
   live behind the advanced-filters <details> above. */
.list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: end;
}
.list-filters > .field {
  flex: 1 1 16rem;
  min-width: 0;
}
.list-filters > .action-button,
.list-filters > .button {
  flex: 0 0 auto;
}
@media (prefers-reduced-motion: reduce) {
  .advanced-filters > summary::after {
    transition: none;
  }
}

.rtl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--work-body-muted);
  background: rgba(76, 38, 110, 0.06);
  border: 1px solid rgba(76, 38, 110, 0.08);
  border-radius: 999px;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
}

.panel,
.stat {
  position: relative;
  overflow: hidden;
  background: var(--work-body-surface);
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-lg);
  box-shadow: var(--work-shadow-lg);
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.panel::before,
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--work-gradient-card);
}

.panel h2,
.panel h3 {
  margin-top: 0;
  color: #3e2450;
  letter-spacing: 0;
}

.panel h2 {
  font-size: 20px;
}

.panel h3 {
  font-size: var(--work-text-lg);
}


/* Shared accessibility and motion foundation. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--work-focus-ring);
  outline-offset: 3px;
}

:where(input, select, textarea)::placeholder {
  color: var(--work-text-muted);
  opacity: 1;
}

.checkbox-inline {
  align-items: center;
  color: var(--work-body-text);
  display: inline-flex;
  font-weight: var(--work-weight-700);
  gap: var(--work-space-3);
}

/* Shared customer and license filter containment. */
.customers-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  max-inline-size: 100%;
}

.customers-filter-bar .field {
  display: flex;
  flex: 1 1 var(--work-responsive-field-min);
  flex-direction: column;
  gap: 4px;
  max-inline-size: 100%;
  min-width: 160px;
  min-inline-size: min(100%, var(--work-responsive-field-min));
}

.customers-filter-bar .field small {
  font-size: var(--work-text-xs);
  line-height: 1.3;
}

.customers-filter-bar input,
.customers-filter-bar select {
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
}

/* Shared operational heading, license, and history primitives. */
.customers-heading-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.customer-license-checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: var(--work-weight-800);
}

.customer-license-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--work-primary);
}

.request-history-list {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-inline-start: 18px;
}

.request-history-list::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  inset-inline-start: 6px;
  width: 2px;
  content: "";
  background: var(--work-history-timeline-line);
  border-radius: var(--work-radius-pill);
}

/* Shared filters and disclosure components. */
.meetings-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meetings-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  max-inline-size: 100%;
}

.meetings-filter-bar .field {
  min-width: 180px;
  flex: 1 1 var(--work-responsive-field-min);
  max-inline-size: 100%;
  min-inline-size: min(100%, var(--work-responsive-field-min));
}

.meetings-filter-bar input,
.meetings-filter-bar select {
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
}

.meetings-filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.field-wide {
  grid-column: 1 / -1;
}

.panel-disclosure {
  margin-top: 16px;
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-lg);
  padding: 10px 14px;
  background: var(--work-body-surface);
}

.panel-disclosure > summary {
  cursor: pointer;
  font-weight: var(--work-weight-600);
  padding: 4px 0;
}

.panel-disclosure[open] > summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--work-body-border);
  padding-bottom: 8px;
}

.panel-disclosure .form-grid {
  margin-top: 6px;
}

/* Responsive shell and shared component foundations. */
.content {
  container-name: work-content;
  container-type: inline-size;
}

.content,
.content > *,
.panel,
.panel > *,
.topbar,
.topbar > *,
.section-heading,
.section-heading > *,
.grid > *,
.form-grid > * {
  min-inline-size: 0;
}

.topbar,
.section-heading,
.section-heading .inline-actions,
.topbar-actions,
.filter-actions,
.modal-actions {
  flex-wrap: wrap;
}

.section-heading > :first-child,
.topbar > :first-child {
  flex: 1 1 24rem;
}

.section-heading .inline-actions,
.topbar-actions {
  flex: 0 1 auto;
  max-inline-size: 100%;
}

.filter-form .filter-actions {
  align-self: end;
}

.filter-bar,
.work-filter-bar {
  max-inline-size: 100%;
}

.filter-bar > .field,
.work-filter-bar > .field {
  flex: 1 1 var(--work-responsive-field-min);
  max-inline-size: 100%;
  min-inline-size: min(100%, var(--work-responsive-field-min));
}

.filter-bar input,
.filter-bar select,
.work-filter-bar input,
.work-filter-bar select {
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
}

.form-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--work-responsive-form-min)), 1fr));
}

.table-wrap,
.table-responsive,
.access-matrix-wrap,
html[data-theme="light"] .table-wrap,
html[data-theme="dark"] .table-wrap {
  max-inline-size: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scrollbar-gutter: auto;
}

.table-wrap > table,
.table-responsive > table,
.access-matrix-wrap > table {
  inline-size: 100%;
}

.business-table th,
.business-table td {
  overflow-wrap: break-word;
  word-break: normal;
}

.business-table code,
.business-table bdi,
.business-table .badge,
.business-table .status-badge,
.business-table .table-action,
.business-table .action-button {
  overflow-wrap: normal;
  word-break: normal;
}

.business-table .badge,
.business-table .status-badge,
.business-table .table-action {
  white-space: nowrap;
}

.business-table td > .inline {
  max-inline-size: 100%;
}

.table-wrap[data-table-layout="wide"] > table,
.table-wrap[data-table-layout="matrix"] > table,
.access-matrix-wrap > table,
table[data-table-layout="wide"],
table[data-table-layout="matrix"] {
  inline-size: max-content;
  min-inline-size: 100%;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  html[data-sidebar="expanded"] .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-sidebar="expanded"] .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(300px, 85vw);
    height: 100vh;
    z-index: var(--work-z-backdrop);
    box-shadow: 0 0 0 100vmax rgba(33, 12, 55, 0.42), 18px 0 36px rgba(33, 12, 55, 0.3);
  }

  html:not([data-sidebar="expanded"]) .sidebar {
    padding-inline: 8px;
  }

  html:not([data-sidebar="expanded"]) .brand span,
  html:not([data-sidebar="expanded"]) .brand-sub,
  html:not([data-sidebar="expanded"]) .nav .nav-label,
  html:not([data-sidebar="expanded"]) .sidebar-footer {
    display: none;
  }

  html:not([data-sidebar="expanded"]) .brand {
    justify-content: center;
  }

  .content {
    padding: 16px;
  }
}

@container work-content (max-width: 84rem) {
  .grid.cols-4,
  .metric-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container work-content (max-width: 62rem) {
  .topbar,
  .section-heading,
  .settings-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading .inline-actions,
  .topbar-actions {
    justify-content: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@container work-content (max-width: 48rem) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .metric-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .section-heading .inline-actions,
  .modal-actions {
    align-items: stretch;
  }
}

@supports not (container-type: inline-size) {
  @media (max-width: 1280px) {
    .grid.cols-4,
    .metric-grid,
    .settings-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar,
    .section-heading {
      align-items: stretch;
      flex-direction: column;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Shell-only overrides. Fixed indicators occupy the sidebar side, never data entry space. */
.improvement-ticket-fab {
    left: auto;
    right: auto;
    inset-inline-start: 8px;
    inset-inline-end: auto;
    max-inline-size: min(19rem, calc(100vw - 16px));
    transition: background-color var(--work-motion-standard) var(--work-ease),
        box-shadow var(--work-motion-standard) var(--work-ease),
        transform var(--work-motion-fast) var(--work-ease);
    z-index: var(--work-z-toast);
}

[dir="rtl"] .improvement-ticket-fab {
    left: auto;
    right: 8px;
}

body:has(.improvement-ticket-fab.maintenance-mode-fab) .content {
    padding-block-end: 112px;
}

html[data-theme="dark"] .maintenance-mode-fab {
    background: var(--work-danger-surface);
    border-color: var(--work-danger-border);
    color: var(--work-danger-inverse);
}


/* Shared component refinement. It consumes semantic tokens only. */
.action-button,
.button,
.table-action {
  transition: background-color var(--work-motion-standard) var(--work-ease),
    border-color var(--work-motion-standard) var(--work-ease),
    box-shadow var(--work-motion-standard) var(--work-ease),
    color var(--work-motion-standard) var(--work-ease),
    transform var(--work-motion-fast) var(--work-ease);
}

html[data-theme="dark"] :is(input, select, textarea) {
  background-color: var(--work-surface-sunken);
  border-color: var(--work-border-strong);
  color: var(--work-text);
}

html[data-theme="dark"] :is(input, select, textarea):disabled,
html[data-theme="dark"] :is(button, .button, .action-button)[disabled] {
  background-color: var(--work-disabled-surface);
  color: var(--work-disabled-text);
}

html[data-theme="dark"] :is(.button.secondary, .action-button.secondary) {
  background-color: var(--work-surface-raised);
  border-color: var(--work-border-strong);
  color: var(--work-text);
}

html[data-theme="dark"] :is(.alert.success, .badge.success) {
  color: var(--work-success-foreground);
}

html[data-theme="dark"] :is(.alert.warning, .badge.warning) {
  color: var(--work-warning-foreground);
}

html[data-theme="dark"] :is(.alert.error, .alert.danger, .badge.danger) {
  color: var(--work-danger-foreground);
}

/* Shared Sales and Procurement quotation-entry surface. */
/* Sales Quotations generator */


/* SALES-QUOTATION-SHOW-UX-09 */


/* SALES-QUOTATION-LINE-ITEM-COMPOSER-UX-03 */


/* SYSTEM-VISUAL-SCENARIO-FIX-20260709 - keep long operational labels readable. */

/* Shared shell and component transfer from legacy app.css. */
body {
  margin: 0;
  color: var(--work-body-text);
  background: var(--work-page-background);
  font-family: Inter, "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--work-primary);
  text-decoration: none;
}

a:hover {
  color: #3f1b55;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 18px;
  overflow-y: auto;
  color: #f8f4ff;
  background:
    radial-gradient(circle at top left, rgba(var(--work-accent-bright-rgb), 0.16), transparent 15rem),
    var(--work-shell-gradient);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--work-shadow-sidebar);
  z-index: 10;
}

.nav {
  display: grid;
  gap: 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.content {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 24px 28px 50px;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  color: #fff;
  background: var(--work-gradient-btn);
  border: 1px solid rgba(76, 38, 110, 0.88);
  border-radius: 14px;
  box-shadow: 0 12px 22px rgba(76, 38, 110, 0.16);
  font: inherit;
  font-weight: var(--work-weight-700);
  letter-spacing: 0;
  cursor: pointer;
  transition: transform var(--work-motion-fast) ease, box-shadow var(--work-motion-fast) ease, filter var(--work-motion-fast) ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  color: #fff;
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(76, 38, 110, 0.2);
  text-decoration: none;
}

.button:active,
button:active,
input[type="submit"]:active {
  filter: brightness(0.96);
  transform: translateY(0);
}

.button.secondary,
button.secondary {
  color: var(--work-primary-dark);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 244, 251, 0.92));
  border-color: rgba(76, 38, 110, 0.2);
  box-shadow: 0 10px 20px rgba(76, 38, 110, 0.08);
}

.button.secondary:hover,
button.secondary:hover {
  color: var(--work-primary-dark);
}

.button.danger,
button.danger {
  background: linear-gradient(135deg, #b42318, #dc3545);
  border-color: #b42318;
}

.button.warning,
button.warning {
  background: linear-gradient(135deg, #a15c07, #d99018);
  border-color: #a15c07;
}

.button.success,
button.success {
  background: linear-gradient(135deg, #157347, #21a36d);
  border-color: #157347;
}


label {
  display: block;
  margin-bottom: 6px;
  color: #4b355e;
  font-weight: var(--work-weight-700);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--work-body-text);
  background: var(--work-control-bg);
  border: 1px solid var(--work-control-border);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font: inherit;
  transition: border-color var(--work-motion-fast) ease, box-shadow var(--work-motion-fast) ease, background var(--work-motion-fast) ease;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  padding: 0;
  box-shadow: none;
  accent-color: var(--work-primary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: #fff;
  border-color: rgba(76, 38, 110, 0.42);
  box-shadow: 0 0 0 4px var(--work-focus-ring-brand);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

.alert.warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.alert.compact {
  padding: 9px 11px;
  margin: 8px 0 0;
  font-size: var(--work-text-sm);
}

button:disabled,
input[type="submit"]:disabled {
  color: #7f728d;
  background: #ece8f1;
  border-color: rgba(76, 38, 110, 0.12);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.table-wrap {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 9px;
  color: #4a2d5e;
  background: rgba(76, 38, 110, 0.09);
  border: 1px solid var(--work-primary-soft);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

.badge.success {
  color: #166534;
  background: var(--work-success-surface-alt);
  border-color: #bbf7d0;
}

.badge.warning {
  color: #92400e;
  background: var(--work-warning-surface-alt);
  border-color: #fde68a;
}

.badge.danger {
  color: #991b1b;
  background: var(--work-danger-surface-alt);
  border-color: #fecaca;
}

.badge.neutral {
  color: #4b5563;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-lg);
  box-shadow: 0 12px 24px rgba(76, 38, 110, 0.07);
  font-weight: var(--work-weight-600);
}

.alert.error {
  color: #991b1b;
  background: #fff1f2;
  border-color: #fecaca;
}

.alert.success {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}


.button.ghost {
  color: #4b355e;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(76, 38, 110, 0.14);
  box-shadow: none;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--work-z-shell-bar);
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(26, 17, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  color: var(--work-body-text);
  background: var(--work-body-surface);
  border: 1px solid rgba(76, 38, 110, 0.16);
  border-radius: var(--work-radius-lg);
  box-shadow: 0 28px 70px rgba(31, 20, 45, 0.22);
}

.modal-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

@media (max-width: 720px) {
  .modal-backdrop {
    padding: 10px;
  }}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* MODAL-STICKY-HEADER-02 — sticky modal chrome is opt-in so a specialized
   long dialog cannot change the layout contract of every modal in Work. */
.modal-card.modal-card--sticky-chrome .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -22px -22px 0;
  padding: 22px 22px 8px;
  background: var(--work-body-surface);
  border-radius: var(--work-radius-lg) var(--work-radius-lg) 0 0;
}

/* MODAL-STICKY-ACTIONS-02 — opt-in action pinning keeps long-dialog controls
   reachable without imposing sticky behavior on unrelated modal surfaces. */
.modal-card.modal-card--sticky-chrome .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 8px -22px -22px;
  padding: 12px 22px 22px;
  background: var(--work-body-surface);
  border-radius: 0 0 var(--work-radius-lg) var(--work-radius-lg);
}

.modal-header h3 {
  margin: 3px 0 4px;
  color: #2f1c3f;
  font-size: 20px;
}

.modal-close-button {
  width: 34px;
  height: 34px;
  /* WORK-ICON-BUTTON-MIN-HEIGHT-01 (2026-08-20) — reset the global
     button { min-height: 40px }; it turned this 34px circle into a 34x40
     vertical ellipse on every modal. */
  min-height: 0;
  padding: 0;
  color: var(--work-primary-dark);
  background: #f4f0f8;
  border-color: rgba(76, 38, 110, 0.14);
  border-radius: 999px;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}

.modal-close-button:hover {
  color: var(--work-primary-dark);
  background: #ece6f3;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.business-table .force-delete-action {
  padding: 0.45rem 0.7rem;
}

button.table-action {
  border: 0;
  cursor: pointer;
}

.sidebar-context {
  display: grid;
  gap: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--work-text-xs);
}

.sidebar-context strong {
  color: rgba(255, 255, 255, 0.84);
  font-size: var(--work-text-sm);
}

.app-topbar {
  align-items: center;
  overflow: visible;
  z-index: var(--work-z-shell-bar);
}

/* OVERLAY-PORTAL-01 — viewport overlays (modals) are portaled to <body> by
   modal-controls.js; they are excluded here defensively so the shell stacking
   rule can never re-position an overlay that has not been portaled yet.
   The .content size container (container-type: inline-size) is a containing
   block for fixed descendants — overlays must stay out of its subtree. */
.content > :not(.app-topbar):not([data-modal]) {
  position: relative;
  z-index: 1;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin-bottom: 3px;
}

.section-heading .inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.section-heading .inline-actions form {
  margin: 0;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.business-table td strong {
  color: #352543;
}

/* WORK-FILTER-BAR-ALIGN-01 (2026-08-19) — one-level filter bars: the fields
   share the row and the action buttons sit inline at the end, bottom-aligned
   with the controls at one shared height. On narrow widths the whole actions
   group wraps as one unit instead of buttons stacking into a column. */
.filter-form {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-form .field {
  flex: 1 1 11rem;
  margin-bottom: 0;
}

.filter-form .field :is(input, select, .app-select),
.filter-form .filter-actions .action-button,
.filter-form .filter-actions .button {
  min-height: 2.5rem;
}

.filter-form .filter-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-inline-start: auto;
  padding-bottom: 0;
}


@media (max-width: 980px) {
  /* UI-UX-PRECISION-FIX-01  -  the shell stays a grid on narrow viewports.
     The sidebar is a 72px icon rail by default (theme-init.js forces the
     collapsed state on small screens); expanding it via the burger opens
     an overlay drawer instead of pushing the content down. The previous
     block-flow + static-sidebar pair stacked the full sidebar ABOVE the
     page content on phones. */
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar {
    box-shadow: 0 16px 28px rgba(33, 12, 55, 0.16);
  }

  .content {
    padding: 16px;
  }

  .filter-form {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    align-items: stretch;
  }}

@media (max-width: 620px) {
  .content {
    padding: 12px;
  }}
.modal-card--wide {
  width: min(920px, calc(100vw - 32px));
}

/* ===================================================================
 * UI-SHELL-NAVIGATION-DARK-MODE-01 (2026-05-26)
 *
 * Appended block  -  does NOT modify any pre-existing rule. Adds:
 *   1. Sales Activities sidebar group (POC + Demo grouped under a labelled
 *      header; navigation-only  -  no CRM / sales-pipeline scope).
 *   2. Sidebar burger / collapse control (data-sidebar="collapsed" on <html>).
 *   3. Dark mode foundation via [data-theme="dark"] token overrides on <html>.
 *   4. Topbar layout adjustment for the new leading slot + theme toggle.
 *
 * All rules are CSP-safe (no inline style attributes anywhere in views;
 * see app/Support/views/layout.php). Operator visual approval is required
 * before final business acceptance  -  see
 * docs/review-reports/UI_SHELL_NAVIGATION_DARK_MODE_01_VISUAL_QA_CHECKLIST.md.
 * =================================================================== */

/* 1. Sales Activities sidebar group ---------------------------------------- */
.nav .nav-group {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.nav .nav-group-label {
  padding: 6px 11px 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--work-text-xs);
  font-weight: var(--work-weight-700);
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav .nav-section-label {
  display: block;
  padding: 7px 12px 3px 46px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: var(--work-weight-800);
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.nav .nav-group-items {
  display: grid;
  gap: 4px;
}

.nav .nav-group.is-active-group .nav-group-label {
  color: var(--work-accent-bright);
}

/* 2. Sidebar burger / collapse -------------------------------------------- */
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-inline-end: 12px;
  color: var(--work-body-text);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--work-control-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--work-motion-interactive) ease, border-color var(--work-motion-interactive) ease, color var(--work-motion-interactive) ease;
}

.sidebar-toggle:hover {
  background: rgba(76, 38, 110, 0.10);
  border-color: rgba(76, 38, 110, 0.36);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--work-brand-purple);
  outline-offset: 2px;
}

.sidebar-toggle .sidebar-toggle-bars {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.sidebar-toggle .sidebar-toggle-bars::before,
.sidebar-toggle .sidebar-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.sidebar-toggle .sidebar-toggle-bars::before {
  top: -6px;
}

.sidebar-toggle .sidebar-toggle-bars::after {
  top: 6px;
}

/* Specific surface-class adjustments for dark mode where the default rule
   used a fixed near-white color rather than a token. These are token-style
   overrides  -  they keep the original light look intact when data-theme is
   absent. */
html[data-theme="dark"] .alert.success {
  color: #c9efd8;
  background: rgba(20, 70, 40, 0.55);
  border-color: rgba(110, 209, 143, 0.36);
}

html[data-theme="dark"] .alert.warning {
  color: #ffe1b3;
  background: rgba(96, 64, 12, 0.55);
  border-color: rgba(246, 192, 101, 0.36);
}

html[data-theme="dark"] .alert.error,
html[data-theme="dark"] .alert.danger {
  color: #ffd2cf;
  background: rgba(96, 24, 24, 0.55);
  border-color: rgba(239, 154, 154, 0.36);
}

html[data-theme="dark"] .business-table thead {
  background: rgba(23, 36, 55, 0.98);
}

html[data-theme="dark"] .business-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: var(--work-body-text);
  background: var(--work-control-bg);
  border-color: var(--work-control-border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(184, 166, 207, 0.7);
}

html[data-theme="dark"] .badge {
  color: var(--work-body-text);
}

.nav .nav-link,
.nav .nav-group-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.nav .nav-link {
  overflow: hidden;
}

.nav .nav-link-pulse .nav-icon {
  animation: work-nav-attention 1.8s ease-in-out infinite;
}

.nav .nav-link-pulse:hover .nav-icon,
.nav .nav-link-pulse.active .nav-icon {
  animation: none;
}

.nav .nav-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav .nav-icon {
  position: relative;
  display: inline-grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav .nav-icon::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--work-nav-icon-url) center / contain no-repeat;
  mask: var(--work-nav-icon-url) center / contain no-repeat;
}

.nav .nav-icon::after {
  display: none;
}

.nav a:hover .nav-icon,
.nav a.active .nav-icon,
.nav .nav-group.is-active-group .nav-icon {
  color: #102a37;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(203, 246, 251, 0.96));
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: 0 10px 22px rgba(37, 201, 219, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

/* CUSTOMER-LICENSES-01  -  direct customer entry + license monitoring screens. */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .form-grid.two {
    grid-template-columns: 1fr;
  }}

.sidebar-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  margin-inline-end: 12px;
  color: #412454;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 244, 249, 0.92));
  border: 1px solid rgba(76, 38, 110, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(36, 18, 51, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: background var(--work-motion-interactive) ease, border-color var(--work-motion-interactive) ease, box-shadow var(--work-motion-interactive) ease, color var(--work-motion-interactive) ease, transform var(--work-motion-interactive) ease;
}

.sidebar-toggle:hover {
  color: #241231;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(225, 243, 247, 0.96));
  border-color: rgba(97, 196, 207, 0.60);
  box-shadow: 0 15px 28px rgba(37, 201, 219, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  filter: none;
  transform: translateY(-1px);
}

.sidebar-toggle:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(36, 18, 51, 0.12), inset 0 2px 6px rgba(36, 18, 51, 0.12);
}

.sidebar-toggle-surface {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(76, 38, 110, 0.08);
}

.sidebar-toggle .sidebar-toggle-bars,
.sidebar-toggle .sidebar-toggle-bars::before,
.sidebar-toggle .sidebar-toggle-bars::after {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  transition: transform var(--work-motion-interactive) ease, opacity var(--work-motion-interactive) ease, width var(--work-motion-interactive) ease, background var(--work-motion-interactive) ease;
}

html[data-theme="dark"] body {
  color: var(--work-body-text);
  background: var(--work-page-background);
}

html[data-theme="dark"] a {
  color: #8eeaf2;
}

html[data-theme="dark"] a:hover {
  color: #d9c4f1;
}

html[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(16, 10, 28, 0.98) 0%, rgba(31, 22, 45, 0.98) 52%, rgba(18, 24, 34, 0.98) 100%);
  border-right-color: rgba(255, 255, 255, 0.10);
  box-shadow: 18px 0 36px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: var(--work-body-text);
  background: var(--work-control-bg);
  border-color: var(--work-control-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  background: #151923;
  border-color: rgba(91, 224, 236, 0.58);
  box-shadow: 0 0 0 4px var(--work-focus-ring-brand);
}

html[data-theme="dark"] button:disabled,
html[data-theme="dark"] input[type="submit"]:disabled {
  color: #8c96a8;
  background: #272b36;
  border-color: rgba(197, 214, 230, 0.12);
}

html[data-theme="dark"] .badge {
  color: #e7d8f4;
  background: var(--work-brand-soft);
  border-color: rgba(185, 150, 219, 0.24);
}

html[data-theme="dark"] .badge.danger {
  color: #ffd2cf;
  background: rgba(150, 48, 48, 0.30);
  border-color: rgba(255, 170, 164, 0.34);
}

html[data-theme="dark"] .alert {
  color: var(--work-body-text);
  background: rgba(26, 29, 39, 0.96);
  border-color: var(--work-body-border);
}

html[data-theme="dark"] .alert.success {
  color: #c6f6d5;
  background: rgba(24, 82, 54, 0.58);
  border-color: rgba(141, 224, 170, 0.34);
}

html[data-theme="dark"] .alert.error,
html[data-theme="dark"] .alert.danger {
  color: #ffd2cf;
  background: rgba(105, 35, 42, 0.54);
  border-color: rgba(255, 170, 164, 0.34);
}

body {
  color: var(--work-field-text);
  background: var(--work-page-backdrop);
}

a {
  color: var(--work-accent-strong);
}

a:hover {
  color: var(--work-brand-violet);
}

.sidebar {
  background: var(--work-shell-gradient);
  border-right-color: rgba(255, 255, 255, 0.10);
  box-shadow: 18px 0 42px rgba(10, 18, 31, 0.20);
}

.nav .nav-link,
.nav .nav-group-label {
  color: rgba(242, 247, 251, 0.78);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.065);
}

.nav .nav-link:hover,
.nav .nav-link.active,
.nav .nav-group.is-active-group > .nav-group-label {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(115, 213, 228, 0.28);
  box-shadow: inset 3px 0 0 rgba(115, 213, 228, 0.75), 0 10px 22px rgba(7, 15, 27, 0.16);
}

.nav .nav-icon {
  color: rgba(242, 247, 251, 0.92);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.11);
}

.nav a:hover .nav-icon,
.nav a.active .nav-icon,
.nav .nav-group.is-active-group .nav-icon {
  color: #082235;
  background: linear-gradient(135deg, rgba(238, 250, 252, 1), rgba(170, 233, 242, 0.95));
  border-color: rgba(255, 255, 255, 0.48);
}

input::placeholder,
textarea::placeholder {
  color: var(--work-body-muted);
  opacity: 1;
}

.button,
button,
input[type="submit"] {
  background: var(--work-gradient-btn);
  border-color: rgba(47, 135, 161, 0.28);
  box-shadow: 0 12px 24px rgba(47, 93, 125, 0.16);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  box-shadow: 0 15px 30px rgba(47, 93, 125, 0.22);
}

.alert {
  color: var(--work-field-text);
  background: var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
  box-shadow: var(--work-shadow-xs);
}

.alert.success {
  color: #12613f;
  background: var(--work-success-surface-alt);
  border-color: rgba(21, 115, 71, 0.22);
}

.alert.error,
.alert.danger {
  color: #8f1f18;
  background: var(--work-danger-surface-alt);
  border-color: rgba(180, 35, 24, 0.24);
}

html[data-theme="dark"] body {
  color: var(--work-field-text);
  background: var(--work-page-backdrop);
}

html[data-theme="dark"] a {
  color: var(--work-accent-glow);
}

html[data-theme="dark"] a:hover {
  color: var(--work-brand-violet);
}

html[data-theme="dark"] .sidebar {
  background: var(--work-shell-gradient);
  border-right-color: rgba(181, 205, 230, 0.10);
  box-shadow: 18px 0 44px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .nav .nav-link,
html[data-theme="dark"] .nav .nav-group-label {
  color: rgba(242, 247, 251, 0.76);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(181, 205, 230, 0.07);
}

html[data-theme="dark"] .nav .nav-link:hover,
html[data-theme="dark"] .nav .nav-link.active,
html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  color: #ffffff;
  background: rgba(115, 213, 228, 0.12);
  border-color: rgba(115, 213, 228, 0.28);
}

html[data-theme="dark"] .nav .nav-icon {
  color: rgba(242, 247, 251, 0.88);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(181, 205, 230, 0.10);
}

html[data-theme="dark"] .nav a:hover .nav-icon,
html[data-theme="dark"] .nav a.active .nav-icon,
html[data-theme="dark"] .nav .nav-group.is-active-group .nav-icon {
  color: #061827;
  background: linear-gradient(135deg, rgba(185, 241, 248, 1), rgba(115, 213, 228, 0.92));
  border-color: rgba(181, 205, 230, 0.34);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--work-body-muted);
}

html[data-theme="dark"] .alert {
  color: var(--work-field-text);
  background: var(--work-shell-bg-strong);
  border-color: var(--work-shell-border);
}

html[data-theme="dark"] .alert.success {
  color: #bff2cf;
  background: var(--work-success-surface-alt);
  border-color: rgba(125, 218, 158, 0.32);
}

html[data-theme="dark"] .alert.error,
html[data-theme="dark"] .alert.danger {
  color: #ffc5c0;
  background: var(--work-danger-surface-alt);
  border-color: rgba(238, 137, 131, 0.32);
}

body {
  color: var(--work-body-text);
  background: var(--work-page-background);
}

a {
  color: var(--work-primary);
}

a:hover {
  color: #3f1b55;
}

.sidebar {
  background:
    radial-gradient(circle at top left, rgba(97, 196, 207, 0.16), transparent 15rem),
    var(--work-shell-gradient);
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: var(--work-shadow-sidebar);
}

.sidebar-footer {
  color: inherit;
}

.nav .nav-link {
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
}

.nav .nav-group-label {
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav .nav-group.is-active-group > .nav-group-label {
  color: var(--work-accent-bright);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav .nav-icon {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--work-shadow-inset-highlight);
}

.nav a:hover .nav-icon,
.nav a.active .nav-icon,
.nav .nav-group.is-active-group .nav-icon {
  color: #101116;
  background: var(--work-accent-bright);
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

html[data-theme="dark"] a {
  color: #8eeaf2;
}

html[data-theme="dark"] a:hover {
  color: #d9c4f1;
}

html[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(16, 10, 28, 0.98) 0%, rgba(31, 22, 45, 0.98) 52%, rgba(18, 24, 34, 0.98) 100%);
  border-right-color: rgba(255, 255, 255, 0.10);
  box-shadow: 18px 0 36px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .nav .nav-link,
html[data-theme="dark"] .nav .nav-group-label {
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .nav .nav-link:hover,
html[data-theme="dark"] .nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .nav .nav-group-label {
  color: rgba(255, 255, 255, 0.62);
}

html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  color: var(--work-accent-bright);
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .nav a:hover .nav-icon,
html[data-theme="dark"] .nav a.active .nav-icon,
html[data-theme="dark"] .nav .nav-group.is-active-group .nav-icon {
  color: #101116;
  background: var(--work-accent-bright);
  border-color: rgba(255, 255, 255, 0.38);
}

/* UI-PREMIUM-VISUAL-SYSTEM-01-CURRENT-WORK-FOLLOWUP (2026-05-27)
 * The current stage owns the first work area. Review tabs follow after it.
 * Layout-only; the accepted palette is unchanged.
 */
/* ===================================================================
 * UI-SHELL-OPERATOR-FOLLOWUP-01
 * Final cascade position for sidebar-edge burger and larger theme toggle.
 * Visual-only and color-locked.
 * =================================================================== */

.sidebar {
  overflow: visible;
}

.sidebar-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-edge-toggle {
  position: absolute;
  inset-block-start: 28px;
  inset-inline-end: -22px;
  z-index: var(--work-z-menu-layer);
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 999px;
}

.sidebar-edge-toggle .sidebar-toggle-bars,
.sidebar-edge-toggle .sidebar-toggle-bars::before,
.sidebar-edge-toggle .sidebar-toggle-bars::after {
  width: 20px;
}

@media (max-width: 980px) {
  .sidebar {
    position: relative;
  }

  .sidebar-edge-toggle {
    inset-block-start: 18px;
    inset-inline-end: 18px;
  }}

html[data-theme="dark"] body {
  color: var(--work-dark-text);
  background: var(--work-dark-page);
}

html[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 20% 8%, rgba(97, 196, 207, 0.18), transparent 9rem),
    linear-gradient(180deg, #2d1b47 0%, #35234f 46%, #273044 100%);
  border-right-color: rgba(255, 255, 255, 0.13);
  box-shadow: 18px 0 40px rgba(11, 15, 25, 0.30);
}

html[data-theme="dark"] .nav .nav-link,
html[data-theme="dark"] .nav .nav-group-label {
  color: rgba(242, 247, 251, 0.82);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .nav .nav-link:hover,
html[data-theme="dark"] .nav .nav-link.active,
html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(97, 196, 207, 0.20), rgba(255, 255, 255, 0.09));
  border-color: rgba(159, 243, 251, 0.42);
  box-shadow: inset 3px 0 0 #61C4CF, 0 12px 24px rgba(18, 22, 35, 0.22);
}

html[data-theme="dark"] .nav .nav-icon {
  color: rgba(239, 247, 252, 0.96);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.13);
}

html[data-theme="dark"] .nav a:hover .nav-icon,
html[data-theme="dark"] .nav a.active .nav-icon,
html[data-theme="dark"] .nav .nav-group.is-active-group .nav-icon {
  color: #102333;
  background: linear-gradient(135deg, #dffbff, #96eef7);
  border-color: rgba(255, 255, 255, 0.56);
  box-shadow: 0 10px 22px rgba(97, 196, 207, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .table-wrap {
  background: rgba(17, 28, 43, 0.94);
}

html[data-theme="dark"] .business-table tbody tr {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .business-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .business-table tbody tr:hover {
  background: rgba(115, 213, 228, 0.07);
}

html[data-theme="dark"] .business-table td strong,
html[data-theme="dark"] .business-table a {
  color: #b9f6ff;
}

/* UI-UX-PRECISION-FIX-01  -  reserve vertical room at the end of the content
   column whenever the floating ticket FAB is rendered, so it can no longer
   sit on top of the last card / right-rail content at the bottom of the
   scroll (observed overlapping the final card in long detail views). */
body:has(.improvement-ticket-fab) .content {
  padding-block-end: 96px;
}

body:has([data-profit-line-panel]) .improvement-ticket-fab {
  top: auto;
  bottom: 24px;
}

button[disabled],
input[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--work-body-border);
}

.pagination-summary {
  color: var(--work-body-muted);
  display: grid;
  gap: 3px;
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-700);
}

.pagination-summary strong {
  color: var(--work-body-text);
}

.pagination-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-link,
.pagination-ellipsis {
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-xs);
  color: var(--work-body-text);
  background: var(--work-body-surface);
  font-size: var(--work-text-md);
  font-weight: var(--work-weight-800);
  text-decoration: none;
}

.pagination-link.is-current {
  color: var(--work-text-inverse);
  border-color: var(--work-primary);
  background: var(--work-primary);
}

.pagination-link.is-disabled {
  pointer-events: none;
  color: var(--work-body-muted);
  background: color-mix(in srgb, var(--work-body-surface), var(--work-body-muted) 8%);
  opacity: 0.62;
}

.pagination-ellipsis {
  min-width: 22px;
  padding: 0 2px;
  border-color: transparent;
  background: transparent;
  color: var(--work-body-muted);
}

@media (max-width: 760px) {
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-pages {
    justify-content: flex-start;
  }}

/* WORK-TABLE-HOVER-POLISH-01 - keep operational tables calm on hover. */
.business-table tbody tr:hover {
  background: rgba(97, 196, 207, 0.035);
  box-shadow: inset 3px 0 0 rgba(97, 196, 207, 0.22);
}

.business-table .table-action {
  border: 1px solid rgba(76, 38, 110, 0.10);
}

.business-table .table-action:hover {
  color: var(--work-primary-dark);
  background: rgba(76, 38, 110, 0.12);
  border-color: rgba(76, 38, 110, 0.24);
  box-shadow: 0 8px 18px rgba(76, 38, 110, 0.12);
  transform: translateY(-1px);
}

html[data-theme="dark"] .business-table tbody tr:hover {
  background: rgba(115, 213, 228, 0.055);
  box-shadow: inset 3px 0 0 rgba(115, 213, 228, 0.30);
}

html[data-theme="dark"] .business-table .table-action:hover {
  color: #f5eaff;
  background: rgba(185, 150, 219, 0.18);
  border-color: rgba(185, 150, 219, 0.42);
  box-shadow: 0 8px 18px rgba(13, 18, 31, 0.22);
}

/* SIDEBAR-DARK-MODULE-HEADERS-01 - soften dark-mode module headers. */
html[data-theme="dark"] .nav .nav-group {
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .nav .nav-group-label {
  color: rgba(242, 247, 251, 0.76);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(97, 196, 207, 0.22), rgba(255, 255, 255, 0.055));
  border-color: rgba(159, 243, 251, 0.34);
  box-shadow: inset 3px 0 0 #61C4CF, 0 10px 22px rgba(10, 16, 26, 0.16);
}

/* SIDEBAR-MODULE-SECTION-HEADERS-01 - module groups are labels, not actions. */
.nav .nav-group {
  margin-top: 12px;
  padding-top: 12px;
}

.nav .nav-group-label {
  min-height: auto;
  padding: 6px 8px 4px;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  cursor: default;
}

.nav .nav-group-label::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.nav .nav-group-label .nav-icon {
  flex-basis: 22px;
  width: 22px;
  height: 22px;
  color: currentColor;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: 0.88;
}

.nav .nav-group.is-active-group > .nav-group-label {
  color: rgba(97, 196, 207, 0.95);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav .nav-group.is-active-group > .nav-group-label .nav-icon {
  color: #61C4CF;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nav .nav-group.is-active-group > .nav-group-label::after {
  background: linear-gradient(90deg, rgba(97, 196, 207, 0.62), rgba(255, 255, 255, 0.08));
}

html[data-theme="dark"] .nav .nav-group-label {
  color: rgba(242, 247, 251, 0.62);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .nav .nav-group-label::after {
  background: rgba(255, 255, 255, 0.11);
}

html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label {
  color: rgba(97, 196, 207, 0.98);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label .nav-icon {
  color: #61C4CF;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .nav .nav-group.is-active-group > .nav-group-label::after {
  background: linear-gradient(90deg, rgba(97, 196, 207, 0.68), rgba(255, 255, 255, 0.08));
}

.filter-chip {
    align-items: center;
    background: var(--work-surface-strong);
    border: 1px solid var(--work-body-border);
    border-radius: 999px;
    color: var(--work-body-text);
    display: inline-flex;
    font-size: 0.85rem;
    gap: 0.35rem;
    line-height: 1.2;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    text-decoration: none;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    border-color: var(--work-accent-bright);
    color: var(--work-accent-bright);
    text-decoration: none;
}

.sidebar {
  /* The edge control extends outside this shell; scrolling belongs to .sidebar-scroll. */
  overflow: visible;
}

.sidebar-scroll {
  padding-inline-end: 4px;
  scrollbar-color: rgba(97, 196, 207, 0.58) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(97, 196, 207, 0.58);
  border-radius: 999px;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb,
.sidebar-scroll:focus-within::-webkit-scrollbar-thumb {
  background: rgba(97, 196, 207, 0.82);
}

.nav .nav-group {
  display: grid;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
}

.nav .nav-group-label {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 7px 9px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  text-align: start;
  text-transform: none;
  transition: color var(--work-motion-fast) ease, background var(--work-motion-fast) ease, border-color var(--work-motion-fast) ease;
}

.nav .nav-group-label::after {
  content: none;
  display: none;
}

.nav .nav-group-label:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(97, 196, 207, 0.28);
}

.nav .nav-group-label:focus-visible {
  outline: 2px solid var(--work-accent-bright);
  outline-offset: 2px;
}

.nav .nav-group-label .nav-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--work-radius-xs);
  box-shadow: none;
  opacity: 1;
}

.nav .nav-group.is-active-group > .nav-group-label {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(97, 196, 207, 0.18), rgba(255, 255, 255, 0.045));
  border-color: rgba(97, 196, 207, 0.32);
  box-shadow: inset 3px 0 0 #61c4cf;
}

.nav .nav-group.is-active-group > .nav-group-label .nav-icon {
  color: #102a37;
  background: #a9eff5;
  border-color: rgba(255, 255, 255, 0.44);
}

.nav .nav-group-items {
  display: grid;
  gap: 4px;
  padding-top: 5px;
}

.nav .nav-group-items[hidden] {
  display: none !important;
}

.nav .nav-section-label {
  padding: 8px 8px 3px;
  padding-inline-start: 46px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: var(--work-weight-800);
  line-height: 1.2;
  text-transform: uppercase;
}

.nav .nav-item-category-label {
  margin-top: 2px;
  color: rgba(169, 239, 245, 0.62);
}

.nav .nav-group.is-active-group .nav-group-items .nav-link:not(.active):not(:hover) .nav-icon {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--work-shadow-inset-highlight);
}

@media (forced-colors: active) {
  .sidebar-scroll {
    scrollbar-color: ButtonText Canvas;
  }

  .nav .nav-group-label {
    border-color: ButtonText;
  }}

button[data-modal-close]:not(.action-button) {
  gap: 7px;
}

button[data-modal-close]:not(.action-button)::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: url("/assets/icons/x.svg?v=20260714-work-actions-01") center / contain no-repeat;
  mask: url("/assets/icons/x.svg?v=20260714-work-actions-01") center / contain no-repeat;
}

.modal-close-button[data-modal-close]:not(.action-button) {
  font-size: 0;
  /* The hidden × text node is still a zero-width flex item; the global
     button gap (7-8px) pushed the masked icon ~4px left of the circle's
     center. Icon-only variant owns zero gap. */
  gap: 0;
}

.modal-close-button[data-modal-close]:not(.action-button)::before {
  width: 18px;
  height: 18px;
}

.inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--work-body-text);
}

.checkbox-row input {
  width: auto;
  min-height: auto;
  accent-color: var(--work-primary);
}

.toggle-switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 28px;
  background: #d7dce8;
  border: 1px solid rgba(76, 38, 110, 0.14);
  border-radius: 999px;
  transition: background var(--work-motion-fast) ease, border-color var(--work-motion-fast) ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(35, 18, 49, 0.18);
  transition: transform var(--work-motion-fast) ease;
}

.toggle-input:checked + .toggle-switch {
  background: linear-gradient(135deg, #157347, #61C4CF);
  border-color: rgba(21, 115, 71, 0.52);
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(24px);
}

.toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toggle-state {
  flex: 0 0 auto;
  min-width: 110px;
  text-align: center;
}

.toggle-state .on,
.toggle-input:checked ~ .toggle-state .off {
  display: none;
}

.toggle-input:checked ~ .toggle-state .on,
.toggle-state .off {
  display: inline-flex;
}

.state-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  background: rgba(187, 211, 238, 0.18);
  border: 1px solid rgba(76, 38, 110, 0.12);
  border-radius: 16px;
}

.state-card .subtle {
  margin: 2px 0 0;
}

.span-2 {
  grid-column: 1 / -1;
}

.inline-between {
  justify-content: space-between;
}

.state-card-stack {
  display: block;
}

.state-card-flush {
  margin-bottom: 0;
}

.toggle-flush {
  margin-top: 0;
}

.table-spaced {
  margin-top: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--work-space-5);
  flex-wrap: wrap;
  margin-top: 14px;
}

.table-action.is-disabled {
  color: #9a8aa8;
  cursor: not-allowed;
  opacity: 0.75;
}

.tiny-muted {
  margin-top: 4px;
  color: var(--work-body-muted);
  font-size: var(--work-text-xs);
  font-weight: var(--work-weight-700);
}

.record-page-back-row {
  display: flex;
  justify-content: flex-end;
}

.settings-back-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.settings-back-row .button {
  width: fit-content;
}

.table-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  color: var(--work-primary);
  background: rgba(76, 38, 110, 0.07);
  border-radius: 12px;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

.table-action:hover {
  color: #fff;
  background: var(--work-primary);
}

.table-action.warning {
  color: #7a4b00;
  background: #fff3d6;
}

.table-action.warning:hover {
  color: #2b1b00;
  background: #f4c56b;
}

.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Keep the hero back-action compact: the flex title block must not squeeze it into two lines. */
.settings-hero > .action-back {
  flex: 0 0 auto;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 16px;
  overflow: hidden;
  color: var(--work-body-text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--work-body-border);
  border-radius: 18px;
  box-shadow: var(--work-shadow-lg);
}

.settings-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--work-gradient-card);
}

.settings-card:hover {
  color: var(--work-body-text);
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(76, 38, 110, 0.12);
}

.settings-card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--work-gradient-btn);
  border-radius: 14px;
  font-weight: var(--work-weight-800);
}

.settings-card strong {
  color: #352543;
  font-size: var(--work-text-lg);
  font-weight: var(--work-weight-800);
}

.settings-card small {
  color: var(--work-body-muted);
  font-weight: var(--work-weight-600);
}

.stack {
  display: grid;
  gap: 14px;
}


.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-item {
  min-width: 0;
  padding: 14px;
  background: rgba(187, 211, 238, 0.14);
  border: 1px solid rgba(76, 38, 110, 0.1);
  border-radius: 14px;
}

.detail-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--work-body-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
  text-transform: uppercase;
}

.detail-item strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #352543;
}

.table-action.as-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.settings-card-icon {
  color: var(--work-accent-strong);
  background: var(--work-accent-soft);
  border-color: rgba(47, 135, 161, 0.20);
  font-size: 0;
}

.settings-card-icon::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--work-settings-card-icon-url, url("/assets/icons/settings.svg?v=20260605-icons-01")) center / contain no-repeat;
  mask: var(--work-settings-card-icon-url, url("/assets/icons/settings.svg?v=20260605-icons-01")) center / contain no-repeat;
}

.settings-card-sensitive {
  border-color: rgba(185, 28, 28, 0.32);
}

/* LIST-CONTRACT-UI-20260709 - governed list sorting, filters, and result bars. */
.work-filter-bar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1rem;
}

.work-filter-bar .field {
    min-width: min(16rem, 100%);
}

.list-results-bar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.list-results-bar .subtle {
    margin: 0;
}

.sortable-table-header {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 0.35rem;
    justify-content: flex-start;
    min-height: 1.75rem;
    text-decoration: none;
}

.sortable-table-header:hover,
.sortable-table-header:focus-visible {
    color: var(--work-accent-bright);
    text-decoration: none;
}

.sort-indicator {
    color: var(--muted-text, var(--work-body-muted));
    display: inline-flex;
    font-size: 0.8em;
    justify-content: center;
    min-width: 1em;
}

.active-filter-chips {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.active-filter-chips a.badge,
.active-filter-chips a.badge:hover {
    text-decoration: none;
}

.active-filter-chips a.badge[aria-current="true"] {
    outline: 2px solid var(--work-primary);
    outline-offset: 1px;
}

/* Workflow steps — shared horizontal lifecycle stepper (display only). */
.workflow-steps {
    display: flex;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.workflow-step {
    color: var(--work-body-muted);
    flex: 1 1 0;
    min-inline-size: 0;
    padding-top: 26px;
    position: relative;
    text-align: center;
}

.workflow-step::before {
    background: var(--work-body-surface);
    border: 2px solid var(--work-border-strong);
    border-radius: 50%;
    content: "";
    height: 12px;
    inset-inline-start: 50%;
    margin-inline-start: -6px;
    position: absolute;
    top: 6px;
    width: 12px;
}

.workflow-step:not(:first-child)::after {
    border-top: 2px solid var(--work-body-border);
    content: "";
    inline-size: 100%;
    inset-inline-start: -50%;
    position: absolute;
    top: 13px;
}

.workflow-step.complete {
    color: var(--work-body-text);
}

.workflow-step.complete::before {
    background: var(--work-success-alt);
    border-color: var(--work-success-alt);
}

.workflow-step.complete::after {
    border-top-color: var(--work-success-alt);
}

.workflow-step.current {
    color: var(--work-body-text);
}

.workflow-step.current::before {
    background: var(--work-primary);
    border-color: var(--work-primary);
    box-shadow: 0 0 0 4px var(--work-primary-soft);
}

.workflow-step-label {
    display: block;
    font-size: 0.85rem;
    font-weight: var(--work-weight-600);
}

.workflow-step-meta {
    display: block;
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Definition grid — shared labelled-value summary. */
.definition-grid {
    display: grid;
    gap: 14px 24px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    margin: 0;
}

.definition-grid > div {
    min-inline-size: 0;
}

.definition-grid dt {
    color: var(--work-body-muted);
    font-size: 0.8rem;
    font-weight: var(--work-weight-600);
    margin-bottom: 3px;
}

.definition-grid dd {
    font-weight: var(--work-weight-600);
    margin: 0;
    overflow-wrap: break-word;
}

.definition-grid dd .subtle {
    display: block;
    font-weight: var(--work-weight-400);
}

/* Business table footer totals. */
.business-table tfoot th,
.business-table tfoot td {
    border-top: 2px solid var(--work-border-strong);
    font-weight: var(--work-weight-700);
}

/* ===================================================================
 * WORK-GLOBAL-ACTION-ICON-SYSTEM-01
 * Fixed semantic action catalog. Icons are local, decorative masks;
 * icon-only controls must provide translated aria-label/data-tooltip.
 * =================================================================== */

.record-list-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--work-space-3);
}

.record-list-row-actions form {
  margin: 0;
}

.action-button {
  /* An unmapped action must not paint an unmasked currentColor square. */
  --work-action-icon-url: linear-gradient(transparent, transparent);
  position: relative;
  gap: 7px;
}

.action-button::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: var(--work-action-icon-url) center / contain no-repeat;
  mask: var(--work-action-icon-url) center / contain no-repeat;
}

.action-button--icon,
.button.action-button--icon,
button.action-button--icon,
.table-action.action-button--icon,
button.table-action.action-button--icon {
  box-sizing: border-box;
  /* WORK-ACTION-ICON-CENTER-01 — anchor icon buttons were overruled by the
     later equal-specificity `.table-action { display: inline-flex }` (no
     justify-content), leaving link icons start-aligned while <button> icons
     stayed centered. The `.table-action.action-button--icon` selector above
     outranks `.table-action`, so one declaration here centers every variant. */
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--work-action-icon-rest-foreground);
  background: var(--work-action-icon-rest-surface);
  border: 1px solid var(--work-action-icon-rest-border);
}

.action-button--icon::before {
  width: 20px;
  height: 20px;
}

html[data-theme="dark"] .action-button--icon,
html[data-theme="dark"] .button.action-button--icon,
html[data-theme="dark"] button.action-button--icon,
html[data-theme="dark"] .table-action.action-button--icon,
html[data-theme="dark"] button.table-action.action-button--icon {
  color: var(--work-action-icon-rest-foreground);
  background: var(--work-action-icon-rest-surface);
  border-color: var(--work-action-icon-rest-border);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.22);
}

.action-button--icon:hover,
.button.action-button--icon:hover,
button.action-button--icon:hover,
.table-action.action-button--icon:hover {
  color: var(--work-action-icon-interactive-foreground);
  background: var(--work-action-icon-interactive-surface);
  border-color: var(--work-action-icon-interactive-border);
  transform: translateY(-1px);
  text-decoration: none;
}

.action-button--icon:focus-visible,
.button.action-button--icon:focus-visible,
button.action-button--icon:focus-visible,
.table-action.action-button--icon:focus-visible {
  color: var(--work-action-icon-interactive-foreground);
  background: var(--work-action-icon-interactive-surface);
  border-color: var(--work-action-icon-interactive-border);
  outline: 2px solid var(--work-accent-glow, var(--work-accent-bright));
  outline-offset: 3px;
  box-shadow: var(--work-focus-ring-wide, 0 0 0 4px rgba(97, 196, 207, 0.24));
}

.action-button--icon:active,
.button.action-button--icon:active,
button.action-button--icon:active,
.table-action.action-button--icon:active {
  color: var(--work-action-icon-interactive-foreground);
  background: var(--work-action-icon-active-surface);
  border-color: var(--work-action-icon-active-surface);
  transform: translateY(0);
}

html[data-theme="dark"] .action-button--icon:is(:hover, :focus-visible),
html[data-theme="dark"] .button.action-button--icon:is(:hover, :focus-visible),
html[data-theme="dark"] button.action-button--icon:is(:hover, :focus-visible),
html[data-theme="dark"] .table-action.action-button--icon:is(:hover, :focus-visible) {
  color: var(--work-action-icon-interactive-foreground);
  background: var(--work-action-icon-interactive-surface);
  border-color: var(--work-action-icon-interactive-border);
}

html[data-theme="dark"] .action-button--icon:active,
html[data-theme="dark"] .button.action-button--icon:active,
html[data-theme="dark"] button.action-button--icon:active,
html[data-theme="dark"] .table-action.action-button--icon:active {
  color: var(--work-action-icon-interactive-foreground);
  background: var(--work-action-icon-active-surface);
  border-color: var(--work-action-icon-active-surface);
}

.action-button--icon[data-tooltip]::after {
  content: none;
}

.action-button--icon.global-tooltip-anchor {
  anchor-name: --global-action-tooltip-anchor;
}

.action-button.is-disabled,
.action-button[disabled],
.action-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}

.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
.button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
.table-action.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active),
.button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active),
button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active),
.table-action.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active) {
  color: var(--work-disabled-text);
  background: var(--work-disabled-surface);
  border-color: var(--work-border);
  box-shadow: none;
  transform: none;
}

html[data-theme="dark"] .action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
html[data-theme="dark"] .button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
html[data-theme="dark"] button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
html[data-theme="dark"] .table-action.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]),
html[data-theme="dark"] .action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active),
html[data-theme="dark"] .button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active),
html[data-theme="dark"] button.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active),
html[data-theme="dark"] .table-action.action-button--icon:is(.is-disabled, [disabled], [aria-disabled="true"]):is(:hover, :focus-visible, :active) {
  color: var(--work-disabled-text);
  background: var(--work-disabled-surface);
  border-color: var(--work-border);
  box-shadow: none;
  transform: none;
}

.action-view { --work-action-icon-url: url("/assets/icons/eye.svg?v=20260714-work-actions-01"); }
.action-move-up { --work-action-icon-url: url("/assets/icons/arrow-up.svg?v=20260905-work-actions-01"); }
.action-move-down { --work-action-icon-url: url("/assets/icons/arrow-down.svg?v=20260905-work-actions-01"); }
.action-reorder { --work-action-icon-url: url("/assets/icons/grip-vertical.svg?v=20260905-work-actions-01"); }
/* Document actions keep a file-shaped silhouette; generic view/download remain for non-document surfaces. */
.action-pdf-preview { --work-action-icon-url: url("/assets/icons/file-type-pdf.svg?v=20260811-work-pdf-actions-02"); }
.action-edit { --work-action-icon-url: url("/assets/icons/edit.svg?v=20260714-work-actions-01"); }
.action-download { --work-action-icon-url: url("/assets/icons/download.svg?v=20260714-work-actions-01"); }
.action-pdf-download { --work-action-icon-url: url("/assets/icons/file-download.svg?v=20260810-work-pdf-actions-01"); }
.action-print { --work-action-icon-url: url("/assets/icons/printer.svg?v=20260714-work-actions-01"); }
.action-copy { --work-action-icon-url: url("/assets/icons/copy.svg?v=20260714-work-actions-01"); }
.action-archive { --work-action-icon-url: url("/assets/icons/archive.svg?v=20260714-work-actions-01"); }
.action-restore { --work-action-icon-url: url("/assets/icons/restore.svg?v=20260714-work-actions-01"); }
.action-delete { --work-action-icon-url: url("/assets/icons/trash.svg?v=20260714-work-actions-01"); }

/* Global field-to-clipboard control. Business duplication actions continue to
   use .action-copy; this compact control is reserved for copying text values. */
.copy-value {
  align-items: center;
  display: inline-flex;
  gap: var(--work-space-1, 0.25rem);
  max-width: 100%;
  min-width: 0;
}

.copy-value__text,
.copy-value > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.copy-value__button {
  --work-copy-icon-url: url("/assets/icons/copy.svg?v=20260828-work-copy-01");
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--work-radius-sm, 6px);
  box-sizing: border-box;
  color: var(--work-accent-strong, var(--work-primary));
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 auto;
  height: 1.5rem;
  min-height: 0;
  min-width: 1.5rem;
  padding: 0;
  place-items: center;
  width: 1.5rem;
}

.copy-value__button::before {
  background: currentColor;
  content: "";
  height: 0.9rem;
  -webkit-mask: var(--work-copy-icon-url) center / contain no-repeat;
  mask: var(--work-copy-icon-url) center / contain no-repeat;
  width: 0.9rem;
}

.copy-value__button:hover {
  background: var(--work-body-subtle, rgba(var(--work-primary-rgb), 0.08));
}

.copy-value__button:focus-visible {
  outline: 2px solid var(--work-focus-ring);
  outline-offset: 2px;
}

.copy-value__button.is-copied {
  --work-copy-icon-url: url("/assets/icons/check.svg?v=20260828-work-copy-01");
  color: var(--work-success);
}

@media (forced-colors: active) {
  .copy-value__button {
    border: 1px solid ButtonText;
  }

  .copy-value__button::before {
    background: ButtonText;
  }
}

/* Governed destructive icon action: quiet muted icon at rest,
   danger only on interaction — never a loud solid-red button per row. */
.action-button--icon:is(.action-icon-danger, .action-delete) {
  color: var(--work-body-muted);
}
.action-button--icon:is(.action-icon-danger, .action-delete):hover,
.action-button--icon:is(.action-icon-danger, .action-delete):focus-visible,
.action-button--icon:is(.action-icon-danger, .action-delete):active {
  color: var(--work-danger-inverse, #ffffff);
  background: var(--work-danger-surface);
  border-color: var(--work-danger-border);
}
html[data-theme="dark"] .action-button--icon:is(.action-icon-danger, .action-delete) {
  color: var(--work-danger);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 156, 164, 0.3);
}
html[data-theme="dark"] .action-button--icon:is(.action-icon-danger, .action-delete):is(:hover, :focus-visible, :active) {
  color: var(--work-danger-inverse, #ffffff);
  background: var(--work-danger-surface);
  border-color: var(--work-danger-border);
}

/* Detail-page header variant: text button demoted to a danger outline
   instead of a solid red fill. */
.button.danger-outline,
.action-button.danger-outline {
  color: var(--work-danger-foreground);
  background: transparent;
  border: 1px solid var(--work-danger-border-subtle);
}
.button.danger-outline:hover,
.action-button.danger-outline:hover {
  color: var(--work-danger-inverse, #ffffff);
  background: var(--work-danger-surface);
  border-color: var(--work-danger-border);
}
.action-enable { --work-action-icon-url: url("/assets/icons/circle-check.svg?v=20260714-work-actions-01"); }
.action-disable { --work-action-icon-url: url("/assets/icons/circle-off.svg?v=20260714-work-actions-01"); }
.action-void { --work-action-icon-url: url("/assets/icons/circle-off.svg?v=20260714-work-actions-01"); }
.action-cancel,
.action-close { --work-action-icon-url: url("/assets/icons/x.svg?v=20260714-work-actions-01"); }
.action-confirm,
.action-approve { --work-action-icon-url: url("/assets/icons/circle-check.svg?v=20260714-work-actions-01"); }
.action-reject { --work-action-icon-url: url("/assets/icons/circle-x.svg?v=20260714-work-actions-01"); }
.action-return { --work-action-icon-url: url("/assets/icons/arrow-left.svg?v=20260714-work-actions-01"); }
.action-withdraw { --work-action-icon-url: url("/assets/icons/restore.svg?v=20260714-work-actions-01"); }
.action-start { --work-action-icon-url: url("/assets/icons/briefcase.svg?v=20260831-work-actions-01"); }
.action-send,
.action-submit { --work-action-icon-url: url("/assets/icons/send.svg?v=20260714-work-actions-01"); }
.action-complete { --work-action-icon-url: url("/assets/icons/circle-check.svg?v=20260714-work-actions-01"); }
.action-save { --work-action-icon-url: url("/assets/icons/device-floppy.svg?v=20260714-work-actions-01"); }
.action-create,
.action-add { --work-action-icon-url: url("/assets/icons/plus.svg?v=20260714-work-actions-01"); }
.action-more { --work-action-icon-url: url("/assets/icons/dots-vertical.svg?v=20260714-work-actions-01"); }

/* ===================================================================
 * Governed row-action overflow menu (theme wave E3): max 2 visible row
 * actions + a calm icon trigger holding the rest in a role="menu" popover.
 * No-JS fallback: the server renders every action inline and the enhancer
 * only restructures when [data-row-actions] holds more than two actions.
 * =================================================================== */
.row-actions-enhanced {
  position: relative;
}

.action-overflow { --work-action-icon-url: url("/assets/icons/dots-vertical.svg?v=20260714-work-actions-01"); }

.action-overflow[aria-expanded="true"] {
  color: var(--work-accent-strong, var(--work-primary));
  border-color: var(--work-accent-strong, var(--work-primary));
}

.row-actions-menu {
  position: absolute;
  z-index: var(--work-z-inline-menu);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 46px;
  padding: 6px;
  background: var(--work-body-surface);
  border: 1px solid var(--work-body-border);
  border-radius: var(--work-radius-md);
  box-shadow: var(--work-shadow-lg);
}

.row-actions-menu form {
  display: flex;
}

.row-actions-menu form .action-button--icon,
.row-actions-menu > .action-button--icon,
.row-actions-menu > span.action-button--icon {
  align-self: center;
}

.action-filter { --work-action-icon-url: url("/assets/icons/filter.svg?v=20260714-work-actions-01"); }
.action-search { --work-action-icon-url: url("/assets/icons/search.svg?v=20260829-work-actions-01"); }
.action-link { --work-action-icon-url: url("/assets/icons/link.svg?v=20260829-work-actions-01"); }
.action-remove { --work-action-icon-url: url("/assets/icons/minus.svg?v=20260829-work-actions-01"); }
.action-clear { --work-action-icon-url: url("/assets/icons/filter-off.svg?v=20260714-work-actions-01"); }
.action-refresh,
.action-reset { --work-action-icon-url: url("/assets/icons/refresh.svg?v=20260714-work-actions-01"); }
.action-back { --work-action-icon-url: url("/assets/icons/arrow-left.svg?v=20260714-work-actions-01"); }
.action-export { --work-action-icon-url: url("/assets/icons/file-export.svg?v=20260714-work-actions-01"); }
.action-upload { --work-action-icon-url: url("/assets/icons/upload.svg?v=20260714-work-actions-01"); }
.action-open { --work-action-icon-url: url("/assets/icons/external-link.svg?v=20260714-work-actions-01"); }

@media (forced-colors: active) {
  .action-button::before {
    background: ButtonText;
  }

  .action-button--icon {
    border-color: ButtonText;
  }}

@media (prefers-reduced-motion: reduce) {
  .action-button--icon {
    transition: none;
  }}

/* Shared password field component (assets/js/platform/password-field.js). */
.password-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--work-space-3);
}

.password-field > input[data-password-input] {
  flex: 1 1 auto;
  min-width: 0;
}

.password-toggle {
  flex: 0 0 auto;
  min-height: 0;
  padding: var(--work-space-3) var(--work-space-5);
  color: var(--work-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--work-radius-sm);
  box-shadow: none;
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--work-primary);
  background: color-mix(in srgb, var(--work-primary) 8%, var(--work-surface));
  border-color: color-mix(in srgb, var(--work-primary) 22%, var(--work-border));
  box-shadow: none;
}

.password-strength {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: var(--work-space-4);
}

.password-strength-track {
  flex: 1 1 auto;
  height: 6px;
  background: var(--work-surface-sunken);
  border-radius: var(--work-radius-pill);
  overflow: hidden;
}

.password-strength-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--work-text-muted);
  border-radius: inherit;
  transition: width var(--work-motion-standard) ease;
}

.password-strength[data-score="0"] .password-strength-fill,
.password-strength[data-score="1"] .password-strength-fill {
  background: var(--work-danger);
}

.password-strength[data-score="2"] .password-strength-fill {
  background: var(--work-warning);
}

.password-strength[data-score="3"] .password-strength-fill,
.password-strength[data-score="4"] .password-strength-fill {
  background: var(--work-success);
}

.password-strength-text {
  flex: 0 0 auto;
  min-width: 64px;
  color: var(--work-text-muted);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

.password-match-hint {
  margin: var(--work-space-3) 0 0;
  color: var(--work-danger);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-800);
}

/* Shared toast component for server-side flash messages and workToast.show().
   The body-owned region stays clear of the top bar and persistent page banners. */
.toast-stack {
  position: fixed;
  inset-block-start: auto;
  inset-block-end: var(--work-space-9, 16px);
  inset-inline-end: var(--work-space-9, 16px);
  z-index: var(--work-z-toast, 80);
  display: flex;
  flex-direction: column;
  gap: var(--work-space-5, 8px);
  width: min(420px, calc(100vw - var(--work-space-9, 16px) - var(--work-space-9, 16px)));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--work-space-5, 8px);
  padding: var(--work-space-7, 12px) var(--work-space-9, 16px);
  color: var(--work-text);
  background: var(--work-surface-raised);
  border: 1px solid var(--work-border);
  border-radius: var(--work-radius-md, 14px);
  box-shadow: var(--work-shadow-sm);
  animation: toast-enter var(--work-motion-standard, 200ms) var(--work-ease, ease-out);
  transition: opacity var(--work-motion-fast, 160ms) var(--work-ease, ease-out),
    transform var(--work-motion-fast, 160ms) var(--work-ease, ease-out);
}

.toast::before {
  content: "";
  flex: 0 0 auto;
  width: var(--work-space-5, 8px);
  height: var(--work-space-5, 8px);
  margin-block-start: var(--work-space-4, 6px);
  border-radius: var(--work-radius-pill, 999px);
  background: var(--work-text-muted);
}

.toast--success {
  color: var(--work-success-foreground);
  background: var(--work-success-surface);
  border-color: var(--work-success-border);
}

.toast--success::before {
  background: var(--work-success);
}

.toast--warning {
  color: var(--work-warning-foreground);
  background: var(--work-warning-surface);
  border-color: var(--work-warning-border);
}

.toast--warning::before {
  background: var(--work-warning);
}

.toast--info {
  color: var(--work-info-text);
  background: var(--work-info-surface);
  border-color: var(--work-info-border);
}

.toast--info::before {
  background: var(--work-info);
}

.toast--error {
  color: var(--work-danger-foreground);
  background: var(--work-danger-surface-soft);
  border-color: var(--work-danger-border-subtle);
}

.toast--error::before {
  background: var(--work-danger);
}

/* System confirm dialog: visible icon disc + danger variant (red confirm,
   warning triangle) driven by modal-controls.js resolveConfirmVariant(). */
.system-confirm-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: var(--work-info, #315db8);
  background: var(--work-info-surface, #f2fbfc);
  border: 1px solid var(--work-info-border, #8fd4dc);
  border-radius: 50%;
  font-size: var(--work-text-xl);
  font-weight: var(--work-weight-800);
}
.system-confirm-icon--danger {
  color: var(--work-danger);
  background: var(--work-danger-surface-subtle);
  border-color: var(--work-danger-border-subtle);
}
.system-confirm-card--danger {
  border-color: var(--work-danger-border-subtle);
}

.toast.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(6px);
}

.toast-message {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
}

.toast-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--work-control-height-sm);
  height: var(--work-control-height-sm);
  min-height: 0;
  margin: 0;
  padding: 0;
  color: var(--work-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--work-radius-sm, 10px);
  box-shadow: none;
  cursor: pointer;
}

.toast-close::before {
  content: "×";
  font-size: var(--work-text-base);
  line-height: 1;
}

.toast-close:hover {
  color: var(--work-text);
  background: var(--work-surface-sunken);
}

.toast-close:focus-visible {
  outline: var(--work-focus-ring-width, 3px) solid var(--work-focus-ring);
  outline-offset: 1px;
}

.toast-retry {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding: var(--work-space-2) var(--work-space-6);
  color: var(--work-primary);
  background: transparent;
  border: 1px solid var(--work-border);
  border-radius: var(--work-radius-sm, 10px);
  font-size: var(--work-text-sm);
  font-weight: var(--work-weight-700);
  cursor: pointer;
}

.toast-retry:hover {
  color: var(--work-primary);
  background: var(--work-surface-sunken);
  filter: none;
  transform: none;
  box-shadow: none;
}

.toast-retry:focus-visible {
  outline: var(--work-focus-ring-width, 3px) solid var(--work-focus-ring);
  outline-offset: 1px;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
    transition: none;
  }
}

/* Shared loading components (spinner + skeleton). Loading protocol: nothing is
   shown under ~300ms; skeleton rows when the content shape is known; spinner
   for short unknown waits. Consumers re-theme the spinner through the
   --work-spinner-color / --work-spinner-ring-color hooks, without new rules. */
@keyframes work-spin {
  to {
    transform: rotate(360deg);
  }
}

.work-spinner {
  --work-spinner-color: var(--work-primary);
  --work-spinner-ring-color: color-mix(in srgb, var(--work-spinner-color) 22%, transparent);
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid var(--work-spinner-ring-color);
  border-top-color: var(--work-spinner-color);
  border-radius: 50%;
  animation: work-spin var(--work-motion-spinner, 720ms) linear infinite;
}

@keyframes work-skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.work-skeleton {
  display: block;
  border-radius: var(--work-radius-sm, 10px);
  background: color-mix(in srgb, var(--work-text) 10%, transparent);
  animation: work-skeleton-pulse 1.2s var(--work-ease, ease-in-out) infinite;
}

.work-skeleton--line {
  height: 0.72em;
}

.work-skeleton--circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.work-skeleton--w-40 {
  width: 40%;
}

.work-skeleton--w-60 {
  width: 60%;
}

.work-skeleton--w-80 {
  width: 80%;
}

@media (prefers-reduced-motion: reduce) {
  .work-spinner {
    animation-duration: 1.6s;
  }

  .work-skeleton {
    animation: none;
  }
}

/* sales-quotation-* selectors were moved to modules/sales.css in wave D1 (governance: module styles live in the module stylesheet). */

/* Shared permission-aware Settings tab workspace. Domain forms and panels stay
   in their owning module; only the navigation and interaction states are shared. */
.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--work-space-9);
}

.settings-tabs-list {
  background: var(--work-tab-list-surface);
  border: 1px solid var(--work-tab-list-border);
  border-radius: var(--work-radius-sm);
  display: grid;
  gap: var(--work-space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  padding: var(--work-space-4);
}

.settings-tab {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--work-radius-sm);
  color: var(--work-body-muted);
  cursor: pointer;
  display: inline-flex;
  font-weight: var(--work-weight-800);
  justify-content: center;
  min-height: 2.5rem;
  padding: var(--work-space-7) var(--work-space-8);
  text-align: center;
}

.settings-tab:hover,
.settings-tab:focus-visible {
  background: var(--work-tab-hover-surface);
  border-color: var(--work-tab-hover-border);
  color: var(--work-tab-hover-text);
}

.settings-tab.is-active,
.settings-tab[aria-selected="true"] {
  background: var(--work-tab-active-surface);
  border-color: var(--work-tab-active-border);
  color: var(--work-tab-active-text);
}

.settings-tab-panel {
  border-top: 1px solid var(--work-body-border);
  padding-top: var(--work-space-9);
}

.settings-tabs[data-settings-tabs-enhanced="1"] .settings-tab-panel[hidden] {
  display: none;
}

/* Route-level workspace sub-navigation (server-driven destinations share one
   visual component; in-page JS tab shells reuse the same look). Owned solely
   here — module stylesheets must not redeclare it. */
.work-route-tabs {
  border-block-end: 1px solid var(--work-body-border);
  display: flex;
  gap: var(--work-space-7);
  margin-block-end: var(--work-space-8);
  overflow-x: auto;
}

.work-route-tab {
  border-block-end: 3px solid transparent;
  color: var(--work-body-muted);
  font-weight: var(--work-weight-800);
  padding: var(--work-space-5) var(--work-space-2);
  text-decoration: none;
  white-space: nowrap;
}

.work-route-tab:hover,
.work-route-tab:focus-visible {
  color: var(--work-body-text);
}

.work-route-tab.is-active,
.work-route-tab[aria-selected="true"],
.work-route-tab[aria-current="page"] {
  border-block-end-color: var(--work-primary);
  color: var(--work-primary);
}
