:root {
  color-scheme: light;
  --ink: #1c2430;
  --muted: #657282;
  --line: #d8dee7;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --page: #eef2f6;
  --brand: #0b6b6f;
  --brand-dark: #084e52;
  --accent: #b9472f;
  --good: #1f7a4f;
  --warn: #ad6c11;
  --bad: #b73636;
  --blue: #2f5f9d;
  --text-soft: #344150;
  --text-subtle: #596574;
  --field-disabled: #edf0f3;
  --field-disabled-text: #7d8792;
  --table-head: #f1f5f8;
  --table-head-text: #3a4652;
  --surface-hover: #fbfcfd;
  --brand-soft: #edf7f6;
  --brand-tint: #e4f3f2;
  --brand-tint-strong: #d8edec;
  --brand-status-text: #157080;
  --success-bg: #e9f6ef;
  --success-panel: #f2faf6;
  --success-line: #cfe1d8;
  --success-text: #17613f;
  --warning-bg: #fff3dc;
  --warning-panel: #fffaf0;
  --warning-line: #e4c58f;
  --warning-text: #7a4d0f;
  --danger-bg: #fff0f0;
  --danger-bg-soft: #fff2f2;
  --danger-panel: #fff4f2;
  --danger-panel-strong: #fff3f1;
  --danger-line-soft: #efc6c6;
  --danger-line: #efc6bf;
  --info-bg: #edf3ff;
  --info-panel: #f5f8fe;
  --info-line: #c9d8ee;
  --info-text: #245c9f;
  --bank-bg: #f2eafd;
  --bank-text: #7245a3;
  --modal-backdrop: rgba(20, 30, 38, 0.52);
  --modal-shadow: 0 24px 70px rgba(20, 30, 38, 0.28);
  --teal-shadow: 0 0 0 2px rgba(11, 107, 111, 0.14);
  --action-surface: rgba(244, 251, 249, 0.96);
  --action-line: #b9d4cf;
  --action-shadow: 0 12px 30px rgba(20, 52, 52, 0.14);
  --action-shadow-mobile: 0 10px 22px rgba(20, 52, 52, 0.12);
  --install-bg: #f5faf3;
  --install-line: #cbdcc8;
  --sidebar-bg: #f8fbfa;
  --sidebar-rail: #15383a;
  --sidebar-surface: #ffffff;
  --sidebar-line: #dce8e6;
  --sidebar-line-strong: #c8dcda;
  --sidebar-text: #1f3538;
  --sidebar-text-muted: #516466;
  --sidebar-text-soft: #728184;
  --sidebar-hover: #eef7f5;
  --sidebar-active: #d3f3df;
  --sidebar-active-text: #006f49;
  --sidebar-popover-shadow: 0 14px 30px rgba(20, 52, 52, 0.16);
  --radius: 8px;
  --shadow: 0 14px 42px rgba(24, 34, 48, 0.12);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
}

[hidden] {
  display: none !important;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--page);
}

.auth-card {
  display: grid;
  gap: 22px;
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 180px;
  max-width: 100%;
  height: 70px;
  object-fit: contain;
}

.auth-card h1 {
  margin: 2px 0 6px;
  font-size: clamp(28px, 5vw, 38px);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-error {
  margin: 0;
  border: 1px solid var(--danger-line-soft);
  border-radius: 8px;
  background: var(--danger-bg-soft);
  color: var(--bad);
  padding: 10px 12px;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(11, 107, 111, 0.28);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
  transition: grid-template-columns 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  padding: 22px 18px 20px;
  box-shadow: inset 6px 0 0 var(--sidebar-rail);
  transition: background 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-collapsed .sidebar {
  align-items: center;
  gap: 16px;
  padding: 20px 12px;
}

.sidebar-button {
  margin-top: 7px;
  border: 1px solid var(--sidebar-line-strong);
  border-radius: 8px;
  background: var(--sidebar-surface);
  color: var(--sidebar-text);
  padding: 8px 10px;
  text-align: left;
}

.sidebar-head {
  display: grid;
  align-items: center;
  min-width: 0;
}

.sidebar-collapsed .sidebar-head {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-logo {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 1px solid var(--sidebar-line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--sidebar-text);
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  color: var(--sidebar-text-muted);
  font-size: 13px;
}

.sidebar-note {
  color: var(--sidebar-text-muted);
  font-size: 12px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .brand-logo {
  width: 48px;
  height: 48px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .module-label,
.sidebar-collapsed .module-toggle,
.sidebar-collapsed .sidebar-note span:not(.status-dot),
.sidebar-collapsed .nav-button span,
.sidebar-collapsed .user-menu-trigger strong,
.sidebar-collapsed .user-menu-chevron {
  display: none;
}

.module-label {
  margin-top: 6px;
  margin-bottom: -10px;
  color: var(--sidebar-text-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.module-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: var(--sidebar-surface);
  padding: 10px 11px;
  color: var(--sidebar-text);
  font-size: 15px;
  font-weight: 850;
  text-align: left;
}

.module-chevron {
  transition: transform 160ms ease;
}

.module-toggle.collapsed .module-chevron {
  transform: rotate(-90deg);
}

.field {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .field span {
  color: var(--sidebar-text-muted);
}

.field.compact select,
.field.compact input {
  min-height: 40px;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.month-picker-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  text-align: left;
}

.month-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(20, 30, 38, 0.46);
  padding: 18px;
}

.month-picker-panel {
  display: grid;
  width: min(360px, calc(100vw - 36px));
  aspect-ratio: 1;
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow);
}

.month-picker-header {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.month-picker-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
}

.year-grid,
.month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
}

.year-option,
.month-option {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 800;
}

.year-option:hover,
.month-option:hover,
.month-option.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.month-picker-close {
  align-self: end;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

input:disabled {
  cursor: not-allowed;
  background: var(--field-disabled);
  color: var(--field-disabled-text);
}

.file-input-control {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.native-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field .file-input-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}

.field .file-input-status {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.native-file-input:focus-visible + .file-input-button {
  outline: 3px solid rgba(11, 107, 111, 0.28);
  outline-offset: 2px;
}

.native-file-input:disabled + .file-input-button {
  cursor: not-allowed;
  opacity: 0.58;
}

.field-required input {
  border-color: var(--warning-line);
  box-shadow: 0 0 0 2px rgba(173, 108, 17, 0.14);
}

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

.check-field {
  display: flex;
  gap: 9px;
  align-items: start;
  width: fit-content;
  max-width: 100%;
  color: var(--ink);
  font-weight: 650;
}

.check-field input {
  width: auto;
  margin-top: 4px;
}

.sidebar select {
  border-color: var(--sidebar-line);
}

.nav {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.nav[hidden] {
  display: none;
}

.nav-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text-muted);
  text-align: left;
  padding: 10px 12px;
  font-weight: 760;
  transition: background 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms ease, transform 160ms ease;
}

.nav-button.active,
.nav-button:hover {
  border-color: transparent;
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.nav-button:hover {
  transform: translateX(2px);
}

.nav-icon,
.sidebar-toggle-icon {
  width: 24px;
  height: 24px;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.nav-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-collapsed .nav {
  width: 100%;
  justify-items: center;
}

.sidebar-collapsed .nav-button {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 52px;
  min-height: 52px;
  padding: 0;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  min-width: 0;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-menu {
  position: relative;
  z-index: 4;
  min-width: 0;
}

.sidebar-bottom-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--sidebar-line-strong);
  border-radius: 8px;
  background: var(--sidebar-surface);
  padding: 8px 10px;
  color: var(--sidebar-text);
}

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

.user-icon {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-tint-strong);
  position: relative;
}

.user-icon::before {
  content: "";
  position: absolute;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand-dark);
}

.user-icon::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 13px;
  height: 6px;
  border-radius: 999px 999px 3px 3px;
  background: var(--brand-dark);
}

.user-menu-trigger strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-chevron {
  margin-left: auto;
  color: var(--sidebar-text-soft);
  font-size: 12px;
}

.user-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 100%;
  border: 1px solid var(--sidebar-line-strong);
  border-radius: 8px;
  background: var(--sidebar-surface);
  padding: 8px;
  box-shadow: var(--sidebar-popover-shadow);
}

.user-popover .sidebar-button {
  width: 100%;
  margin-top: 0;
  background: var(--sidebar-hover);
}

.sidebar-collapsed .user-menu {
  position: relative;
  top: auto;
}

.sidebar-collapsed .sidebar-footer {
  width: 100%;
  justify-items: center;
}

.sidebar-collapsed .sidebar-bottom-actions {
  grid-template-columns: 1fr;
  justify-items: center;
  width: 100%;
}

.sidebar-collapsed .user-menu-trigger {
  justify-content: center;
  width: 52px;
  min-height: 52px;
  padding: 0;
}

.sidebar-collapsed .user-popover {
  display: none;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--good);
}

.main {
  min-width: 0;
  padding: var(--space-6) clamp(var(--space-5), 2.2vw, var(--space-7)) var(--space-7);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-5);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.top-actions,
.row-actions,
.signature-actions,
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sidebar-collapse-toggle {
  flex: 0 0 auto;
  line-height: 1;
  color: var(--sidebar-text-muted);
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-collapse-toggle:hover {
  color: var(--brand);
}

.sidebar-collapsed .sidebar-collapse-toggle {
  width: 52px;
  height: 52px;
  padding: 0;
}

.primary-button,
.ghost-button,
.danger-button,
.small-button {
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 750;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button,
.small-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: var(--danger-panel-strong);
  border-color: var(--danger-line);
  color: var(--bad);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.small-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

.content {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.band {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.band-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
}

.collapsible-band > .band-header {
  cursor: pointer;
  list-style: none;
}

.collapsible-band > .band-header::-webkit-details-marker {
  display: none;
}

.collapsible-band > .band-header::after {
  content: "▾";
  flex: 0 0 auto;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  transition: transform 160ms ease;
}

.collapsible-band:not([open]) > .band-header {
  border-bottom: 0;
}

.collapsible-band:not([open]) > .band-header::after {
  transform: rotate(-90deg);
}

.band-body {
  min-width: 0;
  padding: var(--space-5);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.hidden {
  display: none !important;
}

.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));
}

.admin-order-primary-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(230px, 1.35fr) minmax(0, 1fr);
  align-items: start;
}

.admin-order-primary-grid .field,
.admin-order-secondary-grid .field {
  min-height: 0;
}

.admin-order-primary-grid .field > span,
.admin-order-secondary-grid .field > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-order-primary-grid input,
.admin-order-primary-grid select,
.admin-order-primary-grid .month-picker-trigger,
.admin-order-secondary-grid input,
.admin-order-secondary-grid select,
.admin-order-secondary-grid .month-picker-trigger {
  min-height: 42px;
}

.worker-select select {
  overflow: hidden;
  text-overflow: ellipsis;
}

.worker-select small {
  line-height: 1.25;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.kpi strong {
  display: block;
  font-size: 28px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi-link {
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.kpi-link:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px rgba(11, 107, 111, 0.12);
  transform: translateY(-1px);
}

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

.dashboard-action-queue .band-body {
  display: grid;
  gap: var(--space-4);
}

.dashboard-action-queue-compact .band-header {
  align-items: center;
  padding-block: 12px;
}

.dashboard-action-queue-compact .band-header h2 {
  margin-bottom: 5px;
}

.dashboard-action-queue-compact .band-body {
  gap: 10px;
  padding-block: 12px;
}

.dashboard-header-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-month-control {
  display: grid;
  gap: 5px;
  min-width: 172px;
}

.dashboard-month-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-month-control .month-picker-trigger {
  min-height: 34px;
  padding-block: 7px;
}

.dashboard-panel-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-panel-shortcuts-secondary {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.dashboard-panel-tablist {
  display: grid;
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.dashboard-panel-shortcut {
  display: grid;
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  padding: 7px 12px;
  text-align: center;
  transition: background 140ms ease, color 140ms ease;
}

.dashboard-panel-shortcut:last-child {
  border-right: 0;
}

.dashboard-panel-shortcut strong {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.dashboard-panel-shortcut:hover,
.dashboard-panel-shortcut:focus-visible {
  background: var(--panel);
  color: var(--ink);
}

.dashboard-panel-shortcut.active,
.dashboard-panel-shortcut[aria-pressed="true"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.action-queue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: stretch;
}

.action-queue-card {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  height: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: var(--space-4);
  text-align: left;
}

.action-queue-card:first-child {
  min-height: 0;
}

.settings-section-actions {
  justify-content: flex-end;
  margin-bottom: var(--space-4);
}

.action-queue-card span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
}

.action-queue-card strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.action-queue-card:first-child strong {
  font-size: 34px;
}

.action-queue-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-action-queue-compact .action-queue-card {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 86px;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3);
}

.dashboard-action-queue-compact .action-queue-card:first-child {
  min-height: 86px;
}

.dashboard-action-queue-compact .action-queue-card strong {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 38px;
  font-size: 24px;
}

.dashboard-action-queue-compact .action-queue-card:first-child strong {
  font-size: 24px;
}

.dashboard-action-queue-compact .action-queue-card span {
  grid-column: 2;
  align-self: end;
}

.dashboard-action-queue-compact .action-queue-card small {
  grid-column: 2;
}

.action-queue-card:is(button):hover,
.action-queue-card:is(button):focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.action-queue-ok {
  background: var(--success-panel);
}

.action-queue-warn {
  border-color: var(--warning-line);
  background: var(--warning-panel);
}

.action-queue-danger {
  border-color: var(--danger-line);
  background: var(--danger-panel);
}

.action-queue-info {
  border-color: var(--info-line);
  background: var(--info-panel);
}

.report-readiness-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-panel {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border-color: #d4e1e4;
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.dashboard-panel::before {
  content: "";
  display: none;
}

.dashboard-panel:hover {
  border-color: var(--action-line);
  background: var(--surface-hover);
}

.dashboard-panel-expanded {
  grid-column: 1 / -1;
}

.dashboard-panel-back {
  flex: 0 0 auto;
}

.dashboard-panel-controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  gap: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.metric-tile {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #dce6ed;
  border-radius: 8px;
  background: var(--panel-soft);
  color: inherit;
  padding: 11px;
  text-align: left;
}

.metric-tile strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.metric-tile span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.metric-tile small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.metric-tile-link {
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.metric-tile-link:hover,
.metric-tile-link:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dashboard-mini-list,
.dashboard-detail {
  display: grid;
  gap: 8px;
}

.mini-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.mini-order-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.mini-order-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mini-order-row span {
  color: var(--muted);
  font-size: 12px;
}

.compact-empty {
  padding: 12px;
}

.compact-table table {
  min-width: 640px;
}

.segmented-control {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 750;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active,
.segmented-control button:hover {
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.reference-manager {
  container-type: inline-size;
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
}

.reference-manager-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.reference-manager-head h3 {
  margin-bottom: 3px;
  font-size: 16px;
}

.reference-manager-head p {
  margin-bottom: 0;
  font-size: 13px;
}

.reference-manager-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.reference-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: end;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: var(--space-3);
}

.reference-create-form-branch {
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 0.9fr) auto;
}

.reference-list {
  display: grid;
  gap: var(--space-2);
}

.reference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.reference-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.reference-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
}

.reference-row strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.reference-row .small-button {
  justify-self: end;
  white-space: nowrap;
}

.reference-main > span:not(.pill) {
  color: var(--muted);
  font-size: 13px;
}

.reference-note {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

@container (max-width: 460px) {
  .reference-create-form,
  .reference-create-form-branch {
    grid-template-columns: 1fr;
  }

  .reference-create-form .primary-button {
    width: 100%;
  }
}

@container (max-width: 360px) {
  .reference-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .reference-row .small-button {
    justify-self: start;
  }
}

.work-order-controls {
  display: grid;
  overflow: visible;
}

.status-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-4) 0;
}

.status-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 9px 10px;
  font-weight: 750;
}

.status-tab span {
  display: grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 11px;
}

.status-tab.active {
  border-bottom-color: var(--brand);
  color: var(--brand-dark);
}

.status-tab.active span {
  background: #e4f3f2;
  color: var(--brand-dark);
}

.work-order-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto auto;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-4);
}

.search-field {
  min-width: 0;
}

.filter-panel {
  display: grid;
  width: min(780px, 100%);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--modal-shadow);
}

.filter-panel.open {
  display: grid;
}

.filter-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  background: var(--modal-backdrop);
  padding: 56px 18px 24px;
}

.filter-modal-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: start;
  padding-bottom: 8px;
}

.filter-modal-header > div {
  min-width: 0;
  text-align: center;
}

.filter-modal-header h2 {
  margin: 0;
}

.quick-filter-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.filter-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.filter-panel-heading strong {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 850;
}

.filter-panel-heading span {
  color: var(--muted);
  font-size: 12px;
}

.filter-core-grid,
.advanced-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.filter-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.filter-section-title strong {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 850;
}

.filter-section-title span {
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.advanced-filter-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.advanced-filter-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.advanced-filter-section summary::marker {
  color: var(--muted);
}

.advanced-filter-section summary em {
  display: grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-tint-strong);
  color: var(--brand-dark);
  font-size: 11px;
  font-style: normal;
}

.advanced-filter-grid {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.filter-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-panel-actions .primary-button {
  min-width: 132px;
}

.active-filter-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  border-top: 1px solid var(--line);
  margin-top: var(--space-1);
  padding-top: var(--space-3);
}

.active-filter-chips > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--action-line);
  border-radius: 999px;
  background: var(--success-panel);
  color: var(--brand-dark);
  padding: 5px 9px 5px 11px;
  font-size: 12px;
  font-weight: 750;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.filter-chip.active {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.quick-filter {
  min-height: 34px;
  padding-right: 7px;
}

.filter-chip span {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand-tint-strong);
  line-height: 1;
}

.filter-chip .quick-filter-count {
  width: auto;
  min-width: 20px;
  padding: 0 6px;
  color: var(--sidebar-bg);
}

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

.split {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(520px, 1.28fr);
  gap: var(--space-4);
}

.work-results-panel,
.work-detail-panel {
  min-width: 0;
}

.mobile-work-backbar {
  display: none;
}

.order-list,
.job-list {
  display: grid;
  gap: 9px;
}

.order-item,
.job-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  text-align: left;
}

.order-item.active,
.job-item.active {
  border-color: var(--brand);
  box-shadow: var(--teal-shadow);
}

.item-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.muted {
  color: var(--muted);
}

.fine {
  color: var(--muted);
  font-size: 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text-soft);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 750;
}

.pill.good {
  background: var(--success-bg);
  color: var(--good);
}

.pill.warn {
  background: var(--warning-bg);
  color: var(--warn);
}

.pill.bad {
  background: var(--danger-bg);
  color: var(--bad);
}

.pill.blue {
  background: var(--info-bg);
  color: var(--blue);
}

.pill.status-draft {
  background: var(--field-disabled);
  color: var(--text-subtle);
}

.pill.status-assigned {
  background: var(--info-bg);
  color: var(--info-text);
}

.pill.status-in_progress {
  background: var(--brand-tint);
  color: var(--brand-status-text);
}

.pill.status-ready_review {
  background: var(--warning-bg);
  color: var(--warn);
}

.pill.status-ready_bank {
  background: var(--bank-bg);
  color: var(--bank-text);
}

.pill.status-signed {
  background: var(--success-bg);
  color: var(--success-text);
}

.pill.status-completed {
  background: var(--success-bg);
  color: var(--good);
}

.pill.status-closed {
  background: var(--brand-tint-strong);
  color: #31575b;
}

.pill.status-cancelled {
  background: var(--danger-bg);
  color: var(--bad);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--table-head);
  color: var(--table-head-text);
  font-size: 12px;
  text-transform: uppercase;
}

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

.inline-link {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font: inherit;
  font-weight: 750;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: var(--brand-dark);
}

.alert-pill {
  cursor: help;
}

.floating-tooltip {
  position: fixed;
  z-index: 200;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  border: 1px solid var(--warning-line);
  border-radius: 8px;
  background: var(--warning-panel);
  color: var(--ink);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  white-space: pre-line;
  pointer-events: none;
}

.validation-list {
  display: grid;
  gap: 8px;
}

.validation-item {
  display: flex;
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.validation-item.ok::before,
.validation-item.warn::before,
.validation-item.bad::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 999px;
}

.validation-item.ok::before {
  background: var(--good);
}

.validation-item.warn::before {
  background: var(--warn);
}

.validation-item.bad::before {
  background: var(--bad);
}

.signature-pad {
  display: grid;
  gap: 9px;
}

.signature-pad canvas {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.bank-confirmation-record {
  display: grid;
  gap: 12px;
}

.attached-file {
  display: grid;
  gap: 3px;
  border: 1px solid var(--success-line);
  border-radius: 8px;
  background: var(--success-panel);
  padding: 10px 12px;
}

.attached-file span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.offline-confirmation,
.admin-evidence {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.download-menu {
  position: relative;
}

.download-menu summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
}

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

.download-menu summary::after {
  content: "▾";
  margin-left: 9px;
  font-size: 12px;
}

.download-menu-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 8;
  display: grid;
  width: min(310px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.download-menu-panel button {
  display: grid;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
}

.download-menu-panel button:last-child {
  border-bottom: 0;
}

.download-menu-panel button:hover {
  background: var(--panel-soft);
}

.download-menu-panel span {
  color: var(--muted);
  font-size: 12px;
}

.recorded-signature {
  width: min(100%, 320px);
  max-height: 120px;
  object-fit: contain;
  object-position: left center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.photo-thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.photo-thumb.pending {
  border-style: dashed;
  border-color: var(--brand);
}

.photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.file-placeholder {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.photo-meta {
  display: grid;
  gap: 2px;
  padding: 7px 34px 7px 7px;
}

.photo-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.photo-meta small {
  color: var(--brand);
  font-size: 11px;
}

.photo-delete {
  position: absolute;
  right: 6px;
  bottom: 7px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--danger-line);
  border-radius: 6px;
  background: var(--danger-panel);
  color: var(--bad);
  font-size: 18px;
  line-height: 1;
}

.document-logo {
  display: block;
  width: min(230px, 60vw);
  height: auto;
  margin-bottom: 12px;
}

.remito-company-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 16px;
  border-top: 2px solid var(--ink);
  color: var(--muted);
  padding-top: 10px;
  font-size: 12px;
}

.remito-company-footer span:nth-child(even) {
  text-align: right;
}

.managed-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.managed-pill {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--info-line);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
}

.managed-pill span {
  padding: 7px 10px;
}

.managed-pill button {
  align-self: stretch;
  width: 32px;
  border: 0;
  border-left: 1px solid var(--info-line);
  background: #fff;
  color: var(--bad);
  font-size: 18px;
}

.management-list {
  display: grid;
  gap: 9px;
}

.management-row {
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.management-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.management-row > div,
.user-summary {
  display: grid;
  gap: 5px;
}

.user-list {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-list-header,
.user-list-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(92px, 0.8fr) minmax(106px, 0.9fr) minmax(82px, 0.65fr) minmax(98px, 0.9fr) minmax(76px, 0.55fr) minmax(64px, auto);
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
}

.user-list-header {
  border-bottom: 1px solid var(--line);
  background: #f1f5f8;
  color: #3a4652;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.user-list-row {
  border-bottom: 1px solid var(--line);
}

.user-list-row:last-child {
  border-bottom: 0;
}

.user-list-row:hover {
  background: #f8fafc;
}

.user-cell {
  min-width: 0;
  color: #4f5b68;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.user-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.user-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e4f3f2;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 850;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #536170;
  padding: 8px;
}

.icon-button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: #f3fbfa;
}

.dashboard-panel-toggle {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 850;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.user-list-row .icon-button {
  width: auto;
  min-width: 64px;
  padding-inline: 10px;
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(20, 30, 38, 0.52);
  padding: 22px;
}

.user-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 30, 38, 0.28);
}

.download-ready-modal {
  width: min(540px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 30, 38, 0.28);
}

.download-ready-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.download-ready-body p {
  margin-bottom: 0;
}

.download-ready-body a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.download-ready-file {
  display: grid;
  gap: 4px;
  border: 1px solid #cfe1d8;
  border-radius: 8px;
  background: #f2faf6;
  padding: 12px;
}

.download-ready-file span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.download-ready-file strong {
  overflow-wrap: anywhere;
}

.user-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.user-modal-header h2 {
  margin-bottom: 0;
}

.modal-close {
  font-size: 23px;
  line-height: 1;
}

.user-modal-body {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.user-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.user-summary > span {
  color: var(--muted);
  font-size: 13px;
}

.snapshot {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.snapshot-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.snapshot-row > div,
.document-lines {
  display: grid;
  gap: 8px;
}

.read-only-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.read-only-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.read-only-field span,
.list-separator {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.read-only-field strong {
  overflow-wrap: anywhere;
}

.list-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.list-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.task-line-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.installation-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--install-line);
  border-radius: 8px;
  background: var(--install-bg);
  padding: 14px;
}

.equipment-editor {
  display: grid;
  overflow-x: auto;
}

.equipment-editor-header,
.equipment-editor-row {
  display: grid;
  grid-template-columns: 46px repeat(3, minmax(130px, 1fr)) minmax(170px, 1.3fr);
  gap: 8px;
  align-items: center;
  min-width: 710px;
}

.equipment-editor-header {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 4px 6px;
}

.equipment-editor-row {
  border-top: 1px solid var(--success-line);
  padding: 7px 4px;
}

.equipment-editor-row strong {
  text-align: center;
}

.equipment-editor-row input {
  min-height: 38px;
  padding: 8px 9px;
}

.equipment-table table {
  min-width: 660px;
}

.worker-workflow {
  display: grid;
  gap: 16px;
}

.workflow-step {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
}

.workflow-step-title {
  display: flex;
  align-items: start;
  gap: 11px;
}

.workflow-step-title > span {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.workflow-step-title h3,
.workflow-step-title p,
.workflow-submit p {
  margin-bottom: 0;
}

.signature-columns > div {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.evidence-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 11px 12px;
}

.workflow-submit {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--action-line);
  border-radius: 10px;
  background: var(--action-surface);
  padding: 14px 16px;
  box-shadow: var(--action-shadow);
  backdrop-filter: blur(8px);
}

.autosave-indicator {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.autosave-indicator.saved {
  background: var(--success-bg);
  color: var(--good);
}

.task-line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.danger-text {
  color: var(--bad);
}

.danger-text:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-review-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--success-line);
  border-radius: 8px;
  background: var(--success-panel);
  padding: 12px;
}

.workflow-action-rail {
  position: sticky;
  top: 12px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--action-line);
  border-radius: 8px;
  background: var(--brand-soft);
  padding: 14px;
}

.workflow-action-rail span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.workflow-action-rail strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.workflow-action-rail p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.workflow-action-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: max-content;
}

.workflow-readiness {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 5px 9px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.workflow-readiness-ok {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success-text);
}

.workflow-readiness-warn {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.workflow-readiness-bad {
  border-color: var(--danger-line);
  background: var(--danger-panel);
  color: var(--bad);
}

.workflow-action-muted {
  border-color: var(--line);
  background: var(--panel-soft);
}

.workflow-action-muted span {
  color: var(--muted);
}

.grid > .primary-button {
  align-self: end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: #1d2d35;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    gap: 14px;
    padding: 14px;
  }

  .sidebar-collapsed .sidebar {
    align-items: stretch;
    padding: 14px;
  }

  .sidebar-head,
  .sidebar-collapsed .sidebar-head {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .sidebar-collapsed .brand {
    justify-content: flex-start;
  }

  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-button span,
  .sidebar-collapsed .user-menu-trigger strong,
  .sidebar-collapsed .user-menu-chevron {
    display: grid;
  }

  .sidebar-collapsed .module-label,
  .sidebar-collapsed .module-toggle,
  .sidebar-collapsed .sidebar-note span:not(.status-dot) {
    display: block;
  }

  .sidebar-collapsed .sidebar-collapse-toggle {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    overflow-x: auto;
  }

  .nav-button,
  .sidebar-collapsed .nav-button {
    grid-template-columns: 24px minmax(0, 1fr);
    justify-items: start;
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding-inline: 8px;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  .sidebar-collapsed .nav {
    justify-items: stretch;
  }

  .user-menu {
    position: relative;
    top: auto;
  }

  .sidebar-collapsed .user-menu-trigger {
    justify-content: flex-start;
    width: auto;
    min-height: 42px;
    padding: 8px 10px;
  }

  .sidebar-collapsed .user-popover {
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
  }

  .main {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }

  .split,
  .dashboard-grid,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .read-only-grid,
  .kpis {
    grid-template-columns: 1fr;
  }

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

  .action-queue-card:first-child {
    grid-column: 1 / -1;
  }

  .work-order-search,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .work-order-controls.work-detail-mode {
    display: none;
  }

  .work-split.work-list-open .work-detail-panel,
  .work-split.work-detail-open .work-results-panel {
    display: none;
  }

  .work-split.work-detail-open .work-detail-panel > .band-body {
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }

  .mobile-work-backbar {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
    padding: 12px 14px;
  }

  .mobile-work-backbar .ghost-button {
    flex: 0 0 auto;
  }

  .mobile-work-backbar div {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .mobile-work-backbar strong,
  .mobile-work-backbar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-work-backbar span {
    color: var(--muted);
    font-size: 12px;
  }

  .filter-panel {
    grid-column: 1;
  }

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

  .user-list-header {
    display: none;
  }

  .user-list {
    display: grid;
    gap: 10px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .user-list-row {
    grid-template-columns: 1fr 40px;
    gap: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
  }

  .user-cell {
    grid-column: 1;
  }

  .user-cell:not(.user-name-cell)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .user-list-row .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  .user-modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .user-modal-actions > div,
  .user-modal-actions .danger-button {
    width: 100%;
  }

  .workflow-submit {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-submit .primary-button,
  .workflow-action-rail .primary-button {
    width: 100%;
  }

  .workflow-action-rail {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 9;
    align-items: stretch;
    flex-direction: column;
    box-shadow: var(--action-shadow-mobile);
  }

  .workflow-action-stack {
    justify-items: stretch;
    min-width: 0;
  }

  .workflow-readiness {
    width: 100%;
    border-radius: 8px;
    text-align: center;
    white-space: normal;
  }

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

  .app-shell[data-view="dashboard"] .sidebar {
    gap: 9px;
    padding: 10px 12px;
  }

  .app-shell[data-view="dashboard"] .brand {
    gap: 9px;
  }

  .app-shell[data-view="dashboard"] .brand-logo {
    width: 88px;
    height: 36px;
    padding: 4px;
  }

  .app-shell[data-view="dashboard"] .brand span,
  .app-shell[data-view="dashboard"] .module-label,
  .app-shell[data-view="dashboard"] .sidebar-note {
    display: none;
  }

  .app-shell[data-view="dashboard"] .module-toggle {
    min-height: 34px;
    margin-top: 0;
    padding-top: 9px;
    font-size: 14px;
  }

  .app-shell[data-view="dashboard"] .nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(106px, 1fr);
    grid-template-columns: none;
    gap: 6px;
    padding-bottom: 2px;
  }

  .app-shell[data-view="dashboard"] .nav-button {
    min-height: 34px;
    padding: 6px 8px;
  }

  .app-shell[data-view="dashboard"] .user-menu-trigger {
    min-height: 34px;
    padding: 5px 8px;
  }

  .app-shell[data-view="dashboard"] .user-icon {
    width: 22px;
    height: 22px;
  }

  .app-shell[data-view="dashboard"] .main {
    padding-top: 12px;
  }

  .app-shell[data-view="dashboard"] .topbar {
    margin-bottom: 12px;
  }

  .app-shell[data-view="dashboard"] .production-migration-notice {
    display: none;
  }

  .app-shell[data-view="dashboard"] h1 {
    font-size: 24px;
  }

  .app-shell[data-view="dashboard"] .dashboard-action-queue .band-header,
  .app-shell[data-view="dashboard"] .dashboard-action-queue .band-body {
    padding: var(--space-3);
  }

  .app-shell[data-view="dashboard"] .dashboard-action-queue .band-header {
    gap: var(--space-2);
  }

  .app-shell[data-view="dashboard"] .dashboard-action-queue h2 {
    margin-bottom: 6px;
  }

  .app-shell[data-view="dashboard"] .dashboard-action-queue p {
    margin-bottom: 0;
  }

  .app-shell[data-view="dashboard"] .dashboard-month-control {
    min-width: 156px;
  }

  .app-shell[data-view="dashboard"] .action-queue-card {
    padding: var(--space-3);
  }

  .app-shell[data-view="dashboard"] .action-queue-card strong {
    font-size: 26px;
  }
}

@media (max-width: 1160px) and (min-width: 981px) {
  .split {
    grid-template-columns: 1fr;
  }

  .reference-layout {
    grid-template-columns: 1fr;
  }

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

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

  .user-list-header {
    display: none;
  }

  .user-list {
    display: grid;
    gap: 10px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .user-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
  }

  .user-cell {
    grid-column: 1;
  }

  .user-cell:not(.user-name-cell)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .user-list-row .icon-button {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: start;
  }

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

  .top-actions,
  .row-actions,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .mobile-work-backbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mobile-work-backbar .ghost-button {
    width: 100%;
  }

  .band-header {
    flex-direction: column;
  }

  .metric-grid,
  .report-readiness-row,
  .filter-core-grid,
  .advanced-filter-grid,
  .dashboard-panel-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .snapshot-row {
    grid-template-columns: 1fr;
  }

  .reference-manager-head {
    align-items: start;
    flex-direction: column;
  }

  .reference-create-form,
  .reference-create-form-branch {
    grid-template-columns: 1fr;
  }

  .app-shell[data-view="dashboard"] .sidebar {
    padding: 8px 10px;
  }

  .app-shell[data-view="dashboard"] .brand {
    align-items: center;
  }

  .app-shell[data-view="dashboard"] .brand strong {
    font-size: 13px;
  }

  .app-shell[data-view="dashboard"] .module-toggle {
    min-height: 31px;
    font-size: 13px;
  }

  .app-shell[data-view="dashboard"] .nav {
    grid-auto-columns: minmax(88px, 1fr);
  }

  .app-shell[data-view="dashboard"] .nav-button {
    min-height: 32px;
    font-size: 11px;
  }

  .app-shell[data-view="dashboard"] .main {
    padding: var(--space-3) var(--space-3) var(--space-6);
  }

  .app-shell[data-view="dashboard"] .topbar {
    margin-bottom: 10px;
  }

  .app-shell[data-view="dashboard"] .eyebrow {
    margin-bottom: 2px;
  }

  .app-shell[data-view="dashboard"] .dashboard-header-actions,
  .app-shell[data-view="dashboard"] .dashboard-panel-shortcuts {
    gap: 6px;
  }

  .app-shell[data-view="dashboard"] .dashboard-month-control {
    min-width: 100%;
  }

  .app-shell[data-view="dashboard"] .dashboard-panel-shortcuts {
    align-items: stretch;
    justify-content: center;
  }

  .app-shell[data-view="dashboard"] .dashboard-panel-tablist {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell[data-view="dashboard"] .dashboard-panel-shortcut {
    min-width: 0;
    min-height: 44px;
  }

  .app-shell[data-view="dashboard"] .dashboard-panel-shortcut:nth-child(2n) {
    border-right: 0;
  }

  .app-shell[data-view="dashboard"] .dashboard-panel-shortcut:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .app-shell[data-view="dashboard"] .action-queue-grid {
    grid-template-columns: 1fr;
  }

  .app-shell[data-view="dashboard"] .action-queue-card {
    gap: var(--space-2);
  }
}

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