/* ========================================================================== 
   AllClubCourts · Dark mode compatibility layer
   Loaded after the shared design system. Selectors deliberately carry higher
   specificity than page-local light styles so dark mode remains readable.
   ========================================================================== */

html[data-theme="dark"] {
  --ui-primary: #2dd4bf;
  --ui-primary-600: #14b8a6;
  --ui-primary-700: #0d9488;
  --ui-primary-050: #123633;
  --ui-primary-100: #17443f;
  --ui-accent: #fb923c;
  --ui-accent-600: #f97316;
  --ui-success: #34d399;
  --ui-success-050: #102d25;
  --ui-warning: #fbbf24;
  --ui-warning-050: #332712;
  --ui-danger: #fb7185;
  --ui-danger-050: #35191f;
  --ui-info: #60a5fa;
  --ui-bg: #0b1214;
  --ui-surface: #111b1d;
  --ui-surface-2: #172427;
  --ui-surface-3: #1d2d30;
  --ui-border: #294043;
  --ui-border-strong: #365255;
  --ui-text: #e7f2f1;
  --ui-text-muted: #a9bcba;
  --ui-text-subtle: #78918f;
  --ui-heading: #f7fbfa;
  --ui-shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 5px 16px rgba(0,0,0,.14);
  --ui-shadow-md: 0 8px 26px rgba(0,0,0,.28);
  --ui-shadow-lg: 0 20px 54px rgba(0,0,0,.42);
  --ui-shadow-primary: 0 10px 24px rgba(45,212,191,.18);
  color-scheme: dark;
}

/* Base and structural wrappers */
html[data-theme="dark"] body,
html[data-theme="dark"] body.nav-md,
html[data-theme="dark"] body.nav-sm,
html[data-theme="dark"] body.login,
html[data-theme="dark"] body .main_container,
html[data-theme="dark"] body .right_col,
html[data-theme="dark"] body .container.body,
html[data-theme="dark"] body .content-wrapper,
html[data-theme="dark"] body .page-content,
html[data-theme="dark"] body .mrgtoplayout {
  background: var(--ui-bg) !important;
  color: var(--ui-text) !important;
}

html[data-theme="dark"] body a:not(.btn):not([class*="-btn"]):not([class*="action"]) {
  color: #5eead4;
}
html[data-theme="dark"] body a:not(.btn):not([class*="-btn"]):not([class*="action"]):hover {
  color: #99f6e4;
}

html[data-theme="dark"] body h1,
html[data-theme="dark"] body h2,
html[data-theme="dark"] body h3,
html[data-theme="dark"] body h4,
html[data-theme="dark"] body h5,
html[data-theme="dark"] body h6,
html[data-theme="dark"] body .h1,
html[data-theme="dark"] body .h2,
html[data-theme="dark"] body .h3,
html[data-theme="dark"] body .h4,
html[data-theme="dark"] body .h5,
html[data-theme="dark"] body .h6 {
  color: var(--ui-heading) !important;
}

html[data-theme="dark"] body p,
html[data-theme="dark"] body label,
html[data-theme="dark"] body .control-label,
html[data-theme="dark"] body .help-block,
html[data-theme="dark"] body .form-text,
html[data-theme="dark"] body .text-muted,
html[data-theme="dark"] body small {
  color: var(--ui-text-muted) !important;
}

/* Navigation and menus */
html[data-theme="dark"] body .navbar,
html[data-theme="dark"] body .custom-navbar,
html[data-theme="dark"] body .nav_menu,
html[data-theme="dark"] body .top_nav .nav_menu,
html[data-theme="dark"] body .header-area,
html[data-theme="dark"] body .sticky-area,
html[data-theme="dark"] body .navigation {
  background: #0e171a !important;
  border-color: var(--ui-border) !important;
  box-shadow: 0 1px 0 var(--ui-border), 0 8px 24px rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] body .navbar a,
html[data-theme="dark"] body .navbar .nav > li > a,
html[data-theme="dark"] body .topmenuul a,
html[data-theme="dark"] body .nav_menu a {
  color: #b8c9c7 !important;
}
html[data-theme="dark"] body .navbar a:hover,
html[data-theme="dark"] body .navbar .nav > li > a:hover,
html[data-theme="dark"] body .navbar .nav > li.open > a,
html[data-theme="dark"] body .topmenuul a:hover {
  color: #f7fbfa !important;
  background: var(--ui-surface-2) !important;
}
html[data-theme="dark"] body .dropdown-menu,
html[data-theme="dark"] body .sub-menu,
html[data-theme="dark"] body .popover {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  box-shadow: var(--ui-shadow-lg) !important;
}
html[data-theme="dark"] body .dropdown-menu > li > a,
html[data-theme="dark"] body .dropdown-item,
html[data-theme="dark"] body .sub-menu li a {
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .dropdown-menu > li > a:hover,
html[data-theme="dark"] body .dropdown-item:hover,
html[data-theme="dark"] body .sub-menu li a:hover {
  background: var(--ui-primary-050) !important;
  color: #99f6e4 !important;
}
html[data-theme="dark"] body .dropdown-menu .divider,
html[data-theme="dark"] body .dropdown-divider {
  background: var(--ui-border) !important;
  border-color: var(--ui-border) !important;
}

/* Forms and native controls */
html[data-theme="dark"] body .form-control,
html[data-theme="dark"] body .form-select,
html[data-theme="dark"] body input[type="text"],
html[data-theme="dark"] body input[type="email"],
html[data-theme="dark"] body input[type="password"],
html[data-theme="dark"] body input[type="number"],
html[data-theme="dark"] body input[type="tel"],
html[data-theme="dark"] body input[type="date"],
html[data-theme="dark"] body input[type="time"],
html[data-theme="dark"] body input[type="search"],
html[data-theme="dark"] body input[type="url"],
html[data-theme="dark"] body input[type="file"],
html[data-theme="dark"] body textarea,
html[data-theme="dark"] body select {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .form-control:focus,
html[data-theme="dark"] body .form-select:focus,
html[data-theme="dark"] body input:focus,
html[data-theme="dark"] body textarea:focus,
html[data-theme="dark"] body select:focus {
  background: var(--ui-surface-3) !important;
  border-color: var(--ui-primary) !important;
  color: var(--ui-heading) !important;
  box-shadow: 0 0 0 3px rgba(45,212,191,.16) !important;
}
html[data-theme="dark"] body input::placeholder,
html[data-theme="dark"] body textarea::placeholder {
  color: var(--ui-text-subtle) !important;
  opacity: 1 !important;
}
html[data-theme="dark"] body input[readonly],
html[data-theme="dark"] body input:disabled,
html[data-theme="dark"] body select:disabled,
html[data-theme="dark"] body textarea:disabled,
html[data-theme="dark"] body .form-control:disabled {
  background: #10191b !important;
  border-color: #223638 !important;
  color: #809593 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] body option,
html[data-theme="dark"] body optgroup {
  background: var(--ui-surface-2) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] body input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(.9);
  opacity: .8;
}
html[data-theme="dark"] body input[type="file"]::file-selector-button {
  background: var(--ui-surface-3) !important;
  border: 0 !important;
  border-right: 1px solid var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .input-group-text,
html[data-theme="dark"] body .iti__selected-flag,
html[data-theme="dark"] body .iti__country-list {
  background: var(--ui-surface-3) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .iti__country.iti__highlight,
html[data-theme="dark"] body .iti__country:hover {
  background: var(--ui-primary-050) !important;
}

/* Shared surfaces */
html[data-theme="dark"] body .card,
html[data-theme="dark"] body .card-body,
html[data-theme="dark"] body .panel,
html[data-theme="dark"] body .panel-body,
html[data-theme="dark"] body .panel-default,
html[data-theme="dark"] body .well,
html[data-theme="dark"] body .x_panel,
html[data-theme="dark"] body .x_content,
html[data-theme="dark"] body .tile,
html[data-theme="dark"] body .widget,
html[data-theme="dark"] body .white-box,
html[data-theme="dark"] body .dashboard_graph,
html[data-theme="dark"] body .jumbotron,
html[data-theme="dark"] body .thumbnail,
html[data-theme="dark"] body .list-group-item {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .card-header,
html[data-theme="dark"] body .card-footer,
html[data-theme="dark"] body .panel-heading,
html[data-theme="dark"] body .x_title {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-heading) !important;
}

/* Tables and DataTables */
html[data-theme="dark"] body table,
html[data-theme="dark"] body .table,
html[data-theme="dark"] body table.dataTable {
  color: var(--ui-text) !important;
  border-color: var(--ui-border) !important;
}
html[data-theme="dark"] body .table > thead > tr > th,
html[data-theme="dark"] body table.dataTable thead th,
html[data-theme="dark"] body table.dataTable thead td {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: #b9c9c7 !important;
}
html[data-theme="dark"] body .table > tbody > tr,
html[data-theme="dark"] body table.dataTable tbody tr {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .table > tbody > tr > td,
html[data-theme="dark"] body .table > tbody > tr > th,
html[data-theme="dark"] body table.dataTable tbody td {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .table-hover > tbody > tr:hover > td,
html[data-theme="dark"] body table.dataTable tbody tr:hover td {
  background: var(--ui-primary-050) !important;
}
html[data-theme="dark"] body .table-striped > tbody > tr:nth-of-type(odd) > td {
  background: #142124 !important;
}
html[data-theme="dark"] body .dataTables_wrapper,
html[data-theme="dark"] body .dataTables_wrapper label,
html[data-theme="dark"] body .dataTables_wrapper .dataTables_info,
html[data-theme="dark"] body .dataTables_wrapper .dataTables_length,
html[data-theme="dark"] body .dataTables_wrapper .dataTables_filter {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .dataTables_wrapper .dt-buttons .btn,
html[data-theme="dark"] body .dataTables_wrapper .dt-buttons button,
html[data-theme="dark"] body .dt-button {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body .dataTables_wrapper .dt-buttons .btn:hover,
html[data-theme="dark"] body .dataTables_wrapper .dt-buttons button:hover,
html[data-theme="dark"] body .dt-button:hover {
  background: var(--ui-primary-050) !important;
  border-color: #3c706b !important;
  color: #99f6e4 !important;
}
html[data-theme="dark"] body .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] body .dataTables_wrapper .dataTables_length select {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .dataTables_wrapper .paginate_button,
html[data-theme="dark"] body .dataTables_wrapper .page-link,
html[data-theme="dark"] body .pagination > li > a,
html[data-theme="dark"] body .pagination > li > span {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .dataTables_wrapper .paginate_button:hover,
html[data-theme="dark"] body .dataTables_wrapper .page-link:hover,
html[data-theme="dark"] body .pagination > li > a:hover {
  background: var(--ui-primary-050) !important;
  color: #99f6e4 !important;
}
html[data-theme="dark"] body .dataTables_wrapper .paginate_button.current,
html[data-theme="dark"] body .dataTables_wrapper .paginate_button.current:hover,
html[data-theme="dark"] body .page-item.active .page-link,
html[data-theme="dark"] body .pagination > .active > a,
html[data-theme="dark"] body .pagination > .active > span {
  background: var(--ui-primary-600) !important;
  border-color: var(--ui-primary-600) !important;
  color: #06211e !important;
}
html[data-theme="dark"] body table.dataTable thead .sorting,
html[data-theme="dark"] body table.dataTable thead .sorting_asc,
html[data-theme="dark"] body table.dataTable thead .sorting_desc {
  filter: brightness(1.8) contrast(.8);
}

/* Buttons, alerts, badges and modals */
html[data-theme="dark"] body .btn-default,
html[data-theme="dark"] body .btn-secondary,
html[data-theme="dark"] body .btn-light,
html[data-theme="dark"] body .btn-outline-secondary {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .btn-default:hover,
html[data-theme="dark"] body .btn-secondary:hover,
html[data-theme="dark"] body .btn-light:hover,
html[data-theme="dark"] body .btn-outline-secondary:hover {
  background: var(--ui-surface-3) !important;
  color: var(--ui-heading) !important;
}
html[data-theme="dark"] body .alert-success {
  background: #102d25 !important;
  border-color: #245e4d !important;
  color: #86efac !important;
}
html[data-theme="dark"] body .alert-warning {
  background: #332712 !important;
  border-color: #66501e !important;
  color: #fde68a !important;
}
html[data-theme="dark"] body .alert-danger {
  background: #35191f !important;
  border-color: #71313e !important;
  color: #fda4af !important;
}
html[data-theme="dark"] body .alert-info {
  background: #14283c !important;
  border-color: #2e5274 !important;
  color: #bfdbfe !important;
}
html[data-theme="dark"] body .modal-content,
html[data-theme="dark"] body .modal-header,
html[data-theme="dark"] body .modal-body,
html[data-theme="dark"] body .modal-footer {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .close,
html[data-theme="dark"] body button.close {
  color: var(--ui-heading) !important;
  text-shadow: none !important;
  opacity: .8 !important;
}
html[data-theme="dark"] body .modal-backdrop.show {
  opacity: .72 !important;
}

/* Third-party widgets */
html[data-theme="dark"] body .sceditor-container,
html[data-theme="dark"] body .sceditor-toolbar,
html[data-theme="dark"] body .sceditor-group,
html[data-theme="dark"] body .sceditor-dropdown,
html[data-theme="dark"] body .bootstrap-datetimepicker-widget,
html[data-theme="dark"] body .ui-datepicker,
html[data-theme="dark"] body .ui-widget-content,
html[data-theme="dark"] body .select2-dropdown,
html[data-theme="dark"] body .select2-container--default .select2-selection--single,
html[data-theme="dark"] body .select2-container--default .select2-selection--multiple {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .sceditor-container iframe,
html[data-theme="dark"] body .sceditor-container textarea {
  background: var(--ui-surface-2) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .bootstrap-datetimepicker-widget td,
html[data-theme="dark"] body .bootstrap-datetimepicker-widget th,
html[data-theme="dark"] body .ui-datepicker td,
html[data-theme="dark"] body .ui-datepicker th {
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .bootstrap-datetimepicker-widget td.active,
html[data-theme="dark"] body .bootstrap-datetimepicker-widget td span.active,
html[data-theme="dark"] body .ui-datepicker .ui-state-active {
  background: var(--ui-primary-600) !important;
  color: #06211e !important;
}
html[data-theme="dark"] body .fc-unthemed td,
html[data-theme="dark"] body .fc-unthemed th,
html[data-theme="dark"] body .fc-unthemed .fc-divider,
html[data-theme="dark"] body .fc-unthemed .fc-list-heading td,
html[data-theme="dark"] body .fc-unthemed .fc-popover,
html[data-theme="dark"] body .fc-unthemed .fc-row,
html[data-theme="dark"] body .fc-unthemed tbody,
html[data-theme="dark"] body .fc-unthemed .fc-list-view,
html[data-theme="dark"] body .fc-unthemed .fc-list-heading td {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .fc-unthemed .fc-today {
  background: var(--ui-primary-050) !important;
}

/* Local page palettes */
html[data-theme="dark"] body .events-page {
  --events-primary: #2dd4bf !important;
  --events-primary-dark: #5eead4 !important;
  --events-primary-soft: #123633 !important;
  --events-accent: #fb923c !important;
  --events-accent-soft: #3b2716 !important;
  --events-text: #e7f2f1 !important;
  --events-muted: #a9bcba !important;
  --events-border: #294043 !important;
}
html[data-theme="dark"] body .ue-page {
  --ue-primary: #2dd4bf !important;
  --ue-primary-dark: #5eead4 !important;
  --ue-primary-soft: #123633 !important;
  --ue-accent: #fb923c !important;
  --ue-accent-soft: #3b2716 !important;
  --ue-text: #e7f2f1 !important;
  --ue-muted: #a9bcba !important;
  --ue-border: #294043 !important;
}
html[data-theme="dark"] body .ub-page {
  --ub-primary: #2dd4bf !important;
  --ub-primary-dark: #5eead4 !important;
  --ub-primary-soft: #123633 !important;
  --ub-accent: #fb923c !important;
  --ub-accent-soft: #3b2716 !important;
  --ub-text: #e7f2f1 !important;
  --ub-muted: #a9bcba !important;
  --ub-border: #294043 !important;
}
html[data-theme="dark"] body .rp-page {
  --rp-primary: #2dd4bf !important;
  --rp-primary-dark: #5eead4 !important;
  --rp-primary-soft: #123633 !important;
  --rp-accent: #fb923c !important;
  --rp-accent-soft: #3b2716 !important;
  --rp-text: #e7f2f1 !important;
  --rp-muted: #a9bcba !important;
  --rp-border: #294043 !important;
}
html[data-theme="dark"] body .mm-page {
  --mm-primary: #2dd4bf !important;
  --mm-primary-dark: #5eead4 !important;
  --mm-primary-soft: #123633 !important;
  --mm-accent: #fb923c !important;
  --mm-accent-soft: #3b2716 !important;
  --mm-text: #e7f2f1 !important;
  --mm-muted: #a9bcba !important;
  --mm-border: #294043 !important;
}
html[data-theme="dark"] body .cs-page {
  --cs-primary: #2dd4bf !important;
  --cs-primary-dark: #5eead4 !important;
  --cs-primary-soft: #123633 !important;
  --cs-accent: #fb923c !important;
  --cs-accent-soft: #3b2716 !important;
  --cs-text: #e7f2f1 !important;
  --cs-muted: #a9bcba !important;
  --cs-border: #294043 !important;
}
html[data-theme="dark"] {
  --profile-primary: #2dd4bf !important;
  --profile-primary-dark: #5eead4 !important;
  --profile-primary-soft: #123633 !important;
  --profile-accent: #fb923c !important;
  --profile-text: #e7f2f1 !important;
  --profile-muted: #a9bcba !important;
  --profile-border: #294043 !important;
  --profile-bg: #0b1214 !important;
  --profile-surface: #111b1d !important;
  --ins-primary: #2dd4bf !important;
  --ins-primary-dark: #5eead4 !important;
  --ins-primary-soft: #123633 !important;
  --ins-accent: #fb923c !important;
  --ins-text: #e7f2f1 !important;
  --ins-muted: #a9bcba !important;
  --ins-border: #294043 !important;
  --ins-bg: #0b1214 !important;
  --cp-primary: #2dd4bf !important;
  --cp-primary-dark: #5eead4 !important;
  --cp-primary-soft: #123633 !important;
  --cp-accent: #fb923c !important;
  --cp-text: #e7f2f1 !important;
  --cp-muted: #a9bcba !important;
  --cp-border: #294043 !important;
  --cp-bg: #0b1214 !important;
  --ae-primary: #2dd4bf !important;
  --ae-primary-dark: #5eead4 !important;
  --ae-primary-soft: #123633 !important;
  --ae-accent: #fb923c !important;
}

/* Custom page surfaces */
html[data-theme="dark"] body :is(
  .events-header,.events-feature-banner,.events-toolbar,.event-card,.events-empty,
  .ue-header,.ue-stat,.ue-card,.ue-cancelled-toggle,
  .ub-header,.ub-stat,.ub-card,.ub-all-toggle,
  .rp-header,.rp-card,.rp-summary-tile,
  .mm-header,.mm-stat,.mm-card,.mm-inactive-toggle,.mm-modal,
  .cs-header,.cs-summary-card,.cs-nav,.cs-card,.cs-save-bar,.cs-toggle-card,.cs-subsection,.cs-upload-box,
  .up-header,.up-profile-card,.up-nav-card,.up-section,.up-savebar,.up-upload-box,.up-toggle-row,.up-otp,
  .ins-header,.ins-filter-card,.ins-metric,.ins-chart-card,.ins-utilization-card,.ins-rate-box,
  .cp-header,.cp-card,.cp-help-card,.cp-security-note,
  .ae-hero,.ae-card,.ae-submit-bar,.ae-toggle-row,.ae-sample
) {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
  box-shadow: var(--ui-shadow-sm) !important;
}

html[data-theme="dark"] body :is(
  .ue-card-header,.ub-card-header,.rp-card-header,.mm-card-header,.cs-card-header,
  .ue-modal .modal-header,.ub-modal .modal-header,.mm-modal-header,
  .ins-card-head,.ae-card-head
) {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border) !important;
}

html[data-theme="dark"] body :is(
  .events-title,.event-title,.event-date .day,
  .ue-title,.ue-stat-value,.ue-card-title,.ue-event-name strong,.ue-date-cell,.ue-time-cell,.ue-amount,
  .ub-title,.ub-stat-value,.ub-card-title,.ub-booking-no,.ub-court,.ub-price,.ub-person,
  .rp-title,.rp-card-title,.rp-summary-value,
  .mm-title,.mm-stat-value,.mm-card-title,.mm-member-name,.mm-detail-value,.mm-modal-name,
  .cs-title,.cs-summary-value,.cs-card-title,.cs-toggle-copy strong,.cs-save-copy strong,
  .up-header h1,.up-profile-card h2,.up-section-head h2,.up-field>label,.up-savebar-copy b,
  .ins-header h1,.ins-filter-copy h2,.ins-metric-value,.ins-card-head h2,.ins-rate-box strong,
  .cp-header h1,.cp-card-head h2,.cp-field>label,.cp-help-card h2,
  .ae-card-head h2,.ae-field>label,.ae-submit-copy b
) {
  color: var(--ui-heading) !important;
}

html[data-theme="dark"] body :is(
  .events-subtitle,.events-results-meta,.event-time,.event-meta,.sporttype,.limitText,
  .ue-subtitle,.ue-stat-label,.ue-card-copy,.ue-event-name span,.ue-user,.ue-empty,
  .ub-subtitle,.ub-stat-label,.ub-card-copy,.ub-user,
  .rp-subtitle,.rp-card-copy,.rp-summary-label,.rp-summary-note,
  .mm-subtitle,.mm-stat-label,.mm-card-copy,.mm-member-email,.mm-contact,.mm-address,.mm-joined,.mm-detail-label,.mm-modal-meta,
  .cs-subtitle,.cs-summary-label,.cs-card-copy,.cs-hint,.cs-toggle-copy span,.cs-save-copy span,.cs-nav-note,
  .up-header p,.up-profile-card p,.up-section-head p,.up-hint,.up-toggle-copy span,.up-savebar-copy span,
  .ins-header p,.ins-filter-copy p,.ins-metric-label,.ins-card-head p,.ins-rate-box span,
  .cp-header p,.cp-card-head p,.cp-strength-label,.cp-requirements,.cp-help-card p,
  .ae-hero p,.ae-card-head p,.ae-hint,.ae-toggle-label small,.ae-submit-copy span
) {
  color: var(--ui-text-muted) !important;
}

/* Page controls and rows */
html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dt-buttons .btn,#eventTbl_wrapper .dt-buttons button,#eventTbl_wrapper .dataTables_filter input,#eventTbl_wrapper .dataTables_length select,
  #bookingTbl_wrapper .dt-buttons .btn,#bookingTbl_wrapper .dt-buttons button,#bookingTbl_wrapper .dataTables_filter input,#bookingTbl_wrapper .dataTables_length select,
  #userTbl_wrapper .dt-buttons .btn,#userTbl_wrapper .dt-buttons button,#userTbl_wrapper .dataTables_filter input,#userTbl_wrapper .dataTables_length select,
  .rp-table-wrap .dt-buttons .btn,.rp-table-wrap .dt-buttons button,.rp-table-wrap .dataTables_filter input,
  .events-search,.up-section .form-control,.up-section input,.up-section select,.up-section textarea,
  .cs-card .form-control,.cs-card input,.cs-card select,.cs-card textarea,
  .ins-field .form-control,.cp-field .form-control,.ae-card .form-control,.ae-card input,.ae-card select,.ae-card textarea
) {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}

html[data-theme="dark"] body #eventTbl thead th,
html[data-theme="dark"] body #bookingTbl thead th {
  background: transparent !important;
  color: #b9c9c7 !important;
}
html[data-theme="dark"] body #userTbl thead,
html[data-theme="dark"] body #userTbl thead tr,
html[data-theme="dark"] body #userTbl thead th {
  background: #183236 !important;
}
html[data-theme="dark"] body #userTbl thead th {
  border-color: #3b5b5e !important;
  color: #e9fbf8 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] body #eventTbl tbody tr,
html[data-theme="dark"] body #eventTbl tbody td,
html[data-theme="dark"] body #bookingTbl tbody tr,
html[data-theme="dark"] body #bookingTbl tbody td,
html[data-theme="dark"] body #userTbl tbody tr,
html[data-theme="dark"] body #userTbl tbody td {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body #eventTbl tbody tr:hover td,
html[data-theme="dark"] body #bookingTbl tbody tr:hover td,
html[data-theme="dark"] body #userTbl tbody tr:hover td {
  background: var(--ui-primary-050) !important;
}

/* Semantic chips and icon surfaces */
html[data-theme="dark"] body :is(
  .events-count,.ue-stat-icon,.ue-event-icon,.ue-type-chip,.ue-status-active,.ub-stat-icon,.ub-booking-icon,
  .rp-header-icon,.rp-summary-icon,.mm-header-note,.mm-stat-icon,.mm-skill-badge,.cs-header-badge,.cs-summary-icon,.cs-card-icon,
  .up-header-status,.up-section-icon,.up-role-badge,.ins-header-badge,.ins-metric-icon,.cp-header-icon,.ae-badge,.ae-icon-wrap,.ae-chip
) {
  background: var(--ui-primary-050) !important;
  border-color: #27504c !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] body :is(
  .events-warning,.ue-stat:nth-child(3) .ue-stat-icon,.ub-stat:nth-child(3) .ub-stat-icon,
  .rp-summary-tile.is-due .rp-summary-icon,.mm-stat:nth-child(3) .mm-stat-icon,.mm-stat:nth-child(4) .mm-stat-icon,
  .cs-summary-card:nth-child(3) .cs-summary-icon,.cs-summary-card:nth-child(4) .cs-summary-icon,
  .ins-metric:nth-child(2) .ins-metric-icon,.cp-security-note
) {
  background: var(--ui-warning-050) !important;
  border-color: #5f4b20 !important;
  color: #fbbf24 !important;
}
html[data-theme="dark"] body :is(.ue-status-cancelled,.ue-action-cancel,.ub-action,.mm-status-badge.is-inactive,.cs-delete-image) {
  background: var(--ui-danger-050) !important;
  border-color: #71313e !important;
  color: #fda4af !important;
}
html[data-theme="dark"] body :is(.ue-owner-chip-muted,.ub-action-disabled,.mm-age-badge) {
  background: var(--ui-surface-3) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text-muted) !important;
}

/* Page-specific finishing details */
html[data-theme="dark"] body .events-feature-banner {
  background: #102426 !important;
}
html[data-theme="dark"] body .events-feature-banner img {
  filter: brightness(.78) saturate(.88) contrast(1.04);
}
html[data-theme="dark"] body .event-card .accent {
  background: linear-gradient(180deg, #2dd4bf, #fb923c) !important;
}
html[data-theme="dark"] body .event-date {
  background: #142426 !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .event-date .month { color: #5eead4 !important; }
html[data-theme="dark"] body .events-empty { color: var(--ui-text-muted) !important; }

html[data-theme="dark"] body .ue-btn-secondary,
html[data-theme="dark"] body .ub-modal-close,
html[data-theme="dark"] body .ue-modal .ue-modal-close,
html[data-theme="dark"] body .up-mini-btn,
html[data-theme="dark"] body .up-secondary-btn,
html[data-theme="dark"] body .cs-btn-secondary,
html[data-theme="dark"] body .ins-download {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .ue-action,
html[data-theme="dark"] body .ub-action {
  box-shadow: none !important;
}

html[data-theme="dark"] body .rp-summary-tile.is-paid .rp-summary-icon,
html[data-theme="dark"] body .mm-status-badge.is-active {
  background: var(--ui-success-050) !important;
  border-color: #245e4d !important;
  color: #86efac !important;
}
html[data-theme="dark"] body .rp-summary-tile {
  background: var(--ui-surface-2) !important;
}

html[data-theme="dark"] body .mm-member-button,
html[data-theme="dark"] body .mm-modal-close {
  color: var(--ui-heading) !important;
}
html[data-theme="dark"] body .mm-avatar,
html[data-theme="dark"] body .mm-modal-avatar {
  background: linear-gradient(135deg, #17443f, #1d2d30) !important;
  border-color: #3c706b !important;
}
html[data-theme="dark"] body .mm-modal-backdrop {
  background: rgba(1,8,9,.78) !important;
}

html[data-theme="dark"] body .cs-nav a {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .cs-nav a:hover,
html[data-theme="dark"] body .cs-nav a:focus {
  background: var(--ui-primary-050) !important;
  color: #99f6e4 !important;
}
html[data-theme="dark"] body .cs-editor .sceditor-toolbar,
html[data-theme="dark"] body .cs-editor .sceditor-container,
html[data-theme="dark"] body .cs-table-wrap,
html[data-theme="dark"] body .tblImages tbody td,
html[data-theme="dark"] body .tblImages thead th {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .cs-save-bar,
html[data-theme="dark"] body .up-savebar {
  background: rgba(17,27,29,.96) !important;
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] body .up-upload-box,
html[data-theme="dark"] body .up-toggle-row,
html[data-theme="dark"] body .up-otp {
  background: var(--ui-surface-2) !important;
}
html[data-theme="dark"] body .up-profile-card .up-role-badge {
  background: var(--ui-warning-050) !important;
  color: #fdba74 !important;
}

html[data-theme="dark"] body .ins-chart-card > div[id$="Chart"],
html[data-theme="dark"] body #monthChart,
html[data-theme="dark"] body #timeChart,
html[data-theme="dark"] body .ins-rate-box,
html[data-theme="dark"] body .tabs-container,
html[data-theme="dark"] body .tab-content {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .tabs {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border) !important;
}
html[data-theme="dark"] body .tab-link {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .tab-link.active {
  background: var(--ui-primary-050) !important;
  color: #5eead4 !important;
}

html[data-theme="dark"] body .cp-input-wrap,
html[data-theme="dark"] body .cp-strength span {
  border-color: var(--ui-border-strong) !important;
}
html[data-theme="dark"] body .cp-toggle-password {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .cp-requirements li {
  color: var(--ui-text-muted) !important;
}

html[data-theme="dark"] body .ae-sample,
html[data-theme="dark"] body .ae-toggle-row {
  background: var(--ui-surface-2) !important;
}
html[data-theme="dark"] body .ae-warning {
  background: var(--ui-danger-050) !important;
  border-color: #71313e !important;
  color: #fda4af !important;
}
html[data-theme="dark"] body .txtNotify,
html[data-theme="dark"] body .date-error,
html[data-theme="dark"] body .text-danger,
html[data-theme="dark"] body .field-validation-error {
  color: #fda4af !important;
}

/* Floating toggle */
html[data-theme="dark"] body #ui-theme-toggle {
  background: #172427 !important;
  border-color: #365255 !important;
  color: #fde68a !important;
  box-shadow: 0 14px 38px rgba(0,0,0,.42) !important;
}
html[data-theme="dark"] body #ui-theme-toggle:hover {
  background: #223336 !important;
  color: #fef3c7 !important;
}

@media (prefers-contrast: more) {
  html[data-theme="dark"] {
    --ui-border: #426164;
    --ui-border-strong: #58777a;
    --ui-text-muted: #c0cfcd;
  }
}

/* Legacy event, map, dashboard, and booking views */
html[data-theme="dark"] body :is(
  .listing-card,.details-container,.event-info,.date-card,.event-tabs,
  .quotation-wrap,.fc-view-container,.divContainer
) {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body :is(
  .listing-card .title,.event-info .info-title,.date-card .day,.date-content,
  .section-heading,.section-title
) {
  color: var(--ui-heading) !important;
}
html[data-theme="dark"] body :is(
  .listing-card .subtitle,.listing-card .info-line,.event-info .info-sub,
  .date-card .date-row,.date-card .spots
) {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .event-tabs {
  background: var(--ui-surface-2) !important;
}
html[data-theme="dark"] body .event-tab {
  background: transparent !important;
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .event-tab.active {
  background: var(--ui-primary-050) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] body .info-icon,
html[data-theme="dark"] body .date-row .icon {
  background: var(--ui-primary-050) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] body .date-left {
  background: #142426 !important;
  border-color: var(--ui-border) !important;
}
html[data-theme="dark"] body .date-left .month { color: #5eead4 !important; }
html[data-theme="dark"] body .date-left .day { color: var(--ui-heading) !important; }
html[data-theme="dark"] body .event-info [style*="color:#374151"],
html[data-theme="dark"] body .event-info [style*="color: #374151"],
html[data-theme="dark"] body .date-card [style*="color:#374151"],
html[data-theme="dark"] body .date-card [style*="color: #374151"] {
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body #delNotif,
html[data-theme="dark"] body #inactNotif,
html[data-theme="dark"] body #joinClubNotify,
html[data-theme="dark"] body .ub-modal .modal-body p,
html[data-theme="dark"] body .ue-modal .modal-body p {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .quotation-heading,
html[data-theme="dark"] body .ledger {
  color: var(--ui-heading) !important;
}
html[data-theme="dark"] body .fc-toolbar,
html[data-theme="dark"] body .fc-head,
html[data-theme="dark"] body .fc-body,
html[data-theme="dark"] body .fc-view,
html[data-theme="dark"] body .fc-view-container {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}
html[data-theme="dark"] body .fc-button {
  background: var(--ui-surface-2) !important;
  border-color: var(--ui-border-strong) !important;
  color: var(--ui-text) !important;
  text-shadow: none !important;
}
html[data-theme="dark"] body .fc-button.fc-state-active,
html[data-theme="dark"] body .fc-button:hover {
  background: var(--ui-primary-050) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] body .fc-axis,
html[data-theme="dark"] body .fc-day-header,
html[data-theme="dark"] body .fc-day-number {
  color: var(--ui-text-muted) !important;
}
html[data-theme="dark"] body .fc-unthemed td.fc-today {
  background: #15302e !important;
}

/* ===== My Events and My Bookings: high-contrast dark mode ===== */
html[data-theme="dark"] body .ue-page,
html[data-theme="dark"] body .ub-page {
  color: #e7f2f1 !important;
}

html[data-theme="dark"] body :is(.ue-header, .ub-header, .ue-stat, .ub-stat, .ue-card, .ub-card) {
  background: #101d20 !important;
  border-color: #315055 !important;
}

html[data-theme="dark"] body :is(.ue-card-header, .ub-card-header) {
  background: #14272b !important;
  border-color: #315055 !important;
}

html[data-theme="dark"] body :is(
  .ue-title, .ub-title,
  .ue-card-title, .ub-card-title,
  .ue-stat-value, .ub-stat-value
) {
  color: #f4fbfa !important;
}

html[data-theme="dark"] body :is(
  .ue-subtitle, .ub-subtitle,
  .ue-card-copy, .ub-card-copy,
  .ue-stat-label, .ub-stat-label
) {
  color: #b8cbc8 !important;
}

html[data-theme="dark"] body :is(.ue-cancelled-toggle, .ub-all-toggle) {
  background: #0e1a1d !important;
  border-color: #3a5b60 !important;
  color: #e9f5f3 !important;
  font-size: 14px !important;
}

/* DataTables controls */
html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dt-buttons .btn,
  #eventTbl_wrapper .dt-buttons button,
  #bookingTbl_wrapper .dt-buttons .btn,
  #bookingTbl_wrapper .dt-buttons button
) {
  min-height: 38px !important;
  background: #14272b !important;
  border-color: #3a5b60 !important;
  color: #edf8f6 !important;
  font-size: 13px !important;
}

html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dt-buttons .btn:hover,
  #eventTbl_wrapper .dt-buttons button:hover,
  #bookingTbl_wrapper .dt-buttons .btn:hover,
  #bookingTbl_wrapper .dt-buttons button:hover
) {
  background: #193236 !important;
  border-color: #4f777b !important;
  color: #7ce9d9 !important;
}

html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dataTables_filter,
  #eventTbl_wrapper .dataTables_filter label,
  #eventTbl_wrapper .dataTables_length,
  #eventTbl_wrapper .dataTables_info,
  #bookingTbl_wrapper .dataTables_filter,
  #bookingTbl_wrapper .dataTables_filter label,
  #bookingTbl_wrapper .dataTables_length,
  #bookingTbl_wrapper .dataTables_info
) {
  color: #c2d2d0 !important;
  font-size: 13px !important;
}

html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dataTables_filter input,
  #eventTbl_wrapper .dataTables_length select,
  #bookingTbl_wrapper .dataTables_filter input,
  #bookingTbl_wrapper .dataTables_length select
) {
  min-height: 38px !important;
  background: #14272b !important;
  border-color: #3a5b60 !important;
  color: #f1faf8 !important;
  font-size: 14px !important;
}

html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dataTables_filter input,
  #bookingTbl_wrapper .dataTables_filter input
)::placeholder {
  color: #9fb5b2 !important;
  opacity: 1 !important;
}

/* Strong dark table headings */
html[data-theme="dark"] body #eventTbl thead,
html[data-theme="dark"] body #eventTbl thead tr,
html[data-theme="dark"] body #eventTbl thead th,
html[data-theme="dark"] body #bookingTbl thead,
html[data-theme="dark"] body #bookingTbl thead tr,
html[data-theme="dark"] body #bookingTbl thead th {
  background: #183236 !important;
}

html[data-theme="dark"] body #eventTbl thead th,
html[data-theme="dark"] body #bookingTbl thead th {
  border-top: 1px solid #3b5b5e !important;
  border-bottom: 1px solid #3b5b5e !important;
  color: #ecfaf8 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] body #eventTbl thead th:first-child,
html[data-theme="dark"] body #bookingTbl thead th:first-child {
  border-left: 1px solid #3b5b5e !important;
  border-radius: 12px 0 0 12px !important;
}

html[data-theme="dark"] body #eventTbl thead th:last-child,
html[data-theme="dark"] body #bookingTbl thead th:last-child {
  border-right: 1px solid #3b5b5e !important;
  border-radius: 0 12px 12px 0 !important;
}

html[data-theme="dark"] body :is(
  #eventTbl thead .sorting::before,
  #eventTbl thead .sorting::after,
  #eventTbl thead .sorting_asc::before,
  #eventTbl thead .sorting_asc::after,
  #eventTbl thead .sorting_desc::before,
  #eventTbl thead .sorting_desc::after,
  #bookingTbl thead .sorting::before,
  #bookingTbl thead .sorting::after,
  #bookingTbl thead .sorting_asc::before,
  #bookingTbl thead .sorting_asc::after,
  #bookingTbl thead .sorting_desc::before,
  #bookingTbl thead .sorting_desc::after
) {
  color: #9ddbd2 !important;
  opacity: .9 !important;
}

/* Readable table rows and cells */
html[data-theme="dark"] body #eventTbl tbody tr,
html[data-theme="dark"] body #bookingTbl tbody tr {
  background: #132427 !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] body #eventTbl tbody td,
html[data-theme="dark"] body #bookingTbl tbody td {
  background: #132427 !important;
  border-color: #2f4b4f !important;
  color: #dce9e7 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
}

html[data-theme="dark"] body #eventTbl tbody tr:hover td,
html[data-theme="dark"] body #bookingTbl tbody tr:hover td {
  background: #193236 !important;
  border-color: #477075 !important;
}

/* My Events field contrast */
html[data-theme="dark"] body .ue-event-name strong {
  color: #f8fcfb !important;
  font-size: 14.5px !important;
}
html[data-theme="dark"] body .ue-event-name span,
html[data-theme="dark"] body .ue-time-cell,
html[data-theme="dark"] body .ue-free {
  color: #bdd0cd !important;
  font-size: 13px !important;
}
html[data-theme="dark"] body :is(.ue-date-cell, .ue-amount) {
  color: #eef8f6 !important;
  font-size: 14px !important;
}
html[data-theme="dark"] body .ue-type-chip {
  background: #123c38 !important;
  border-color: #28655f !important;
  color: #76ead8 !important;
  font-size: 12.5px !important;
}
html[data-theme="dark"] body .ue-status-active {
  background: #103b2b !important;
  border-color: #236b4b !important;
  color: #79f1a8 !important;
}
html[data-theme="dark"] body .ue-status-cancelled {
  background: #3b2022 !important;
  border-color: #754146 !important;
  color: #ffb2b7 !important;
}
html[data-theme="dark"] body .ue-owner-chip {
  background: #3d2c17 !important;
  border-color: #725126 !important;
  color: #ffc77d !important;
}
html[data-theme="dark"] body .ue-owner-chip-muted {
  background: #203033 !important;
  border-color: #3d5659 !important;
  color: #c2d1cf !important;
}

/* My Bookings field contrast */
html[data-theme="dark"] body :is(.ub-booking-no, .ub-court, .ub-price, .ub-person) {
  color: #f3faf8 !important;
  font-size: 14px !important;
}
html[data-theme="dark"] body .ub-user {
  color: #bed0cd !important;
  font-size: 13px !important;
}
html[data-theme="dark"] body #bookingTbl tbody td:nth-child(3),
html[data-theme="dark"] body #bookingTbl tbody td:nth-child(4),
html[data-theme="dark"] body #bookingTbl tbody td:nth-child(5) {
  color: #c8d8d5 !important;
}

/* Action buttons */
html[data-theme="dark"] body :is(.ue-action, .ub-action) {
  background: #182d31 !important;
  border-color: #42646a !important;
  color: #d6e7e4 !important;
}
html[data-theme="dark"] body :is(.ue-action:hover, .ub-action:hover) {
  background: #214044 !important;
  border-color: #5b868b !important;
  color: #82eadc !important;
}
html[data-theme="dark"] body .ue-action-register {
  background: #123c38 !important;
  border-color: #28655f !important;
  color: #76ead8 !important;
}
html[data-theme="dark"] body .ue-action-edit {
  background: #3d2c17 !important;
  border-color: #725126 !important;
  color: #ffc77d !important;
}
html[data-theme="dark"] body :is(.ue-action-cancel, .ub-action) {
  background: #3b2022 !important;
  border-color: #754146 !important;
  color: #ffb2b7 !important;
}
html[data-theme="dark"] body .ub-action-disabled {
  background: #1a292c !important;
  border-color: #31484c !important;
  color: #788f8c !important;
}

/* Pagination */
html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dataTables_paginate .paginate_button,
  #eventTbl_wrapper .dataTables_paginate .page-link,
  #bookingTbl_wrapper .dataTables_paginate .paginate_button,
  #bookingTbl_wrapper .dataTables_paginate .page-link
) {
  background: #14272b !important;
  border-color: #3a5b60 !important;
  color: #dce9e7 !important;
  font-size: 13px !important;
}
html[data-theme="dark"] body :is(
  #eventTbl_wrapper .dataTables_paginate .paginate_button:hover,
  #eventTbl_wrapper .dataTables_paginate .page-link:hover,
  #bookingTbl_wrapper .dataTables_paginate .paginate_button:hover,
  #bookingTbl_wrapper .dataTables_paginate .page-link:hover
) {
  background: #1d383c !important;
  border-color: #52787d !important;
  color: #82eadc !important;
}


/* ======================================================================
   MY EVENTS + MY BOOKINGS — LIGHT MODE READABILITY
   Explicit high-contrast light-theme rules. These pages use inline rem-
   based styles, while the legacy site can reduce the root font size.
   Fixed sizes and stronger colors keep both tables readable.
   ====================================================================== */
html:not([data-theme="dark"]) body .ue-page {
  --ue-primary: #087f78 !important;
  --ue-primary-dark: #055f5a !important;
  --ue-primary-soft: #e4f4f2 !important;
  --ue-accent: #e98525 !important;
  --ue-accent-soft: #fff0df !important;
  --ue-text: #102d2d !important;
  --ue-muted: #4c6564 !important;
  --ue-border: #cbdcda !important;
}

html:not([data-theme="dark"]) body .ub-page {
  --ub-primary: #087f78 !important;
  --ub-primary-dark: #055f5a !important;
  --ub-primary-soft: #e4f4f2 !important;
  --ub-accent: #e98525 !important;
  --ub-accent-soft: #fff0df !important;
  --ub-text: #102d2d !important;
  --ub-muted: #4c6564 !important;
  --ub-border: #cbdcda !important;
}

html:not([data-theme="dark"]) body :is(.ue-page, .ub-page) {
  color: #102d2d !important;
}

html:not([data-theme="dark"]) body :is(
  .ue-header, .ub-header,
  .ue-stat, .ub-stat,
  .ue-card, .ub-card
) {
  background: #ffffff !important;
  border-color: #cbdcda !important;
}

html:not([data-theme="dark"]) body :is(.ue-card-header, .ub-card-header) {
  background: #f8fbfa !important;
  border-color: #cbdcda !important;
}

html:not([data-theme="dark"]) body :is(
  .ue-title, .ub-title,
  .ue-card-title, .ub-card-title,
  .ue-stat-value, .ub-stat-value
) {
  color: #102d2d !important;
}

html:not([data-theme="dark"]) body :is(
  .ue-subtitle, .ub-subtitle,
  .ue-card-copy, .ub-card-copy,
  .ue-stat-label, .ub-stat-label
) {
  color: #4c6564 !important;
  font-size: 13px !important;
}

html:not([data-theme="dark"]) body :is(.ue-cancelled-toggle, .ub-all-toggle) {
  min-height: 40px !important;
  background: #ffffff !important;
  border-color: #bfd3d0 !important;
  color: #173837 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

/* DataTables toolbar */
html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dt-buttons .btn,
  #eventTbl_wrapper .dt-buttons button,
  #bookingTbl_wrapper .dt-buttons .btn,
  #bookingTbl_wrapper .dt-buttons button
) {
  min-height: 38px !important;
  padding: 7px 12px !important;
  background: #ffffff !important;
  border-color: #bfd3d0 !important;
  color: #173837 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dt-buttons .btn:hover,
  #eventTbl_wrapper .dt-buttons button:hover,
  #bookingTbl_wrapper .dt-buttons .btn:hover,
  #bookingTbl_wrapper .dt-buttons button:hover
) {
  background: #eaf6f4 !important;
  border-color: #68a9a3 !important;
  color: #055f5a !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dataTables_filter,
  #eventTbl_wrapper .dataTables_filter label,
  #eventTbl_wrapper .dataTables_length,
  #eventTbl_wrapper .dataTables_info,
  #bookingTbl_wrapper .dataTables_filter,
  #bookingTbl_wrapper .dataTables_filter label,
  #bookingTbl_wrapper .dataTables_length,
  #bookingTbl_wrapper .dataTables_info
) {
  color: #425e5c !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dataTables_filter input,
  #eventTbl_wrapper .dataTables_length select,
  #bookingTbl_wrapper .dataTables_filter input,
  #bookingTbl_wrapper .dataTables_length select
) {
  min-height: 40px !important;
  background: #ffffff !important;
  border-color: #b9cfcc !important;
  color: #102d2d !important;
  font-size: 14px !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dataTables_filter input,
  #bookingTbl_wrapper .dataTables_filter input
)::placeholder {
  color: #687f7d !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dataTables_filter input:focus,
  #bookingTbl_wrapper .dataTables_filter input:focus
) {
  background: #ffffff !important;
  border-color: #087f78 !important;
  box-shadow: 0 0 0 4px rgba(8, 127, 120, .13) !important;
}

/* High-contrast light table headers */
html:not([data-theme="dark"]) body #eventTbl thead,
html:not([data-theme="dark"]) body #eventTbl thead tr,
html:not([data-theme="dark"]) body #eventTbl thead th,
html:not([data-theme="dark"]) body #bookingTbl thead,
html:not([data-theme="dark"]) body #bookingTbl thead tr,
html:not([data-theme="dark"]) body #bookingTbl thead th {
  background: #e5f1ef !important;
}

html:not([data-theme="dark"]) body #eventTbl thead th,
html:not([data-theme="dark"]) body #bookingTbl thead th {
  padding-top: 11px !important;
  padding-bottom: 11px !important;
  border-top: 1px solid #bfd3d0 !important;
  border-bottom: 1px solid #bfd3d0 !important;
  color: #173c3a !important;
  font-size: 12.5px !important;
  font-weight: 900 !important;
  letter-spacing: .045em !important;
  opacity: 1 !important;
}

html:not([data-theme="dark"]) body #eventTbl thead th:first-child,
html:not([data-theme="dark"]) body #bookingTbl thead th:first-child {
  border-left: 1px solid #bfd3d0 !important;
  border-radius: 12px 0 0 12px !important;
}

html:not([data-theme="dark"]) body #eventTbl thead th:last-child,
html:not([data-theme="dark"]) body #bookingTbl thead th:last-child {
  border-right: 1px solid #bfd3d0 !important;
  border-radius: 0 12px 12px 0 !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl thead .sorting::before,
  #eventTbl thead .sorting::after,
  #eventTbl thead .sorting_asc::before,
  #eventTbl thead .sorting_asc::after,
  #eventTbl thead .sorting_desc::before,
  #eventTbl thead .sorting_desc::after,
  #bookingTbl thead .sorting::before,
  #bookingTbl thead .sorting::after,
  #bookingTbl thead .sorting_asc::before,
  #bookingTbl thead .sorting_asc::after,
  #bookingTbl thead .sorting_desc::before,
  #bookingTbl thead .sorting_desc::after
) {
  color: #40736f !important;
  opacity: .85 !important;
}

/* Readable light table rows */
html:not([data-theme="dark"]) body #eventTbl tbody tr,
html:not([data-theme="dark"]) body #bookingTbl tbody tr {
  background: #ffffff !important;
  box-shadow: 0 3px 12px rgba(17, 60, 57, .07) !important;
}

html:not([data-theme="dark"]) body #eventTbl tbody td,
html:not([data-theme="dark"]) body #bookingTbl tbody td {
  background: #ffffff !important;
  border-color: #d3e1df !important;
  color: #233f3e !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
}

html:not([data-theme="dark"]) body #eventTbl tbody tr:hover td,
html:not([data-theme="dark"]) body #bookingTbl tbody tr:hover td {
  background: #f1f8f7 !important;
  border-color: #9fc4c0 !important;
}

/* My Events values */
html:not([data-theme="dark"]) body .ue-event-name strong {
  color: #102d2d !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
}

html:not([data-theme="dark"]) body :is(.ue-event-name span, .ue-time-cell, .ue-free) {
  color: #4d6664 !important;
  font-size: 13px !important;
}

html:not([data-theme="dark"]) body :is(.ue-date-cell, .ue-amount) {
  color: #173837 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

html:not([data-theme="dark"]) body .ue-type-chip {
  background: #e8f5f3 !important;
  border-color: #acd2ce !important;
  color: #075f59 !important;
  font-size: 12.5px !important;
}

html:not([data-theme="dark"]) body .ue-status-active {
  background: #e6f7ee !important;
  border-color: #9ed8b7 !important;
  color: #156b3e !important;
}

html:not([data-theme="dark"]) body .ue-status-cancelled {
  background: #fff0f0 !important;
  border-color: #e7b1b4 !important;
  color: #a92f37 !important;
}

html:not([data-theme="dark"]) body .ue-owner-chip {
  background: #fff0df !important;
  border-color: #efc58e !important;
  color: #8a4b10 !important;
}

html:not([data-theme="dark"]) body .ue-owner-chip-muted {
  background: #eef3f2 !important;
  border-color: #c8d6d4 !important;
  color: #455d5b !important;
}

/* My Bookings values */
html:not([data-theme="dark"]) body :is(.ub-booking-no, .ub-court, .ub-price, .ub-person) {
  color: #102d2d !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

html:not([data-theme="dark"]) body .ub-user {
  color: #4d6664 !important;
  font-size: 13px !important;
}

html:not([data-theme="dark"]) body #bookingTbl tbody td:nth-child(3),
html:not([data-theme="dark"]) body #bookingTbl tbody td:nth-child(4),
html:not([data-theme="dark"]) body #bookingTbl tbody td:nth-child(5) {
  color: #344f4d !important;
}

/* Actions */
html:not([data-theme="dark"]) body :is(.ue-action, .ub-action) {
  border-width: 1px !important;
  font-size: 14px !important;
}

html:not([data-theme="dark"]) body .ue-action {
  background: #ffffff !important;
  border-color: #b9cfcc !important;
  color: #294b48 !important;
}

html:not([data-theme="dark"]) body .ue-action:hover {
  background: #eaf6f4 !important;
  border-color: #70aba6 !important;
  color: #055f5a !important;
}

html:not([data-theme="dark"]) body .ue-action-register {
  background: #e5f5f2 !important;
  border-color: #9dcfc9 !important;
  color: #075f59 !important;
}

html:not([data-theme="dark"]) body .ue-action-edit {
  background: #fff0df !important;
  border-color: #efc58e !important;
  color: #8a4b10 !important;
}

html:not([data-theme="dark"]) body :is(.ue-action-cancel, .ub-action) {
  background: #fff0f0 !important;
  border-color: #e7b1b4 !important;
  color: #a92f37 !important;
}

html:not([data-theme="dark"]) body .ub-action-disabled {
  background: #eef3f2 !important;
  border-color: #c8d6d4 !important;
  color: #718683 !important;
}

/* Pagination */
html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dataTables_paginate .paginate_button,
  #eventTbl_wrapper .dataTables_paginate .page-link,
  #bookingTbl_wrapper .dataTables_paginate .paginate_button,
  #bookingTbl_wrapper .dataTables_paginate .page-link
) {
  min-width: 36px !important;
  min-height: 36px !important;
  background: #ffffff !important;
  border-color: #bfd3d0 !important;
  color: #294b48 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

html:not([data-theme="dark"]) body :is(
  #eventTbl_wrapper .dataTables_paginate .paginate_button:hover,
  #eventTbl_wrapper .dataTables_paginate .page-link:hover,
  #bookingTbl_wrapper .dataTables_paginate .paginate_button:hover,
  #bookingTbl_wrapper .dataTables_paginate .page-link:hover
) {
  background: #eaf6f4 !important;
  border-color: #70aba6 !important;
  color: #055f5a !important;
}


/* Add Event: explicit readable contrast in both themes. */
body .ae-page .ae-field > label,
body .ae-page .ae-card-head h2,
body .ae-page .ae-toggle-label b,
body .ae-page .ae-submit-copy b {
  color: #172b32 !important;
  opacity: 1 !important;
}
body .ae-page .ae-card-head p,
body .ae-page .ae-hint,
body .ae-page .ae-toggle-label small,
body .ae-page .ae-submit-copy span,
body .ae-page .ae-sample-body {
  color: #52666e !important;
  opacity: 1 !important;
}
html[data-theme="dark"] body .ae-page .ae-field > label,
html[data-theme="dark"] body .ae-page .ae-card-head h2,
html[data-theme="dark"] body .ae-page .ae-toggle-label b,
html[data-theme="dark"] body .ae-page .ae-submit-copy b {
  color: #f1fbfa !important;
}
html[data-theme="dark"] body .ae-page .ae-card-head p,
html[data-theme="dark"] body .ae-page .ae-hint,
html[data-theme="dark"] body .ae-page .ae-toggle-label small,
html[data-theme="dark"] body .ae-page .ae-submit-copy span,
html[data-theme="dark"] body .ae-page .ae-sample-body {
  color: #b9cdca !important;
}


/* ===== My Events & My Bookings summary-card readability ===== */
html:not([data-theme="dark"]) body :is(.ue-stat, .ub-stat) {
  background: #ffffff !important;
  border-color: #b9d1ce !important;
  box-shadow: 0 7px 18px rgba(17, 60, 57, .08) !important;
}

html:not([data-theme="dark"]) body :is(.ue-stat-value, .ub-stat-value) {
  color: #102d2d !important;
  font-size: 24px !important;
  font-weight: 850 !important;
}

html:not([data-theme="dark"]) body :is(.ue-stat-label, .ub-stat-label) {
  color: #365654 !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  line-height: 1.3 !important;
}

html:not([data-theme="dark"]) body :is(.ue-stat-icon, .ub-stat-icon) {
  background: #dff3f0 !important;
  color: #066c66 !important;
  border: 1px solid #b9ddd8 !important;
}

html:not([data-theme="dark"]) body :is(.ue-stat:nth-child(3) .ue-stat-icon, .ub-stat:nth-child(3) .ub-stat-icon) {
  background: #fff0df !important;
  color: #a9570c !important;
  border-color: #f1c995 !important;
}

html[data-theme="dark"] body :is(.ue-stat, .ub-stat) {
  background: #122427 !important;
  border-color: #426267 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] body :is(.ue-stat-value, .ub-stat-value) {
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 850 !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

html[data-theme="dark"] body :is(.ue-stat-label, .ub-stat-label) {
  color: #cfe1df !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

html[data-theme="dark"] body :is(.ue-stat-icon, .ub-stat-icon) {
  background: #0b4b47 !important;
  color: #72f0df !important;
  border: 1px solid #26766f !important;
}

html[data-theme="dark"] body :is(.ue-stat:nth-child(3) .ue-stat-icon, .ub-stat:nth-child(3) .ub-stat-icon) {
  background: #49330f !important;
  color: #ffc66d !important;
  border-color: #73541d !important;
}

html:not([data-theme="dark"]) body :is(.ue-title, .ub-title) {
  color: #102d2d !important;
  font-size: 28px !important;
}

html:not([data-theme="dark"]) body :is(.ue-subtitle, .ub-subtitle) {
  color: #46615f !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

html[data-theme="dark"] body :is(.ue-title, .ub-title) {
  color: #ffffff !important;
  font-size: 28px !important;
}

html[data-theme="dark"] body :is(.ue-subtitle, .ub-subtitle) {
  color: #c2d4d1 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

@media (max-width: 767px) {
  html body :is(.ue-stat-value, .ub-stat-value) {
    font-size: 22px !important;
  }
  html body :is(.ue-stat-label, .ub-stat-label) {
    font-size: 13.5px !important;
  }
}
