/* Shared Console appearance. Product images, barcodes and document previews retain
   their original colors; print output always uses the normal light palette. */
@import url('./appearance_workspaces.css');
@import url('./appearance_warehouse.css');
@import url('./appearance_transactions.css');
@import url('./appearance_misc.css');
@import url('./appearance_settings.css');
html[data-theme="light"] { color-scheme: light; }
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --o-ground: #141b18;
    --o-sheet: #202a24;
    --o-border: #46534a;
    --o-border-light: #354238;
    --o-text: #e0e8e1;
    --o-text-strong: #f3f7f3;
    --o-muted: #b0beb2;
    --o-brand: #357a40;
    --o-brand-dark: #9bd99f;
    --o-brand-deep: #b9e8bc;
    --o-brand-light: #89c98d;
    --o-brand-soft: #293e2c;
    --o-primary: #9bd99f;
    --o-success: #84d492;
    --o-success-bg: #203c2b;
    --o-success-border: #477b54;
    --o-success-text: #a8e6b6;
    --o-info: #84cddc;
    --o-info-bg: #213a42;
    --o-info-text: #b0dfeb;
    --o-warning-bg: #40361f;
    --o-warning-border: #826b36;
    --o-warning-text: #f0d595;
    --o-danger: #f18e89;
    --o-danger-bg: #442a2a;
    --o-danger-border: #88504d;
    --o-danger-text: #ffb8b1;
    --o-motherhood-bg: #412e39;
    --o-motherhood-border: #865871;
    --o-motherhood-text: #efb2cf;
    --o-shadow: 0 3px 16px #0005;
    --ink: var(--o-text-strong);
    --muted: var(--o-muted);
    --line: var(--o-border);
    --paper: var(--o-ground);
    --green-100: var(--o-brand-soft);
    --green-600: #65b96d;
    --danger: #d3524c;
  }
  html[data-theme="dark"], html[data-theme="dark"] body { background: var(--o-ground); }
  html[data-theme="dark"] :is(h1, h2, h3, h4, h5) { color: var(--o-text-strong); }
  html[data-theme="dark"] .o_console_brand_lockup img {
    filter: brightness(0) invert(1); opacity: .94;
  }

  /* Chrome, authentication, user settings and shared sheets. Specificity
     exceeds lazy-loaded screen styles without disabling component states. */
  html[data-theme="dark"] :is(.o_navbar, .o_landing, .o_login_wrap, .o_system_hold) {
    background: var(--o-ground); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.o_user_dropdown, .o_login_card, .o_system_hold_card,
    .o_personal_settings_section, .o_dialog, .o_notification, .o_connection_notice,
    .o_user_menu_action,
    .o_form_sheet, .o_list_view, .o_control_panel, .o_chatter, .o_ctx_menu,
    .o_area_card, .o_landing_recent_item, .o_launch_context, .o_app_download,
    .o_chat_notice_panel, .o_price_notice_panel, .o_chat_sidebar, .o_chat_pane,
    .o_chat_composer, .o_chat_thread_panel) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  @media (max-width: 720px) {
    html[data-theme="dark"] .o_launch_datetime {
      background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
    }
  }
  html[data-theme="dark"] :is(.o_landing h1, .area-copy strong, .o_launch_time,
    .o_landing_recent_heading h2, .o_landing_recent_copy strong, .o_app_downloads_heading h2,
    .o_app_download_copy strong, .o_system_hold_copy h1) {
    color: var(--o-text-strong);
  }
  html[data-theme="dark"] :is(.o_landing_lead, .area-copy span, .o_launch_date,
    .o_launch_context, .o_landing_recent_copy span, .o_app_downloads_heading p,
    .o_app_download_copy > span, .o_app_download_copy small, .o_system_hold_copy p,
    .o_user_menu_action) { color: var(--o-muted); }
  html[data-theme="dark"] :is(.o_header_phone, .o_chat_trigger, .o_price_notice_trigger,
    .o_navbar .o_user_menu_trigger, .o_pin_pad button, .o_input, .o_select,
    .o_searchview, .o_searchview input, .o_list_table td input,
    .o_chat_composer textarea, .o_chat_composer input, .o_dialog .o_close) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(input, textarea)::placeholder { color: var(--o-muted); opacity: 1; }
  html[data-theme="dark"] :is(.btn-secondary, .btn-light, .o_list_table th,
    .o_dialog_footer, .o_chat_msg_body, .o_chat_channel:hover,
    .o_area_card:hover, .o_landing_recent_item:hover) {
    background: var(--o-brand-soft); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.o_list_table tbody tr:hover, .o_list_table tbody tr.o_selected,
    .o_chat_notice_row:hover, .o_price_notice_row:hover, .o_locked_indicator:hover) {
    background: var(--o-brand-soft);
  }
  html[data-theme="dark"] .btn-secondary:not(:disabled):hover,
  html[data-theme="dark"] .btn-light:not(:disabled):hover {
    background: #344c38; border-color: var(--o-brand-light);
  }
  html[data-theme="dark"] .o_user_menu_action:hover { background: var(--o-brand-soft); }
  html[data-theme="dark"] .o_ctx_menu button:not(:disabled):hover { background: var(--o-brand-soft); }
  html[data-theme="dark"] :is(.o_mobile_tools_select, .o_workspace_nav_button,
    .o_recent_trigger, .o_cp_back, .cs-global-search, .cs-customer-actions-menu,
    .cs-customer-balance-strip, .cs-customer-balance, .cs-customer-panel,
    .cs-customer-tabs, .cs-customer-tabs button, .cs-account-summary,
    .o_chat_strip_btn, .o_chat_chip, .wh-context-item.is-selector, .wh-context-select) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] .cs-customer-content { background: var(--o-ground); }
  html[data-theme="dark"] .cs-home-content { background: var(--o-ground); }
  html[data-theme="dark"] :is(.cs-home-panel, .cs-filter, .cs-customer-panel-header) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.cs-panel-mark, .cs-recent-mark, .cs-filter.active,
    .badge, .badge-secondary) {
    background: var(--o-brand-soft); color: var(--o-text);
  }
  html[data-theme="dark"] :is(.whp-alert.is-danger, .whp-unsaved) {
    background: var(--o-danger-bg); color: var(--o-danger-text); border-color: var(--o-danger-border);
  }
  html[data-theme="dark"] :is(.cs-home-intro h1, .cs-panel-title h2) { color: var(--o-text-strong); }
  html[data-theme="dark"] .wh-brand-nature { --wh-doc-brand: #9bd99f; --wh-doc-soft: var(--o-brand-soft); }
  html[data-theme="dark"] .wh-brand-mixed { --wh-doc-brand: #efb2cf; --wh-doc-soft: var(--o-motherhood-bg); }
  html[data-theme="dark"] .cs-customer-workspace {
    --cs-nw: #9bd99f; --cs-nw-soft: var(--o-brand-soft);
    --cs-mh: #efb2cf; --cs-mh-soft: var(--o-motherhood-bg);
  }
  html[data-theme="dark"] .cs-customer-header h1 { color: var(--o-text-strong); }
  html[data-theme="dark"] .cs-customer-kicker { color: var(--o-brand-dark); }
  html[data-theme="dark"] :is(.o_chat_row.unread, .o_chat_chip.unread,
    .o_workspace_nav_button.active, .cs-customer-tabs button.active, .wh-process-icon) {
    background: var(--o-brand-soft); color: var(--o-brand-dark);
  }
  html[data-theme="dark"] :is(.o_chat_chip.shared, .o_chat_group_avatar,
    .o_landing_attention) {
    background: var(--o-warning-bg); color: var(--o-warning-text); border-color: var(--o-warning-border);
  }
  html[data-theme="dark"] :is(.o_landing_attention_copy strong, .o_landing_attention_copy span,
    .o_landing_attention_open) { color: var(--o-warning-text); }
  html[data-theme="dark"] .o_app_update_notice {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] .o_app_update_notice.is-available {
    background: var(--o-warning-bg); color: var(--o-warning-text); border-color: var(--o-warning-border);
  }
  html[data-theme="dark"] .o_record_actions_pinned_item {
    border-top-color: rgba(255, 255, 255, .08);
  }
  html[data-theme="dark"] :is(.o_user_menu_action.logout, .text-danger) { color: var(--o-danger-text); }
  /* 2026-09-11 sweep (Tom): banners, search results, payment-method chooser,
     card chip and other light-on-light leftovers. */
  html[data-theme="dark"] .alert-warning { background: var(--o-warning-bg); border-color: var(--o-warning-border); color: var(--o-warning-text); }
  html[data-theme="dark"] .alert-danger { background: var(--o-danger-bg); border-color: var(--o-danger-border); color: var(--o-danger-text); }
  html[data-theme="dark"] .alert-success { background: var(--o-success-bg); border-color: var(--o-success-border); color: var(--o-success-text); }
  html[data-theme="dark"] .alert-info { background: var(--o-info-bg); border-color: var(--o-border); color: var(--o-info-text); }
  html[data-theme="dark"] :is(.alert-warning, .alert-danger, .alert-success, .alert-info) :is(strong, b, .text-strong) { color: inherit; }
  html[data-theme="dark"] .cs-search-result { background: var(--o-sheet); border-color: var(--o-border-light); color: var(--o-text); }
  html[data-theme="dark"] .cs-search-result:hover, html[data-theme="dark"] .cs-search-result:focus-visible { background: var(--o-brand-soft); }
  html[data-theme="dark"] .cs-search-result-badge { background: var(--o-brand-soft); color: var(--o-brand-deep); }
  html[data-theme="dark"] :is(.o_home_search input, .o_cp_searchview input, .cs-products-search,
    .cs-record-mention-suggestions, .cs-catalog-tabs button, .cs-products-empty,
    .cs-sub-progress, .cs-sub-review .o_group, .cs-sub-step-review .o_group,
    .cs-gift-sale-catalogs button, .cs-gift-sale-delivery button,
    .cs-gift-sale-value, .cs-gift-sale-note) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] .cs-gift-sale-catalogs .catalog-natures.active,
  html[data-theme="dark"] .cs-gift-sale-delivery button.active { background: var(--o-brand-soft); color: var(--o-brand-dark); }
  html[data-theme="dark"] .cs-gift-sale-catalogs .catalog-motherhood.active { background: rgba(213, 147, 173, .16); color: #f0b7ce; }
  html[data-theme="dark"] .o_choice_list label:hover { background: var(--o-brand-soft); }
  html[data-theme="dark"] .o_choice_list label.selected { background: var(--o-brand-soft); border-color: var(--o-brand-light); color: var(--o-text-strong); }
  html[data-theme="dark"] .cs-card-brand { background: var(--o-brand-soft); border-color: var(--o-border); color: var(--o-brand-dark); }
  html[data-theme="dark"] .cs-confirmed-hero { background: var(--o-success-bg); border-color: var(--o-success-border); }
  html[data-theme="dark"] :is(.cs-bargain-brand, .cs-bargain-club-preferences) { border-color: var(--o-border-light); }
  html[data-theme="dark"] .cs-timeline-item::before { background: var(--o-sheet); }
  html[data-theme="dark"] .o_statusbar_status .o_arrow_button { background: var(--o-sheet); color: var(--o-text); }
  html[data-theme="dark"] .oe_button_box .oe_stat_button:hover { background: var(--o-brand-soft); }
  html[data-theme="dark"] .o_notification_mark { background: var(--o-brand-soft); color: var(--o-brand-dark); }
  html[data-theme="dark"] .o_notification.warning .o_notification_mark { background: var(--o-warning-bg); color: var(--o-warning-text); }
  html[data-theme="dark"] .o_notification.danger .o_notification_mark { background: var(--o-danger-bg); color: var(--o-danger-text); }
  html[data-theme="dark"] .o_notification.success .o_notification_mark { background: var(--o-success-bg); color: var(--o-success-text); }
  html[data-theme="dark"] .o_notification .o_close:hover { background: var(--o-brand-soft); }
  html[data-theme="dark"] .o_message { border-color: var(--o-border-light); }
  html[data-theme="dark"] :is(.phone-board-tabs, .o_chat_tabs) { background: var(--o-ground); border-color: var(--o-border); }
  html[data-theme="dark"] .phone-board-tabs button { color: var(--o-muted); }
  html[data-theme="dark"] .phone-board-tabs button.active { background: var(--o-sheet); color: var(--o-brand-dark); box-shadow: none; }
  html[data-theme="dark"] :is(.phone-orchard-toolbar, .phone-orchard-scorecard) { background: var(--o-sheet); border-color: var(--o-border-light); }
  html[data-theme="dark"] .phone-agent-device { background: var(--o-brand-soft); color: var(--o-text); }
  html[data-theme="dark"] .phone-call-time { background: var(--o-warning-bg); color: var(--o-warning-text) !important; }
  html[data-theme="dark"] .o_message.note { background: rgba(240, 213, 149, .07); }
  html[data-theme="dark"] .o_message .meta .author { color: var(--o-text-strong); }
  html[data-theme="dark"] :is(.o_chat_badge, .o_price_notice_badge) { border-color: var(--o-sheet); }
  html[data-theme="dark"] :is(.o_chat_chip_count, .o_chat_chip_presence, .o_chat_mobile_badge) {
    border-color: var(--o-ground);
  }
  html[data-theme="dark"] .o_chat_chip_count:not(.mention) { background: var(--o-brand); color: #fff; }
  html[data-theme="dark"] .o_chat_chip.mention .o_chat_chip_count { background: #b4433d; }
  html[data-theme="dark"] .o_area_card {
    --area: #9bd99f; --area-soft: #293e2c;
  }
  html[data-theme="dark"] .o_area_card.driver { --area: #9bd5df; --area-soft: #253c42; }
  html[data-theme="dark"] .o_area_card.dispatch { --area: #e0c581; --area-soft: #403922; }
  html[data-theme="dark"] .o_area_card.settings { --area: #edb2cd; --area-soft: #412e39; }
  html[data-theme="dark"] .o_area_recent {
    background: var(--area-soft); color: var(--area); border-color: var(--o-border);
  }
  html[data-theme="dark"] .o_device_switch > span { background: #546359; }
  html[data-theme="dark"] .o_device_switch input:checked + span { background: #408c49; }

  /* Customer service, subscriptions, payroll and operational workspaces. */
  html[data-theme="dark"] :is(.cs-order-workspace, .cs-subscription-workspace,
    .cs-sub-wizard, .payroll-workspace) {
    --order-accent-soft: var(--o-brand-soft); --order-accent-deep: var(--o-brand-dark);
    --subscription-accent-soft: var(--o-brand-soft); --subscription-accent-deep: var(--o-brand-dark);
    --sub-wizard-accent-soft: var(--o-brand-soft); --sub-wizard-accent-deep: var(--o-brand-dark);
    --pay-ink: var(--o-text-strong); --pay-muted: var(--o-muted);
    --pay-line: var(--o-border); --pay-soft: var(--o-brand-soft);
  }
  html[data-theme="dark"] :is(.cs-sub-choice, .cs-sub-inline-choice, .cs-sub-summary-card,
    .cs-sub-bundle__items,
    .cs-authorize-summary, .cs-subscription-combo, .cs-subscription-combo-line td,
    .cs-log-composer, .cs-add-item, .cs-customer-card, .cs-customer-summary,
    .cs-order-activity, .cs-activity-card, .cs-order-notes, .cs-finance-strip,
    .payroll-panel, .payroll-next-pay, .wh-process-group, .wh-process-door,
    .wh-context-strip, .wh-next-scan, .wh-card, .wh-task-card, .wh-task-sheet,
    .wh-worklist, .wh-worklist-card, .wh-quantity-sheet) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.cs-order-meta b, .cs-order-meta-status, .cs-route-facts b,
    .cs-subscription-meta b, .cs-activity-title strong, .cs-finance-strip strong,
    .cs-out-item-name span, .cs-out-item-qty, .pay-week-label,
    .cs-authorize-total span, .cs-authorize-label) { color: var(--o-text); }
  html[data-theme="dark"] :is(.cs-order-lines tr.has-backorder, .wh-setup-alert,
    .wh-scan-status, .cs-subscription-coupon) {
    background: var(--o-warning-bg); color: var(--o-warning-text); border-color: var(--o-warning-border);
  }
  html[data-theme="dark"] :is(.wh-setup-alert strong, .wh-setup-alert p, .wh-setup-alert ul) {
    color: var(--o-warning-text);
  }

  /* Mobile cards have explicit light cell colors in mobile.css. Override both
     the surface and its text, including populated amounts and record numbers. */
  html[data-theme="dark"] :is(.o_mobile_card_table, .cs-order-line-table,
    .cs-subscription-composition-table) td { color: var(--o-text); }
  html[data-theme="dark"] :is(.o_mobile_card_table, .cs-order-line-table,
    .cs-subscription-composition-table) td::before { color: var(--o-muted); }
  html[data-theme="dark"] .o_mobile_card_table td[data-mobile-order="0"],
  html[data-theme="dark"] .cs-record-id { color: var(--o-brand-deep); }
  html[data-theme="dark"] :is(.o_mobile_card_table tr:not(.o_selected), .cs-order-line-table tr:not(.has-backorder),
    .cs-subscription-composition-table tr:not(.cs-subscription-table-section):not(.cs-subscription-next-empty),
    .cs-work-queue-select, .cs-customer-tab-select, .cs-search-results,
    .o_phone_state_select, .o_phone_queue_toggle) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] .cs-global-search input {
    background: transparent; color: var(--o-text-strong);
  }
  html[data-theme="dark"] .cs-global-search input::placeholder { color: var(--o-muted); }
  html[data-theme="dark"] .cs-recent-item { color: var(--o-text); }
  html[data-theme="dark"] .o_hours_meter { background: var(--o-border-light); }
  html[data-theme="dark"] :is(.o_phone_queue_toggle:hover, .o_phone_queue_toggle.is-on,
    .o_phone_open_button:hover) { background: var(--o-brand-soft); color: var(--o-brand-deep); }

  html[data-theme="dark"] :is(.o_recent_dropdown, .o_recent_item, .o_kbd) {
    background: var(--o-sheet); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.o_recent_trigger:hover, .o_recent_trigger[aria-expanded="true"], .o_recent_item:hover) {
    background: var(--o-brand-soft); color: var(--o-text); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.o_recent_heading, .cs-recent-copy span, .cs-recent-meta span) { color: var(--o-muted); }
  html[data-theme="dark"] :is(.o_recent_empty, .cs-recent-item, .cs-panel-head) { border-color: var(--o-border-light); }

  html[data-theme="dark"] :is(.o_chat_strip, .o_chat_directory_section) {
    background: var(--o-ground); color: var(--o-muted); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.o_chat_strip_btn:hover, .o_chat_strip_btn.active,
    .o_chat_person_row.picked, .o_chat_person_row.direct:active) {
    background: var(--o-brand-soft); color: var(--o-brand-dark); border-color: var(--o-border);
  }
  html[data-theme="dark"] :is(.o_chat_directory_section.groups, .o_chat_shared_initials) {
    background: var(--o-warning-bg); color: var(--o-warning-text); border-color: var(--o-warning-border);
  }
  html[data-theme="dark"] :is(.o_chat_chip.mention, .o_chat_row.mention) {
    background: var(--o-danger-bg); color: var(--o-danger-text); border-color: var(--o-danger-border);
  }
  html[data-theme="dark"] .o_chat_panel { border-color: var(--o-border); }

  /* The softphone is a separate document, with its own palette. */
  html[data-theme="dark"] :is(.phone-identity, .phone-delete-confirm, .transfer-panel,
    .phone-message:not(:empty), .audio-hint, .caller-context, #audioRouteSelect,
    .phone-tabs button, .phone-inbox button, .phone-inbox input, .phone-inbox select,
    .number-wrap input, .transfer-panel input, .keypad button, .caller-matches button,
    .caller-actions button, .caller-actions select, .new-caller input, .new-caller button,
    .call-controls button, .transfer-panel button) {
    background: var(--o-sheet); color: var(--ink); border-color: var(--line);
  }
  html[data-theme="dark"] :is(.phone-tabs button.active, .call-controls button.active,
    .phone-inbox-row.unread, #connectionText) {
    background: var(--green-100); color: var(--o-brand-dark); border-color: var(--green-600);
  }
  html[data-theme="dark"] .keypad small { color: var(--muted); }
  html[data-theme="dark"] .phone-message { color: var(--o-danger-text); }
  /* Line pill (NW / MHS). --green-100 goes dark here but --green-900 does not,
     so the pill was dark green on dark green and reps could not read which
     line the caller dialed (Sara, 2026-10-08). */
  html[data-theme="dark"] #callContextBrand { background: var(--o-brand-soft); color: var(--o-brand-dark); }
  html[data-theme="dark"] #callContextBrand[data-brand="TMS"] { background: var(--o-motherhood-bg); color: var(--o-motherhood-text); }
}
