/* Approved GUHU logo gold: one theme across departments; status colors stay semantic. */
:root,
#appView,
#chinaFinanceDialog {
  --brand-gold: #d4a248;
  --brand-gold-highlight: #f0cf78;
  --brand-gold-shade: #b88531;
  --brand-gold-metal: linear-gradient(135deg, #f0cf78 0%, #d4a248 45%, #b88531 100%);
  --gold: var(--brand-gold);
  --gold2: var(--brand-gold-highlight);
  --cf-gold: var(--brand-gold);
  --wb-gold: var(--brand-gold);
  --archive-gold-700: #997027;
  --archive-gold-600: var(--brand-gold);
  --archive-gold-500: var(--brand-gold-highlight);
  --archive-gold-300: #ecd294;
  --archive-gold-100: #fff3d4;
}
#appView
  :is(button, a, label):is(.active, .is-active, [aria-selected='true'], [aria-pressed='true']),
#appView [role='tab'][aria-selected='true'],
#appView
  :is(#nav, .sidebar nav, #chinaFinanceNav, .sales-mobile-nav, .ao-tabs)
  button:is(.active, .is-active),
#appView
  :is([class*='tabs'], [class*='segmented'], [class*='chips'], .do-status-filters)
  :is(button, a):is(.active, .is-active, [aria-selected='true'], [aria-pressed='true']) {
  background: var(--brand-gold-metal) !important;
  border-color: var(--brand-gold-shade) !important;
  color: #fffdf9 !important;
  box-shadow: none !important;
}
#appView
  :is(#nav, .sidebar nav, #chinaFinanceNav, .sales-mobile-nav, .ao-tabs)
  button:is(.active, .is-active)
  :is(svg, .nav-svg, .nav-text) {
  color: inherit !important;
}
#appView
  :is(
    .cf-btn:not(.secondary),
    [data-cf-bulk-open],
    [data-cf-itinerary-search-button],
    .primary,
    button[type='submit']:not(.danger)
  ),
#chinaFinanceDialog .cf-btn:not(.secondary) {
  background: var(--brand-gold-metal) !important;
  border-color: var(--brand-gold-shade) !important;
  color: #fffdf9 !important;
}
#appView .cf-shared-itinerary {
  color: #916218;
  background: #fff0c5;
}
/* Keep uploaded portrait pixels, while uncustomized avatars share the brand finish. */
:is(#appView, #avatarDialog)
  :is(
    .avatar,
    .top-avatar,
    .pf-avatar,
    .sales-profile-avatar,
    .fm-avatar,
    .gm-profile-avatar,
    .gm-person-avatar,
    .ao-profile-avatar,
    .avatar-preview
  ) {
  background-color: var(--brand-gold) !important;
  border-color: var(--brand-gold-shade) !important;
  color: #10243a !important;
}
:is(#appView, #avatarDialog)
  :is(
    .avatar,
    .top-avatar,
    .pf-avatar,
    .sales-profile-avatar,
    .fm-avatar,
    .gm-profile-avatar,
    .gm-person-avatar,
    .ao-profile-avatar,
    .avatar-preview
  ):not([style*='url']):not(:has(img)) {
  background-image: var(--brand-gold-metal) !important;
}
/* Desktop toolbar follows the approved search / bulk / state sequence. */
#appView .cf-status-toolbar {
  display: flex;
  gap: 12px;
}
#appView .cf-status-toolbar .cf-status-filter {
  margin-inline-start: 0;
}
#appView .cf-status-toolbar > button {
  white-space: nowrap;
}
#appView .cf-status-toolbar .cf-itinerary-search-box {
  min-width: 150px;
  flex: 1 1 220px;
}
@media (min-width: 1280px) {
  #appView .cf-status-toolbar {
    flex-wrap: nowrap;
  }
  #appView .cf-status-toolbar .cf-shared-itinerary {
    flex-shrink: 0;
  }
  #appView .cf-status-toolbar .cf-status-filter {
    flex-shrink: 0;
  }
  #appView .cf-status-toolbar .cf-status-filter select {
    max-width: 150px;
  }
}
@media (max-width: 760px) {
  #appView .cf-status-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }
  #appView .cf-status-toolbar .cf-itinerary-search-box {
    min-width: 0;
    width: 100%;
  }
  #appView .cf-status-toolbar [data-cf-bulk-open] {
    grid-column: 1 / 3;
  }
  #appView .cf-status-toolbar .cf-status-filter {
    grid-column: 1 / -1;
    width: 100%;
  }
  #appView .cf-status-toolbar .cf-status-filter select {
    flex: 1;
    max-width: none;
    min-width: 0;
  }
}
/* Money first, number of records second; real work and daily registrations above arrivals. */
#appView .cf-metrics .cf-metric-amount {
  font-size: 23px;
  overflow-wrap: anywhere;
}
#appView .cf-metrics .cf-metric-count {
  margin-top: 8px;
  font-size: 13px;
  color: #78828d;
}
.cf-home-columns {
  align-items: start;
}
.cf-home-columns .cf-panel {
  min-width: 0;
}
.cf-home-todos {
  max-height: 450px;
  overflow-y: auto;
}
.cf-home-todos .cf-row {
  padding: 15px 18px;
}
.cf-home-todos .cf-row > span:first-child {
  min-width: 0;
}
.cf-home-todos .cf-row small {
  overflow-wrap: anywhere;
}
.cf-home-todos .cf-row > span:last-child {
  color: #997027;
  font-size: 13px;
  flex-shrink: 0;
}
.cf-todo-count {
  color: #78828d;
  font-size: 13px;
}
.cf-daily-cashflow {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cf-daily-cashflow :is(td, th) {
  text-align: start;
  padding: 14px 12px;
  border-top: 1px solid #eee9e0;
}
.cf-daily-cashflow th {
  color: #78828d;
  font-weight: 500;
}
.cf-daily-cashflow td:not(:first-child) {
  white-space: nowrap;
}
.cf-daily-cashflow td small {
  display: block;
  color: #78828d;
  margin-top: 4px;
}
.cf-daily-note {
  padding: 0 12px 12px;
  font-size: 11px;
}
@media (max-width: 760px) {
  #appView .cf-metrics .cf-metric-amount {
    font-size: 19px;
  }
  .cf-daily-cashflow :is(td, th) {
    padding: 12px 8px;
    font-size: 12px;
  }
  .cf-daily-cashflow td:first-child {
    white-space: nowrap;
  }
}
/* Legacy mobile labels must not retain a gold foreground on the selected gold tab. */
#appView
  :is(#nav, #chinaFinanceNav, .sales-mobile-nav, .ao-tabs)
  button:is(.active, .is-active)
  :is(span, small, b, strong, svg) {
  color: inherit !important;
}

.cf-todo-group h3 {
  margin: 0;
  padding: 14px 18px 8px;
  font-size: 14px;
}
.cf-todo-group h3 small {
  margin-inline-start: 10px;
  padding: 4px 10px;
  background: #fff0c5;
  border-radius: 20px;
  color: #916218;
  font-weight: 500;
}
.cf-todo-note {
  margin: 0;
  padding: 12px 18px;
  color: #78828d;
  font-size: 12px;
  border-top: 1px solid #eee9e0;
}
.cf-home-columns .cf-panel > header {
  background: #f4f9ff;
}

#appView .language-switch label.active :is(b, small) {
  color: inherit !important;
}
#appView input:is([type='checkbox'], [type='radio']) {
  accent-color: var(--brand-gold);
}

/* Approved neutral content palette. Gold actions/selection and semantic status
   colors remain owned by their existing component rules. No layout overrides. */
:root,
#appView,
#chinaFinanceDialog {
  --content-surface: #fff;
  --content-surface-soft: #f5f7fa;
  --content-line: #e2e8f0;
  --archive-canvas: #fff;
  --archive-canvas-subtle: #f5f7fa;
  --archive-surface: #fff;
  --archive-surface-raised: #fff;
  --archive-surface-muted: #f5f7fa;
  --archive-paper: #fff;
  --archive-line: #e2e8f0;
  --archive-line-strong: #cbd5e1;
  --paper: #fff;
  --bg: #fff;
}

/* Hard-coded legacy detail/card surfaces cannot inherit the shared tokens. */
#appView
  :is(
    .cf-panel,
    .cf-order,
    .cf-profile,
    .cf-payment-view,
    .cf-order-detail,
    .ps-table > tbody > tr[data-cf-platform-expanded],
    .ps-table > tbody > tr[data-cf-platform-expanded] > td,
    [data-cf-itinerary-expanded],
    .cf-bulk-panel,
    .cf-single-panel,
    .cf-exception-detail,
    .cf-other-upload,
    .af-other-upload,
    .ctrip-order-links,
    .ctrip-links-modal,
    .brief-itinerary,
    .day-detail-editor,
    .quote-policy-grid article,
    .order-detail-drawer,
    .order-convert-dialog,
    .order-detail-overview,
    .order-detail-section,
    .simple-business-editor,
    .sales-order-metrics article,
    .order-additional-form,
    .order-additional-tasks,
    .order-glance,
    .order-reception-task-body,
    .cf-itinerary-mobile .cf-ledger-team,
    .orders-page .order-ledger-group > header,
    .new-order-page .ai-intake-dropzone,
    .new-order-page
      #newOrderStandardForm[data-business-stage='order']
      .business-section-continuation,
    .business-form-section > .business-form-section-head,
    .business-create-wizard .business-editor-panel-side,
    .business-create-wizard .business-editor-panel-content > .guide-requirement-editor,
    .organized-itinerary-form .order-itinerary-day-side,
    .pv-daily article,
    .department-order-expanded > td,
    .settings-control-nav,
    .settings-control-main,
    .settings-code-row,
    .settings-pending-row,
    .od-finance-card.od-paid,
    .od-finance-card.od-office,
    .daily-cashflow article
  ) {
  background-color: var(--content-surface) !important;
}

#chinaFinanceDialog,
#appView.china-finance-user #mainContent,
#appView #mainContent .orders-page.is-platform-sales-ledger .order-platform-inline-brief > td,
#appView #mainContent .orders-page.is-platform-sales-ledger article .order-platform-inline-brief,
#chinaFinanceDialog :is(.cf-other-upload, .cf-proof-simple .cf-plus.cf-upload-simple),
.ctrip-links-modal,
.order-convert-dialog {
  background-color: var(--content-surface, #fff) !important;
}

/* Supporting context, totals, table headings and read-only explanatory strips. */
#appView
  :is(
    .cf-note,
    .cf-deposit-preview,
    .cf-platform-receipt-head,
    .cf-cumulative-summary,
    .fc-transfer-cumulative,
    .cf-progress-table th,
    .cf-registration-table th,
    .cf-report-table th,
    .cf-report-totals article,
    .cf-status-ledger .cf-itinerary-group:nth-child(even),
    .ps-table > thead > tr > th,
    .ps-table > tbody > tr:nth-child(even),
    .notice:not(.error):not(.danger),
    .password-policy,
    .order-detail-drawer .order-copilot-bar,
    .order-payment-summary > div,
    .order-segments,
    .order-convert-payment,
    .order-convert-reason,
    .order-itinerary-form > footer,
    .order-table th,
    .business-accommodation,
    .complimentary-reason,
    .order-decision-panel,
    .order-glance-pending,
    .order-next-action:not(.is-danger),
    .order-team-number-form,
    .order-complimentary-approval,
    .payment-supplement-form,
    .ctrip-commission-summary,
    .business-create-wizard .business-editor-panel-side .business-form-step,
    .organized-itinerary-form .order-itinerary-day-side .business-form-step,
    .new-order-ai-review-head,
    .order-reception-dispatch-note,
    .business-toggle:not(:has(input:checked)),
    .new-order-page .business-payment-details,
    .workbench-team-money > div:nth-child(3):not(.is-danger),
    .workbench-reception-glance > div:not(.is-done):not(.is-off),
    .new-order-page .business-type-unclassified,
    .new-order-page .ai-intake-process li > b,
    .ai-itinerary-review > header > strong,
    .ai-itinerary-recognition.is-checking,
    .ai-itinerary-recognition.needs-review,
    .ai-itinerary-review-grid input[readonly],
    .pv-total,
    .cad-totals,
    .payment-payer-table th,
    .payment-payer-detail td,
    .payment-cancel-position-head,
    #paymentAllocationRows label,
    .payment-people-existing span,
    .fc-update:not(.fc-error):not(.fc-form-error),
    .fc-advance-summary article:nth-child(3),
    .fc-transfer-summary,
    .settings-file-path,
    .cover-thumb,
    .team-number-formula,
    .settings-rule-note,
    .settings-quote-example,
    .settings-service-reception,
    .settings-member-table th,
    .od-pending-total,
    .od-warning,
    .od-workspace .workbench-todo.is-overdue,
    .knowledge-structured-facts,
    .knowledge-language-sections .knowledge-guidance,
    .knowledge-insight-summary,
    .ai-chat-message.is-user .ai-chat-bubble,
    .ao-notice:not(.ao-error),
    .ao-sync.is-offline
  ) {
  background-color: var(--content-surface-soft) !important;
}

#chinaFinanceDialog .cf-note,
.fc-update:not(.fc-error):not(.fc-form-error),
.settings-rule-note,
.settings-quote-example,
.password-policy {
  background-color: var(--content-surface-soft, #f5f7fa);
}

/* Table and segmented-control containers use a neutral divider surface; their
   selected children retain the existing gold rules. */
#appView th,
#appView
  :is(
    .archive-segmented-tabs,
    .archive-segmented,
    .segmented-tabs,
    .ops-segmented,
    .workbench-segmented
  ) {
  background-color: var(--content-surface-soft);
}

/* Row hover is supporting emphasis, not a selected gold control. */
#appView
  tbody
  tr:hover:not(.active):not(.is-active):not(.selected):not(.is-selected):not([aria-selected='true'])
  > td {
  background-color: var(--content-surface-soft);
}

#appView .cf-note,
#chinaFinanceDialog .cf-note {
  color: #64748b;
}

/* Keep inner boundaries visible on white, without changing their dimensions. */
#appView
  :is(
    [data-cf-itinerary-expanded],
    .cf-bulk-panel,
    .cf-single-panel,
    .cf-reference-inline,
    .cf-day-table article,
    .cf-other-upload,
    .af-other-upload
  ) {
  border-color: var(--content-line);
}

/* Numeric fields retain native precision/range validation without pointer steppers. */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
