/* V3 workbench task cards use the V2 owner theme and its layout breakpoints. */
#root .shell.admin-workspace .wuyou-wb-v3 .owner-ws-board .wuyou-wb-task {
  --wb-task-signal: #5a72ed;
  --wb-task-chip: #e9edff;
  --wb-task-chip-text: #303b89;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 8px;
  padding: 13px 13px 12px;
  border-inline-start: 3px solid var(--wb-task-signal);
  background: var(--wb-panel);
}

#root .shell.admin-workspace .wuyou-wb-v3 .owner-ws-board .wuyou-wb-task.selected {
  border-inline-start-color: var(--wb-task-signal);
  box-shadow: 0 0 0 1px var(--wb-accent);
}

#root .shell.admin-workspace .wuyou-wb-v3 .owner-ws-board .wuyou-wb-task.owner-ws-waiting {
  --wb-task-signal: #7987ae;
  --wb-task-chip: #eef0f7;
  --wb-task-chip-text: #34405f;
}

#root .shell.admin-workspace .wuyou-wb-v3 .owner-ws-board .wuyou-wb-task.owner-ws-review {
  --wb-task-signal: #c9741c;
  --wb-task-chip: #fff0db;
  --wb-task-chip-text: #743a08;
}

#root .shell.admin-workspace .wuyou-wb-v3 .owner-ws-board .wuyou-wb-task.owner-ws-done {
  --wb-task-signal: #279b71;
  --wb-task-chip: #e2f5ec;
  --wb-task-chip-text: #1b6048;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .owner-ws-slot-head {
  gap: 5px 7px;
  margin: 0;
  align-items: baseline;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .wuyou-wb-task-status {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--wb-task-chip);
  color: var(--wb-task-chip-text);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .owner-ws-customer {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
  line-height: 1.4;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .wuyou-wb-plan {
  display: block;
  margin: 2px 0 0;
  color: var(--wb-muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .wuyou-wb-task-detail {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--wb-ink);
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.wuyou-wb-task-meta,
.wuyou-wb-task-footer small {
  font-size: 11px;
  color: var(--wb-muted);
  font-variant-numeric: tabular-nums;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .wuyou-wb-task-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px 8px;
  margin-top: auto;
  padding: 7px 0 0;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task button.wuyou-wb-task-action {
  min-height: 32px;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--wb-soft);
  color: var(--wb-ink);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 650;
  text-align: center;
  cursor: pointer;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task button.wuyou-wb-task-action:hover:not(:disabled) {
  border-color: var(--wb-task-signal);
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task.wuyou-wb-task-verify button.wuyou-wb-task-action,
#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task.owner-ws-done button.wuyou-wb-task-action {
  background: var(--wb-task-chip);
  color: var(--wb-task-chip-text);
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task button.wuyou-wb-task-action:focus-visible {
  outline: 2px solid var(--wb-task-signal);
  outline-offset: 2px;
}

#root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task button.wuyou-wb-task-action:disabled {
  opacity: .65;
  cursor: not-allowed;
}

@media (max-width: 540px) {
  #root .shell.admin-workspace .wuyou-wb-v3 .owner-ws-board .wuyou-wb-task {
    min-height: 0;
    padding: 10px 11px;
    gap: 6px;
  }

  #root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task .owner-ws-slot-head {
    justify-content: space-between;
  }

  #root .shell.admin-workspace .wuyou-wb-v3 .wuyou-wb-task button.wuyou-wb-task-action {
    min-height: 40px;
    padding-inline: 9px;
  }
}

/* The owner records view uses the existing server filters, totals and refresh. */
#root .shell.admin-workspace .cv-records .wuyou-records-v3 {
  --record-panel: var(--au-panel, #fff);
  --record-text: var(--au-ink, #182139);
  --record-muted: var(--au-muted, #64748b);
  --record-soft: var(--au-soft, #f4f5fb);
  --record-line: var(--au-line, #e4e7f1);
  --record-accent: var(--au-button, #674ec7);
  --record-accent-end: var(--au-button2, #7655c5);
  min-width: 0;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-list-summary {
  order: 0;
  gap: 9px;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-list-summary > span:last-child {
  justify-self: end;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid var(--record-line);
  border-radius: 999px;
  color: var(--record-muted);
  background: var(--record-soft);
  font-size: 11px;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 > .wuyou-records-filters {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.7fr);
  align-items: end;
  gap: 10px;
  padding: 14px;
  background: var(--record-panel);
  border: 1px solid var(--record-line);
  border-radius: 14px;
}

#root .shell.admin-workspace .cv-records .wuyou-records-filter-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--record-muted);
  font-size: 12px;
  line-height: 1.3;
}

#root .shell.admin-workspace .cv-records .wuyou-records-filter-state > span {
  color: var(--record-text);
  font-weight: 700;
}

#root .shell.admin-workspace .cv-records .wuyou-records-filters :is(input, select) {
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
  min-height: 41px;
  padding: 8px 9px;
  color: var(--record-text);
  background: var(--record-soft);
  border: 1px solid var(--record-line);
  border-radius: 8px;
  grid-area: auto;
}

#root .shell.admin-workspace .cv-records .wuyou-records-filter-state select {
  border-color: var(--record-accent);
}

#root .shell.admin-workspace .cv-records .wuyou-records-search {
  grid-column: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
}

#root .shell.admin-workspace .cv-records .wuyou-records-filters:has(.wuyou-records-filter-agent) .wuyou-records-search {
  grid-column: 2 / -1;
}

#root .shell.admin-workspace .cv-records .wuyou-records-search button {
  grid-area: auto;
  min-height: 41px;
  margin: 0;
  padding: 8px 12px;
  color: #fff;
  border: 0;
  background: linear-gradient(110deg, var(--record-accent), var(--record-accent-end));
  border-radius: 8px;
}

#root .shell.admin-workspace .cv-records .wuyou-records-filter-message {
  grid-column: 1 / -1;
  color: var(--record-muted);
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table {
  min-width: 930px;
  background: var(--record-panel);
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table th {
  color: var(--record-muted);
  background: var(--record-soft);
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table :is(th, td) {
  border-color: var(--record-line);
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table td {
  color: var(--record-text);
  padding: 11px 9px;
  overflow-wrap: anywhere;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table :is(code, small) {
  color: var(--record-muted);
  overflow-wrap: anywhere;
  white-space: normal;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 :is(td[data-label="兑换码"], td[data-label="充值时间"]) > :is(code, strong, small:first-of-type) {
  color: var(--record-text);
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table .cv-record-feedback {
  min-width: 145px;
  max-width: 245px;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .cv-record-result {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--record-text);
  background: var(--record-soft);
  line-height: 1.4;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .cv-record-result.warning {
  background: #fff0df;
  color: #7f3c12;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .cv-record-result.success {
  background: #e4f7ec;
  color: #146044;
}

#root .shell.admin-workspace .cv-records .wuyou-records-v3 .cv-record-success-panel > small {
  color: #296348;
}

@media (max-width: 1140px) {
  #root .shell.admin-workspace .cv-records .wuyou-records-v3 > .wuyou-records-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  #root .shell.admin-workspace .cv-records .wuyou-records-v3 > .wuyou-records-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 11px;
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-filter-state {
    grid-column: 1 / -1;
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-filters:has(.wuyou-records-filter-agent) :is(.wuyou-records-filter-agent, .wuyou-records-search) {
    grid-column: 1 / -1;
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table {
    min-width: 0;
    background: transparent;
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table > tbody > tr {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 10px;
    padding: 5px 11px;
    border: 1px solid var(--record-line);
    border-radius: 13px;
    background: var(--record-panel);
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table td {
    grid-column: auto;
    min-width: 0;
    max-width: none;
    padding: 8px 0;
    line-height: 1.5;
    white-space: normal;
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table td::before {
    margin-bottom: 3px;
    color: var(--record-muted);
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table td:is([data-label="状态 / 错误说明"], [data-label="客户邮箱"]) {
    grid-column: 1 / -1;
  }

  #root .shell.admin-workspace .cv-records .wuyou-records-v3 .manager-order-table .cv-row-detail summary {
    min-height: 28px;
    padding-block: 3px;
  }
}

/* Daily profit workspace: paired date fields, compact report rows and clear disclosures. */
#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel {
  display: grid;
  grid-template-columns: minmax(195px, .85fr) minmax(0, 2fr);
  align-items: end;
  gap: 14px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--profit-line);
  border-radius: 16px;
  background: var(--profit-paper);
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel > :is(.hub-toolbar, .hub-fieldset) {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel .daily-profit-presets {
  padding: 4px;
  border-radius: 13px;
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel .daily-profit-presets button {
  min-height: 36px;
  padding: 5px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel .daily-profit-filters {
  margin: 0;
  gap: 8px;
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel .daily-profit-filters label {
  gap: 4px;
  min-width: 0;
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel :is(input, select) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 13px;
}

#root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel input[type='date']::-webkit-date-and-time-value {
  min-width: 0;
  text-align: start;
}

#root .shell.admin-workspace .daily-profit-page .profit-report > .profit-v3-warning {
  margin: 0;
}

#root .shell.admin-workspace .daily-profit-page .profit-report .profit-agent-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center;
  min-height: 56px;
  gap: 8px;
  padding: 9px 0;
}

#root .shell.admin-workspace .daily-profit-page .profit-agent-card > summary .profit-agent-margin {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

#root .shell.admin-workspace .daily-profit-page .profit-agent-card > summary .profit-agent-margin strong {
  overflow-wrap: anywhere;
}

#root .shell.admin-workspace .daily-profit-page .profit-agent-card[open] > .profit-agent-detail {
  margin: 0 0 10px;
  padding: 4px 12px 12px;
  border: 1px solid var(--profit-line);
  border-radius: 12px;
  background: var(--profit-soft);
}

#root .shell.admin-workspace .daily-profit-page :is(.profit-notes, .profit-order-details, .daily-profit-settings) > summary {
  min-height: 34px;
}

#root .shell.admin-workspace .daily-profit-page .profit-notes[open] > p {
  max-width: 75ch;
  margin: 9px 0 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
  #root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
}

@media (max-width: 640px) {
  #root .shell.admin-workspace .daily-profit-page {
    gap: 9px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel {
    padding: 9px 10px 10px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel .daily-profit-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #root .shell.admin-workspace .daily-profit-page .profit-v3-filter-panel .daily-profit-presets button {
    min-height: 40px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-overview > :is(.profit-small-metric, .profit-hero) {
    gap: 5px;
    min-height: 0;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-hero-footer {
    font-size: 10px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-report > .profit-section {
    padding: 11px 12px !important;
    border-radius: 14px !important;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-report .profit-section-heading {
    gap: 5px;
    margin-bottom: 2px;
    padding-bottom: 6px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-report .profit-money-grid {
    gap: 6px;
    margin: 7px 0 4px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-report .profit-money-grid strong {
    font-size: clamp(12px, 3.45vw, 16px);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-report .profit-money-grid > div {
    gap: 3px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-report .profit-agent-avatar {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  #root .shell.admin-workspace .daily-profit-page .profit-preferences > .hub-card {
    padding: 11px 12px;
    border-radius: 14px;
  }
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager > .bm-toolbar:has(> .wuyou-bank-filters) {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(110px, 1fr);
  gap: 8px;
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager > .bm-toolbar:has(> .wuyou-bank-filters) > :is(input,select) {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 40px;
  margin: 0;
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager .wuyou-bank-filters { grid-column: 1 / -1; }

#root .shell.admin-workspace[data-aurora-theme] .bank-manager :is(.wuyou-bank-filters,.wuyou-bank-batch,.wuyou-bank-usage-note) {
  min-width: 0;
  border: 1px solid var(--au-line);
  border-radius: 10px;
  background: var(--au-panel);
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager :is(.wuyou-bank-filters,.wuyou-bank-batch,.wuyou-bank-usage-note) > summary {
  align-content: center;
  min-height: 38px;
  padding: 7px 11px;
  color: var(--au-ink);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager .wuyou-bank-batch[open] { flex-basis: 100%; }

#root .shell.admin-workspace[data-aurora-theme] .bank-manager :is(.wuyou-bank-filter-fields,.wuyou-bank-batch-actions) {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(125px,1fr));
  gap: 8px;
  padding: 9px;
  border-top: 1px solid var(--au-line);
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager .wuyou-bank-filter-fields > :is(input,select) {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}

#root .shell.admin-workspace[data-aurora-theme] .bank-manager .wuyou-bank-batch-actions > button { min-height: 38px; }
#root .shell.admin-workspace[data-aurora-theme] .bank-manager .wuyou-bank-batch-actions > .danger { color: #b43b45; }
#root .shell.admin-workspace[data-aurora-theme] .bank-manager .wuyou-bank-usage-note > p { margin: 0; padding: 0 11px 11px; color: var(--au-muted); }

@media (max-width: 490px) {
  #root .shell.admin-workspace[data-aurora-theme] .bank-manager > .bm-toolbar:has(> .wuyou-bank-filters) {
    grid-template-columns: minmax(0, 1fr);
  }

  #root .shell.admin-workspace[data-aurora-theme] .bank-manager :is(.wuyou-bank-filter-fields,.wuyou-bank-batch-actions) {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
