/*
 * Final admin contrast pass: Light + Luxury.
 * Kept separate so theme.css remains the palette source of truth and this file
 * can be removed without touching layout or application logic.
 */

/* ---------- Light: clean white / navy / blue ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --ink: #172033;
  --muted: #596579;
  --line: #ccd5e2;
  --soft: #f3f6fa;
  --deep: #0b1930;
  --pink: #1463d6;
  --pink-2: #2f7ae5;
  --purple: #244b8f;
  --accent: #1463d6;
  --theme-surface: #ffffff;
  --theme-surface-2: #edf3fa;
  --theme-text: #172033;
  --theme-muted: #596579;
  --theme-line: #ccd5e2;
  --theme-action: #1463d6;
  --theme-action-2: #244b8f;
  --theme-action-text: #ffffff;
  --theme-button-bg: #ffffff;
  --theme-button-text: #17325f;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) {
  color: #172033;
  background: #f3f6fa;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .sidebar {
  color: #f8fbff;
  background: linear-gradient(180deg, #102747, #08162b);
  box-shadow: inset -1px 0 #29415f;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .sidebar::before {
  opacity: .12;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .nav-item {
  color: #cbd8e9;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .nav-item:hover {
  color: #ffffff;
  background: #193a65;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .nav-item.active {
  color: #ffffff;
  border-color: #6fb0ff;
  background: #1463d6;
  box-shadow: inset 4px 0 #b9dcff;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .nav-item :where(svg, i) {
  color: currentColor;
  stroke: currentColor;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .topbar, .panel, .stat-card, .filters, .settings-card, .settings-section,
  .settings-group, .customer-search-results, .customer-profile-panel,
  .customer-history-record, .inventory-list-panel, .sales-chart-panel,
  .sales-summary-card, .receipt-settings-panel, .receipt-preview,
  .salary-builder, .salary-summary-card, .salary-staff-card,
  .ticket-edit-card, .ticket-order-detail, .shift-focus-card,
  .payroll-summary-metrics article, .payroll-summary-columns article,
  .payroll-summary-days, .portfolio-store-card, .crm-store-card,
  .store-detail-panel, .dashboard-active-ticket-card, dialog, .modal-card
) {
  color: #172033 !important;
  border-color: #ccd5e2 !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

/* Customer selection keeps the name readable; only the rail and chevron use blue. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) #customer-search-results > button.active {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  border-color: #6da7e8 !important;
  background: #e9f3ff !important;
  background-image: none !important;
  box-shadow: inset 4px 0 #1463d6 !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) #customer-search-results > button.active strong {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) #customer-search-results > button.active small {
  color: #526177 !important;
  -webkit-text-fill-color: #526177 !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) #customer-search-results > button.active :where(svg,[data-lucide]) {
  color: #1463d6 !important;
  stroke: currentColor !important;
}

/* Ticket history: remove the legacy blush cards from the light/NOX blue system. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) #tickets :where(
  .ticket-summary-card, .empty-side
) {
  color: #172033 !important;
  border-color: #c5d3e3 !important;
  background-color: #f2f7fc !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) #tickets .ticket-summary-card :where(span,strong) {
  color: #172033 !important;
}

/* Admin cast directory/profile: never let generic light button rules erase avatars. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .admin-cast-directory-item .avatar-chip, .cast-profile-identity .avatar-chip
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid rgba(255,255,255,.7) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.4) !important;
  box-shadow: 0 4px 10px rgba(20,48,78,.16) !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.coral { background: #1463b8 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.blue { background: #245f9f !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.amber { background: #805000 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.mint { background: #176b58 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.green { background: #26704f !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.violet { background: #643899 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.pink { background: #087b93 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .avatar-chip.free { background: #40536b !important; }

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  p, small, em, dt, .muted, .hint, .field-note, .empty-state,
  .status-text, .panel-subtitle, .settings-description, .delta
) {
  color: #596579 !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  h1, h2, h3, h4, strong, b, label, legend, dd, summary,
  td, .table-cell, .ticket-order-item, .ticket-order-totals
) {
  color: #172033;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  .customer-search, .inventory-search, .editable-table-input, .payroll-input
) {
  color: #172033 !important;
  -webkit-text-fill-color: #172033;
  border-color: #aeb9c9 !important;
  background: #ffffff !important;
}

html[data-theme="light"] :where(input, textarea)::placeholder {
  color: #667387 !important;
  opacity: 1;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  input, select, textarea
):focus {
  border-color: #1463d6 !important;
  outline: 3px solid rgba(20, 99, 214, .18) !important;
  outline-offset: 1px;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  table:not(.payroll-table) thead, table:not(.payroll-table) th,
  .table-head, .settings-row, .menu-settings-head, .portal-settings-head,
  .ticket-order-meta div, .ticket-order-totals span,
  .active-ticket-detail-summary, .active-ticket-detail-total
) {
  color: #25334b !important;
  border-color: #ccd5e2 !important;
  background: #edf3fa !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) tbody tr:hover :where(th, td) {
  background-color: #e6f0ff !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  button:not(.theme-toggle):not(.active):not(.selected):not(.primary),
  .app-link, .outline, .clear, .detail, .secondary-settings-button,
  .row-action.ghost, .settings-tab:not(.active),
  .segmented-control button:not(.selected)
) {
  color: #17325f !important;
  border-color: #aeb9c9 !important;
  background: #ffffff !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  button:not(.theme-toggle):not(.active):not(.selected):not(.primary),
  .app-link, .outline, .clear, .detail, .secondary-settings-button,
  .row-action.ghost, .settings-tab:not(.active)
):hover {
  color: #0c3978 !important;
  border-color: #1463d6 !important;
  background: #e6f0ff !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .primary, .search-btn, .settings-form button:not(.secondary-settings-button):not(.delete-category-button),
  .receipt-settings-actions button, .customer-profile-actions button,
  .inventory-dialog-actions .primary, .shift-entry-form button, .shift-event-form button,
  .payroll-pdf-button, .salary-export-button, .settings-tab.active,
  .receipt-kind-switch button.active, .back-mode-switch button.active,
  .row-action:not(.ghost):not(.delete)
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  border-color: #0d4fae !important;
  background: #1463d6 !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .primary, .search-btn, .settings-tab.active,
  .row-action:not(.ghost):not(.delete)
):hover {
  background: #0d4fae !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .delete, .delete-category-button, [data-delete-menu], [data-delete-staff],
  [data-delete-menu-category]
) {
  color: #a51c30 !important;
  border-color: #df9aa5 !important;
  background: #fff1f3 !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  a:not(.nav-item), .stat-link, .delta a, .inventory-updated
) {
  color: #0d55bb !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(svg, i) {
  stroke: currentColor;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  button, a, .stat-icon, .badge, .role, .ticket-status-pill
) :where(svg, i) {
  color: inherit;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .badge, .role, .ticket-status-pill, .shift-summary div,
  .customer-summary-cards article, .inventory-summary-cards article
) {
  color: #25334b !important;
  border-color: #aeb9c9 !important;
  background: #edf3fa !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  dialog::backdrop, .modal-backdrop, .overlay
) {
  background: rgba(9, 20, 38, .64) !important;
}

/* ---------- Luxury: unmistakable black / antique gold ---------- */
html[data-theme="luxury"] {
  --ink: #fff8e8;
  --muted: #d7c8a8;
  --line: #806a3a;
  --soft: #201b12;
  --deep: #080704;
  --pink: #e6c45d !important;
  --pink-2: #ffe08a !important;
  --purple: #b58a24 !important;
  --accent: #e6c45d !important;
  --theme-surface: #15130e;
  --theme-surface-2: #211d13;
  --theme-text: #fff8e8;
  --theme-muted: #d7c8a8;
  --theme-line: #806a3a;
  --theme-action: #f1cf67;
  --theme-action-2: #a87913;
  --theme-action-text: #171104;
  --theme-button-bg: #292318;
  --theme-button-text: #ffe8a6;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) {
  color: #fff8e8;
  background: #090805;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .sidebar {
  color: #fff6d8;
  background: linear-gradient(180deg, #151107, #060503);
  box-shadow: inset -1px 0 #826a30;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .sidebar::before {
  opacity: .08;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .nav-item {
  color: #dbcda9;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .nav-item:hover {
  color: #fff8e8;
  background: #302713;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .nav-item.active {
  color: #171104;
  border-color: #ffe69a;
  background: #e6c45d;
  box-shadow: inset 4px 0 #fff2bd;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .nav-item :where(svg, i) {
  color: currentColor !important;
  stroke: currentColor;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .topbar, .panel, .stat-card, .filters, .settings-card, .settings-section,
  .settings-group, .customer-search-results, .customer-profile-panel,
  .customer-history-record, .inventory-list-panel, .sales-chart-panel,
  .sales-summary-card, .receipt-settings-panel, .receipt-preview,
  .salary-builder, .salary-summary-card, .salary-staff-card,
  .ticket-edit-card, .ticket-order-detail, .shift-focus-card,
  .payroll-summary-metrics article, .payroll-summary-columns article,
  .payroll-summary-days, .portfolio-store-card, .crm-store-card,
  .store-detail-panel, .dashboard-active-ticket-card, dialog, .modal-card
) {
  color: #fff8e8 !important;
  border-color: #806a3a !important;
  background-color: #15130e !important;
  background-image: none !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  p, small, em, dt, .muted, .hint, .field-note, .empty-state,
  .status-text, .panel-subtitle, .settings-description, .delta
) {
  color: #d7c8a8 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  h1, h2, h3, h4, strong, b, label, legend, dd, summary, td, .table-cell
) {
  color: #fff8e8 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  .customer-search, .inventory-search, .editable-table-input, .payroll-input
) {
  color: #fff8e8 !important;
  -webkit-text-fill-color: #fff8e8;
  border-color: #907744 !important;
  background: #0a0906 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(input, select, textarea):focus {
  border-color: #f1cf67 !important;
  outline: 3px solid rgba(241, 207, 103, .24) !important;
  outline-offset: 1px;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  table:not(.payroll-table) thead, table:not(.payroll-table) th,
  .table-head, .settings-row, .menu-settings-head, .portal-settings-head,
  .ticket-order-meta div, .ticket-order-totals span,
  .active-ticket-detail-summary, .active-ticket-detail-total
) {
  color: #fff1c8 !important;
  border-color: #806a3a !important;
  background: #211d13 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) tbody tr:hover :where(th, td) {
  background-color: #302713 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  button:not(.theme-toggle):not(.active):not(.selected):not(.primary),
  .app-link, .outline, .clear, .detail, .secondary-settings-button,
  .row-action.ghost, .settings-tab:not(.active)
) {
  color: #ffe8a6 !important;
  border-color: #806a3a !important;
  background: #292318 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  button:not(.theme-toggle):not(.active):not(.selected):not(.primary),
  .app-link, .outline, .clear, .detail, .secondary-settings-button,
  .row-action.ghost, .settings-tab:not(.active)
):hover {
  color: #fff8e8 !important;
  border-color: #f1cf67 !important;
  background: #3a3019 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .primary, .search-btn, .settings-form button:not(.secondary-settings-button):not(.delete-category-button),
  .receipt-settings-actions button, .customer-profile-actions button,
  .inventory-dialog-actions .primary, .shift-entry-form button, .shift-event-form button,
  .payroll-pdf-button, .salary-export-button, .settings-tab.active,
  .receipt-kind-switch button.active, .back-mode-switch button.active,
  .row-action:not(.ghost):not(.delete)
) {
  color: #171104 !important;
  -webkit-text-fill-color: #171104;
  border-color: #ffe69a !important;
  background: #e6c45d !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .primary, .search-btn, .settings-tab.active,
  .row-action:not(.ghost):not(.delete)
):hover {
  background: #f1cf67 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .delete, .delete-category-button, [data-delete-menu], [data-delete-staff],
  [data-delete-menu-category]
) {
  color: #ffb1bb !important;
  border-color: #9e4857 !important;
  background: #3a171d !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  a:not(.nav-item), .stat-link, .delta a, .inventory-updated,
  .spark, .ornament, .eyebrow, .panel-title > span
) {
  color: #f1cf67 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  button, a, .stat-icon, .badge, .role, .ticket-status-pill
) :where(svg, i) {
  color: inherit !important;
  stroke: currentColor;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .badge, .role, .ticket-status-pill, .shift-summary div,
  .customer-summary-cards article, .inventory-summary-cards article
) {
  color: #fff1c8 !important;
  border-color: #907744 !important;
  background: #211d13 !important;
}

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  dialog::backdrop, .modal-backdrop, .overlay
) {
  background: rgba(0, 0, 0, .82) !important;
}

/* Dashboard icons and shift states are explicit per theme to prevent shared dark colors. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.stat-icon, .stat-icon.pink, .stat-icon.purple) {
  color: #ffffff !important;
  border: 2px solid #0d55bb !important;
  background: linear-gradient(145deg, #2474df, #164f9d) !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .stat-icon :where(svg, i, .yen-symbol) { color: #ffffff !important; stroke: currentColor !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-calendar { border-color: #9aabc0 !important; background: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-weekday { color: #172033 !important; background: #e4ebf4 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-day { color: #172033 !important; border-color: #b8c4d4 !important; background: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-day.is-empty { background: #f3f6fa !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-calendar .shift-day.has-one-shift { background: #e5f4ee !important; box-shadow: inset 0 0 0 2px #3f9876 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-calendar .shift-day.is-understaffed { background: #fff0c7 !important; box-shadow: inset 0 0 0 2px #ba7900 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.shift-day-total, .shift-day-more) { color: #34445c !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-day-warning { color: #714900 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-day-number { color: #172033 !important; border-color: #7f91a8 !important; background: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-chip { color: #ffffff !important; border-color: #0e4c9e !important; background: #1463b8 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-chip :where(strong, span) { color: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .shift-chip em { color: #17325f !important; background: #ffffff !important; }

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.stat-icon, .stat-icon.pink, .stat-icon.purple) {
  color: #171108 !important;
  border: 2px solid #ffe69a !important;
  background: linear-gradient(145deg, #f5d77d, #b48a32) !important;
}
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .stat-icon :where(svg, i, .yen-symbol) { color: #171108 !important; stroke: currentColor !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.shift-calendar, .shift-day) { color: #fff8e8 !important; border-color: #806a3a !important; background: #17140e !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-weekday { color: #fff8e8 !important; background: #302719 !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-day.is-empty { background: #100e0a !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-calendar .shift-day.has-one-shift { background: #393019 !important; box-shadow: inset 0 0 0 2px #d7b45d !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-calendar .shift-day.is-understaffed { background: #463411 !important; box-shadow: inset 0 0 0 2px #f1c85c !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.shift-day-total, .shift-day-more) { color: #f2ddb0 !important; }

/* Final cascade guard: admin cast avatars are buttons, so generic button rules
   must never erase either their fill or their white initial. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .admin-cast-directory-item button.avatar-chip.cast-profile-trigger,
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .cast-profile-identity .avatar-chip {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: rgba(255,255,255,.78) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.42) !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.coral { background: #1463b8 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.blue { background: #245f9f !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.amber { background: #805000 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.mint { background: #176b58 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.green { background: #26704f !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.violet { background: #643899 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.pink { background: #087b93 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) button.avatar-chip.free { background: #40536b !important; }

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .cast-profile-head .cast-profile-identity :where(h2,span) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .cast-profile-head .cast-profile-identity small {
  color: #dbeafe !important;
  -webkit-text-fill-color: #dbeafe !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .cast-profile-head #close-cast-profile {
  color: #ffffff !important;
  border-color: rgba(255,255,255,.72) !important;
  background: rgba(7,35,75,.38) !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .cast-profile-head #close-cast-profile :where(svg,path) {
  color: #ffffff !important;
  stroke: currentColor !important;
}

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) .cast-profile-dialog :where(
  #cast-profile-password-state, #cast-profile-customer-count, #cast-profile-ticket-count
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-day-warning { color: #ffe08b !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-day-number { color: #fff8e8 !important; border-color: #a78a4b !important; background: #342b1c !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-chip { color: #fff8e8 !important; border-color: #d7b45d !important; background: #5b451d !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-chip :where(strong, span) { color: #fff8e8 !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) .shift-chip em { color: #2b200d !important; background: #fff0bf !important; }

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .portfolio-hero, .customer-admin-head, .inventory-admin-head,
  .payroll-summary-hero, .report-hero
) {
  color: #ffffff !important;
  border: 1px solid #3978c8 !important;
  background: radial-gradient(circle at 84% 16%, rgba(255,255,255,.18), transparent 28%), linear-gradient(125deg, #102d56, #185da9 58%, #287dcc) !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-hero,.customer-admin-head,.inventory-admin-head,.payroll-summary-hero,.report-hero) :where(h1,h2,h3,h4,strong,p,small,span,label,svg) { color: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.eyebrow,.customer-eyebrow,.inventory-eyebrow,.payroll-summary-hero > div:first-child > span) { color: #d9ebff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.customer-search,.inventory-search) { border-color: #9bc5f3 !important; background: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.customer-search,.inventory-search) :where(input,svg) { color: #172033 !important; border: 0 !important; background: transparent !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.customer-search,.inventory-search) input::placeholder { color: #596579 !important; }

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .portfolio-hero, .customer-admin-head, .inventory-admin-head,
  .payroll-summary-hero, .report-hero
) {
  color: #fff8e8 !important;
  border: 1px solid #b89549 !important;
  background: radial-gradient(circle at 84% 16%, rgba(255,230,154,.13), transparent 28%), linear-gradient(125deg, #0e0b07, #342715 58%, #60491d) !important;
}
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-hero,.customer-admin-head,.inventory-admin-head,.payroll-summary-hero,.report-hero) :where(h1,h2,h3,h4,strong,p,small,span,label,svg) { color: #fff8e8 !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.eyebrow,.customer-eyebrow,.inventory-eyebrow,.payroll-summary-hero > div:first-child > span) { color: #ffe39a !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.customer-search,.inventory-search) { border-color: #a88b4a !important; background: #100e0a !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.customer-search,.inventory-search) :where(input,svg) { color: #fff8e8 !important; border: 0 !important; background: transparent !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.customer-search,.inventory-search) input::placeholder { color: #d8c9a8 !important; }

html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis article,.inventory-summary-cards article,.customer-summary-cards article) { color: #172033 !important; border-color: #aebdd0 !important; background: #ffffff !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis article,.inventory-summary-cards article,.customer-summary-cards article)::before { width: 5px !important; background: linear-gradient(180deg,#65a5f2,#1463d6 55%,#173f7a) !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis,.inventory-summary-cards,.customer-summary-cards) :where(span,small) { color: #596579 !important; }
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis,.inventory-summary-cards,.customer-summary-cards) strong { color: #172033 !important; }

html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis article,.inventory-summary-cards article,.customer-summary-cards article) { color: #fff8e8 !important; border-color: #907744 !important; background: #211d13 !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis article,.inventory-summary-cards article,.customer-summary-cards article)::before { width: 5px !important; background: linear-gradient(180deg,#ffe69a,#d7b45d 55%,#8b6a2b) !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis,.inventory-summary-cards,.customer-summary-cards) :where(span,small) { color: #d8c9a8 !important; }
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.portfolio-kpis,.inventory-summary-cards,.customer-summary-cards) strong { color: #fff8e8 !important; }

/* Status colors retain meaning and remain readable in both audited themes. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.success, .positive, .status-open) {
  color: #087044 !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(.warning, .status-warning) {
  color: #8a4b00 !important;
}
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.success, .positive, .status-open) {
  color: #74e3ad !important;
}
html[data-theme="luxury"] body:not(.ipad-app):not(.staff-portal-app) :where(.warning, .status-warning) {
  color: #ffd07a !important;
}

/* Keyboard users must always see focus, regardless of component-specific CSS. */
html:is([data-theme="light"], [data-theme="luxury"]) body:not(.ipad-app):not(.staff-portal-app) :where(button, a, [role="button"]):focus-visible {
  outline: 3px solid var(--theme-action) !important;
  outline-offset: 3px !important;
}

/* Disabled controls remain readable but unmistakably inactive. */
html[data-theme="light"] :where(button, input, select, textarea):disabled {
  color: #647083 !important;
  -webkit-text-fill-color: #647083;
  background: #e8edf3 !important;
  opacity: 1;
}
html[data-theme="luxury"] :where(button, input, select, textarea):disabled {
  color: #b9ac91 !important;
  -webkit-text-fill-color: #b9ac91;
  background: #1d1a13 !important;
  opacity: 1;
}

/* Final light-theme selection audit: selected controls use blue, never the legacy pink/purple. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .settings-tab.active,
  .table-settings-floor-list > button.active,
  .admin-ticket-config-tabs > button.active,
  .receipt-kind-switch button.active,
  .back-mode-switch button.active,
  .segmented-control button.selected,
  [role="tab"][aria-selected="true"]
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #0d4fae !important;
  background: linear-gradient(135deg, #0d4fae, #1463d6 58%, #287dcc) !important;
  background-image: linear-gradient(135deg, #0d4fae, #1463d6 58%, #287dcc) !important;
  box-shadow: 0 8px 20px rgba(20, 99, 214, .22) !important;
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .settings-tab.active,
  .table-settings-floor-list > button.active,
  .admin-ticket-config-tabs > button.active,
  .receipt-kind-switch button.active,
  .back-mode-switch button.active,
  .segmented-control button.selected,
  [role="tab"][aria-selected="true"]
) :where(strong,span,small,svg,[data-lucide]) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  stroke: currentColor !important;
}

/* Remove legacy pink shadows from neutral management controls and panels. */
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .settings-tabs,
  .settings-panel,
  .admin-ticket-config-panel,
  .table-settings-workspace,
  .table-settings-floor-pane,
  .settings-tab,
  .table-settings-floor-list > button,
  .admin-ticket-config-tabs > button
) {
  --legacy-pink-shadow: rgba(20, 48, 78, .12);
}
html[data-theme="light"] body:not(.ipad-app):not(.staff-portal-app) :where(
  .settings-tabs,
  .settings-panel,
  .admin-ticket-config-panel,
  .table-settings-workspace,
  .table-settings-floor-pane
) {
  box-shadow: 0 10px 28px rgba(20, 48, 78, .10) !important;
}
