:root {
  --wm-primary: #2563eb;
  --wm-success: #16a34a;
  --wm-warning: #d97706;
  --wm-danger: #dc2626;
  --wm-neutral: #6b7280;
  --wm-body-bg: #f7f9fb;
  --wm-surface: #ffffff;
  --wm-surface-muted: #f1f5f9;
  --wm-surface-muted-strong: #e8eef5;
  --wm-border: #e5e7eb;
  --wm-border-muted: #e2e8f0;
  --wm-table-hover: #edf3ff;
  --wm-text: #111827;
  --wm-text-muted: #6b7280;
  --wm-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --wm-shadow-md: 0 12px 24px rgba(15, 23, 42, 0.12);
  --wm-radius-sm: 0.375rem;
  --wm-radius-md: 0.5rem;
  --wm-radius-lg: 0.75rem;
  --wm-focus-ring: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);

  --bs-primary: var(--wm-primary);
  --bs-success: var(--wm-success);
  --bs-warning: var(--wm-warning);
  --bs-danger: var(--wm-danger);
  --bs-secondary: var(--wm-neutral);
  --bs-link-color: var(--wm-primary);
  --bs-link-hover-color: #1d4ed8;
  --bs-border-color: var(--wm-border);
  --bs-border-radius: var(--wm-radius-sm);
  --bs-border-radius-lg: var(--wm-radius-md);
  --bs-border-radius-sm: 0.25rem;
  --bs-focus-ring-color: rgba(37, 99, 235, 0.25);
}

body {
  background-color: var(--wm-body-bg);
  color: var(--wm-text);
}

.wm-surface-muted {
  background-color: var(--wm-surface-muted);
}

.wm-surface-muted-strong {
  background-color: var(--wm-surface-muted-strong);
}

.wm-badge-toggle {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.35em 0.65em;
  border-radius: var(--bs-badge-border-radius, 0.375rem);
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: baseline;
}

.wm-badge-toggle:focus-visible {
  outline: none;
  box-shadow: var(--wm-focus-ring);
}

.wm-row-hover-item {
  transition: background-color 120ms ease;
}

.wm-row-hover-item:hover,
.wm-row-hover-item:focus-within,
.wm-row-hover-item:active {
  background-color: var(--wm-table-hover) !important;
}

.wm-action-icon-slot {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.wm-action-icon-btn {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wm-action-row--completed {
  background-color: var(--wm-surface) !important;
}

.daily-action-row.wm-action-row--completed .flex-grow-1 {
  color: rgba(107, 114, 128, 0.68) !important;
}

.daily-action-row.wm-action-row--completed .flex-grow-1 * {
  color: inherit !important;
}

.daily-action-row.wm-action-row--completed .flex-grow-1 .text-decoration-line-through {
  text-decoration-color: rgba(107, 114, 128, 0.45) !important;
}

.daily-action-row .form-check-input,
.inbox-action-row .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0;
  border: 2px solid rgba(15, 23, 42, 0.35);
  background-color: #fff;
  box-shadow: none;
}

.daily-action-row .form-check-input:hover,
.inbox-action-row .form-check-input:hover {
  border-color: rgba(15, 23, 42, 0.55);
}

.daily-action-row .form-check-input:checked,
.inbox-action-row .form-check-input:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

.daily-action-row .form-check-input:focus,
.inbox-action-row .form-check-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.16rem rgba(37, 99, 235, 0.25);
}

.badge.wm-badge-actively-looking {
  background-color: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid rgba(22, 101, 52, 0.22) !important;
}

.badge.wm-badge-passively-looking {
  background-color: #dbeafe !important;
  color: #1e40af !important;
  border: 1px solid rgba(30, 64, 175, 0.18) !important;
}

.badge.wm-badge-not-looking {
  background-color: #e5e7eb !important;
  color: #111827 !important;
  border: 1px solid rgba(17, 24, 39, 0.14) !important;
}

.badge.wm-badge-inactive-retired {
  background-color: #f3f4f6 !important;
  color: #6b7280 !important;
  border: 1px solid rgba(107, 114, 128, 0.22) !important;
}

.status-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  vertical-align: middle;
}
.status-dot-warning {
  background: #f59e0b;
}
.status-dot-info {
  background: #3b82f6;
}
.status-dot-success {
  background: #22c55e;
}
.status-dot-neutral {
  background: #94a3b8;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.page-header-body {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}

.page-header-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--wm-text-muted);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-left: auto;
}

.filter-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--wm-radius-md);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0.75rem;
  z-index: 5;
}

.filter-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.filter-bar__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wm-text);
  margin: 0;
}

.filter-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-toggle {
  background: #ffffff;
  border-color: #d1d5db;
  font-family: inherit;
}

.filter-toggle.is-active {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af;
}

.filter-menu {
  min-width: 240px;
  padding: 12px 12px 10px 12px;
  font-family: inherit;
}

.filter-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 0;
  white-space: nowrap;
}

.filter-option-row.form-check {
  padding-left: 12px;
}

.filter-option-row .form-check-input,
.filter-option-row .form-check-label {
  font-family: inherit;
}

.filter-option-row .form-check-input {
  margin-left: 0;
  margin-top: 0;
  position: static;
}

.filter-option-row:hover {
  background: var(--wm-table-hover);
}

.filter-menu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid #e5e7eb;
}

.filter-pill-row {
  font-family: inherit;
}

.filter-pill {
  background: #f8fafc;
  border-color: #d1d5db;
  font-family: inherit;
  color: inherit;
}

.filter-pill:hover {
  background: var(--wm-table-hover);
  color: inherit;
  border-color: #d1d5db;
}

.filter-pill-x {
  margin-left: 6px;
  font-weight: 600;
}

.filter-pill-category {
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    width: 100%;
  }
}

.empty-state {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: var(--wm-radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.empty-state-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.empty-state-subtitle {
  margin: 0.35rem 0 0;
  color: var(--wm-text-muted);
  font-size: 0.9rem;
}

.empty-state-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  .empty-state {
    flex-direction: column;
    align-items: flex-start;
  }
}


.navbar {
  background: #f7f9fc;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.wm-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background-color: var(--wm-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.navbar.bg-white.border-bottom {
  border-bottom-color: #e0e6f0 !important;
}
.contractor-title {
  font-size: 1.75rem;
  font-weight: 600;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--wm-text);
  letter-spacing: -0.01em;
}

.section-block {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--wm-text-muted);
  letter-spacing: 0.03em;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wm-text-muted);
}

.form-control::placeholder,
.form-control::-webkit-input-placeholder {
  color: #cbd5e1;
  font-style: italic;
}

.form-control:focus::placeholder,
.form-control:focus::-webkit-input-placeholder {
  color: #e2e8f0;
  font-style: italic;
}

.wm-date-input.is-empty {
  color: #cbd5e1;
  font-style: italic;
}

.wm-date-input.is-empty:focus {
  color: #e2e8f0;
  font-style: italic;
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  color: #475569;
  font-size: 0.75rem;
  line-height: 1;
  cursor: help;
}

.help-icon:focus {
  outline: 2px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}

.form-text,
.small-hint {
  font-size: 0.8rem;
  color: var(--wm-text-muted);
}

.form-label .required-indicator {
  color: var(--wm-danger);
  margin-left: 0.25rem;
  font-weight: 600;
}

.errorlist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  color: var(--wm-danger);
  font-size: 0.85rem;
}

.errorlist li {
  margin: 0;
}

.form-control.is-invalid,
.form-select.is-invalid,
textarea.is-invalid {
  border-color: var(--wm-danger);
  background-color: #fff5f5;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.12);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
textarea.is-invalid:focus,
.form-control[aria-invalid="true"]:focus,
.form-select[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus {
  border-color: var(--wm-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.18);
}

.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--wm-danger);
  background-color: #fff5f5;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.12);
}

.form-check-input.is-invalid {
  border-color: var(--wm-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.12);
}

.form-check-input.is-invalid:focus {
  border-color: var(--wm-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.18);
}

.field-group.is-invalid {
  border-color: var(--wm-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.12);
}

.field-group.is-invalid .form-control,
.field-group.is-invalid .form-select,
.field-group.is-invalid textarea {
  border-color: var(--wm-danger);
  background-color: #fff5f5;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.12);
}

.field-group.is-invalid .form-check-input {
  border-color: var(--wm-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.12);
}

.field-group.is-invalid .touchpoint-btn {
  border-color: rgba(220, 38, 38, 0.45);
}

.field-group.is-invalid .btn-check:checked + .touchpoint-btn {
  border-color: var(--wm-danger);
  background-color: rgba(220, 38, 38, 0.08);
  color: var(--wm-danger);
}

/* Tabs */
.custom-tabs {
  border-bottom: none;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0.75rem;
}

.custom-tabs .nav-item,
.custom-tabs .nav-link {
  scroll-snap-align: start;
}

.custom-tabs .nav-link {
  color: var(--wm-text-muted);
  border: 1px solid transparent;
  border-bottom: none;
  padding: 0.75rem 1rem;
  font-weight: 500;
  background-color: transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

@media (max-width: 575.98px) {
  .custom-tabs {
    /* Subtle cue that this row can be swiped horizontally. */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }
}

.custom-tabs .nav-link:hover {
  color: var(--wm-primary);
  background-color: #f8f9fa;
}

.custom-tabs .nav-link.active {
  color: var(--wm-primary);
  font-weight: 700;
  background-color: #fff;
  border: 1px solid var(--wm-border);
  border-bottom-color: #fff;
  border-radius: 0.375rem 0.375rem 0 0;
}

.wm-mobile-section-switcher {
  position: sticky;
  top: var(--wm-sticky-offset, 4rem);
  z-index: 8;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--wm-radius-md);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.wm-mobile-section-switcher .form-label {
  font-size: 0.75rem;
  color: var(--wm-text-muted);
}

.alert {
  word-break: break-word;
}

.mailbox-message-pre {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.75rem;
  border-radius: 6px;
  max-height: 260px;
  overflow: auto;
  margin-top: 0.5rem;
}
.row-highlight,
.row-highlight td {
  background-color: var(--wm-table-hover) !important;
  transition: background-color 1.1s ease, box-shadow 1.1s ease;
}

.btn:focus-visible,
.btn-close:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible {
  outline: none;
  box-shadow: var(--wm-focus-ring);
}

.js-row-link {
  cursor: pointer;
}

.table.wm-table {
  --wm-table-border: #e6ebf2;
  --wm-table-stripe: #fbfdff;
  --wm-table-hover: #edf3ff;
  --bs-table-hover-bg: transparent;
  --bs-table-hover-color: inherit;

  border-color: var(--wm-table-border);
}

.table.wm-table thead th {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  color: #475569;
  background-color: #f1f5f9;
  border-bottom: 1px solid #d6e0ee;
  padding: 0.7rem 0.85rem;
  vertical-align: bottom;
}

.table.wm-table tbody > tr > * {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #eef2f7;
}

.table.wm-table tbody > tr:hover > * {
  background-color: var(--wm-table-hover);
}

.wm-hover-highlight {
  transition: background-color 0.12s ease-in-out;
}

.wm-hover-highlight:hover,
.wm-hover-highlight:focus-within {
  background-color: var(--wm-table-hover);
}

.table.wm-table tbody > tr.js-row-link:focus-within,
.table.wm-table tbody > tr.js-row-link:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  outline-offset: -2px;
}

.table.wm-table tbody > tr.js-row-link:focus-within > *,
.table.wm-table tbody > tr.js-row-link:focus > * {
  background-color: var(--wm-table-hover);
}

.table.table-sm.wm-table thead th {
  padding: 0.55rem 0.7rem;
}

.table.table-sm.wm-table tbody > tr > * {
  padding: 0.55rem 0.7rem;
}

.table.wm-table.wm-stack {
  width: 100%;
}

@media (max-width: 991.98px) {
  .wm-stack {
    --wm-stack-label-width: 8.5rem;
  }

  .wm-stack thead {
    display: none;
  }

  .wm-stack tbody tr {
    display: block;
    border: 1px solid var(--wm-border-muted);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    margin-bottom: 0.75rem;
  }

  .table.wm-table.wm-stack tbody tr > * {
    display: block;
    position: relative;
    width: 100%;
    padding: 0.45rem 0 0.45rem calc(var(--wm-stack-label-width) + 0.75rem);
    border-bottom: 0 !important;
    border-top: 0 !important;
    background-color: transparent;
  }

  .table.wm-table.wm-stack tbody tr > *:last-child {
    border-bottom: 0;
  }

  .table.wm-table.wm-stack tbody tr > *::before {
    content: attr(data-label);
    position: absolute;
    top: 0.45rem;
    left: 0;
    width: var(--wm-stack-label-width);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    color: #6b7280;
  }

  .table.wm-table.wm-stack tbody tr > *.text-end {
    text-align: right;
  }

  .table.wm-table.wm-stack tbody tr > *.text-end::before {
    text-align: left;
  }

  .wm-stack tbody > tr:nth-child(even) > *,
  .wm-stack tbody > tr:hover > * {
    background-color: transparent;
  }

  .table.wm-table.wm-stack tbody tr.js-row-link:hover > *,
  .table.wm-table.wm-stack tbody tr.js-row-link:focus-within > *,
  .table.wm-table.wm-stack tbody tr.js-row-link:active > *,
  .table.wm-table.wm-stack tbody tr.js-row-link > *:active {
    background-color: var(--wm-table-hover);
  }

  .table.wm-table.wm-stack tbody tr.js-row-link:hover,
  .table.wm-table.wm-stack tbody tr.js-row-link:focus-within,
  .table.wm-table.wm-stack tbody tr.js-row-link:active {
    background-color: var(--wm-table-hover);
  }

  .table.wm-table.wm-stack.wm-row-hover tbody tr:hover > *,
  .table.wm-table.wm-stack.wm-row-hover tbody tr:focus-within > *,
  .table.wm-table.wm-stack.wm-row-hover tbody tr:active > *,
  .table.wm-table.wm-stack.wm-row-hover tbody tr > *:active {
    background-color: var(--wm-table-hover);
  }

  .table.wm-table.wm-stack.wm-row-hover tbody tr:hover,
  .table.wm-table.wm-stack.wm-row-hover tbody tr:focus-within,
  .table.wm-table.wm-stack.wm-row-hover tbody tr:active {
    background-color: var(--wm-table-hover);
  }

  .wm-stack tbody tr.mailbox-details-row {
    margin-top: -0.5rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
  }

  .table.wm-table.wm-stack tbody tr.mailbox-details-row > * {
    display: block;
    padding: 0.6rem 0.75rem;
  }

  .table.wm-table.wm-stack tbody tr.mailbox-details-row > *::before {
    content: none;
    margin: 0;
  }
}

@media (max-width: 575.98px) {
  .wm-stack {
    --wm-stack-label-width: 7rem;
  }


}

.js-action-reorder-list .daily-action-row[data-reorder-item="true"] {
  cursor: grab;
  position: relative;
}

.js-action-reorder-list .daily-action-row.is-dragging {
  opacity: 0.92;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  transform: scale(1.01);
  z-index: 2;
  border-radius: 12px;
}

.js-action-reorder-list {
  position: relative;
}

.js-action-reorder-list > .is-drop-before {
  position: relative;
}

.js-action-reorder-list > .is-drop-before::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: #2563eb;
  border-radius: 999px;
  pointer-events: none;
}

.js-action-reorder-list.is-drop-at-end::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #2563eb;
  border-radius: 999px;
  pointer-events: none;
}

.wm-action-drag-handle {
  border: 0;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  min-width: 1rem;
  height: 1.25rem;
  cursor: grab;
  padding: 0;
  margin-right: 0.1rem;
}

.wm-action-drag-handle:hover,
.wm-action-drag-handle:focus {
  color: #475569;
}

.wm-action-drag-handle:active {
  cursor: grabbing;
}

.wm-grip-icon {
  width: 10px;
  height: 14px;
  fill: currentColor;
}

