:root {
  color-scheme: light;
  --ink: #1d2430;
  --muted: #667085;
  --soft: #8a94a6;
  --line: #d9e0ea;
  --line-soft: #edf1f6;
  --panel: #ffffff;
  --surface: #f5f7fa;
  --surface-strong: #eef3f7;
  --accent: #147d8f;
  --accent-strong: #0f6575;
  --accent-soft: #e7f5f7;
  --accent-line: #b9e1e7;
  --success: #1f7a4d;
  --success-soft: #e8f6ee;
  --danger: #b42318;
  --danger-soft: #fcebea;
  --warning: #9b5a10;
  --warning-soft: #fff4df;
  --shadow-soft: 0 16px 40px rgba(31, 41, 55, 0.08);
  --sidebar-surface: #fbfcfe;
  --control-surface: #ffffff;
  --topbar-surface: rgba(255, 255, 255, 0.92);
  --table-heading: #f9fbfd;
  --table-heading-text: #5f6b7a;
  --row-alt: #fcfdff;
  --row-hover: #f2fbfc;
  --row-active: #e4f4f7;
  --resizer-surface: #f8fafc;
  --resizer-strong: #c5cfdd;
  --chart-grid: #e8edf3;
  --chart-axis-line: #cfd8e3;
  --chart-axis-text: #667085;
  --chart-value-text: #344054;
  --chart-point: #ffffff;
  --chart-bar: #9fb5c3;
  --chart-bar-pending: #9aa7b8;
  --pdf-shell: #555f6d;
  --pdf-viewer-surface: #eef2f6;
  --neutral-pill-text: #475467;
  --neutral-pill: #eef2f6;
  --confidence-medium: #f6d365;
  --confidence-low: #f5b5ae;
  --confidence-pending: #98a2b3;
  --approval-resizer-grip: #8aa1b5;
  --modal-backdrop: rgba(29, 36, 48, 0.46);
  --skeleton: linear-gradient(90deg, #eef2f6 0%, #f8fafc 45%, #eef2f6 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef4fb;
  --muted: #a9b5c5;
  --soft: #7f8ea1;
  --line: #334155;
  --line-soft: #233044;
  --panel: #111827;
  --surface: #0b1120;
  --surface-strong: #182235;
  --accent: #3fb7c9;
  --accent-strong: #79d7e4;
  --accent-soft: #0f3440;
  --accent-line: #2d6875;
  --success: #6bd89d;
  --success-soft: #123725;
  --danger: #ff8d86;
  --danger-soft: #451b1f;
  --warning: #f5bd5b;
  --warning-soft: #3c2b12;
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.34);
  --sidebar-surface: #0f172a;
  --control-surface: #151f2f;
  --topbar-surface: rgba(15, 23, 42, 0.94);
  --table-heading: #182235;
  --table-heading-text: #b8c4d4;
  --row-alt: #131d2c;
  --row-hover: #113642;
  --row-active: #123f4c;
  --resizer-surface: #111827;
  --resizer-strong: #526175;
  --chart-grid: #27364b;
  --chart-axis-line: #3a4a61;
  --chart-axis-text: #a9b5c5;
  --chart-value-text: #dce7f3;
  --chart-point: #0b1120;
  --chart-bar: #6f8297;
  --chart-bar-pending: #7d8da0;
  --pdf-shell: #070b12;
  --pdf-viewer-surface: #172033;
  --neutral-pill-text: #c2ccda;
  --neutral-pill: #273449;
  --confidence-medium: #d6a43d;
  --confidence-low: #c87178;
  --confidence-pending: #7d8da0;
  --approval-resizer-grip: #7488a0;
  --modal-backdrop: rgba(3, 7, 18, 0.72);
  --skeleton: linear-gradient(90deg, #162235 0%, #223149 45%, #162235 100%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
}

a {
  color: inherit;
}

body.review-open,
body.review-page {
  overflow: hidden;
}

.app-shell {
  --sidebar-width: 236px;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 8px minmax(0, 1fr);
  background: var(--surface);
}

.app-sidebar {
  min-width: 0;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar-surface);
}

.sidebar-resizer {
  position: relative;
  z-index: 5;
  min-width: 8px;
  border-right: 1px solid var(--line);
  background: var(--resizer-surface);
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 52px;
  border-radius: 999px;
  background: var(--resizer-strong);
  transform: translate(-50%, -50%);
}

.sidebar-resizer:hover,
.sidebar-resizer:focus-visible,
.sidebar-resizer.active {
  outline: none;
  background: var(--accent-soft);
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.sidebar-resizer.active::after {
  background: var(--accent);
}

.app-shell.sidebar-compact .sidebar-brand span:last-child,
.app-shell.sidebar-compact .sidebar-link span,
.app-shell.sidebar-compact .nav-group-label {
  display: none;
}

.app-shell.sidebar-compact .app-sidebar {
  padding-inline: 10px;
}

.app-shell.sidebar-compact .sidebar-link {
  justify-content: flex-start;
}

.sidebar-brand-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-brand {
  min-height: 44px;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 15px;
}

.sidebar-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-nav {
  margin-top: 30px;
  display: grid;
  gap: 6px;
}

.nav-group-label {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-label.secondary {
  margin-top: 18px;
}

.sidebar-link,
.sidebar-utility {
  min-height: 38px;
  width: 100%;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.sidebar-link span {
  width: 28px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sidebar-link strong,
.sidebar-utility {
  font-size: 13px;
  font-weight: 750;
}

.sidebar-link:hover,
.sidebar-link.active,
.sidebar-utility:hover {
  border-color: var(--accent-line);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.sidebar-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
}

.sidebar-utility {
  justify-content: space-between;
}

.sidebar-utility.subtle {
  color: var(--muted);
}

.sidebar-version {
  margin-top: 8px;
  padding: 8px 9px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--soft);
  font-size: 10px;
  line-height: 1.35;
}

.sidebar-version span,
.sidebar-version strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-version strong {
  margin-top: 1px;
  color: var(--muted);
  font-weight: 850;
}

.backend-status {
  min-width: 0;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 10px;
  line-height: 1.35;
}

#backendStatusLight {
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: 0 0 0 3px var(--line-soft);
}

.backend-status.healthy {
  border-color: rgba(31, 122, 77, 0.35);
  background: var(--success-soft);
}

.backend-status.healthy #backendStatusLight {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.16);
}

.backend-status.error {
  border-color: rgba(180, 35, 24, 0.34);
  background: var(--danger-soft);
}

.backend-status.error #backendStatusLight {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.backend-status-copy {
  min-width: 0;
}

.backend-status-copy strong,
.backend-status-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backend-status-copy strong {
  color: var(--ink);
  font-weight: 850;
}

.backend-status-copy span {
  margin-top: 1px;
  color: var(--muted);
}

.app-workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
  min-height: 76px;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto minmax(172px, 1fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-surface);
}

body[data-workflow-view="apiQueue"] .topbar {
  display: none;
}

body[data-workflow-view="spreadsheetQueue"] .topbar {
  display: none;
}

.topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.page-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.approval-summary-card {
  justify-self: center;
  min-height: 50px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.approval-summary-person {
  min-width: 112px;
  padding-right: 12px;
  border-right: 1px solid var(--line-soft);
}

.approval-summary-person .eyebrow {
  margin-bottom: 1px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.approval-summary-person strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.approval-manager-picker,
.dashboard-queue-picker {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.approval-manager-picker select,
.dashboard-queue-picker select {
  min-height: 34px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 13px;
  font-weight: 750;
  text-transform: none;
}

.dashboard-queue-picker {
  min-width: 220px;
}

.approval-summary-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, auto));
  align-items: center;
  gap: 8px;
}

.approval-summary-stats div {
  min-width: 48px;
}

.approval-summary-stats dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.approval-summary-stats dd {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

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

.workflow-switcher {
  display: none;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-switch {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background 160ms ease, border-color 160ms ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--control-surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform 160ms ease, background 160ms ease;
}

.theme-switch input:checked + .theme-switch-track {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  transform: translateX(20px);
  background: var(--accent);
}

.theme-switch input:focus-visible + .theme-switch-track {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

.sidebar-theme-switch {
  min-height: 30px;
  flex: 0 0 auto;
  cursor: pointer;
}

.sidebar-theme-switch .theme-switch-track {
  width: 38px;
  height: 22px;
  flex-basis: 38px;
}

.sidebar-theme-switch .theme-switch-thumb {
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
}

.sidebar-theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
  transform: translateX(16px);
}

.sidebar-theme-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.workflow-switcher select,
.compact-filter select,
.assignment-select,
.dialog-content select {
  min-height: 36px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-weight: 700;
}

.topbar-link,
.icon-button,
.open-attachment,
.secondary-attachment {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.topbar-link,
.icon-button,
.secondary-attachment {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--control-surface);
}

.topbar-link:hover,
.icon-button:hover,
.secondary-attachment:hover {
  border-color: var(--accent-line);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.open-attachment {
  border: 1px solid var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.open-attachment:hover {
  background: var(--accent-strong);
}

.open-attachment:disabled,
.secondary-attachment:disabled {
  opacity: 0.55;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workflow-layer {
  min-height: 0;
}

.mail-layout {
  --triage-inbox-width: minmax(280px, 0.92fr);
  --triage-reading-width: minmax(380px, 1.34fr);
  --triage-attachments-width: minmax(320px, 1fr);
  flex: 1;
  display: grid;
  grid-template-columns:
    var(--triage-inbox-width)
    8px
    var(--triage-reading-width)
    8px
    var(--triage-attachments-width);
  overflow: hidden;
}

.workflow-page {
  flex: 1;
  overflow: auto;
}

.pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.attachments-pane {
  border-right: 0;
}

.pane-header,
.message-header,
.view-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.inbox-pane > .pane-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.pane-header p,
.message-header p,
.view-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.triage-message-filter {
  min-width: 138px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.triage-message-search {
  padding: 0 14px 10px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.triage-message-filter select {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 12px;
}

.triage-message-search input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 13px;
}

.triage-message-search input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pane-header.compact {
  min-height: 38px;
  padding: 5px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.pane-header.compact h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
}

.pane-header.compact p {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-pane-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.pane-collapse-button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent-strong);
  background: var(--control-surface);
  font-size: 11px;
  font-weight: 800;
}

.pane-collapse-button:hover,
.pane-collapse-button:focus-visible {
  outline: none;
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.pane-collapse-button:disabled {
  color: var(--soft);
  background: var(--surface);
  cursor: not-allowed;
}

.view-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.message-list,
.attachment-list,
.approval-attachment-list {
  min-height: 0;
  overflow: auto;
}

.message-list {
  flex: 1;
}

.message-row {
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.message-row:hover,
.message-row.active {
  background: var(--accent-soft);
}

.message-summary {
  width: 100%;
  padding: 13px 14px 8px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.message-summary strong {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.25;
}

.message-summary strong .status-dot {
  display: inline-block;
}

.message-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inbox-assignment {
  padding: 0 14px 10px;
  display: grid;
  grid-template-columns: 112px minmax(120px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.assignment-suggestion-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}

.assignment-select {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
}

.assignment-select.has-suggestion {
  border-color: color-mix(in srgb, var(--success) 46%, var(--border));
  background: color-mix(in srgb, var(--success) 16%, var(--control-surface));
}

.assignment-suggestion-button {
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--success) 45%, var(--border));
  border-radius: 7px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.assignment-suggestion-button:hover,
.assignment-suggestion-button:focus-visible {
  background: color-mix(in srgb, var(--success) 18%, transparent);
}

.assignment-submit {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.checkbox-row input {
  accent-color: var(--accent);
}

.inbox-assignment.submitted .assignment-submit {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
  color: var(--success);
}

.assignment-submit:disabled {
  opacity: 0.5;
}

.message-header h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.message-body,
.approval-message-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  background: var(--panel);
  font-size: 13px;
  line-height: 1.5;
}

.approval-invoice-detail {
  flex: 0 0 auto;
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.approval-invoice-detail.empty-state {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.approval-detail-section {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.approval-detail-section h3 {
  margin-bottom: 8px;
}

.approval-detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.approval-detail-grid div {
  min-width: 0;
}

.approval-detail-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.approval-detail-grid dd {
  margin: 2px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.message-body img,
.approval-message-body img {
  max-width: 100%;
  height: auto;
}

.approval-attachment-list {
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.attachment-button {
  width: auto;
  max-width: 280px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  text-align: left;
}

.attachment-button:hover,
.attachment-button.active {
  background: var(--accent-soft);
}

.attachment-button strong,
.attachment-button span,
.approval-grid-row strong,
.approval-grid-row span,
.data-table td strong,
.data-table td span {
  display: block;
}

.attachment-button strong {
  overflow: hidden;
  max-width: 210px;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-button span,
.data-table td span,
.approval-grid-row span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-button span {
  font-size: 10px;
  line-height: 1;
}

.attachment-actions {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.attachment-preview,
.approval-attachment-preview {
  flex: 1;
  min-height: 260px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--resizer-surface);
}

.approval-attachment-preview {
  padding: 12px;
  overflow: auto;
  background: #2a2a2a;
}

.approval-pdf-page {
  max-width: 100%;
  height: auto;
  margin: 0 auto 14px;
  display: block;
  background: #ffffff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.22);
}

.approval-pdf-status {
  margin: 0;
  padding: 14px;
  color: #d0d5dd;
  font-size: 13px;
}

.approval-pdf-status.error {
  color: #f8b4ad;
}

.match-panel {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.match-panel h2,
.llm-finding h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-panel dl,
.llm-finding dl {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 13px;
}

.match-panel dt,
.llm-finding dt {
  color: var(--muted);
}

.match-panel dd,
.llm-finding dd {
  margin: 0;
  font-weight: 750;
}

.match-reason {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.llm-finding {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dashboard-overview {
  padding-bottom: 24px;
}

.metrics-grid,
.analytics-grid,
.table-panel {
  margin: 16px 18px 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.dashboard-card,
.chart-panel,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.02);
}

.dashboard-card {
  min-height: 124px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.metric-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

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

.metric-card.success {
  border-color: #c8ead8;
}

.metric-card.warning {
  border-color: #f0d5a9;
}

.metric-card.accent {
  border-color: var(--accent-line);
}

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

.chart-panel {
  min-width: 0;
  padding: 14px;
}

.panel-heading {
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.chart-frame {
  min-height: 246px;
}

.business-chart {
  width: 100%;
  min-height: 246px;
}

.chart-grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--chart-axis-line);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--chart-axis-text);
  font-size: 11px;
  font-weight: 700;
}

.chart-value {
  fill: var(--chart-value-text);
  font-size: 11px;
  font-weight: 800;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--chart-point);
  stroke: var(--accent);
  stroke-width: 3;
}

.chart-bar {
  fill: var(--chart-bar);
}

.chart-bar.pending {
  fill: var(--chart-bar-pending);
}

.chart-bar.approved {
  fill: var(--success);
}

.chart-bar.rejected {
  fill: var(--danger);
}

.table-panel {
  overflow: hidden;
}

.table-panel-header {
  padding: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

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

.table-search,
.compact-filter,
.job-search,
.dialog-content label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.table-search {
  width: min(330px, 34vw);
}

.table-search input,
.job-search input,
.dialog-content input,
.dialog-content textarea,
.login-panel input,
.authorized-user-form input,
.approval-row-comment {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 13px;
}

.table-search input:focus,
.job-search input:focus,
.dialog-content input:focus,
.dialog-content textarea:focus,
.dialog-content select:focus,
.login-panel input:focus,
.authorized-user-form input:focus,
.approval-row-comment:focus,
.assignment-select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.popover-wrap {
  position: relative;
}

.account-menu-wrap {
  position: relative;
}

.columns-popover,
.account-menu {
  position: absolute;
  z-index: 20;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.columns-popover {
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  display: grid;
  gap: 8px;
}

.columns-popover label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.account-menu {
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 170px;
}

.account-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 750;
  text-align: left;
}

.account-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.selection-toolbar {
  min-height: 48px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--accent-line);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.data-table-wrap {
  overflow: auto;
}

.data-table,
.jobs-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 13px;
}

.data-table th,
.data-table td,
.jobs-table th,
.jobs-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
}

.data-table th,
.jobs-table th {
  color: var(--table-heading-text);
  background: var(--table-heading);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table th button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-transform: inherit;
}

.data-table th[data-sort="asc"] button::after {
  content: " ↑";
}

.data-table th[data-sort="desc"] button::after {
  content: " ↓";
}

.data-table tr:hover td,
.jobs-table tr:hover td {
  background: var(--accent-soft);
}

.select-column {
  width: 42px;
}

.table-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.table-pagination {
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.api-queue-page {
  min-height: 0;
  padding: 8px 10px 10px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.spreadsheet-queue-page {
  min-height: 0;
  padding: 0;
  display: grid;
  overflow: hidden;
}

.spreadsheet-queue-page iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.api-queue-header {
  min-width: 0;
  min-height: 50px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: minmax(150px, .46fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.api-queue-title {
  min-width: 0;
}

.api-queue-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.api-queue-header .eyebrow,
.api-queue-header h2 + p {
  display: none;
}

.api-queue-refresh {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.api-queue-refresh span {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-refresh .icon-button,
.api-queue-refresh .secondary-attachment {
  min-height: 28px;
  padding-inline: 8px;
  font-size: 11px;
}

.api-queue-cards {
  min-width: 0;
  margin-top: 0;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.api-queue-card {
  min-width: 0;
  min-height: 44px;
  flex: 1 1 0;
  padding: 5px 6px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.api-queue-card-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 900;
}

.api-queue-card > div:last-child {
  min-width: 0;
}

.api-queue-card strong,
.api-queue-card b,
.api-queue-card span {
  display: block;
}

.api-queue-card strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-card b {
  margin-top: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.api-queue-card span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--soft);
  font-size: 8px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-card.blue,
.api-queue-status.blue,
.api-queue-group.blue td {
  color: var(--accent-strong);
}

.api-queue-card.green,
.api-queue-status.green,
.api-queue-group.green td {
  color: var(--success);
}

.api-queue-card.red,
.api-queue-status.red,
.api-queue-group.red td {
  color: var(--danger);
}

.api-queue-card.orange,
.api-queue-status.orange,
.api-queue-group.orange td {
  color: var(--warning);
}

.api-queue-controls {
  min-width: 0;
  min-height: 42px;
  margin-top: 0;
  padding: 4px;
  display: grid;
  grid-template-columns: minmax(82px, .75fr) minmax(150px, 1.45fr) minmax(78px, .72fr) minmax(92px, .85fr) auto minmax(180px, 1.6fr) auto;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.api-queue-controls label {
  min-width: 0;
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.api-queue-controls select,
.api-queue-controls input {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 12px;
}

.api-queue-controls > button {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 11px;
  white-space: nowrap;
}

.api-queue-controls label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.api-queue-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.api-queue-table-panel {
  grid-column: 1 / -1;
  min-height: 0;
  margin-top: 0;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.api-queue-table-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}

.api-queue-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.api-queue-table th,
.api-queue-table td {
  overflow: hidden;
  padding: 7px 6px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--table-heading-text);
  background: var(--table-heading);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  white-space: normal;
}

.api-queue-table td {
  white-space: nowrap;
}

.api-queue-table th.filter-open {
  z-index: 4;
}

.api-queue-table th.api-queue-filter-heading {
  padding: 0;
  overflow: visible;
}

.api-queue-filter-wrap {
  position: relative;
}

.api-queue-filter-button {
  width: 100%;
  min-height: 50px;
  padding: 8px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: none;
}

.api-queue-filter-button:hover,
.api-queue-filter-button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.api-queue-filter-button b {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
}

.api-queue-filter-button span {
  min-width: 0;
  line-height: 1.15;
}

.api-queue-filter-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 4px;
  width: 250px;
  padding: 8px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  text-transform: none;
}

.api-queue-filter-search {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 12px;
}

.api-queue-filter-options {
  max-height: 230px;
  overflow: auto;
  display: grid;
  gap: 2px;
}

.api-queue-filter-option {
  min-height: 28px;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.api-queue-filter-option:hover {
  background: var(--accent-soft);
}

.api-queue-filter-option input {
  accent-color: var(--accent);
}

.api-queue-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-filter-option.select-all {
  border-bottom: 1px solid var(--line-soft);
  border-radius: 6px 6px 0 0;
}

.api-queue-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.api-queue-filter-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 12px;
  font-weight: 800;
}

.api-queue-filter-actions button[type="submit"] {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.api-queue-table td strong,
.api-queue-table td span {
  display: block;
}

.api-queue-table td span {
  color: var(--muted);
  font-size: 11px;
}

.api-queue-action-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.api-queue-submit-button {
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--success);
  border-radius: 7px;
  color: #ffffff;
  background: var(--success);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.api-queue-submit-button:hover,
.api-queue-submit-button:focus-visible {
  filter: brightness(1.05);
}

.api-queue-data-row {
  transition: background-color .12s ease, box-shadow .12s ease;
  cursor: default;
}

.api-queue-data-row:hover td {
  background: color-mix(in srgb, var(--accent-soft) 34%, transparent);
}

.api-queue-data-row.selected td {
  background: color-mix(in srgb, var(--accent-soft) 58%, transparent);
}

.api-queue-data-row.selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.api-queue-data-row:focus-visible td {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.api-queue-pm-link {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.api-queue-pm-link:hover,
.api-queue-pm-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.api-queue-assignment-select {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  font: inherit;
}

.api-queue-assignment-select.wide {
  min-width: 0;
}

.api-queue-table td:has(.api-queue-project-picker) {
  overflow: visible;
}

.api-queue-project-picker {
  position: relative;
  width: 100%;
  min-width: 0;
}

.api-queue-project-picker-button {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.api-queue-project-picker-button span {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-project-picker-button b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.api-queue-project-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  width: min(360px, 70vw);
  padding: 7px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.api-queue-project-picker-search {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  font: inherit;
}

.api-queue-project-picker-sort {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-strong);
}

.api-queue-project-picker-sort-button {
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.api-queue-project-picker-sort-button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--accent);
}

.api-queue-project-picker-options {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 2px;
}

.api-queue-project-picker-option {
  min-width: 0;
  min-height: 34px;
  padding: 5px 6px;
  display: grid;
  grid-template-columns: minmax(52px, max-content) minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.api-queue-project-picker-option:hover,
.api-queue-project-picker-option:focus-visible,
.api-queue-project-picker-option[aria-selected="true"] {
  background: var(--accent-soft);
}

.api-queue-project-picker-option strong,
.api-queue-project-picker-option span {
  min-width: 0;
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-queue-project-picker-option strong {
  font-size: 12px;
  font-weight: 900;
}

.api-queue-project-picker-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.api-queue-project-picker-empty {
  padding: 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.api-queue-group td {
  background: var(--surface-strong);
  font-weight: 900;
}

.api-queue-group-toggle {
  width: 100%;
  min-height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.api-queue-group-toggle:hover,
.api-queue-group-toggle:focus-visible {
  color: var(--accent-strong);
}

.api-queue-group-caret,
.api-queue-group-label,
.api-queue-group-count {
  display: inline;
}

.api-queue-group-caret {
  width: 14px;
  color: var(--muted);
  text-align: center;
}

.api-queue-group-count {
  color: var(--muted);
}

.api-queue-group.collapsed td {
  border-bottom-color: var(--line);
}

.api-queue-more td {
  color: var(--accent-strong);
  background: var(--accent-soft);
  text-align: center;
  font-weight: 850;
}

.api-queue-more button {
  width: 100%;
  min-height: 30px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.api-queue-more button:hover,
.api-queue-more button:focus-visible {
  text-decoration: underline;
}

.api-queue-button-cell {
  text-align: center;
}

.api-queue-icon-button {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
}

.api-queue-icon-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.api-queue-icon-button.has-notes {
  border-color: color-mix(in srgb, var(--accent) 78%, white);
  background: color-mix(in srgb, var(--accent) 28%, var(--control-surface));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
}

.api-queue-icon-button.has-pm-response {
  border-color: color-mix(in srgb, #fb7185 78%, white);
  background: color-mix(in srgb, #fb7185 30%, var(--control-surface));
  color: #fecdd3;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fb7185 42%, transparent);
}

.api-queue-icon-button:disabled {
  color: var(--soft);
  opacity: .45;
}

.api-queue-icon-button.has-multi-invoice::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #1d8cff;
  box-shadow: 0 0 0 2px var(--control-surface);
}

.api-queue-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
}

.api-queue-status[title] {
  cursor: help;
  text-decoration: underline dotted currentColor;
  text-underline-offset: 3px;
}

.pm-queue-page {
  padding: 10px 18px 24px;
  overflow: auto;
}

.pm-queue-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pm-queue-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.pm-queue-toolbar select {
  min-width: 190px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-surface);
}

.pm-queue-cards {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.pm-queue-card {
  min-height: 82px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.pm-queue-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid currentColor;
  font-size: 18px;
  font-weight: 900;
}

.pm-queue-card strong,
.pm-queue-card b,
.pm-queue-card span {
  display: block;
}

.pm-queue-card strong {
  color: var(--muted);
  font-size: 11px;
}

.pm-queue-card b {
  margin-top: 2px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pm-queue-card span {
  margin-top: 5px;
  color: var(--soft);
  font-size: 11px;
}

.pm-queue-card.blue,
.pm-queue-status.blue,
.pm-queue-group.blue td {
  color: var(--accent-strong);
}

.pm-queue-card.orange,
.pm-queue-status.orange,
.pm-queue-group.orange td {
  color: var(--warning);
}

.pm-queue-card.purple,
.pm-queue-status.purple,
.pm-queue-group.purple td {
  color: #c58bff;
}

.pm-queue-card.green,
.pm-queue-status.green,
.pm-queue-group.green td {
  color: var(--success);
}

.pm-queue-snapshot {
  width: min(380px, 100%);
  margin-top: 16px;
}

.pm-queue-snapshot h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 13px;
}

.pm-queue-snapshot h3 span {
  color: var(--muted);
  font-size: 11px;
}

.pm-queue-snapshot table,
.pm-queue-table {
  width: 100%;
  border-collapse: collapse;
}

.pm-queue-snapshot th,
.pm-queue-snapshot td {
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  font-size: 11px;
  text-align: left;
}

.pm-queue-snapshot th {
  color: var(--muted);
  font-weight: 850;
}

.pm-queue-manager-link {
  color: var(--accent);
  font-weight: 850;
  text-decoration: none;
}

.pm-queue-manager-link:hover,
.pm-queue-manager-link:focus {
  color: var(--accent-strong);
  text-decoration: underline;
  outline: none;
}

.pm-queue-you {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #d8f2ff;
  background: #0e6fc9;
  font-size: 10px;
  font-weight: 850;
}

.pm-queue-table-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  min-height: 420px;
}

.pm-queue-bulk-toolbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent-soft) 26%, var(--panel));
}

.pm-queue-bulk-toolbar[hidden] {
  display: none;
}

.pm-queue-bulk-toolbar strong {
  margin-right: auto;
  color: var(--ink);
  font-size: 13px;
}

.pm-queue-grid {
  width: 100%;
  height: min(620px, calc(100vh - 374px));
  min-height: 420px;
}

.pm-queue-page .tabulator {
  height: 100%;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
}

.pm-queue-page .tabulator .tabulator-header {
  border-color: var(--line);
  color: var(--table-heading-text);
  background: var(--table-heading);
  font-weight: 750;
}

.pm-queue-page .tabulator .tabulator-header .tabulator-col {
  border-color: var(--line);
  color: var(--table-heading-text);
  background: var(--table-heading);
}

.pm-queue-page .tabulator .tabulator-row {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel);
}

.pm-queue-page .tabulator .tabulator-row:nth-child(even) {
  background: var(--row-alt);
}

.pm-queue-page .tabulator .tabulator-row:hover {
  background: var(--row-hover);
}

.pm-queue-page .tabulator .tabulator-row.pm-row-selected,
.pm-queue-page .tabulator .tabulator-row.pm-row-selected:hover {
  background: var(--row-active);
}

.pm-queue-page .tabulator .tabulator-cell {
  border-color: var(--line-soft);
}

.pm-queue-page .tabulator .tabulator-cell[tabulator-field="_select"] {
  display: inline-grid;
  place-items: center;
  padding-block: 4px;
}

.pm-queue-page .tabulator input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
}

.pm-queue-page .tabulator .tabulator-group {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 850;
}

.pm-queue-open-actions {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pm-queue-icon-button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.pm-queue-icon-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.pm-queue-table-scroll {
  overflow: auto;
}

.pm-queue-table {
  min-width: 1360px;
  font-size: 12px;
}

.pm-queue-table th,
.pm-queue-table td {
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  white-space: nowrap;
}

.pm-queue-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--table-heading-text);
  background: var(--table-heading);
  font-size: 10px;
  font-weight: 850;
}

.pm-queue-table td strong,
.pm-queue-table td span {
  display: block;
}

.pm-queue-table td span {
  color: var(--muted);
  font-size: 11px;
}

.pm-queue-group td {
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 900;
}

.pm-queue-days {
  text-align: center;
  font-weight: 900;
}

.pm-queue-money {
  text-align: right;
}

.pm-queue-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
}

.pm-queue-action-control {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 32px;
  align-items: center;
  gap: 7px;
}

.pm-queue-action {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--control-surface);
  font-size: 12px;
  font-weight: 750;
}

.pm-queue-action:hover,
.pm-queue-action:focus {
  border-color: var(--accent);
  outline: none;
}

.pm-queue-action-submit {
  width: 32px;
  height: 30px;
  min-width: 32px;
  min-height: 30px;
}

.pm-queue-action-submit svg {
  width: 15px;
  height: 15px;
}

.pm-queue-lock {
  display: block;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
}

.pm-invoice-review-dialog,
.pm-queue-bulk-dialog {
  width: min(780px, 100%);
}

.pm-invoice-review-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pm-invoice-review-content {
  max-height: calc(100vh - 170px);
  overflow: auto;
}

.pm-invoice-review-details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pm-invoice-review-details div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.pm-invoice-review-details dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.pm-invoice-review-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.table-pagination > div {
  display: flex;
  gap: 8px;
}

.approval-layout {
  --approval-grid-height: 214px;
  flex: 1;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.approval-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.approval-grid-wrap {
  --approval-grid-cols:
    116px
    minmax(300px, 1.8fr)
    92px
    104px
    96px
    104px
    minmax(170px, 0.9fr)
    100px;
  flex: 0 0 var(--approval-grid-height);
  min-height: 86px;
  max-height: none;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  background: var(--resizer-surface);
}

.approval-grid-row {
  width: 100%;
  min-width: 1080px;
  display: grid;
  grid-template-columns: var(--approval-grid-cols);
  align-items: center;
}

.approval-grid-body .approval-grid-row {
  cursor: pointer;
}

.approval-grid-body .approval-grid-row:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: -2px;
}

.approval-grid-row > div {
  position: relative;
  min-width: 0;
  min-height: 30px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 12px;
}

.approval-grid-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--table-heading);
  color: var(--table-heading-text);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.approval-grid-header > div {
  min-height: 30px;
  padding-top: 7px;
  padding-bottom: 7px;
  justify-content: flex-start;
  text-align: left;
  color: inherit;
  font-size: inherit;
}

.approval-grid-body .approval-grid-row > div {
  background: var(--panel);
}

.approval-grid-body .approval-grid-row:nth-child(even) > div {
  background: var(--row-alt);
}

.approval-grid-body .approval-grid-row:hover > div {
  background: var(--row-hover);
}

.approval-grid-body .approval-grid-row.active > div,
.approval-grid-body .approval-grid-row.active:hover > div {
  background: var(--row-active);
  border-top: 1px solid var(--accent-line);
  border-bottom: 1px solid var(--accent-line);
}

.approval-grid-body .approval-grid-row.active > div:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.approval-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 4;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.approval-column-resizer::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 3px;
  bottom: 6px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.approval-column-resizer:hover::after,
.approval-column-resizer:focus-visible::after,
.approval-column-resizer.active::after {
  background: var(--accent);
}

.project-cell,
.approval-email-cell,
.approval-date-cell,
.approval-amount-cell,
.approval-status-cell {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  line-height: 1.1;
}

.project-cell,
.approval-email-cell,
.approval-date-cell,
.approval-amount-cell {
  align-items: flex-start !important;
  text-align: left;
}

.approval-review-cell,
.approval-decision-cell {
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.approval-comment-cell {
  justify-content: flex-start;
  gap: 4px;
}

.approval-comment-cell .approval-row-comment {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.approval-amount-cell {
  font-variant-numeric: tabular-nums;
}

.amount-inline {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.project-code {
  display: inline-flex !important;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1px !important;
  padding: 1px 6px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  color: var(--accent-strong) !important;
  background: var(--accent-soft);
  font-size: 10px !important;
  font-weight: 850;
  line-height: 1.1;
}

.project-cell strong,
.approval-email-cell strong,
.approval-amount-cell strong {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
}

.approval-email-cell strong,
.approval-email-cell span,
.project-cell strong {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.approval-email-cell strong {
  -webkit-line-clamp: 1;
}

.approval-email-cell span,
.project-cell strong {
  -webkit-line-clamp: 1;
}

.approval-email-cell span,
.project-cell strong,
.approval-grid-row span {
  margin-top: 1px !important;
  font-size: 11px !important;
}

.approval-date-cell {
  align-items: flex-start !important;
  text-align: left;
}

.approval-date-cell strong {
  font-size: 12px;
  font-weight: 850;
}

.approval-date-cell span {
  margin-top: 1px !important;
  font-size: 10px !important;
}

.approval-review-button,
.approval-decision-button {
  width: 30px;
  height: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  font-weight: 850;
}

.approval-review-button {
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: var(--control-surface);
}

.approval-review-button:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.approval-review-button:disabled {
  color: var(--soft);
  background: var(--surface-strong);
  opacity: 0.7;
}

.approval-review-button span,
.approval-decision-button span {
  margin: 0 !important;
  color: inherit !important;
  font-size: 12px !important;
  line-height: 1;
}

.approval-review-button strong,
.approval-decision-button strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.approval-decision-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--control-surface);
}

.approval-decision-button.approve:hover,
.approval-decision-button.approve.selected {
  border-color: #b8e3cb;
  color: var(--success);
  background: var(--success-soft);
}

.approval-decision-button.reject:hover,
.approval-decision-button.reject.selected {
  border-color: #f2b8b5;
  color: var(--danger);
  background: var(--danger-soft);
}

.approval-row-comment {
  height: 24px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.1;
}

.comment-expand-button {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--control-surface);
  font-size: 12px;
  font-weight: 850;
}

.comment-expand-button:hover,
.comment-expand-button:focus-visible {
  outline: none;
  border-color: var(--accent-line);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.comment-expand-button.has-expanded-comment {
  border-color: var(--accent-line);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(20, 125, 143, 0.14);
}

.approval-status {
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-confidence-label {
  width: 9px;
  height: 9px;
  margin-top: 0 !important;
  padding: 0;
  display: inline-block !important;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0 !important;
  line-height: 0;
}

.amount-confidence-label.high {
  color: var(--success) !important;
  background: var(--success);
}

.amount-confidence-label.medium,
.amount-confidence-label.pending {
  color: var(--chart-axis-text) !important;
  background: var(--neutral-pill);
}

.amount-confidence-label.low,
.amount-confidence-label.none {
  color: var(--danger) !important;
  background: var(--danger);
}

.approval-status.pending {
  color: var(--neutral-pill-text);
  background: var(--neutral-pill);
}

.approval-status.approved {
  color: var(--success);
  background: var(--success-soft);
}

.approval-status.rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.amount-value {
  font-weight: 750;
}

.amount-confidence {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.amount-confidence.high {
  color: var(--success);
  background: var(--success);
}

.amount-confidence.medium {
  color: var(--warning);
  background: var(--confidence-medium);
}

.amount-confidence.low,
.amount-confidence.none {
  color: var(--danger);
  background: var(--confidence-low);
}

.amount-confidence.pending {
  color: var(--confidence-pending);
  background: var(--neutral-pill);
}

.approval-review-split {
  --approval-body-width: minmax(320px, 0.85fr);
  --approval-attachment-width: minmax(420px, 1.15fr);
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--approval-body-width) 12px var(--approval-attachment-width);
  background: var(--panel);
}

.row-resizer {
  position: relative;
  z-index: 3;
  flex: 0 0 8px;
  min-height: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--resizer-surface);
  cursor: row-resize;
  touch-action: none;
}

.row-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 2px;
  border-radius: 999px;
  background: var(--resizer-strong);
  transform: translate(-50%, -50%);
}

.row-resizer:hover,
.row-resizer:focus-visible,
.row-resizer.active {
  outline: none;
  background: var(--accent-soft);
}

.row-resizer:hover::after,
.row-resizer:focus-visible::after,
.row-resizer.active::after {
  background: var(--accent);
}

.approval-review-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.approval-attachment-list {
  max-height: 142px;
  border-bottom: 1px solid var(--line);
}

.column-resizer {
  position: relative;
  z-index: 3;
  min-width: 8px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--resizer-surface);
  cursor: col-resize;
  touch-action: none;
}

.approval-review-split > .column-resizer {
  min-width: 12px;
  border-right-color: var(--line);
  border-left-color: var(--line);
  background: var(--surface-strong);
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 34px;
  border-radius: 999px;
  background: var(--resizer-strong);
  transform: translate(-50%, -50%);
}

.approval-review-split > .column-resizer::after {
  width: 3px;
  height: 56px;
  background: var(--approval-resizer-grip);
}

.column-resizer:hover,
.column-resizer:focus-visible,
.column-resizer.active {
  outline: none;
  background: var(--accent-soft);
}

.column-resizer:hover::after,
.column-resizer:focus-visible::after,
.column-resizer.active::after {
  background: var(--accent);
}

body.column-resizing {
  cursor: col-resize;
  user-select: none;
}

body.row-resizing {
  cursor: row-resize;
  user-select: none;
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px rgba(31, 41, 55, 0.14);
}

.match-green {
  background: var(--success);
}

.match-yellow {
  background: #d89b00;
}

.match-partial {
  background: #f5c451;
}

.match-red {
  background: var(--danger);
}

.match-pending {
  background: #98a2b3;
}

.google-api-dot {
  margin-left: -2px;
}

.google-api-green {
  background: var(--success);
}

.google-api-yellow {
  background: #d89b00;
}

.google-api-red {
  background: var(--danger);
}

.empty-state,
.status {
  color: var(--muted);
}

.status {
  padding: 16px;
  font-size: 14px;
}

.error {
  color: var(--danger);
}

.status-block,
.empty-panel {
  padding: 16px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.status-block strong,
.empty-panel strong {
  color: var(--ink);
}

.status-block.error strong {
  color: var(--danger);
}

.empty-panel.compact {
  min-height: 226px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.skeleton-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.skeleton-list span,
.skeleton-card,
.chart-skeleton {
  border-radius: 8px;
  background: var(--skeleton);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton-list span {
  height: 52px;
}

.chart-skeleton {
  min-height: 226px;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.login-overlay,
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--modal-backdrop);
}

.login-panel,
.settings-panel,
.dialog-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(31, 41, 55, 0.24);
}

.approval-comment-dialog {
  width: min(560px, 100%);
}

.login-panel {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.login-panel h2,
.settings-header h2,
.dialog-header h2 {
  margin: 0;
}

.login-panel label,
.authorized-user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-section,
.authorized-user-form {
  display: grid;
  gap: 12px;
}

.settings-section h3,
.settings-section-heading h3 {
  margin: 0;
  font-size: 15px;
}

.settings-section p,
.settings-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.settings-check input {
  margin-top: 2px;
}

.settings-check span {
  display: grid;
  gap: 2px;
}

.settings-check strong {
  color: var(--ink);
  font-size: 13px;
}

.settings-check small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.settings-nav-row {
  display: grid;
  grid-template-columns: 18px minmax(110px, 0.75fr) minmax(160px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.settings-nav-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.settings-nav-row input[type="text"] {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 13px;
}

.ap-team-project-list {
  display: grid;
  gap: 8px;
}

.ap-team-project-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.38fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.ap-team-project-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ap-team-project-row input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  text-transform: none;
}

.settings-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.microsoft-login {
  min-height: 38px;
  border: 1px solid #2f65c8;
  border-radius: 8px;
  color: #ffffff;
  background: #2f65c8;
  font-size: 13px;
  font-weight: 800;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-panel {
  width: min(640px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
}

.settings-header,
.dialog-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.approval-body-header,
.approval-attachment-header {
  align-items: flex-start;
}

.approval-body-heading,
.approval-attachment-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.approval-body-heading h2,
.approval-body-heading .dialog-summary,
.approval-attachment-heading h2,
.approval-attachment-heading .dialog-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-body-header-actions,
.approval-attachment-header-actions {
  min-width: 0;
  flex: 0 1 760px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.approval-attachment-header-actions .pdf-file-switcher {
  margin-top: 0;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.approval-body-header-actions .pm-support-action-host,
.approval-attachment-header-actions .pm-support-action-host {
  min-width: min(330px, 100%);
  flex: 0 1 360px;
}

.pm-support-action-host[hidden] {
  display: none;
}

.pm-support-action-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pm-support-action-stack {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.pm-support-action-control .pm-queue-action-control {
  width: min(270px, 100%);
  grid-template-columns: minmax(150px, 1fr) 32px;
}

.pm-support-project-line {
  margin: 0;
  max-width: 270px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-support-action-control .pm-queue-icon-button {
  flex: 0 0 auto;
}

.approval-body-header-actions .icon-button,
.approval-attachment-header-actions .secondary-attachment,
.approval-attachment-header-actions .icon-button {
  flex: 0 0 auto;
}

.settings-tabs {
  padding: 10px 16px 0;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.settings-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 13px;
  font-weight: 800;
}

.settings-tab.active {
  color: var(--accent-strong);
  background: var(--panel);
}

.settings-content,
.dialog-content {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.dialog-content {
  display: grid;
  gap: 14px;
}

.comment-editor-textarea {
  min-height: 180px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.dialog-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.approval-modal {
  align-items: stretch;
}

.approval-body-dialog,
.approval-attachment-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}

.approval-body-dialog {
  width: min(920px, calc(100vw - 36px));
}

.approval-modal-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 18px;
  background: var(--panel);
  font-size: 14px;
  line-height: 1.55;
}

.approval-modal-body img {
  max-width: 100%;
  height: auto;
}

.approval-attachment-dialog-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--panel);
}

.approval-pdf-viewer {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--pdf-viewer-surface);
}

.pdf-file-switcher {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pdf-file-chip {
  max-width: 260px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--control-surface);
  font-size: 11px;
  font-weight: 800;
}

.pdf-file-chip span {
  display: none;
}

.pdf-file-chip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-file-chip.active {
  border-color: var(--accent-line);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.approval-attachment-modal-preview {
  flex: 1;
  width: 100%;
  min-height: 520px;
  border-top: 0;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--ink) !important;
  font-size: 13px !important;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.authorized-user-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.55fr) minmax(170px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
}

.authorized-users-list {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.authorized-user-row {
  min-height: 52px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

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

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

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 240px;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 750;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.success {
  border-color: #c8ead8;
  color: var(--success);
}

.toast.error {
  border-color: #f2b8b5;
  color: var(--danger);
}

.toast.warning {
  border-color: #f0d5a9;
  color: var(--warning);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(4px);
}

.invoice-review {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface);
}

.invoice-review-header {
  min-height: 72px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.invoice-review-header h1,
.invoice-review-header h2 {
  max-width: 760px;
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-home-link {
  text-decoration: none;
}

.invoice-review-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(420px, 0.9fr);
}

.invoice-review-pdf {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--pdf-shell);
}

.invoice-review-pdf iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.invoice-review-jobs {
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
}

.invoice-review-jobs .job-search {
  width: 100%;
}

.invoice-review-jobs > p,
.jobs-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.invoice-jobs-table-wrap,
.jobs-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.invoice-jobs-table-wrap {
  flex: 1;
}

.jobs-page {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

.jobs-shell {
  min-height: 100vh;
  background: var(--surface);
}

.jobs-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
}

.jobs-main {
  padding: 18px;
}

.jobs-toolbar {
  margin-bottom: 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.job-search {
  width: min(520px, 100%);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(280px, 1fr) auto auto;
  }

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

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

  .api-queue-page {
    display: block;
    overflow: auto;
  }

  .api-queue-cards,
  .api-queue-controls,
  .api-queue-table-panel {
    margin-top: 8px;
  }

  .table-panel-header,
  .table-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .table-search {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .api-queue-header,
  .api-queue-refresh {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-queue-cards,
  .api-queue-controls {
    grid-template-columns: 1fr;
  }

  .api-queue-cards {
    display: grid;
  }

  .api-queue-controls label {
    display: grid;
    gap: 5px;
  }

  .api-queue-controls label > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}

@media (max-width: 980px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-resizer {
    display: none;
  }

  .sidebar-brand,
  .nav-group-label.secondary,
  .sidebar-footer {
    display: none;
  }

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

  .nav-group-label {
    display: none;
  }

  .sidebar-link {
    justify-content: center;
  }

  .sidebar-link span {
    display: none;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .approval-summary-card,
  .topbar-actions {
    justify-self: stretch;
  }

  .workflow-switcher {
    display: grid;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .mail-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .column-resizer {
    display: none;
  }

  .pane {
    min-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .message-list {
    max-height: 420px;
  }

  .metrics-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .approval-layout {
    height: auto;
  }

  .approval-grid-wrap {
    max-height: 520px;
  }

  .approval-review-split {
    min-height: 720px;
    grid-template-columns: 1fr;
  }

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

  .ap-team-project-row,
  .authorized-user-form,
  .jobs-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-review-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 1fr) minmax(320px, 0.9fr);
  }

  .invoice-review-pdf {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-grid,
  .analytics-grid,
  .table-panel {
    margin-right: 10px;
    margin-left: 10px;
  }

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

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

  .toast-region {
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
