/*
  Final Executive Navy readability guard.
  This file is intentionally loaded after page-specific CSS so forms, dropdowns,
  modal controls, and helper text stay readable across the app.
*/

body[data-dashboard-theme="executive-navy"] :is(
  .container,
  .content-wrapper,
  .dashboard-header,
  .dashboard-header-actions,
  .dashboard-metrics,
  .dashboard-insights,
  .metric-card,
  .filter-container,
  .filter-bar,
  .filters,
  .ticket-control-panel,
  .table-container,
  .table-scroll-wrapper,
  .chart-card,
  .chart-shell,
  .report-panel,
  .expense-dashboard-panel,
  .expense-table-panel,
  .expense-metrics-grid,
  .expense-readiness-panel,
  .application-metric-card,
  .application-stage-panel,
  .application-work-panel,
  .application-intake-panel,
  .application-filter-panel,
  .application-list-panel,
  .application-work-item,
  .application-card,
  .document-metric-card,
  .document-action-panel,
  .document-coverage-panel,
  .document-filter-panel,
  .document-library-panel,
  .document-coverage-card,
  .document-card,
  .operation-card,
  .readiness-card,
  .leasing-stage-card,
  .leasing-pipeline-card,
  .integration-health-card,
  .tenant-metric-card,
  .tenant-panel,
  .tenant-readiness-panel,
  .tenant-next-steps-panel,
  .tenant-readiness-card,
  .property-manager-panel,
  .property-count-card,
  .property-detail-metric,
  .property-detail-card,
  .property-readiness-card,
  .invite-panel,
  .invite-role-card,
  .invite-team-note,
  .account-panel,
  .account-status-card,
  .message-summary-card,
  .message-action-queue,
  .message-template-panel,
  .message-compose-card,
  .message-thread-card,
  .message-detail-card,
  .message-compose-panel,
  .message-thread-panel,
  .rent-insight-card,
  .rent-reconciliation-card,
  .expense-readiness-card,
  .expense-vendor-card,
  .report-card
) {
  background-color: #0f2437 !important;
}

html:has(body[data-dashboard-theme="executive-navy"]),
body[data-dashboard-theme="executive-navy"] {
  background-color: #071421 !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  main,
  .page-shell,
  .dashboard-shell,
  .property-detail-shell,
  .tenant-dashboard-shell,
  .tenant-maintenance-shell
) {
  color: #f7fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .gear-button,
  .application-primary-action,
  .documents-primary-action,
  .section-action,
  .invite-secondary-action,
  .property-command-action,
  .back-button,
  .tenant-action,
  .operation-card,
  .communication-card,
  .readiness-card,
  .leasing-stage-card,
  .leasing-pipeline-card,
  .integration-health-card,
  .invite-actions a,
  .invite-team-note a,
  .tenant-panel a,
  .tenant-contact-list a,
  .tenant-payment-list a,
  .tenant-document-list a
) {
  background-color: #102f4a !important;
  border-color: rgba(127, 194, 255, 0.42) !important;
  color: #f7fbff !important;
  -webkit-text-fill-color: #f7fbff !important;
}

body[data-dashboard-theme="executive-navy"] .gear-button {
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24) !important;
  min-height: 42px;
}

body[data-dashboard-theme="executive-navy"] .gear-button :is(img, svg),
body[data-dashboard-theme="executive-navy"] .gear-button .gear-icon {
  filter: brightness(0) invert(1) !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .gear-button:hover,
  .gear-button:focus-visible,
  .application-primary-action:hover,
  .application-primary-action:focus-visible,
  .documents-primary-action:hover,
  .documents-primary-action:focus-visible,
  .section-action:hover,
  .section-action:focus-visible,
  .invite-secondary-action:hover,
  .invite-secondary-action:focus-visible,
  .property-command-action:hover,
  .property-command-action:focus-visible,
  .back-button:hover,
  .back-button:focus-visible,
  .tenant-action:hover,
  .tenant-action:focus-visible,
  .operation-card:hover,
  .operation-card:focus-visible,
  .communication-card:hover,
  .communication-card:focus-visible,
  .readiness-card:hover,
  .readiness-card:focus-visible,
  .leasing-stage-card:hover,
  .leasing-stage-card:focus-visible,
  .leasing-pipeline-card:hover,
  .leasing-pipeline-card:focus-visible,
  .integration-health-card:hover,
  .integration-health-card:focus-visible,
  .invite-actions a:hover,
  .invite-actions a:focus-visible,
  .invite-team-note a:hover,
  .invite-team-note a:focus-visible,
  .tenant-panel a:hover,
  .tenant-panel a:focus-visible,
  .tenant-contact-list a:hover,
  .tenant-contact-list a:focus-visible,
  .tenant-payment-list a:hover,
  .tenant-payment-list a:focus-visible,
  .tenant-document-list a:hover,
  .tenant-document-list a:focus-visible
) {
  background: linear-gradient(135deg, #2fc7a1, #4ba3ff) !important;
  border-color: transparent !important;
  color: #03101c !important;
  -webkit-text-fill-color: #03101c !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]),
  select,
  textarea,
  .form-control,
  .modal-input,
  .property-picker-input,
  .property-picker-select
) {
  background: #06121e !important;
  border: 1px solid rgba(196, 218, 239, 0.62) !important;
  box-shadow: none !important;
  caret-color: #ffffff !important;
  color: #ffffff !important;
  color-scheme: dark !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]),
  select,
  textarea,
  .form-control,
  .modal-input,
  .property-picker-input,
  .property-picker-select
):focus {
  border-color: rgba(127, 194, 255, 0.95) !important;
  box-shadow: 0 0 0 3px rgba(75, 163, 255, 0.24) !important;
  outline: none !important;
}

body[data-dashboard-theme="executive-navy"] :is(input, textarea)::placeholder {
  color: #e0ebf5 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #e0ebf5 !important;
}

body[data-dashboard-theme="executive-navy"] :is(input, textarea)::selection {
  background: rgba(75, 163, 255, 0.5) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] select,
body[data-dashboard-theme="executive-navy"] .property-picker-select {
  appearance: none !important;
  background-color: #06121e !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #e6f1ff 50%),
    linear-gradient(135deg, #e6f1ff 50%, transparent 50%) !important;
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px) !important;
  background-repeat: no-repeat !important;
  background-size: 6px 6px, 6px 6px !important;
  padding-right: 2.35rem !important;
}

body[data-dashboard-theme="executive-navy"] :is(select option, select optgroup) {
  background-color: #081626 !important;
  color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] select option:checked {
  background-color: #17364f !important;
  color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] :is(input[list], .property-picker-input) {
  background:
    linear-gradient(#06121e, #06121e) padding-box,
    linear-gradient(135deg, rgba(47, 199, 161, 0.46), rgba(75, 163, 255, 0.34)) border-box !important;
  border-color: transparent !important;
  padding-right: 2.2rem !important;
}

body[data-dashboard-theme="executive-navy"] input[list]::-webkit-calendar-picker-indicator,
body[data-dashboard-theme="executive-navy"] input[type="date"]::-webkit-calendar-picker-indicator,
body[data-dashboard-theme="executive-navy"] input[type="time"]::-webkit-calendar-picker-indicator,
body[data-dashboard-theme="executive-navy"] input[type="month"]::-webkit-calendar-picker-indicator,
body[data-dashboard-theme="executive-navy"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.92) !important;
}

body[data-dashboard-theme="executive-navy"] input[type="date"]::-webkit-datetime-edit,
body[data-dashboard-theme="executive-navy"] input[type="datetime-local"]::-webkit-datetime-edit,
body[data-dashboard-theme="executive-navy"] input[type="month"]::-webkit-datetime-edit,
body[data-dashboard-theme="executive-navy"] input[type="time"]::-webkit-datetime-edit,
body[data-dashboard-theme="executive-navy"] input[type="date"]::-webkit-datetime-edit-fields-wrapper,
body[data-dashboard-theme="executive-navy"] input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
body[data-dashboard-theme="executive-navy"] input[type="month"]::-webkit-datetime-edit-fields-wrapper,
body[data-dashboard-theme="executive-navy"] input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] input:-webkit-autofill,
body[data-dashboard-theme="executive-navy"] input:-webkit-autofill:hover,
body[data-dashboard-theme="executive-navy"] input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px #06121e inset !important;
  caret-color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] input[type="file"] {
  background: #06121e !important;
  border: 1px solid rgba(196, 218, 239, 0.62) !important;
  border-radius: 8px !important;
  color: #eef7ff !important;
  min-height: 44px;
  padding: 7px 10px !important;
  -webkit-text-fill-color: #eef7ff !important;
}

body[data-dashboard-theme="executive-navy"] input[type="file"]::file-selector-button {
  background: #43d6af !important;
  border: 0 !important;
  border-radius: 8px !important;
  color: #02101b !important;
  cursor: pointer;
  font-weight: 850;
  margin-right: 10px;
  padding: 8px 12px;
}

body[data-dashboard-theme="executive-navy"] :is(input:disabled, select:disabled, textarea:disabled, input[readonly], textarea[readonly]) {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(196, 218, 239, 0.26) !important;
  color: #b9c9da !important;
  cursor: not-allowed;
  opacity: 1 !important;
  -webkit-text-fill-color: #b9c9da !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  label,
  fieldset legend,
  .filter-group label,
  .filters label,
  .modal-content label,
  .application-filter-panel label,
  .application-form label,
  .invite-form label,
  .tenant-maintenance-form label,
  .property-form label,
  .delete-section label,
  .payment-method-selector label,
  .checkbox-row,
  .alerts-checkbox-row,
  .consent-checkbox-row,
  .modal-checkbox-row,
  .tenant-visible-toggle
) {
  color: #f4f9ff !important;
  text-shadow: none !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .field-hint,
  .form-hint,
  .input-help,
  .tenant-input-help,
  .invite-field-hint,
  .property-field-hint,
  .help-text,
  .document-upload-hint,
  small
) {
  background: rgba(6, 18, 30, 0.78) !important;
  border: 1px solid rgba(196, 218, 239, 0.18) !important;
  border-radius: 6px !important;
  box-decoration-break: clone;
  color: #f8fbff !important;
  line-height: 1.5;
  padding: 1px 5px !important;
  text-shadow: none !important;
  -webkit-box-decoration-break: clone;
  -webkit-text-fill-color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  button,
  .btn,
  .nav-link,
  .gear-dropdown,
  .dropdown,
  .dropdown-menu,
  .toolbar-menu,
  .action-menu
) :is(
  .field-hint,
  .form-hint,
  .input-help,
  .tenant-input-help,
  .invite-field-hint,
  .property-field-hint,
  .help-text,
  .document-upload-hint,
  small
) {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .gear-dropdown,
  .dropdown,
  .dropdown-menu,
  .filter-dropdown,
  .toolbar-menu,
  .action-menu,
  .suggestions-list,
  .autocomplete-menu,
  .autocomplete-results,
  .property-picker-menu,
  .property-picker-results,
  [role="listbox"],
  .popover,
  .modal-content
) {
  background-color: #0f2437 !important;
  border-color: rgba(196, 218, 239, 0.34) !important;
  color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] .gear-dropdown {
  top: calc(100% + 8px) !important;
  transform: none !important;
}

body[data-dashboard-theme="executive-navy"] .gear-dropdown.align-left {
  left: 0 !important;
  right: auto !important;
  transform-origin: top left !important;
}

body[data-dashboard-theme="executive-navy"] .gear-dropdown.align-right {
  left: auto !important;
  right: 0 !important;
  transform-origin: top right !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .gear-dropdown a,
  .gear-dropdown button,
  .dropdown-menu a,
  .dropdown-menu button,
  .toolbar-menu a,
  .toolbar-menu button,
  .action-menu a,
  .action-menu button,
  .suggestions-list li,
  .autocomplete-menu li,
  .autocomplete-results li,
  .property-picker-menu li,
  .property-picker-results li,
  [role="listbox"] [role="option"]
) {
  color: #f1f7ff !important;
  -webkit-text-fill-color: #f1f7ff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .gear-dropdown a:hover,
  .gear-dropdown button:hover,
  .gear-dropdown a:focus-visible,
  .gear-dropdown button:focus-visible,
  .dropdown-menu a:hover,
  .dropdown-menu button:hover,
  .dropdown-menu a:focus-visible,
  .dropdown-menu button:focus-visible,
  .toolbar-menu a:hover,
  .toolbar-menu button:hover,
  .toolbar-menu a:focus-visible,
  .toolbar-menu button:focus-visible,
  .action-menu a:hover,
  .action-menu button:hover,
  .action-menu a:focus-visible,
  .action-menu button:focus-visible,
  .suggestions-list li:hover,
  .suggestions-list li:focus-visible,
  .autocomplete-menu li:hover,
  .autocomplete-menu li:focus-visible,
  .autocomplete-results li:hover,
  .autocomplete-results li:focus-visible,
  .property-picker-menu li:hover,
  .property-picker-menu li:focus-visible,
  .property-picker-results li:hover,
  .property-picker-results li:focus-visible,
  [role="listbox"] [role="option"]:hover,
  [role="listbox"] [role="option"]:focus-visible,
  [role="listbox"] [aria-selected="true"]
) {
  background: rgba(47, 199, 161, 0.14) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Broad final contrast sweep for Executive Navy pages.
   This catches page-specific cards/statuses that were added outside the shared design system. */
body[data-dashboard-theme="executive-navy"] :is(
  [class$="-panel"],
  [class*="-panel "],
  [class$="-card"],
  [class*="-card "],
  [class$="-surface"],
  [class*="-surface "],
  [class$="-shell"],
  [class*="-shell "],
  [class$="-empty"],
  [class*="-empty "],
  [class$="-status"],
  [class*="-status "],
  [class$="-notice"],
  [class*="-notice "],
  [class$="-summary"],
  [class*="-summary "],
  [class$="-queue"],
  [class*="-queue "],
  [class$="-log"],
  [class*="-log "],
  [class$="-item"],
  [class*="-item "],
  [class$="-row"],
  [class*="-row "]
) {
  color: #f8fbff !important;
  text-shadow: none !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  [class$="-panel"],
  [class*="-panel "],
  [class$="-card"],
  [class*="-card "],
  [class$="-surface"],
  [class*="-surface "],
  [class$="-empty"],
  [class*="-empty "],
  [class$="-notice"],
  [class*="-notice "],
  [class$="-summary"],
  [class*="-summary "],
  [class$="-queue"],
  [class*="-queue "],
  [class$="-log"],
  [class*="-log "]
) {
  background-color: #0f2437 !important;
  border-color: rgba(196, 218, 239, 0.32) !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  li,
  dt,
  dd,
  th,
  td,
  label,
  legend,
  output,
  summary
) {
  color: #f8fbff !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .dashboard-subtitle,
  .subtitle,
  .description,
  .muted,
  .meta,
  .supporting-copy,
  .empty-copy,
  .helper-copy,
  .fine-print,
  .secondary-text,
  [class$="-subtitle"],
  [class*="-subtitle "],
  [class$="-description"],
  [class*="-description "],
  [class$="-meta"],
  [class*="-meta "],
  [class$="-copy"],
  [class*="-copy "],
  [class$="-hint"],
  [class*="-hint "],
  [class$="-help"],
  [class*="-help "],
  small
) {
  color: #dbeafe !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #dbeafe !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .status-pill,
  .status-badge,
  .badge,
  .chip,
  .pill,
  [class$="-badge"],
  [class*="-badge "],
  [class$="-pill"],
  [class*="-pill "],
  [class$="-chip"],
  [class*="-chip "],
  [class$="-tag"],
  [class*="-tag "]
) {
  background: rgba(6, 18, 30, 0.9) !important;
  border: 1px solid rgba(196, 218, 239, 0.34) !important;
  color: #f8fbff !important;
  -webkit-text-fill-color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .dropdown,
  .dropdown-menu,
  .filter-dropdown,
  .toolbar-menu,
  .action-menu,
  .menu,
  .menu-list,
  .select-menu,
  .select-options,
  .suggestions-list,
  .autocomplete-menu,
  .autocomplete-results,
  .property-picker-menu,
  .property-picker-results,
  .popover,
  .tooltip,
  [popover],
  [role="menu"],
  [role="listbox"],
  [role="dialog"],
  .flatpickr-calendar,
  .ui-menu,
  .pac-container
) {
  background: #0b1f32 !important;
  border-color: rgba(196, 218, 239, 0.46) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
  color: #f8fbff !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .dropdown *,
  .dropdown-menu *,
  .filter-dropdown *,
  .toolbar-menu *,
  .action-menu *,
  .menu *,
  .menu-list *,
  .select-menu *,
  .select-options *,
  .suggestions-list *,
  .autocomplete-menu *,
  .autocomplete-results *,
  .property-picker-menu *,
  .property-picker-results *,
  [role="menu"] *,
  [role="listbox"] *,
  .flatpickr-calendar *,
  .ui-menu *,
  .pac-container *
) {
  color: #f8fbff !important;
  opacity: 1 !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  select,
  option,
  optgroup
) {
  background-color: #06121e !important;
  color: #ffffff !important;
  text-shadow: none !important;
  -webkit-text-fill-color: #ffffff !important;
}

body[data-dashboard-theme="executive-navy"] option:checked,
body[data-dashboard-theme="executive-navy"] option:hover {
  background-color: #17364f !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

@supports selector(select::picker(select)) {
  body[data-dashboard-theme="executive-navy"] select::picker(select) {
    background-color: #06121e !important;
    color: #ffffff !important;
  }
}

/* Executive Navy fallback colors v20260706-readability5.
   These components use dark gradients, but the explicit color keeps text readable
   when gradients are unavailable and makes contrast audits match the rendered UI. */
body[data-dashboard-theme="executive-navy"] :is(
  .account-shell,
  .reports-shell,
  .property-metric,
  .properties-metrics,
  .property-action-summary,
  .property-action-card,
  .coordinate-repair-card,
  .property-list-panel,
  .setup-checklist-shell,
  .setup-progress-panel,
  .setup-sequence-panel,
  .setup-launch-panel,
  .setup-checklist-group,
  .setup-sequence-step,
  .setup-launch-card,
  .setup-launch-empty,
  .setup-checklist-item,
  .tenant-maintenance-card,
  .tenant-history-card,
  .tenant-request-item
) {
  background-color: #0f2437 !important;
  border-color: rgba(196, 218, 239, 0.32) !important;
  color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .property-metric span,
  .property-count-card span,
  .property-action-card-heading span,
  .property-action-meta,
  .property-list-meta,
  .property-profile-stat small,
  .setup-checklist-group .eyebrow,
  .setup-sequence-panel .eyebrow,
  .setup-launch-panel .eyebrow,
  .setup-checklist-content p,
  .setup-sequence-content p,
  .setup-launch-content p,
  .tenant-card-heading p,
  .tenant-history-heading p,
  .tenant-request-meta,
  .tenant-request-description,
  .tenant-history-empty
) {
  color: #dbeafe !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #dbeafe !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .property-metric strong,
  .property-count-card strong,
  .property-action-card-heading strong,
  .property-action-card p,
  .property-list-title strong,
  .property-profile-stat strong,
  .setup-checklist-group h2,
  .setup-sequence-panel h2,
  .setup-launch-panel h2,
  .setup-checklist-content strong,
  .setup-sequence-content strong,
  .setup-launch-content strong,
  .tenant-card-heading h2,
  .tenant-history-heading h2,
  .tenant-request-title strong
) {
  color: #f8fbff !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] :is(
  .account-panels-row,
  .dashboard-metrics,
  .dashboard-insights,
  .reports-metrics,
  .reports-insights
) {
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  color: #f8fbff !important;
  -webkit-text-fill-color: #f8fbff !important;
}

body[data-dashboard-theme="executive-navy"] .tenant-back-link {
  background-color: #43d6af !important;
  background-image: linear-gradient(135deg, #2fc7a1, #4ba3ff) !important;
  border: 1px solid rgba(47, 199, 161, 0.58) !important;
  color: #02101b !important;
  -webkit-text-fill-color: #02101b !important;
}
