/* Matilde v66: tema oscuro inspirado en la paleta visual de CoverManager. */
:root {
  --mat-cover-bg: #202a31;
  --mat-cover-top: #1b252c;
  --mat-cover-panel: #303b43;
  --mat-cover-panel-2: #36434b;
  --mat-cover-map: #263239;
  --mat-cover-border: #4b5962;
  --mat-cover-text: #f1f4f5;
  --mat-cover-muted: #aeb9c1;
  --mat-cover-yellow: #f5c842;
  --mat-cover-lime: #9aca4f;
  --mat-cover-pink: #e65397;
  --mat-cover-blue: #69bde7;
  --mat-cover-danger: #ef6464;
}

body.matilde-cover-dark-mode {
  background: var(--mat-cover-bg) !important;
  color: var(--mat-cover-text) !important;
}

/* TABLET */
#section-tablet.covermanager-dark-mode,
#section-tablet.covermanager-dark-mode .tablet-maitre-app,
#section-tablet.covermanager-dark-mode .tablet-main-grid {
  background: var(--mat-cover-bg) !important;
  color: var(--mat-cover-text) !important;
}

#section-tablet.covermanager-dark-mode .tablet-maitre-topbar {
  background: var(--mat-cover-top) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
}

#section-tablet.covermanager-dark-mode .tablet-controlbar,
#section-tablet.covermanager-dark-mode .tablet-panel,
#section-tablet.covermanager-dark-mode .tablet-map-toolbar,
#section-tablet.covermanager-dark-mode .tablet-map-footer,
#section-tablet.covermanager-dark-mode .tablet-agenda-header,
#section-tablet.covermanager-dark-mode .tablet-agenda-searchbar,
#section-tablet.covermanager-dark-mode .tablet-stats-row,
#section-tablet.covermanager-dark-mode .tablet-calendar-popover {
  background: var(--mat-cover-panel) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
}

#section-tablet.covermanager-dark-mode .tablet-map-viewport,
#section-tablet.covermanager-dark-mode .tablet-map-base,
#section-tablet.covermanager-dark-mode .tablet-agenda-list {
  background: var(--mat-cover-map) !important;
  border-color: var(--mat-cover-border) !important;
}

#section-tablet.covermanager-dark-mode :is(
  .tablet-brand-title,
  .tablet-section-title strong,
  .tablet-stat-box strong,
  .tablet-control-date-button strong,
  .tablet-calendar-title,
  .tablet-legend,
  .tablet-empty-note,
  .tablet-map-hint
) {
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

#section-tablet.covermanager-dark-mode :is(
  .tablet-brand-subtitle,
  .tablet-section-title span,
  .tablet-stat-box span,
  .tablet-control-label,
  .tablet-control-group label,
  .tablet-legend span,
  .tablet-control-date-button small
) {
  color: var(--mat-cover-muted) !important;
  -webkit-text-fill-color: var(--mat-cover-muted) !important;
  opacity: 1 !important;
}

#section-tablet.covermanager-dark-mode :is(.tablet-search-input, .tablet-select, input, select, textarea) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
  caret-color: var(--mat-cover-yellow) !important;
}

#section-tablet.covermanager-dark-mode :is(input, textarea)::placeholder {
  color: var(--mat-cover-muted) !important;
  -webkit-text-fill-color: var(--mat-cover-muted) !important;
  opacity: 1 !important;
}

#section-tablet.covermanager-dark-mode :is(
  .tablet-icon-btn-primary,
  .tablet-btn-primary,
  .tablet-btn.is-active,
  .tablet-shift-btn.is-active,
  .tablet-count-pill,
  .tablet-control-date-button,
  .tablet-calendar-nav:hover
) {
  background: var(--mat-cover-yellow) !important;
  border-color: var(--mat-cover-yellow) !important;
  color: #202a31 !important;
  -webkit-text-fill-color: #202a31 !important;
}

#section-tablet.covermanager-dark-mode :is(.tablet-icon-btn-muted, .tablet-shift-btn:not(.is-active), .tablet-calendar-nav) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

#section-tablet.covermanager-dark-mode .tablet-stat-box,
#section-tablet.covermanager-dark-mode .tablet-empty-note {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
}

/* Reservas oscuras: tarjeta gris y señal de estado como en la referencia. */
#section-tablet.covermanager-dark-mode .tablet-res-card {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
  box-shadow: 0 8px 18px rgba(7, 12, 15, .18) !important;
}

#section-tablet.covermanager-dark-mode .tablet-res-card.is-pending { border-left: 8px solid var(--mat-reserved) !important; }
#section-tablet.covermanager-dark-mode .tablet-res-card.is-reserved { border-left: 8px solid var(--mat-reserved) !important; }
#section-tablet.covermanager-dark-mode .tablet-res-card.is-seated { border-left: 8px solid var(--mat-cover-pink) !important; }
#section-tablet.covermanager-dark-mode .tablet-res-card.is-completed { border-left: 8px solid var(--mat-cover-lime) !important; }
#section-tablet.covermanager-dark-mode .tablet-res-card.is-cancelled { border-left: 8px solid var(--mat-cover-danger) !important; opacity: .72 !important; }

#section-tablet.covermanager-dark-mode .tablet-res-card :is(.tablet-res-time, .tablet-res-name, .tablet-res-state, .tablet-res-meta, span, strong, p) {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

#section-tablet.covermanager-dark-mode .tablet-mini-btn.primary,
#section-tablet.covermanager-dark-mode .tablet-mini-btn.green,
#section-tablet.covermanager-dark-mode .tablet-mini-btn.done {
  background: var(--mat-cover-lime) !important;
  color: #172027 !important;
  -webkit-text-fill-color: #172027 !important;
}

#section-tablet.covermanager-dark-mode .tablet-mini-btn.warn {
  background: var(--mat-cover-yellow) !important;
  color: #172027 !important;
  -webkit-text-fill-color: #172027 !important;
}

#section-tablet.covermanager-dark-mode .tablet-table {
  box-shadow: 0 5px 12px rgba(7, 12, 15, .24) !important;
}

#section-tablet.covermanager-dark-mode .tablet-table.is-free {
  background: #3a464e !important;
  border-color: #62717a !important;
  color: var(--mat-cover-text) !important;
}

#section-tablet.covermanager-dark-mode .tablet-table.is-reserved,
#section-tablet.covermanager-dark-mode .tablet-table.is-assignable {
  background: var(--mat-cover-lime) !important;
  border-color: #b4dd6c !important;
  color: #1c2820 !important;
}

#section-tablet.covermanager-dark-mode .tablet-table.is-seated {
  background: var(--mat-cover-pink) !important;
  border-color: #f278ad !important;
  color: #23151d !important;
}

#section-tablet.covermanager-dark-mode .tablet-table.is-selected {
  background: var(--mat-cover-yellow) !important;
  border-color: #ffe073 !important;
  color: #202a31 !important;
}

/* MÓVIL */
#section-mobile.covermanager-dark-mode,
#section-mobile.covermanager-dark-mode .mobile-screen,
#section-mobile.covermanager-dark-mode .mobile-main,
#section-mobile.covermanager-dark-mode .mobile-content {
  background: var(--mat-cover-bg) !important;
  color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode :is(.mobile-topbar, .mobile-bottom-nav) {
  background: var(--mat-cover-top) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode :is(
  .mobile-card,
  .mobile-table-row,
  .mobile-customer-item,
  .mobile-notification-row,
  .mobile-customer-booking,
  .mobile-setting-row,
  .mobile-assignment-panel,
  .mobile-design-panel,
  .mobile-table-detail-box
) {
  background: var(--mat-cover-panel) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode :is(.mobile-map-stage, .mobile-map-canvas, .mobile-map-base, .mobile-reservations-list) {
  background: var(--mat-cover-map) !important;
  border-color: var(--mat-cover-border) !important;
}

#section-mobile.covermanager-dark-mode :is(
  .mobile-section-title strong,
  .mobile-setting-row strong,
  .mobile-res-name,
  .mobile-res-time,
  .mobile-card-title
) {
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode :is(
  .mobile-section-title span,
  .mobile-setting-row span,
  .mobile-res-meta,
  .mobile-customer-item span,
  .mobile-table-detail-box span
) {
  color: var(--mat-cover-muted) !important;
  -webkit-text-fill-color: var(--mat-cover-muted) !important;
  opacity: 1 !important;
}

#section-mobile.covermanager-dark-mode :is(input, select, textarea, .mobile-search) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
  caret-color: var(--mat-cover-yellow) !important;
}

#section-mobile.covermanager-dark-mode :is(
  .mobile-tool-btn.is-active,
  .mobile-area-tab.is-active,
  .mobile-shift-tab.is-active,
  .mobile-nav-btn.is-active,
  .mobile-action-btn:not(.light):not(.secondary),
  .mobile-map-tool
) {
  background: var(--mat-cover-yellow) !important;
  border-color: var(--mat-cover-yellow) !important;
  color: #202a31 !important;
  -webkit-text-fill-color: #202a31 !important;
}

#section-mobile.covermanager-dark-mode :is(.mobile-tool-btn, .mobile-area-tab, .mobile-square-btn) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode .mobile-res-item {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode .mobile-res-item.is-pending { border-left: 7px solid var(--mat-cover-yellow) !important; }
#section-mobile.covermanager-dark-mode .mobile-res-item.is-pending,
#section-mobile.covermanager-dark-mode .mobile-res-item.is-reserved { border-left: 7px solid var(--mat-reserved) !important; }
#section-mobile.covermanager-dark-mode .mobile-res-item.is-seated { border-left: 7px solid var(--mat-cover-pink) !important; }
#section-mobile.covermanager-dark-mode .mobile-res-item.is-completed { border-left: 7px solid var(--mat-cover-lime) !important; }
#section-mobile.covermanager-dark-mode .mobile-res-item.is-cancelled { border-left: 7px solid var(--mat-cover-danger) !important; }

#section-mobile.covermanager-dark-mode .mobile-res-item :is(span, strong, p, div) {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

#section-mobile.covermanager-dark-mode :is(.mobile-table.is-free, .mobile-table.free) {
  background: #3a464e !important;
  border-color: #62717a !important;
  color: var(--mat-cover-text) !important;
}

#section-mobile.covermanager-dark-mode :is(.mobile-table.is-reserved, .mobile-table.reserved) {
  background: var(--mat-cover-lime) !important;
  border-color: #b4dd6c !important;
  color: #1c2820 !important;
}

#section-mobile.covermanager-dark-mode :is(.mobile-table.is-seated, .mobile-table.seated) {
  background: var(--mat-cover-pink) !important;
  border-color: #f278ad !important;
  color: #23151d !important;
}

/* Paneles y modales que viven fuera de las secciones principales. */
body.matilde-cover-dark-mode :is(
  .tablet-extra-panel,
  .tablet-extra-head,
  .tablet-extra-body,
  .tablet-extra-row,
  .tablet-extra-setting-row,
  .tablet-extra-detail,
  .tablet-extra-detail-box,
  .tablet-extra-notice,
  #modal-config-matilde > div,
  #modal-gestion-salas > div
) {
  background: var(--mat-cover-panel) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode :is(.tablet-extra-title span, .tablet-extra-row span, .tablet-extra-setting-row span, .tablet-extra-detail-box span) {
  color: var(--mat-cover-muted) !important;
  -webkit-text-fill-color: var(--mat-cover-muted) !important;
}

body.matilde-cover-dark-mode :is(.tablet-extra-close, .tablet-extra-action, .tablet-extra-detail-tab.is-active) {
  background: var(--mat-cover-yellow) !important;
  border-color: var(--mat-cover-yellow) !important;
  color: #202a31 !important;
  -webkit-text-fill-color: #202a31 !important;
}

/* v95: menús desplegables y paneles flotantes con la misma paleta oscura. */
body.matilde-cover-dark-mode :is(
  .matilde-table-action-sheet,
  .matilde-table-action-title,
  .mobile-table-detail-card,
  .mobile-table-detail-box,
  .mobile-table-detail-card .mobile-card
) {
  background: var(--mat-cover-panel) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode :is(
  .matilde-table-action-sheet button[data-table-action],
  .mobile-table-detail-card button,
  .mobile-table-detail-card .mobile-pill
) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode :is(
  #drawer-reserva-local,
  #drawer-reserva-local > div,
  #drawer-reserva-local .wizard-head,
  #drawer-reserva-local .wizard-body,
  #drawer-reserva-local .wizard-footer,
  #drawer-reserva-local .wizard-suggestions,
  #local-res-map-container,
  #local-res-map-info,
  #local-res-map-summary,
  #matilde-wizard-table-bar
) {
  background: var(--mat-cover-panel) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode #drawer-reserva-local :is(h1, h2, h3, h4, label, strong, p, span) {
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode #drawer-reserva-local :is(input, select, textarea, .wizard-input, .wizard-select, .wizard-textarea, .wizard-number, .wizard-pill, .wizard-hour, .wizard-waiter, .wizard-suggestion, #sug-local-list) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode #drawer-reserva-local :is(input, textarea)::placeholder {
  color: var(--mat-cover-muted) !important;
  -webkit-text-fill-color: var(--mat-cover-muted) !important;
  opacity: 1 !important;
}

body.matilde-cover-dark-mode #drawer-reserva-local :is(.wizard-btn-main, #local-res-confirm-btn, button[onclick*="confirmarReservaLocal"]) {
  background: var(--mat-cover-yellow) !important;
  border-color: var(--mat-cover-yellow) !important;
  color: #202a31 !important;
  -webkit-text-fill-color: #202a31 !important;
}

body.matilde-cover-dark-mode #drawer-reserva-local button[onclick*="cerrarDrawerReservaLocal"] {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode #matilde-v38-filter-drawer .matilde-v38-filter-panel {
  background: var(--mat-cover-panel) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode #matilde-v38-filter-drawer :is(.matilde-v38-filter-scroll, .matilde-v38-section, .matilde-v38-check-row, .matilde-v38-check-row span, .matilde-v38-title, .matilde-v38-section-title) {
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
  border-color: var(--mat-cover-border) !important;
}

body.matilde-cover-dark-mode #matilde-v38-filter-drawer :is(.matilde-v38-select, input, select) {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

body.matilde-cover-dark-mode #matilde-v38-filter-drawer .matilde-v38-footer {
  background: var(--mat-cover-top) !important;
  border-color: var(--mat-cover-border) !important;
}

body.matilde-cover-dark-mode #section-tablet .matilde-now-control,
body.matilde-cover-dark-mode #section-tablet #tablet-btn-ahora.tablet-now-btn {
  background: var(--mat-cover-panel-2) !important;
  border-color: var(--mat-cover-border) !important;
  color: var(--mat-cover-text) !important;
  -webkit-text-fill-color: var(--mat-cover-text) !important;
}

/* SALOVIX_COLORES_ESTABLES_R1_MOBILE_RESERVATIONS
 * En oscuro la lista de reservas usa exclusivamente la paleta oscura.
 * Evita que las reglas de estado claras compitan con cover-dark. */
#section-mobile.covermanager-dark-mode .mobile-res-item.is-pending {
  background:var(--mat-cover-pending,#7C5C21) !important;
  background-color:var(--mat-cover-pending,#7C5C21) !important;
  border-color:var(--mat-cover-pending,#7C5C21) !important;
}
#section-mobile.covermanager-dark-mode .mobile-res-item.is-reserved {
  background:var(--mat-cover-lime,#4F6B2F) !important;
  background-color:var(--mat-cover-lime,#4F6B2F) !important;
  border-color:var(--mat-cover-lime,#4F6B2F) !important;
}
#section-mobile.covermanager-dark-mode .mobile-res-item.is-seated {
  background:var(--mat-cover-pink,#7A3F62) !important;
  background-color:var(--mat-cover-pink,#7A3F62) !important;
  border-color:var(--mat-cover-pink,#7A3F62) !important;
}
#section-mobile.covermanager-dark-mode .mobile-res-item.is-completed {
  background:var(--mat-cover-blue,#315E78) !important;
  background-color:var(--mat-cover-blue,#315E78) !important;
  border-color:var(--mat-cover-blue,#315E78) !important;
}
#section-mobile.covermanager-dark-mode .mobile-res-item.is-cancelled {
  background:var(--mat-cover-danger,#7A3030) !important;
  background-color:var(--mat-cover-danger,#7A3030) !important;
  border-color:var(--mat-cover-danger,#7A3030) !important;
}
#section-mobile.covermanager-dark-mode .mobile-res-item,
#section-mobile.covermanager-dark-mode .mobile-res-item :is(.mobile-res-time,.mobile-res-name,.mobile-res-state,.mobile-res-meta,span,strong,p,div) {
  color:var(--mat-cover-text,#F8FAFC) !important;
  -webkit-text-fill-color:var(--mat-cover-text,#F8FAFC) !important;
}

/* SALOVIX_APARIENCIA_BOTONES_ACCION_R1 - MODO OSCURO
 * Se carga después de las reglas legacy de Tablet y por eso es la autoridad final
 * únicamente para Sentar / Mover-Reubicar / Cancelar reserva.
 */
body.matilde-cover-dark-mode button[onclick*="sentarCliente("],
#section-tablet.covermanager-dark-mode button[onclick*="sentarCliente("],
#section-mobile.covermanager-dark-mode button[onclick*="sentarCliente("],
body.matilde-cover-dark-mode [data-v43-seat]{
  background:var(--mat-cover-action-seat,#9ACA4F)!important;
  background-color:var(--mat-cover-action-seat,#9ACA4F)!important;
  border-color:var(--mat-cover-action-seat,#9ACA4F)!important;
  color:var(--mat-cover-action-seat-text,#111827)!important;
  -webkit-text-fill-color:var(--mat-cover-action-seat-text,#111827)!important;
  background-image:none!important;
}
body.matilde-cover-dark-mode button[onclick*="iniciarReubicacionMesa("],
body.matilde-cover-dark-mode #btn-detalle-reubicar,
body.matilde-cover-dark-mode [data-v43-move],
body.matilde-cover-dark-mode [data-v385-move],
#section-tablet.covermanager-dark-mode button[onclick*="iniciarReubicacionMesa("],
#section-mobile.covermanager-dark-mode button[onclick*="iniciarReubicacionMesa("]{
  background:var(--mat-cover-action-move,#F5C842)!important;
  background-color:var(--mat-cover-action-move,#F5C842)!important;
  border-color:var(--mat-cover-action-move,#F5C842)!important;
  color:var(--mat-cover-action-move-text,#111827)!important;
  -webkit-text-fill-color:var(--mat-cover-action-move-text,#111827)!important;
  background-image:none!important;
}
body.matilde-cover-dark-mode button[onclick*="cancelarReserva("],
body.matilde-cover-dark-mode [data-v43-cancel],
body.matilde-cover-dark-mode [data-v385-cancel],
body.matilde-cover-dark-mode [data-v62-cancel],
body.matilde-cover-dark-mode [data-v168-cancel],
body.matilde-cover-dark-mode [data-v142-cancel],
#section-tablet.covermanager-dark-mode button[onclick*="cancelarReserva("],
#section-mobile.covermanager-dark-mode button[onclick*="cancelarReserva("]{
  background:var(--mat-cover-action-cancel,#EF6464)!important;
  background-color:var(--mat-cover-action-cancel,#EF6464)!important;
  border-color:var(--mat-cover-action-cancel,#EF6464)!important;
  color:var(--mat-cover-action-cancel-text,#FFFFFF)!important;
  -webkit-text-fill-color:var(--mat-cover-action-cancel-text,#FFFFFF)!important;
  background-image:none!important;
}

