/**
 * Visual Recovery Batch 1 — Revision 2
 * True composition redesign for Customers, Offers list, Tasks;
 * Operations desktop filter toolbar fix.
 * Shared V2 list primitives live here (allowlisted path).
 * Offer builder: preserve direction only.
 */

/* ========== Shared V2 primitives ========== */
.v2-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.v2-page-toolbar__search {
  flex: 1 1 240px;
  min-width: 0;
}

.v2-page-toolbar__filters {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.v2-page-toolbar__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.v2-page-toolbar .search,
.v2-page-toolbar label.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
  min-height: var(--v2-control-h);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-sm);
  background: var(--v2-surface);
  box-shadow: none;
}

.v2-page-toolbar .search input,
.v2-page-toolbar .ds-input {
  border: 0;
  background: transparent;
  box-shadow: none;
  width: 100%;
  min-height: calc(var(--v2-control-h) - 2px);
}

.v2-page-toolbar select,
.v2-filter-control {
  min-height: var(--v2-control-h);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-sm);
  background: var(--v2-surface);
  color: var(--v2-text);
  padding: 0 10px;
  box-shadow: none;
}

.v2-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v2-identity__primary {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-text);
  line-height: 1.25;
}

.v2-identity__secondary {
  font-size: 0.8125rem;
  color: var(--v2-text-secondary);
  line-height: 1.35;
}

.v2-identity__tertiary {
  font-size: var(--v2-type-meta);
  color: var(--v2-text-muted);
  line-height: 1.35;
}

.v2-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--v2-text-secondary);
  line-height: 1.35;
}

.v2-meta__line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-meta--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 8px;
  align-items: baseline;
}

.v2-meta--inline .v2-meta__line + .v2-meta__line::before {
  content: "·";
  margin-right: 8px;
  color: var(--v2-text-faint);
}

.v2-amount {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.v2-amount--accent {
  color: var(--v2-brand-ink);
}

.v2-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--v2-border);
  background: var(--v2-surface-muted);
  color: var(--v2-text-secondary);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.v2-badge--brand {
  background: var(--v2-brand-soft);
  border-color: color-mix(in srgb, var(--v2-brand) 28%, var(--v2-border));
  color: var(--v2-brand-ink);
}

.v2-badge--success {
  background: var(--v2-success-soft);
  border-color: color-mix(in srgb, var(--v2-success) 28%, var(--v2-border));
  color: #047857;
}

.v2-badge--info {
  background: var(--v2-info-soft);
  border-color: color-mix(in srgb, var(--v2-info) 28%, var(--v2-border));
  color: #1d4ed8;
}

.v2-badge--danger {
  background: var(--v2-danger-soft);
  border-color: color-mix(in srgb, var(--v2-danger) 28%, var(--v2-border));
  color: #b91c1c;
}

.v2-badge--warn {
  background: var(--v2-warning-soft);
  border-color: color-mix(in srgb, var(--v2-warning) 28%, var(--v2-border));
  color: #b45309;
}

.v2-due {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--v2-radius-sm);
  font-size: var(--v2-type-meta);
  font-weight: 650;
  color: var(--v2-text-secondary);
  background: var(--v2-surface-muted);
  border: 1px solid transparent;
  white-space: nowrap;
}

.v2-due--overdue {
  color: #b91c1c;
  background: var(--v2-danger-soft);
}

.v2-due--today {
  color: var(--v2-brand-ink);
  background: var(--v2-brand-soft);
}

.v2-due--upcoming {
  color: var(--v2-text-secondary);
  background: var(--v2-surface-muted);
}

.v2-due--done {
  color: var(--v2-text-muted);
  background: transparent;
  text-decoration: line-through;
}

.v2-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.v2-kebab summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--v2-radius-sm);
  border: 1px solid transparent;
  color: var(--v2-text-muted);
  cursor: pointer;
}

.v2-kebab summary::-webkit-details-marker {
  display: none;
}

.v2-kebab summary:hover {
  background: var(--v2-surface-muted);
  border-color: var(--v2-border);
  color: var(--v2-text);
}

.v2-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.v2-data-surface {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-sm);
  overflow: hidden;
}

.v2-data-table thead th {
  background: var(--v2-surface-muted);
  color: var(--v2-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--v2-border);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.v2-data-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--v2-border);
  vertical-align: middle;
  font-size: var(--v2-type-body);
  color: var(--v2-text);
}

.v2-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.v2-data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--v2-brand-soft) 28%, var(--v2-surface));
}

.v2-mobile-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  box-shadow: var(--v2-shadow-xs);
}

.v2-mobile-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.v2-mobile-card__rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.8125rem;
  color: var(--v2-text-secondary);
}

.v2-page-header {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--v2-border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.v2-page-header__title {
  margin: 0;
  font-size: var(--v2-type-page);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--v2-text);
  line-height: var(--v2-type-page-lh);
}

.v2-page-header__sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--v2-text-muted);
}

.v2-page-header__context {
  margin: 6px 0 0;
  font-size: var(--v2-type-meta);
  font-weight: 650;
  color: var(--v2-text-secondary);
}

/* ========== A. Customers — Rev2 ========== */
#customersView.customers-modern .customers-page-header {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--v2-border);
  align-items: flex-end;
}

#customersView.customers-modern .ds-page-header__title {
  font-size: var(--v2-type-page);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--v2-text);
  margin: 0;
}

#customersView.customers-modern .customers-page-header__sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
}

#customersView.customers-modern .customers-list-summary {
  margin: -4px 0 12px;
  font-size: var(--v2-type-meta);
  font-weight: 650;
  color: var(--v2-text-secondary);
}

#customersView.customers-modern .customers-modern-toolbar {
  margin: 0 0 12px;
}

#customersView.customers-modern .customers-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

#customersView.customers-modern .customers-archive-search {
  flex: 1 1 260px;
}

#customersView.customers-modern .customers-table-wrap.table-wrap,
#customersView.customers-modern .table-wrap {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-sm);
  overflow: hidden;
}

#customersView.customers-modern .customers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#customersView.customers-modern .customers-table thead th {
  background: var(--v2-surface-muted);
  color: var(--v2-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--v2-border);
  padding: 10px 14px;
}

#customersView.customers-modern .customers-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--v2-border);
  vertical-align: top;
}

#customersView.customers-modern .customers-table tbody tr:last-child td {
  border-bottom: 0;
}

#customersView.customers-modern .customers-table tbody tr:hover td {
  background: color-mix(in srgb, var(--v2-brand-soft) 28%, var(--v2-surface));
}

#customersView.customers-modern .customers-table__row .v2-identity__primary {
  font-size: 0.975rem;
}

#customersView.customers-modern .customers-table th:nth-child(4),
#customersView.customers-modern .customers-table td:nth-child(4),
#customersView.customers-modern .customers-table th:nth-child(5),
#customersView.customers-modern .customers-table td:nth-child(5) {
  text-align: center;
  white-space: nowrap;
}

#customersView.customers-modern .customers-table th:last-child,
#customersView.customers-modern .customers-table td:last-child {
  width: 48px;
  text-align: right;
}

#customersView.customers-modern .customers-view-btn {
  display: none;
}

#customersView.customers-modern .customers-row-actions {
  justify-content: flex-end;
}

#customersView.customers-modern .customers-status.ds-badge {
  background: var(--v2-brand-soft);
  border: 1px solid color-mix(in srgb, var(--v2-brand) 28%, var(--v2-border));
  color: var(--v2-brand-ink);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 650;
  padding: 3px 8px;
}

#customersView.customers-modern .primary-button,
#customersView.customers-modern .customers-new-btn {
  background: var(--v2-brand-strong);
  border-color: var(--v2-brand-strong);
  color: var(--v2-text-inverse);
  border-radius: var(--v2-radius-sm);
  box-shadow: none;
  min-height: var(--v2-control-h);
}

#customersView.customers-modern .customers-mobile-list {
  display: grid;
  gap: 10px;
  padding: 0;
}

#customersView.customers-modern .customers-mobile-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  box-shadow: var(--v2-shadow-xs);
}

#customersView.customers-modern .customers-mobile-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#customersView.customers-modern .customers-mobile-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-text);
  line-height: 1.25;
}

#customersView.customers-modern .customers-mobile-card__contact {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--v2-text-secondary);
}

#customersView.customers-modern .customers-mobile-card__channels {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--v2-text-muted);
}

#customersView.customers-modern .customers-mobile-card__ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.75rem;
  color: var(--v2-text-secondary);
}

#customersView.customers-modern .customers-mobile-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--v2-border);
}

#customersView.customers-modern .customers-mobile-card__chev {
  display: none;
}

/* ========== B. Offers list — Rev2 (builder preserved) ========== */
#offersView.offers-modern .offers-page-header {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--v2-border);
  align-items: flex-end;
}

#offersView.offers-modern .ds-page-header__title {
  font-size: var(--v2-type-page);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--v2-text);
  margin: 0;
}

#offersView.offers-modern .offers-page-header__sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
}

#offersView.offers-modern .offers-tabs.offer-tabs {
  gap: 6px;
  margin: 0 0 14px;
  padding: 3px;
  border: 0;
  background: var(--v2-surface-sunken);
  border-radius: var(--v2-radius-md);
  width: fit-content;
  max-width: 100%;
}

#offersView.offers-modern .offers-tabs .offer-tab,
#offersView.offers-modern .offers-tabs .ds-tabs__tab {
  border: 0;
  border-radius: var(--v2-radius-sm);
  background: transparent;
  color: var(--v2-text-secondary);
  min-height: 32px;
  padding: 6px 12px;
  font-weight: 550;
  box-shadow: none;
}

#offersView.offers-modern .offers-tabs .offer-tab.active,
#offersView.offers-modern .offers-tabs .offer-tab[aria-selected="true"] {
  background: var(--v2-surface);
  color: var(--v2-text);
  box-shadow: var(--v2-shadow-xs);
}

#offersView.offers-modern .offers-archive-panel.panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

#offersView.offers-modern .offers-modern-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#offersView.offers-modern .offers-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

#offersView.offers-modern .offers-archive-search {
  flex: 1 1 260px;
}

#offersView.offers-modern .offers-list-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 10px;
  font-size: var(--v2-type-meta);
  color: var(--v2-text-muted);
}

#offersView.offers-modern .offers-list-summary strong {
  color: var(--v2-text);
  font-size: 0.875rem;
}

#offersView.offers-modern .offers-table-wrap,
#offersView.offers-modern .offer-list-table-wrap {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-sm);
  overflow: hidden;
}

#offersView.offers-modern .offers-table,
#offersView.offers-modern .offer-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#offersView.offers-modern .offers-table thead th,
#offersView.offers-modern .offer-list-table thead th {
  background: var(--v2-surface-muted);
  color: var(--v2-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--v2-border);
  padding: 10px 14px;
}

#offersView.offers-modern .offers-table tbody td,
#offersView.offers-modern .offer-list-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--v2-border);
  vertical-align: top;
}

#offersView.offers-modern .offers-table tbody tr:last-child td,
#offersView.offers-modern .offer-list-table tbody tr:last-child td {
  border-bottom: 0;
}

#offersView.offers-modern .offers-table tbody tr:hover td,
#offersView.offers-modern .offer-list-table tbody tr:hover td {
  background: color-mix(in srgb, var(--v2-brand-soft) 24%, var(--v2-surface));
}

#offersView.offers-modern .offers-offer-no {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-text);
}

#offersView.offers-modern .offers-offer-date {
  display: block;
  margin-top: 2px;
  font-size: var(--v2-type-meta);
  color: var(--v2-text-muted);
}

#offersView.offers-modern .offers-customer {
  font-weight: 650;
  color: var(--v2-text);
}

#offersView.offers-modern .money-cell,
#offersView.offers-modern .v2-amount {
  color: var(--v2-text) !important;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

#offersView.offers-modern .offers-view-btn {
  display: none;
}

#offersView.offers-modern .offers-row-actions {
  justify-content: flex-end;
}

#offersView.offers-modern .primary-button,
#offersView.offers-modern .offers-new-btn {
  background: var(--v2-brand-strong);
  border-color: var(--v2-brand-strong);
  color: var(--v2-text-inverse);
  border-radius: var(--v2-radius-sm);
  box-shadow: none;
}

#offersView.offers-modern .offers-quick-btn,
#offersView.offers-modern .primary-button.is-outline {
  background: var(--v2-surface);
  color: var(--v2-brand-ink);
  border: 1px solid color-mix(in srgb, var(--v2-brand) 32%, var(--v2-border));
}

/* Preserve offer builder panels — light token only */
#offersView.offers-modern .panel.offer-builder,
#offersView.offers-modern #offerBuilderSection .panel {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-xs);
}

#offersView.offers-modern .offers-mobile-list {
  display: grid;
  gap: 10px;
}

#offersView.offers-modern .offers-mobile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
  padding: 14px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  box-shadow: var(--v2-shadow-xs);
}

#offersView.offers-modern .offers-mobile-card__main {
  display: grid;
  gap: 6px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  width: 100%;
}

#offersView.offers-modern .offers-mobile-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#offersView.offers-modern .offers-mobile-card__no {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#offersView.offers-modern .offers-mobile-card__amount {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--v2-text);
}

#offersView.offers-modern .offers-mobile-card__party {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--v2-text);
}

#offersView.offers-modern .offers-mobile-card__meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--v2-text-muted);
}

#offersView.offers-modern .offers-mobile-card__statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#offersView.offers-modern .offers-mobile-more {
  align-self: start;
}

/* ========== C. Tasks — Rev2 ========== */
#tasksView.tasks-modern .tasks-page-header {
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--v2-border);
}

#tasksView.tasks-modern .tasks-page-header__title,
#tasksView.tasks-modern .ds-page-header__title {
  margin: 0;
  font-size: var(--v2-type-page);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--v2-text);
}

#tasksView.tasks-modern .tasks-page-header__sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--v2-text-muted);
}

#tasksView.tasks-modern .tasks-workspace-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

#tasksView.tasks-modern .tasks-workspace-summary__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  font-size: var(--v2-type-meta);
  font-weight: 650;
  color: var(--v2-text-secondary);
}

#tasksView.tasks-modern .task-bulk-toolbar {
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 1px solid var(--v2-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#tasksView.tasks-modern .task-bulk-toolbar__actions .ghost-button {
  min-height: 32px;
  opacity: 0.85;
}

#tasksView.tasks-modern .tasks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}

#tasksView.tasks-modern .tasks-panel.panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

#tasksView.tasks-modern .tasks-panel .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 2px;
  background: transparent;
  border: 0;
}

#tasksView.tasks-modern .tasks-panel .panel-heading h2 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v2-text-muted);
}

#tasksView.tasks-modern .tasks-panel .panel-heading span {
  font-size: var(--v2-type-meta);
  color: var(--v2-text-secondary);
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 999px;
  padding: 2px 8px;
}

#tasksView.tasks-modern .task-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-xs);
  overflow: hidden;
}

#tasksView.tasks-modern .task-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--v2-border);
  border-radius: 0;
  box-shadow: none;
  min-height: 56px;
}

#tasksView.tasks-modern .task-item:last-child {
  border-bottom: 0;
}

#tasksView.tasks-modern .task-item:hover {
  background: color-mix(in srgb, var(--v2-brand-soft) 22%, var(--v2-surface));
}

#tasksView.tasks-modern .task-item.is-linked,
.task-item.is-linked {
  cursor: pointer;
}

#tasksView.tasks-modern .task-item.is-linked:focus-visible,
.task-item.is-linked:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: -3px;
}

#tasksView.tasks-modern .task-item.done {
  opacity: 0.72;
}

#tasksView.tasks-modern .task-item.done .task-item__title {
  color: var(--v2-text-muted);
  text-decoration: line-through;
}

#tasksView.tasks-modern .task-item__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--v2-text);
  line-height: 1.3;
}

#tasksView.tasks-modern .task-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--v2-text-muted);
}

#tasksView.tasks-modern .task-item__meta .task-item__type::before {
  content: "·";
  margin-right: 8px;
  color: var(--v2-text-faint);
}

#tasksView.tasks-modern .task-item__date {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

#tasksView.tasks-modern .task-item__delete {
  opacity: 0.55;
}

#tasksView.tasks-modern .task-item:hover .task-item__delete,
#tasksView.tasks-modern .task-item:focus-within .task-item__delete {
  opacity: 1;
}

#tasksView.tasks-modern .mobile-task-extra {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 2px;
}

#tasksView.tasks-modern .mobile-task-extra .ghost-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.75rem;
  border-radius: var(--v2-radius-sm);
}

@media (max-width: 1199px) {
  #tasksView.tasks-modern .tasks-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  #tasksView.tasks-modern .task-item {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "select done body due"
      "extra extra extra extra";
    gap: 8px 10px;
    padding: 12px;
  }
  #tasksView.tasks-modern .task-select-checkbox { grid-area: select; }
  #tasksView.tasks-modern .task-done-checkbox { grid-area: done; }
  #tasksView.tasks-modern .task-item__body { grid-area: body; }
  #tasksView.tasks-modern .task-item__date { grid-area: due; }
  #tasksView.tasks-modern .task-item__delete { display: none; }
  #tasksView.tasks-modern .mobile-task-extra {
    grid-area: extra;
    border-top: 1px solid var(--v2-border);
    padding-top: 8px;
    margin-top: 2px;
  }
  #tasksView.tasks-modern .mobile-task-extra .ghost-button:not([data-mobile-task-done]) {
    /* secondary actions quieter; keep hooks */
    color: var(--v2-text-secondary);
  }
  #tasksView.tasks-modern .mobile-task-extra [data-mobile-task-done] {
    background: var(--v2-brand-soft);
    border-color: color-mix(in srgb, var(--v2-brand) 30%, var(--v2-border));
    color: var(--v2-brand-ink);
    font-weight: 650;
  }
}

/* ========== D. Operations — filter toolbar fix only ========== */
.operations-center-page.operations-center-main-modern {
  --ops-radius: var(--v2-radius-lg);
  --ops-surface: var(--v2-surface);
  --ops-surface-quiet: var(--v2-surface-muted);
  --ops-line: var(--v2-border);
  --ops-ink: var(--v2-text);
  --ops-muted: var(--v2-text-muted);
  --ops-accent: var(--v2-brand-strong);
  gap: 14px;
}

.operations-center-page.operations-center-main-modern .operations-center-header {
  margin: 0 0 2px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--v2-border);
}

.operations-center-page.operations-center-main-modern .operations-center-header__title {
  margin: 0;
  font-size: var(--v2-type-page);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--v2-text);
}

.operations-center-page.operations-center-main-modern .operations-center-header__eyebrow {
  color: var(--v2-brand-ink);
  font-size: var(--v2-type-meta);
  letter-spacing: 0.06em;
  font-weight: 650;
}

.operations-center-page.operations-center-main-modern .operations-center-lead {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--v2-text-muted);
}

.operations-center-page.operations-center-main-modern .operations-center-kpi-grid.metric-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0;
  padding: 2px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-sm);
  overflow: hidden;
}

.operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile {
  margin: 0;
  padding: 14px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-right: 1px solid var(--v2-border);
  min-height: 78px;
}

.operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile::before {
  content: none !important;
  display: none !important;
}

.operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile:last-child {
  border-right: 0;
}

.operations-center-page.operations-center-main-modern .operations-center-kpi strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--v2-text);
}

.operations-center-page.operations-center-main-modern .operations-center-kpi span {
  display: block;
  margin-top: 4px;
  font-size: var(--v2-type-meta);
  color: var(--v2-text-muted);
}

.operations-center-page.operations-center-main-modern .operations-center-kpi--risk strong {
  color: var(--v2-danger);
}

.operations-center-page.operations-center-main-modern .panel {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-xl);
  box-shadow: var(--v2-shadow-sm);
  overflow: hidden;
}

.operations-center-page.operations-center-main-modern .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  background: var(--v2-surface-muted);
  border-bottom: 1px solid var(--v2-border);
}

.operations-center-page.operations-center-main-modern .panel-heading h2 {
  margin: 0;
  font-size: var(--v2-type-section);
  font-weight: 650;
  color: var(--v2-text);
}

.operations-center-page.operations-center-main-modern .operations-center-recent-panel > #operationsCenterFilters,
.operations-center-page.operations-center-main-modern .operations-center-recent-panel > #operationsCenterTable,
.operations-center-page.operations-center-main-modern .operations-center-workorders-panel > #operationsCenterAllWorkOrders {
  padding: 12px 14px;
}

/* Desktop: one compact toolbar row */
.operations-center-page.operations-center-main-modern .operations-center-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(140px, 0.7fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border: 0;
  align-items: center;
}

.operations-center-page.operations-center-main-modern .operations-center-filter-input,
.operations-center-page.operations-center-main-modern .operations-center-filter-select {
  width: 100%;
  min-width: 0;
  min-height: var(--v2-control-h);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-sm);
  background: var(--v2-surface);
  box-shadow: none;
  color: var(--v2-text);
  padding: 0 12px;
}

@media (max-width: 1100px) {
  .operations-center-page.operations-center-main-modern .operations-center-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .operations-center-page.operations-center-main-modern .operations-center-filter-input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .operations-center-page.operations-center-main-modern .operations-center-filters {
    grid-template-columns: 1fr;
  }
  .operations-center-page.operations-center-main-modern .operations-center-kpi-grid.metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile {
    border-right: 1px solid var(--v2-border);
    border-bottom: 1px solid var(--v2-border);
    padding: 10px 12px;
    min-height: 0;
  }
  .operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile:nth-child(2n) {
    border-right: 0;
  }
  .operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 1200px) and (min-width: 768px) {
  .operations-center-page.operations-center-main-modern .operations-center-kpi-grid.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile:nth-child(4n) {
    border-right: 0;
  }
  .operations-center-page.operations-center-main-modern .operations-center-kpi.metric-tile:nth-child(-n + 4) {
    border-bottom: 1px solid var(--v2-border);
  }
}
