:root {
  color-scheme: light dark;
  --font-family: "Manrope", "Public Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  --transition-duration: 180ms;
  --shadow-elevated: 0 18px 42px rgba(15, 23, 42, 0.14);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--surface);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition-duration) ease, color var(--transition-duration) ease;
}

body.theme-light {
  --surface: #f6f8fe;
  --surface-elevated: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.7);
  --text-primary: #0b1628;
  --text-secondary: #4c5a71;
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.15);
  --accent-strong: #1346cb;
  --success: oklch(0.47 0.13 151);
  --danger: oklch(0.52 0.16 27);
  --warning: oklch(0.58 0.13 72);
  --border: rgba(15, 23, 42, 0.08);
  --dropzone-bg: rgba(47, 107, 255, 0.08);
  --dropzone-border: rgba(47, 107, 255, 0.45);
  --toast-bg: rgba(15, 23, 42, 0.92);
  --toast-text: #ffffff;
  --logo-bg: #ffffff;
  --toggle-track-bg: rgba(15, 23, 42, 0.12);
  --toggle-thumb-bg: #ffffff;
  --table-header-bg: rgba(47, 107, 255, 0.08);
  --table-header-bg-opaque: #dce8fb;
  --offers-sent-bg: rgba(48, 158, 92, 0.18);
  --offers-preview-border: rgba(15, 23, 42, 0.12);
}

body.theme-dark {
  --surface: #0b1321;
  --surface-elevated: rgba(23, 33, 52, 0.92);
  --surface-muted: rgba(23, 33, 52, 0.7);
  --text-primary: #f5f7fb;
  --text-secondary: #b8c4de;
  --accent: #7da9ff;
  --accent-soft: rgba(125, 169, 255, 0.22);
  --accent-strong: #98c1ff;
  --success: oklch(0.76 0.13 151);
  --danger: oklch(0.72 0.13 27);
  --warning: oklch(0.78 0.12 72);
  --border: rgba(135, 155, 192, 0.28);
  --dropzone-bg: rgba(125, 169, 255, 0.15);
  --dropzone-border: rgba(125, 169, 255, 0.5);
  --toast-bg: rgba(245, 247, 251, 0.95);
  --toast-text: #121a2c;
  --logo-bg: rgba(255, 255, 255, 0.95);
  --toggle-track-bg: rgba(245, 247, 251, 0.28);
  --toggle-thumb-bg: #0c1424;
  --table-header-bg: rgba(125, 169, 255, 0.15);
  --table-header-bg-opaque: #203957;
  --offers-sent-bg: rgba(92, 210, 150, 0.22);
  --offers-preview-border: rgba(135, 155, 192, 0.28);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(24px, 6vw, 64px);
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--logo-bg);
  border: 1px solid rgba(12, 20, 36, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: none;
}

.brand-icon img {
  width: 60%;
  height: auto;
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
}

.brand-text p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dev-login {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-login input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  width: 220px;
}

.dev-login button {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 12px;
  cursor: pointer;
}

.dev-login button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

#user-name {
  font-weight: 600;
}

#user-email {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-button,
.primary-button,
.ghost-button,
.actions button {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 12px 22px;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-duration) ease, box-shadow var(--transition-duration) ease, opacity var(--transition-duration) ease;
}

.auth-button,
.primary-button,
.actions button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 12px 28px rgba(47, 107, 255, 0.25);
}

.ghost-button {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.auth-button:disabled,
.primary-button:disabled,
.ghost-button:disabled,
.actions button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-button:hover,
.primary-button:hover,
.actions button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--text-secondary);
}

.theme-toggle__track {
  position: relative;
  width: 64px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(125, 147, 189, 0.35);
  background: var(--toggle-track-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-duration) ease, border var(--transition-duration) ease;
}

.theme-toggle__icon {
  position: absolute;
  top: 50%;
  line-height: 1;
  opacity: 0.55;
  font-size: 1rem;
  transition: opacity var(--transition-duration) ease;
  transform: translateY(-50%);
  pointer-events: none;
}

.theme-toggle__icon--sun {
  left: 12px;
}

.theme-toggle__icon--moon {
  right: 12px;
}

.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--toggle-thumb-bg);
  transform: translate(0, -50%);
  transition: transform var(--transition-duration) ease, background var(--transition-duration) ease;
}

.theme-toggle.theme-toggle--dark .theme-toggle__thumb {
  transform: translate(32px, -50%);
}

.theme-toggle__text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 clamp(24px, 6vw, 64px);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}

.nav-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--transition-duration) ease, background var(--transition-duration) ease;
}

.nav-tab--active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-tab[hidden] {
  display: none !important;
}

.nav-tab[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.page-content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(16px, 5vw, 48px);
}

.panel {
  width: min(1080px, 100%);
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
  display: none;
  flex-direction: column;
  gap: 32px;
}

.panel--wide {
  width: 100%;
  max-width: 1440px;
}

.panel--active {
  display: flex;
}

.panel-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 700;
}

.panel-header p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drop-zone {
  position: relative;
  border: 2px dashed var(--dropzone-border);
  border-radius: var(--radius-lg);
  background: var(--dropzone-bg);
  padding: clamp(32px, 6vw, 48px) clamp(20px, 4vw, 40px);
  cursor: pointer;
  transition: border-color var(--transition-duration) ease, background var(--transition-duration) ease, transform var(--transition-duration) ease;
  overflow: hidden;
}

.drop-zone--dragging,
.drop-zone:hover {
  border-color: var(--accent);
  background: rgba(47, 107, 255, 0.18);
  transform: translateY(-1px);
}


.drop-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.drop-zone:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.drop-zone__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.drop-zone__icon {
  font-size: clamp(2.5rem, 4vw, 3.2rem);
  filter: drop-shadow(0 12px 28px rgba(47, 107, 255, 0.22));
}

.drop-zone__text {
  margin: 0;
  font-size: 1rem;
}

.drop-zone__hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.drop-zone__file {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

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

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.filter-field--wide {
  grid-column: span 2;
}

.filter-field label {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.filter-field input,
.filter-field select,
textarea,
.modal__group input,
.modal__group textarea {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 1rem;
  padding: 12px 14px;
  transition: border var(--transition-duration) ease, box-shadow var(--transition-duration) ease;
}

.filter-field input:focus,
.modal__group input:focus,
.modal__group textarea:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.18);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.actions .ghost-button {
  color: var(--text-primary);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: none;
}

.actions .ghost-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.run-status {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.request-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  padding: 14px 16px;
}

.request-status[hidden] {
  display: none;
}

.request-status h3,
.request-status p {
  margin: 0;
}

.request-status h3 {
  font-size: 1rem;
}

.request-status p,
.request-status__meta {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.request-status__meta {
  text-align: right;
  max-width: 44%;
  overflow-wrap: anywhere;
}

.dry-run-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dry-run-preview[hidden] {
  display: none;
}

.dry-run-preview__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.dry-run-preview__header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.dry-run-preview__header p,
.dry-run-preview__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.dry-run-preview__meta {
  text-align: right;
  max-width: 46%;
  overflow-wrap: anywhere;
}

.dry-run-status {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.dry-run-status[hidden] {
  display: none;
}

.dry-run-status::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: dry-run-status-spin 0.9s linear infinite;
}

.dry-run-status[data-tone="error"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-elevated));
}

.dry-run-status[data-tone="error"]::before {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  border-top-color: var(--danger);
}

@keyframes dry-run-status-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dry-run-status::before {
    animation: none;
  }
}

.dry-run-preview__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  align-items: center;
}

.dry-run-preview__controls input[type="search"] {
  width: min(360px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.dry-run-preview__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dry-run-preview__field-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dry-run-filter-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.dry-run-filter-chip:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.dry-run-filter-chip--active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.dry-run-preview__table {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.dry-run-preview__table table {
  min-width: 1420px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.dry-run-preview__table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  background: var(--table-header-bg);
  box-shadow: 0 1px 0 var(--border), 0 6px 12px color-mix(in srgb, var(--surface) 80%, transparent);
}

.dry-run-preview__table tbody tr {
  cursor: pointer;
}

.dry-run-preview__table tbody tr.selected {
  background: rgba(47, 107, 255, 0.18);
}

.dry-run-row--review {
  background: var(--accent-soft);
}

.dry-run-col--eventAction {
  width: 132px;
}

.dry-run-col--changedFields {
  width: 180px;
}

.dry-run-col--review {
  width: 150px;
}

.dry-run-col--WorkOrderNumber,
.dry-run-col--SoldOrder_OrderNumber,
.dry-run-col--AppointmentNumber {
  width: 120px;
}

.dry-run-col--Status,
.dry-run-col--ServiceAppointmentStatus,
.dry-run-col--WorkOrderType {
  width: 120px;
}

.dry-run-col--Scheduled,
.dry-run-col--ArrivalWindowStartTimeOnly,
.dry-run-col--ArrivalWindowEndTimeOnly {
  width: 130px;
}

.dry-run-col--JellyPrimaryResource,
.dry-run-col--Contact_FullName {
  width: 180px;
}

.dry-run-col--City {
  width: 140px;
}

.dry-run-preview__table th,
.dry-run-preview__table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dry-run-action-badge {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.dry-run-action-badge--created {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: color-mix(in srgb, var(--success) 14%, var(--surface-elevated));
}

.dry-run-action-badge--updated {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: var(--accent-soft);
}

.dry-run-action-badge--deleted {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-elevated));
}

.dry-run-action-badge--skipped {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 44%, var(--border));
  background: color-mix(in srgb, var(--warning) 14%, var(--surface-elevated));
}

.dry-run-detail {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  overflow: hidden;
}

.dry-run-detail[hidden] {
  display: none;
}

.dry-run-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.dry-run-detail__header h4,
.dry-run-detail__summary,
.dry-run-detail__empty {
  margin: 0;
}

.dry-run-detail__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.dry-run-detail__summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.dry-run-detail__summary-grid div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dry-run-detail__summary-grid span,
.dry-run-detail__meta {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dry-run-detail__summary-grid strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dry-run-detail__summary,
.dry-run-detail__empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.dry-run-detail__diff-list {
  display: grid;
  gap: 12px;
}

.dry-run-diff-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  overflow: hidden;
}

.dry-run-diff-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.dry-run-diff-card__title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dry-run-diff-card__title span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dry-run-diff-card__title strong {
  color: var(--text-primary);
  font-size: 0.98rem;
}

.dry-run-diff-card__action {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--text-secondary);
  background: var(--surface-elevated);
  font-size: 0.76rem;
  font-weight: 800;
}

.dry-run-diff-card__action--created {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: color-mix(in srgb, var(--success) 12%, var(--surface-elevated));
}

.dry-run-diff-card__action--updated {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: var(--accent-soft);
}

.dry-run-diff-card__action--deleted {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-elevated));
}

.dry-run-diff-card__panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
}

.dry-run-diff-card__pane {
  min-width: 0;
  background: var(--surface-elevated);
  padding: 12px 14px;
}

.dry-run-diff-card__pane-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dry-run-diff-card__value {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 240px;
  overflow: auto;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dry-run-diff-line {
  display: block;
  min-height: 1.5em;
  border-radius: 4px;
  padding: 0 4px;
  white-space: pre-wrap;
}

.dry-run-diff-line--removed {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--text-primary);
}

.dry-run-diff-line--added {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--text-primary);
}

.dry-run-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  text-transform: none;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.dry-run-detail__meta span {
  min-width: 0;
}

@media (max-width: 900px) {
  .dry-run-preview__header {
    flex-direction: column;
  }

  .dry-run-preview__meta {
    max-width: none;
    text-align: left;
  }

  .dry-run-detail__summary-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .dry-run-diff-card__panes {
    grid-template-columns: 1fr;
  }
}

.dry-run-preview__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--table-header-bg-opaque);
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-elevated);
}

thead {
  background: var(--table-header-bg);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: rgba(47, 107, 255, 0.08);
}

.jobs-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  align-items: end;
}

.jobs-filters .filter-actions {
  display: flex;
  gap: 12px;
}

.jobs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.jobs-toolbar__summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.jobs-toolbar__actions {
  display: flex;
  gap: 12px;
}

.jobs-table-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: auto;
}

.jobs-table-wrapper table {
  min-width: 960px;
}

.jobs-table-wrapper td:first-child,
.jobs-table-wrapper th:first-child {
  width: 48px;
}

.jobs-table-wrapper tbody tr.selected {
  background: rgba(47, 107, 255, 0.15);
}

.table-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.channel-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.channel-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.offers-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.offers-search {
  display: flex;
  align-items: center;
  gap: 12px;
}

.offers-search input {
  min-width: 260px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-primary);
}

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

.offers-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.offers-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.offers-filters select {
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.offers-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.offers-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
}

.offers-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.offers-table-wrapper {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  overflow: auto;
}

.table-scroll {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  overflow: auto;
}

.table-scroll table {
  min-width: 980px;
}

.calendar-management-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface-muted);
}

.calendar-management-section h3 {
  margin: 0;
}

.rforce-scheduling-verify,
.rforce-scheduling-form,
.rforce-scheduling-workspace {
  display: grid;
  gap: 16px;
}

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

.rforce-scheduling-header-row .ghost-button {
  flex: 0 0 auto;
  padding: 9px 16px;
}

.rforce-queue-dashboard {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
}

.rforce-queue-dashboard__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.rforce-queue-dashboard__header h3 {
  margin: 0 0 4px;
}

.rforce-queue-dashboard__actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.rforce-queue-dashboard__actions .filter-field {
  min-width: 220px;
}

.rforce-queue-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rforce-queue-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rforce-queue-table th,
.rforce-queue-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.rforce-queue-table th {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.rforce-queue-table tbody tr:last-child td {
  border-bottom: 0;
}

.rforce-queue-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.rforce-queue-status[data-status="queued"] {
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.rforce-queue-status[data-status="running"] {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.rforce-queue-status[data-status="completed"] {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
}

.rforce-queue-status[data-status="error"],
.rforce-queue-status[data-status="failed"],
.rforce-queue-status[data-status="refused"],
.rforce-queue-status[data-status="blocked"] {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.rforce-scheduling-verify {
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: end;
}

.rforce-scheduling-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rforce-scheduling-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface-muted);
}

.rforce-scheduling-section h3 {
  margin: 0;
}

.rforce-scheduling-grid,
.rforce-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.rforce-scheduling-controls {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.rforce-schedule-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  align-items: start;
}

.rforce-resource-field,
.rforce-schedule-grid .filter-field {
  min-width: 0;
}

.rforce-schedule-grid .filter-field--wide {
  grid-column: span 3;
}

.rforce-schedule-grid .filter-field > label {
  display: flex;
  min-height: 44px;
  align-items: flex-start;
}

.rforce-schedule-grid .filter-field[hidden] {
  display: none;
}

.rforce-resource-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.rforce-resource-search select {
  min-width: 0;
}

@media (max-width: 1200px) {
  .rforce-queue-dashboard__header,
  .rforce-queue-dashboard__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rforce-queue-dashboard__actions .filter-field {
    min-width: 0;
  }

  .rforce-scheduling-controls {
    grid-template-columns: 1fr;
  }

  .rforce-schedule-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

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

.rforce-scheduling-grid .rforce-field--wide {
  grid-column: span 2;
}

.rforce-scheduling-grid .rforce-field--wide textarea {
  min-height: 180px;
  resize: vertical;
}

.rforce-field-helper {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
}

.rforce-field-draft-status {
  min-height: 16px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.25;
}

.rforce-help-dialog {
  width: min(780px, 100%);
}

.rforce-help-body {
  gap: 16px;
}

.rforce-help-search {
  margin: 0;
}

.rforce-help-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rforce-help-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rforce-help-section h4 {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rforce-help-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rforce-help-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.rforce-help-item[open] {
  background: var(--surface-elevated);
}

.rforce-help-item[data-tone="warning"] {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.08);
}

.rforce-help-item summary {
  cursor: pointer;
  padding: 13px 15px;
  color: var(--text-primary);
  font-weight: 700;
}

.rforce-help-item summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.rforce-help-item p {
  margin: 0;
  padding: 0 15px 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.rforce-help-empty {
  margin: 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text-secondary);
  text-align: center;
}

.rforce-field-draft-status[data-state="dirty"] {
  color: var(--text-secondary);
}

.rforce-field-draft-status[data-state="error"] {
  color: var(--danger);
}

.rforce-context-item {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface-elevated);
}

.rforce-context-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.rforce-context-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.calendar-preview-controls,
.calendar-day-controls,
.calendar-batch-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.calendar-detail-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calendar-detail-panel h4 {
  margin: 0;
  font-size: 1rem;
}

.calendar-detail-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.calendar-detail-json {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 12px;
  min-height: 140px;
  max-height: 360px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.35;
}

.permissions-table {
  min-width: 1250px;
}

.permissions-table th,
.permissions-table td {
  text-align: center;
  white-space: nowrap;
}

.permissions-table th:first-child,
.permissions-table td:first-child {
  text-align: left;
  min-width: 320px;
}

.permissions-table th:nth-child(2),
.permissions-table td:nth-child(2) {
  text-align: left;
  min-width: 120px;
}

.permissions-table tr.is-saving {
  opacity: 0.55;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.option-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 14px 16px;
}

.option-block h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.option-block h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.option-block label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(120%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 28px;
  border-radius: var(--radius-md);
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.28);
  transition: transform var(--transition-duration) ease, opacity var(--transition-duration) ease;
  opacity: 0;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 520px;
  min-width: 240px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
  gap: 12px;
}

.toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast[data-tone="success"] {
  background: linear-gradient(135deg, #3ab97d, #2d9d66);
  color: #ffffff;
}

.toast[data-tone="error"] {
  background: linear-gradient(135deg, #f06161, #d64545);
  color: #ffffff;
}

.latest-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.latest-search {
  display: flex;
  align-items: center;
  gap: 12px;
}

.latest-search input {
  min-width: 260px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-primary);
}

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

.service-offerings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.service-offerings-grid {
  margin-bottom: 0;
}

.service-offerings-options {
  margin-top: 4px;
}

.service-offerings-description {
  max-width: 100%;
}

.service-offerings-actions {
  gap: 12px;
}

.latest-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.latest-filter {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.latest-filter legend {
  font-weight: 600;
  font-size: 0.95rem;
}

.latest-filter select,
.latest-filter input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px;
}

.latest-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  background: var(--surface-elevated);
  margin-bottom: 16px;
}

.latest-bulk-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.latest-table-wrapper {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  overflow: auto;
}

.latest-table-wrapper .react-table-root,
.offers-table-wrapper .react-table-root,
.run-status .react-table-root {
  overflow: auto;
}

.latest-table-wrapper .react-table-root .MuiTable-root,
.offers-table-wrapper .react-table-root .MuiTable-root {
  min-width: 100%;
  width: max-content;
}
.latest-table-wrapper .react-table-root {
  overflow: auto;
}


.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.48);
  padding: 24px;
  z-index: 999;
}

.modal[hidden] {
  display: none;
}

.modal__dialog {
  width: min(720px, 100%);
  max-height: 90vh;
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
}

.modal__header,
.modal__footer {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.modal__footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
}

.modal__body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal__hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: grab;
}

.modal__list-item.dragging {
  opacity: 0.6;
}

.modal__list-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.modal__list-actions {
  display: flex;
  gap: 8px;
}

.modal__footer .modal__actions {
  display: flex;
  gap: 12px;
}

.modal__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

.modal__group > span {
  color: var(--text-secondary);
  font-weight: 600;
}

.modal__group input[type="text"],
.modal__group input[type="datetime-local"],
.modal__group textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  padding: 10px 12px;
}

.modal__group--context .modal__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal__step {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal__contact {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.modal__group--preview {
  gap: 12px;
}

.modal__preview-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal__preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.modal__preview-column h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.modal__preview-block {
  min-height: 100px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--offers-preview-border);
  background: var(--surface-muted);
  padding: 12px;
  line-height: 1.4;
  font-size: 0.9rem;
  overflow-y: auto;
  white-space: pre-wrap;
}

.modal__preview-block--disabled {
  opacity: 0.55;
  font-style: italic;
}

.modal__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.modal__status {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

@media (max-width: 980px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
  }

  .toolbar {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .nav-tabs {
    flex-wrap: wrap;
  }

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

  .jobs-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .jobs-toolbar__actions {
    justify-content: flex-end;
  }

  .panel {
    padding: 20px;
  }

  .toolbar {
    flex-direction: column;
  }

  .user-info {
    width: 100%;
    justify-content: center;
  }

  .calendar-preview-controls,
  .calendar-day-controls,
  .calendar-batch-controls,
  .calendar-detail-controls {
    grid-template-columns: 1fr;
  }
}

/* Refined dev portal visual system */
:root {
  --font-family: "Manrope", "Public Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-family-display: "Sora", "Manrope", "Public Sans", sans-serif;
  --transition-duration: 150ms;
  --ease-standard: cubic-bezier(0.2, 0.64, 0.2, 1);
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-md: 4px;
  --radius-sm: 4px;
  --radius-pill: 4px;
}

body.theme-light {
  --surface: #eaf0f6;
  --surface-elevated: #f4f8fc;
  --surface-muted: #edf3f9;
  --surface-card: #ffffff;
  --text-primary: #10233a;
  --text-secondary: #4b6078;
  --accent: #145ea5;
  --accent-soft: rgba(20, 94, 165, 0.12);
  --accent-strong: #0f4a81;
  --border: rgba(16, 35, 58, 0.13);
  --panel-border: rgba(16, 35, 58, 0.12);
  --shell-border: rgba(16, 35, 58, 0.14);
  --dropzone-bg: rgba(20, 94, 165, 0.07);
  --dropzone-border: rgba(20, 94, 165, 0.4);
  --toast-bg: rgba(16, 35, 58, 0.94);
  --toast-text: #ffffff;
  --logo-bg: #ffffff;
  --toggle-track-bg: rgba(16, 35, 58, 0.14);
  --toggle-thumb-bg: #ffffff;
  --table-header-bg: #edf3fa;
  --table-row-hover: rgba(20, 94, 165, 0.09);
  --table-row-selected: rgba(20, 94, 165, 0.16);
  --offers-sent-bg: rgba(44, 138, 87, 0.2);
  --offers-preview-border: rgba(16, 35, 58, 0.14);
  --shadow-shell: 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 34px rgba(12, 30, 50, 0.14);
  --shadow-elevated: 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 20px rgba(12, 30, 50, 0.12);
  --focus-ring: rgba(20, 94, 165, 0.34);
  --atmo-one: rgba(22, 109, 186, 0.18);
  --atmo-two: rgba(14, 156, 136, 0.12);
  --success-bg: rgba(44, 138, 87, 0.18);
  --error-bg: rgba(186, 65, 65, 0.16);
}

body.theme-dark {
  --surface: #0d1522;
  --surface-elevated: #111d2f;
  --surface-muted: #162236;
  --surface-card: rgba(20, 33, 50, 0.96);
  --text-primary: #ecf2fb;
  --text-secondary: #b0c1d9;
  --accent: #5da7ec;
  --accent-soft: rgba(93, 167, 236, 0.2);
  --accent-strong: #4a8bc8;
  --border: rgba(170, 193, 223, 0.26);
  --panel-border: rgba(170, 193, 223, 0.24);
  --shell-border: rgba(170, 193, 223, 0.28);
  --dropzone-bg: rgba(93, 167, 236, 0.15);
  --dropzone-border: rgba(93, 167, 236, 0.48);
  --toast-bg: rgba(238, 244, 252, 0.95);
  --toast-text: #122236;
  --logo-bg: rgba(255, 255, 255, 0.96);
  --toggle-track-bg: rgba(236, 242, 251, 0.25);
  --toggle-thumb-bg: #0e1727;
  --table-header-bg: rgba(93, 167, 236, 0.16);
  --table-row-hover: rgba(93, 167, 236, 0.17);
  --table-row-selected: rgba(93, 167, 236, 0.24);
  --offers-sent-bg: rgba(89, 195, 139, 0.26);
  --offers-preview-border: rgba(170, 193, 223, 0.28);
  --shadow-shell: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 30px rgba(2, 10, 22, 0.5);
  --shadow-elevated: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 20px rgba(2, 10, 22, 0.4);
  --focus-ring: rgba(93, 167, 236, 0.42);
  --atmo-one: rgba(35, 102, 170, 0.32);
  --atmo-two: rgba(24, 154, 135, 0.18);
  --success-bg: rgba(89, 195, 139, 0.24);
  --error-bg: rgba(206, 93, 93, 0.2);
}

body {
  position: relative;
  isolation: isolate;
  line-height: 1.5;
  background: var(--surface);
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
  line-height: 1.14;
  text-wrap: balance;
}

p {
  line-height: 1.55;
  max-width: 65ch;
  text-wrap: pretty;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, var(--surface-elevated), var(--surface));
}

.app-shell {
  width: min(1860px, calc(100% - clamp(10px, 2.4vw, 40px)));
  margin: clamp(16px, 2.6vw, 30px) auto clamp(24px, 4.2vw, 54px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--shell-border);
  background: var(--surface-card);
  box-shadow: var(--shadow-shell);
  overflow: clip;
}

.top-bar {
  padding: clamp(18px, 2.4vw, 28px) clamp(18px, 2.8vw, 34px) clamp(16px, 2vw, 22px);
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  gap: 14px;
}

.brand-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  border-color: var(--border);
  box-shadow: 0 10px 20px rgba(16, 35, 58, 0.08);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.brand-text h1 {
  font-family: var(--font-family-display);
  font-size: clamp(1.45rem, 2.1vw, 1.95rem);
  letter-spacing: -0.01em;
}

.brand-text p {
  margin-top: 2px;
  font-size: 0.92rem;
}

.toolbar {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dev-login {
  gap: 10px;
}

.dev-login input {
  width: min(280px, 100%);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.dev-login button {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.user-info {
  background: var(--surface-card);
  box-shadow: 0 8px 18px rgba(16, 35, 58, 0.1);
}

.auth-button,
.primary-button,
.actions button {
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 16px rgba(20, 94, 165, 0.24);
}

.ghost-button {
  border-radius: var(--radius-pill);
  background: var(--surface-card);
}

.auth-button,
.primary-button,
.ghost-button,
.actions button,
.nav-tab,
.theme-toggle,
.drop-zone,
.modal__close {
  transition:
    transform var(--transition-duration) var(--ease-standard),
    box-shadow var(--transition-duration) var(--ease-standard),
    border-color var(--transition-duration) var(--ease-standard),
    background-color var(--transition-duration) var(--ease-standard),
    color var(--transition-duration) var(--ease-standard),
    opacity var(--transition-duration) var(--ease-standard);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.drop-zone:focus-visible,
.nav-tab:focus-visible,
.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.auth-button:hover:not(:disabled),
.primary-button:hover:not(:disabled),
.actions button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  transform: none;
}

.actions .ghost-button {
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border);
  box-shadow: none;
}

.actions .ghost-button:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle {
  color: var(--text-secondary);
}

.theme-toggle__track {
  width: 66px;
  height: 34px;
  border-color: var(--border);
}

.theme-toggle__thumb {
  width: 30px;
  height: 30px;
  left: 2px;
}

.theme-toggle.theme-toggle--dark .theme-toggle__thumb {
  transform: translate(32px, -50%);
}

.nav-tabs {
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 14px clamp(18px, 2.8vw, 34px);
  border-bottom: 1px solid var(--border);
  background: var(--surface-elevated);
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-tab {
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  padding: 10px 16px;
  white-space: nowrap;
}

.nav-tab:hover:not(.nav-tab--active) {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.nav-tab--active {
  background: var(--accent-soft);
  border-color: rgba(20, 94, 165, 0.36);
  color: var(--accent-strong);
}

.page-content {
  padding: clamp(14px, 2.1vw, 24px);
  align-items: flex-start;
}

.panel {
  width: 100%;
  max-width: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--surface-card);
  box-shadow: var(--shadow-elevated);
  padding: clamp(16px, 2.6vw, 26px);
  gap: 26px;
}

.panel--active {
  animation: panel-enter 220ms var(--ease-standard);
}

.panel-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-family: var(--font-family-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-header p {
  max-width: 70ch;
  line-height: 1.55;
}

.upload-form {
  gap: 18px;
}

.drop-zone {
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px) clamp(16px, 2.8vw, 28px);
  background: var(--dropzone-bg);
}

.drop-zone:hover,
.drop-zone--dragging {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(20, 94, 165, 0.35);
}

.drop-zone__icon {
  font-size: clamp(2.2rem, 3.2vw, 2.9rem);
}

.filters {
  gap: 14px;
}

.filter-field {
  gap: 8px;
}

.filter-field label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-field input,
.filter-field select,
textarea,
.modal__group input,
.modal__group textarea,
.offers-search input,
.latest-search input,
.offers-filters select,
.latest-filter input,
.latest-filter select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-card);
}

.run-status,
.jobs-toolbar,
.offers-toolbar,
.latest-bulk-toolbar,
.latest-filter,
.calendar-management-section,
.calendar-detail-panel,
.option-block {
  background: transparent;
  border-radius: 0;
  border-color: var(--border);
  border-width: 0 0 1px;
  border-style: solid;
}

.table-scroll,
.latest-table-wrapper,
.offers-table-wrapper,
.jobs-table-wrapper {
  border-radius: var(--radius-md);
  border-color: var(--border);
  background: var(--surface-card);
}

table {
  background: var(--surface-card);
}

thead {
  background: var(--table-header-bg);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

tbody tr:hover {
  background: var(--table-row-hover);
}

.jobs-table-wrapper tbody tr.selected,
.offers-table-wrapper tbody tr.selected {
  background: var(--table-row-selected);
}

.table-empty,
.form-hint,
.modal__status,
.modal__hint {
  color: var(--text-secondary);
}

.calendar-management-section {
  border-radius: var(--radius-md);
  padding: 16px;
  gap: 12px;
}

.calendar-management-section h3 {
  font-family: var(--font-family-display);
  font-size: 1.04rem;
  letter-spacing: -0.01em;
}

.calendar-detail-panel h4 {
  font-family: var(--font-family-display);
  font-size: 0.98rem;
}

.calendar-detail-json {
  border-color: var(--border);
  background: var(--surface-card);
}

.permissions-table th:first-child,
.permissions-table td:first-child {
  min-width: 300px;
}

.permissions-table th,
.permissions-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.woa-wizard {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.woa-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.woa-step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.woa-step-tab:last-child {
  border-right: 0;
}

.woa-step-tab span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.woa-step-tab:hover:not(:disabled),
.woa-step-tab--active {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.woa-step-tab:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.woa-step-tab:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.woa-step {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.woa-wizard-panel {
  min-width: 0;
  outline: none;
}

.woa-wizard-panel:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.woa-step:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

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

.woa-step__header > div {
  min-width: 0;
}

.woa-step__number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.woa-step h3,
.woa-step h4 {
  margin: 0;
  overflow-wrap: anywhere;
}

.woa-step__header p,
.woa-selected-card p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.woa-search-row {
  display: grid;
  gap: 10px;
}

.woa-list-field {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px);
  gap: 10px;
  align-items: center;
  justify-content: start;
}

.woa-list-field label {
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
}

.woa-list-field select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
}

.woa-search-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface-elevated) 86%, transparent);
  min-width: 0;
}

.woa-search-field {
  position: relative;
  min-width: 0;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent-soft));
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  transition:
    border-color var(--transition-duration) var(--ease-standard),
    background-color var(--transition-duration) var(--ease-standard),
    box-shadow var(--transition-duration) var(--ease-standard);
}

.woa-search-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--border));
  background: var(--surface-card);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.woa-search-field::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--text-secondary);
  border-radius: 999px;
  opacity: 0.75;
  transform: translateY(-58%);
  pointer-events: none;
}

.woa-search-field::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 26px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-secondary);
  opacity: 0.75;
  transform: translateY(4px) rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}

#woa-search {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px 0 42px;
  border: 0;
  border-radius: calc(var(--radius-md) - 1px);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  line-height: 40px;
  outline: none;
  box-shadow: none;
}

#woa-search::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

#woa-search:focus {
  outline: none;
  box-shadow: none;
}

.woa-search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.woa-search-actions select,
.woa-search-actions input {
  min-height: 40px;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
}

.woa-search-actions select {
  min-width: 112px;
  padding: 7px 10px;
}

.woa-search-actions input {
  width: 74px;
  padding: 7px 8px;
}

.woa-search-actions .ghost-button {
  min-height: 40px;
  white-space: nowrap;
}

.woa-advanced .woa-search-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.woa-advanced .woa-search-actions .ghost-button {
  width: 100%;
}

.woa-card-results,
.woa-inbox-results {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.woa-card-button {
  width: 100%;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 0;
  border: 1px solid var(--border);
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.woa-card-button:hover:not(:disabled),
.woa-card-button--selected {
  color: var(--accent-strong);
}

.woa-card-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.woa-card-button strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.woa-card-button span {
  color: var(--text-secondary);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.woa-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.woa-inline-actions .ghost-button {
  min-height: 34px;
}

.woa-batch-card-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.woa-batch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.woa-batch-card__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.woa-batch-card__copy strong,
.woa-batch-card__copy span {
  overflow-wrap: anywhere;
}

.woa-batch-card .ghost-button {
  min-height: 32px;
  padding: 4px 10px;
}

.woa-inline-error {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid color-mix(in oklch, var(--danger) 45%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--danger) 9%, var(--surface-elevated));
  color: var(--text-primary);
}

.woa-inline-error strong {
  font-size: 0.92rem;
}

.woa-inline-error span {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.woa-selected-card,
.woa-artifacts {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.woa-selected-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.woa-selected-card h4 {
  color: var(--text-primary);
  font-size: 1rem;
}

#woa-selected-description {
  max-width: 76ch;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.woa-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.woa-wizard-actions .primary-button,
.woa-wizard-actions .ghost-button {
  min-height: 42px;
  white-space: nowrap;
}

.woa-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.woa-review-grid > .filter-field,
.woa-review-grid input,
.woa-review-grid select {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.woa-review-notes {
  grid-column: 1 / -1;
}

.woa-review-notes textarea {
  resize: vertical;
  min-height: 78px;
}

.woa-primary-decisions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.woa-primary-decisions .primary-button,
.woa-primary-decisions .ghost-button {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  white-space: nowrap;
}

.woa-advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  min-width: 0;
}

.woa-advanced > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 800;
}

.woa-advanced > summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.woa-advanced > summary small {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.woa-advanced__body {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.woa-advanced__body .woa-step {
  padding-top: 14px;
}

.woa-artifact-button {
  justify-content: flex-start;
}

.woa-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.woa-readiness--warning {
  color: var(--text-primary);
}

.woa-readiness__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.woa-fallback-probe {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  min-width: 0;
}

.woa-fallback-probe__fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  min-width: 0;
}

.woa-fallback-probe__fields input {
  width: 100%;
}

.woa-fallback-probe__actions {
  align-items: center;
  margin-top: 0;
}

.woa-fallback-probe__result {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.woa-fallback-probe__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.woa-probe-source {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.woa-probe-source strong {
  color: var(--text-primary);
}

.woa-probe-source p,
.woa-fallback-probe__result p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.woa-preview-surface {
  display: grid;
  gap: 16px;
  margin: 0;
  min-width: 0;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.woa-progress-surface {
  gap: 10px;
  min-height: 104px;
  align-content: center;
}

.woa-progress-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.woa-progress-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in oklch, var(--accent) 22%, var(--border));
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: woa-progress-spin 900ms linear infinite;
}

.woa-progress-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.woa-progress-copy strong {
  color: var(--text-primary);
  font-size: 0.96rem;
}

.woa-progress-copy span,
.woa-progress-meta,
.woa-progress-note {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.45;
}

.woa-progress-meta {
  overflow-wrap: anywhere;
}

.woa-progress-note {
  margin: 0;
  padding-top: 2px;
  color: var(--text-primary);
}

.woa-diagnostics {
  gap: 12px;
}

.woa-diagnostics-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
}

.woa-diagnostics-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--text-primary);
  font-size: 0.84rem;
}

.woa-diagnostics-table th,
.woa-diagnostics-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.woa-diagnostics-table th {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.woa-diagnostics-table tbody tr:last-child td {
  border-bottom: 0;
}

.woa-diagnostics-duration {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.woa-stage-status {
  font-weight: 700;
}

.woa-stage-status--completed {
  color: var(--success);
}

.woa-stage-status--running {
  color: var(--accent);
}

.woa-stage-status--failed,
.woa-stage-status--error {
  color: var(--danger);
}

@keyframes woa-progress-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .woa-progress-spinner {
    animation: none;
  }
}

.woa-rforce-preview__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.woa-rforce-preview__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.woa-rforce-preview__header h4 {
  margin: 0;
  font-size: 1.08rem;
}

.woa-rforce-preview__header p {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

.woa-preview-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.woa-preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.woa-preview-badge--success {
  border-color: color-mix(in oklch, var(--success) 42%, var(--border));
  background: color-mix(in oklch, var(--success) 12%, var(--surface-elevated));
  color: var(--text-primary);
}

.woa-preview-badge--warning {
  border-color: color-mix(in oklch, var(--warning) 42%, var(--border));
  background: color-mix(in oklch, var(--warning) 12%, var(--surface-elevated));
  color: var(--text-primary);
}

.woa-rforce-preview__body {
  display: grid;
  gap: 0;
}

.woa-rforce-section {
  display: grid;
  gap: 10px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

.woa-rforce-preview__body .woa-rforce-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.woa-rforce-section h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.woa-fallback-section .woa-fallback-badges {
  justify-content: flex-start;
}

.woa-rforce-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 0;
  margin: 0;
}

.woa-rforce-field {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.woa-rforce-field dt {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.woa-rforce-field dd {
  min-width: 0;
  margin: 0;
  color: var(--text-primary);
  font-size: 0.93rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.woa-rforce-field--muted dd {
  color: var(--text-secondary);
}

.woa-rforce-field--long {
  grid-column: 1 / -1;
}

.woa-rforce-long-text {
  max-height: 240px;
  overflow: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.woa-review-contexts {
  display: grid;
  gap: 0;
  padding-top: 0;
  border-top: 1px solid var(--border);
}

.woa-review-contexts--primary {
  margin-top: 2px;
}

.woa-review-context {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.woa-review-context:last-child {
  border-bottom: 0;
}

.woa-review-context summary {
  cursor: pointer;
  padding: 10px 0;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 800;
}

.woa-review-context summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.woa-review-context ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 0 12px 20px;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.woa-review-context p {
  margin: 0;
  padding: 0 0 12px;
}

.woa-review-answer-status {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.woa-review-answer-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
}

.woa-review-answer {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.woa-review-answer:first-child {
  border-top: 0;
}

.woa-review-answer__question {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.4;
}

.woa-review-answer__suggestion {
  display: grid;
  gap: 5px;
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.woa-review-answer__suggestion[data-status="unsupported"],
.woa-review-answer__suggestion[data-status="error"],
.woa-review-answer__suggestion[data-status="missing"] {
  color: var(--text-secondary);
}

.woa-review-answer__label {
  width: fit-content;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.woa-review-answer__suggestion p {
  padding: 0;
}

.woa-review-answer__citations {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.woa-review-answer__missing {
  color: var(--warning);
  font-size: 0.82rem;
}

.woa-review-answer__controls {
  display: grid;
  grid-template-columns: auto minmax(90px, max-content) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.woa-review-answer__controls input[type="checkbox"] {
  margin-top: 4px;
}

.woa-review-answer__controls label {
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 800;
}

.woa-review-answer__controls textarea {
  min-height: 48px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  line-height: 1.4;
}

.woa-review-answer__controls textarea:disabled {
  opacity: 0.64;
}

.woa-review-answer__controls textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}

.woa-correction-field {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 800;
}

.woa-correction-field:first-of-type {
  border-top: 0;
}

.woa-correction-field textarea {
  min-height: 68px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-weight: 500;
  line-height: 1.4;
}

.woa-correction-field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}

.woa-json-preview {
  margin: 0;
  min-height: 120px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--text-primary);
  font: 0.86rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

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

.analytics-controls .filter-field:nth-child(1),
.analytics-controls .filter-field:nth-child(2),
.analytics-controls .filter-field:nth-child(3) {
  grid-column: span 2;
}

.analytics-controls .analytics-targets {
  grid-column: span 4;
}

.analytics-controls .analytics-actions {
  grid-column: span 2;
  justify-content: flex-end;
}

.analytics-targets textarea {
  height: 44px;
  min-height: 44px;
  resize: none;
}

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

.analytics-kpi-card {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.analytics-kpi-card h3 {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.analytics-kpi-card p {
  margin: 10px 0 0;
  font-family: var(--font-family-display);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.1;
}

.analytics-section {
  display: grid;
  gap: 10px;
}

.analytics-section h3 {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: 1rem;
}

.analytics-table th,
.analytics-table td {
  white-space: nowrap;
}

.analytics-pagination {
  justify-content: flex-end;
}

.modal {
  background: rgba(10, 19, 33, 0.56);
}

.modal__dialog {
  width: min(760px, 100%);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.modal__header,
.modal__footer {
  padding: 16px 20px;
}

.modal__body {
  padding: 20px;
}

.modal__close {
  border-radius: 8px;
  width: 30px;
  height: 30px;
}

.modal__close:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.modal__preview-block {
  background: var(--surface-card);
}

.toast {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast[data-tone="success"] {
  background: linear-gradient(135deg, #2f9b6d, #257e59);
}

.toast[data-tone="error"] {
  background: linear-gradient(135deg, #c75151, #a53e3e);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .toolbar {
    justify-content: flex-start;
  }

  .page-content {
    padding: 16px;
  }

  .permissions-table {
    min-width: 1120px;
  }

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

  .analytics-controls .filter-field,
  .analytics-controls .analytics-targets,
  .analytics-controls .analytics-actions {
    grid-column: span 1;
  }

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

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

  .woa-review-grid {
    grid-template-columns: 1fr;
  }

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

  .woa-rforce-preview__header {
    grid-template-columns: 1fr;
  }

  .woa-preview-badges {
    justify-content: flex-start;
  }

  .woa-rforce-fields {
    grid-template-columns: 1fr;
  }

  .woa-review-answer__controls {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .woa-review-answer__controls textarea {
    grid-column: 1 / -1;
  }

  .woa-search-toolbar {
    grid-template-columns: 1fr;
  }

  .woa-list-field {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .woa-list-field select {
    width: 100%;
  }

  .woa-search-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .woa-search-actions select,
  .woa-search-actions input {
    width: 100%;
  }

  .woa-search-actions .ghost-button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: calc(100% - 24px);
    margin-top: 12px;
    border-radius: 18px;
  }

  .top-bar {
    align-items: flex-start;
  }

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

  .toolbar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .app-shell {
    width: 100%;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .top-bar {
    padding: 16px;
  }

  .nav-tabs {
    padding: 12px 16px;
  }

  .page-content {
    padding: 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 14px;
  }

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

  .woa-stepper {
    grid-template-columns: 1fr;
  }

  .woa-step-tab {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .woa-step-tab:last-child {
    border-bottom: 0;
  }

  .woa-step {
    padding: 14px;
  }

  .woa-advanced__body {
    padding: 0 12px 12px;
  }

  .woa-primary-decisions {
    grid-template-columns: 1fr;
  }

  .woa-wizard-actions {
    justify-content: stretch;
  }

  .woa-wizard-actions .primary-button,
  .woa-wizard-actions .ghost-button {
    width: 100%;
  }

  .woa-fallback-probe__fields {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .dev-login {
    flex-direction: column;
    align-items: stretch;
  }

  .dev-login input,
  .dev-login button,
  .auth-button {
    width: 100%;
  }

  .user-info {
    width: 100%;
    justify-content: flex-start;
  }

  .modal {
    padding: 10px;
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding: 14px;
  }
}

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