/* XMARTS · PUENTE DE PALETA OFICIAL / LAB
   SOURCE OF TRUTH: /oficina-virtual-colores.css (archivo del usuario intacto).
   Solo presentación. Mantener mapas, píxeles, sprites, avatar, mensajes,
   LiveKit, estado real de red, multimedia, Odoo y permisos sin cambios.
   Se aplica DESPUÉS de todos los CSS legados, incluida Administración V67. */

/* El tema real de la aplicación usa data-theme; la hoja oficial usa .light.
   Enlazamos ambos SIN modificar el controlador de temas. */
html[data-theme="light"]{
 /* Optional component roles; dark declarations keep their original fallback. */
 --vo-light-primary:var(--fg);--vo-light-secondary:var(--muted);
 --vo-light-surface:var(--glass-solid);--vo-light-card:var(--ground);
 --vo-light-hover:color-mix(in srgb,var(--fg) 8%,var(--glass-solid));--vo-light-selection:var(--accent-soft);
 --vo-light-border:var(--line);--vo-light-outline:color-mix(in srgb,var(--accent) 80%,var(--fg));
 --vo-light-error:color-mix(in srgb,var(--danger) 50%,var(--fg));
 --vo-light-success:color-mix(in srgb,var(--st-free) 40%,var(--fg));
 --vo-light-warning:color-mix(in srgb,var(--st-busy) 35%,var(--fg));
 --vo-light-error-bg:var(--danger-soft);--vo-light-success-bg:var(--accent-soft);--vo-light-warning-bg:color-mix(in srgb,var(--st-busy) 16%,var(--glass-solid));
 --vo-light-toggle:var(--accent);
 --vo-light-media-hover:var(--tooltip);
 --vo-light-disabled-opacity:.8;--vo-light-copy-opacity:1;--vo-light-color-scheme:light;
 --ground:#E7EBE6;--glass:rgba(250,251,249,.90);--glass-solid:#FBFCFA;
 --raise:rgba(20,35,20,.05);--raise-2:rgba(20,35,20,.10);--line:rgba(20,35,20,.11);
 --fg:#17201A;--muted:#56605A;--faint:#838B85;
 --accent:#5F9A45;--accent-soft:rgba(110,170,80,.16);
}
html,html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"]{color-scheme:light}
html body.xm-mkt-ui,html body.admin-open{
 --mk2-main:var(--glass-solid);--mk2-panel:var(--glass);
 --mk2-panel2:var(--raise);--mk2-input:var(--raise);
 --mk2-border:var(--line);--mk2-softborder:var(--line);
 --mk2-hover:var(--raise-2);--mk2-text:var(--fg);
 --mk2-muted:var(--muted);--mk2-accent:var(--accent);
 --mk2-accent-text:var(--accent-ink);
 --xm-accent:var(--accent);
}
html body.xm-mkt-ui :is(button,input,select,textarea),
html body.admin-open #adminPanel,
html body.admin-open #adminPanel :is(button,input,select,textarea),
html body .xm-mkt-modal,
html body .wa16-overlay,
html body .odoo-v47-panel{
 font-family:var(--font)!important;
}
html body.xm-mkt-ui{
 background-color:var(--ground)!important;background-image:none!important;
 color:var(--fg);font-family:var(--font)!important;
}
html body.admin-open,
html body.login-visible.xm-mkt-login-ui #login{
 font-family:var(--font)!important;
}
/* Botones destructivos y colores de indicadores semánticos NO se neutralizan. */

/* 01 · Cabecera, navegación y menú de presencia */
html body.xm-mkt-ui .app-header :is(.brand-shell,.header-nav,.header-actions),
html body.xm-mkt-ui :is(.xm-mkt-more-menu,.presence-menu-list){
 background:var(--glass-solid)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui .app-header .header-nav>.top-nav:not(.active),
html body.xm-mkt-ui .xm-mkt-more-menu button,
html body.xm-mkt-ui .presence-menu-list :is(.presence-menu-item,.presence-sound-toggle){
 background:transparent!important;background-image:none!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}
html body.xm-mkt-ui .app-header .header-nav>.top-nav.active,
html body.xm-mkt-ui .app-header .header-nav>.top-nav[aria-current="page"]{
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;border-color:var(--accent)!important;
}
html body.xm-mkt-ui :is(.xm-mkt-more-menu button,.presence-menu-item,.presence-sound-toggle):hover,
html body.xm-mkt-ui .app-header .header-nav>.top-nav:hover:not(.active){
 background:var(--raise-2)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui .app-header :is(.header-actions,.brand-shell){
 box-shadow:0 8px 28px rgba(0,0,0,.22)!important;
}
html body.xm-mkt-ui .presence-menu-list :is(.presence-sound-setting,.presence-sound-help){
 border-color:var(--line)!important;color:var(--muted)!important;
}

/* 02 · Personas (panel y submenús, búsqueda, filtros, acciones) */
html body.xm-mkt-ui #peopleRail,
html body.xm-mkt-ui #peopleRail .xm-personas-header{
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #peopleRail :is(.xm-personas-tools input,.xm-personas-filters select,
 .xm-personas-switch-buttons,.directory-item,.directory-actions button){
 background:var(--raise)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui #peopleRail :is(.directory-item,.directory-actions button):hover{
 background:var(--raise-2)!important;
}
html body.xm-mkt-ui #peopleRail :is(.xm-personas-switch-buttons button,.directory-status-count):is(.active,[aria-pressed="true"]){
 background:var(--accent-soft)!important;color:var(--fg)!important;
 border-color:var(--accent)!important;
}
html body.xm-mkt-ui #peopleRail :is(.xm-personas-headline span,.directory-meta,.directory-details,.directory-status-count){
 color:var(--muted)!important;
}
/* Las bolitas de disponibilidad y los avisos de ausencia mantienen su tipo. */

/* 03 · Mensajes: General, Privados, Canales, buscador y nuevos chats */
html body.xm-mkt-ui #chatRail.chat-v984,
html body.xm-mkt-ui #messengerChatDock .messenger-chat-window{
 background:var(--glass-solid)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(.chat-modern-head,.chat-mode-tabs,.chat-conversation-pane,.chat-conversation-head,
 .chat-list-pane,.chat-modern-send,.chat-user-search-wrap,.chat-channel-search,.xm-general-search,.v984-picker,
 .v984-picker-list,.v984-picker-head),
html body.xm-mkt-ui #messengerChatDock :is(.messenger-chat-head,.messenger-chat-compose){
 background:var(--glass)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(.chat-mode-tabs button,.chat-recent-bubble,.v984-person-row,.v984-channel-row,
 #v984NewChat,#newChannelBtn,#chatRailMaximize,#chatRailClose,#chatRailBubbleMinimize),
html body.xm-mkt-ui #messengerChatDock .messenger-chat-head-actions button{
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 .chat-mode-tabs>button:is(.active,[aria-selected="true"]),
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open #chatModeWhatsappLab.active{
 background:var(--accent-soft)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--accent)!important;
 box-shadow:inset 0 -2px var(--accent)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(.v984-person-row,.v984-channel-row,.chat-recent-bubble):is(.active,[aria-current="true"]){
 background:var(--accent-soft)!important;background-image:none!important;
 border-color:var(--accent)!important;box-shadow:inset 3px 0 var(--accent)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(#v984NewChat,#newChannelBtn,.chat-send-btn),
html body.xm-mkt-ui #messengerChatDock .messenger-chat-compose button{
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;border-color:var(--accent)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(#chatUserSearch,#channelSearch,#xmGeneralSearch,#msg,.v984-picker input),
html body.xm-mkt-ui #messengerChatDock .messenger-chat-compose input{
 background:var(--raise)!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(#chatUserSearch,#channelSearch,#xmGeneralSearch,#msg,.v984-picker input)::placeholder,
html body.xm-mkt-ui #messengerChatDock .messenger-chat-compose input::placeholder{
 color:var(--muted)!important;
}
html body.xm-mkt-ui #messengerChatDock :is(.chat-msg-bubble,.messenger-chat-log),
html body.xm-mkt-ui #chatRail.chat-v984 :is(.chat-bubble-log,.chat-msg-bubble){
 border-color:var(--line)!important;
}
html body.xm-mkt-ui :is(#messengerBubbleStack .messenger-mini-bubble,#chatMiniBubble){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border:2px solid var(--faint)!important;
 box-shadow:0 8px 20px #0007!important;opacity:1!important;
 backdrop-filter:none!important;
}
html body.xm-mkt-ui #messengerBubbleStack .messenger-mini-bubble:is(:hover,:focus-visible){
 border-color:var(--accent)!important;
}
html body.xm-mkt-ui #messengerBubbleStack .messenger-mini-bubble::before{
 background:var(--glass-solid)!important;border-color:var(--line)!important;
 color:var(--fg)!important;
}
html body.xm-mkt-ui .channel-create-box{
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui .channel-create-box :is(.channel-create-input,.channel-create-head button,.channel-create-actions button:not(.primary)){
 background:var(--raise)!important;border-color:var(--line)!important;
 color:var(--fg)!important;
}
html body.xm-mkt-ui .channel-create-box .channel-create-actions button.primary{
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;border-color:var(--accent)!important;
}

/* 04 · WhatsApp: panel, submenús, listado, controles, nuevo mensaje
   No recolorear estados de enviado/entregado/leído ni adjuntos reales. */
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open :is(.wa-lab-panel,.wa-lab-layout,.wa-lab-sidebar,.wa-lab-content,
 .wa-lab-thread,.wa-lab-contact,.wa-lab-intro,.wa-lab-options,.wa-lab-controls,
 .wa-lab-emoji-picker,.wa-lab-sticker-picker,.wa-lab-searchbar){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open :is(.wa-lab-list>button,.wa-lab-actions button,.wa-lab-queue button,
 .wa-lab-filter-toggle,.wa-lab-options-toggle,.wa-lab-new-chat-fab,.wa-lab-iconbtn){
 background:var(--raise)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open :is(.wa-lab-list>button,.wa-lab-queue button,.wa-lab-filter-toggle):is(.active,[aria-current="true"],[aria-pressed="true"],[aria-expanded="true"]){
 background:var(--accent-soft)!important;border-color:var(--accent)!important;
 color:var(--fg)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open :is(.wa-lab-actions .wa-lab-send,.wa-lab-new-chat-fab,.wa-lab-contact .wa-lab-take){
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;border-color:var(--accent)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open :is(.wa-lab-actions input,.wa-lab-actions textarea,
 .wa-lab-searchbar input,.wa-lab-new-chat-search input){
 background:var(--raise)!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}

/* 05 · Notificaciones, barra lateral, contador y preferencias */
html body.xm-mkt-ui #notificationPanel.notification-panel,
html body.xm-mkt-ui #notificationPanel :is(.notification-head,.notification-tabs){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #notificationPanel .notification-tabs button:is(.active,[aria-selected="true"]),
html body.xm-mkt-ui #notificationPanel .notification-actions button.primary{
 background:var(--accent-soft)!important;color:var(--fg)!important;
 border-color:var(--accent)!important;box-shadow:inset 0 -2px var(--accent)!important;
}
html body.xm-mkt-ui #notificationPanel .notification-actions button.primary{
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;
}
html body.xm-mkt-ui #notificationPanel :is(.notification-item,.notification-actions button:not(.primary)){
 background:var(--raise)!important;border-color:var(--line)!important;
 color:var(--fg)!important;
}
html body.xm-mkt-ui #notificationPanel .notification-item.unread{
 background:var(--accent-soft)!important;border-left-color:var(--accent)!important;
}
/* Conteos de avisos en rojo = avisos pendientes, no son botones de paleta. */

/* 06 · Calendario, reservas, selector Odoo y reuniones */
html body.xm-mkt-ui #calendarModal :is(.calendar-box,.calendar-form,.calendar-list-panel,.calendar-participants,.reservation-list),
html body.xm-mkt-ui #calendarModal .calendar-head{
 background:var(--glass-solid)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui #calendarModal :is(.odoo-v55-tabs button,.participant-mode-switch button,.calendar-actions button,#calendarCloseTop),
html body.xm-mkt-ui #calendarModal :is(select,input[type="text"],input[type="search"],input[type="datetime-local"]){
 background:var(--raise)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui #calendarModal :is(.odoo-v55-tabs button,.participant-mode-switch button):is(.active,[aria-selected="true"]){
 background:var(--accent-soft)!important;color:var(--fg)!important;
 border-color:var(--accent)!important;
}
html body.xm-mkt-ui #calendarModal #reservationCreate{
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 border-color:var(--accent)!important;color:var(--accent-ink)!important;
}
/* "Eventos de Odoo" --odoo y "Reuniones de sala" --st-call conservados. */

/* 07 · Configuración: audio, vídeo, fondos, efectos y preferencias */
html body.xm-mkt-ui .xm-mkt-modal :is(.xm-mkt-dialog,.audio-pro-settings,.xm-mkt-general-extra,
 .xm-mkt-settings-area,.media-device-grid>div,.camera-background-settings,.camera-background-presets){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui .xm-mkt-modal :is(.xm-mkt-settings-nav button,.device-actions button,
 .camera-background-actions button,.camera-background-upload-label,[data-theme-pref]){
 background:var(--raise)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui .xm-mkt-modal :is(.xm-mkt-settings-nav button[aria-current="page"],
 .camera-background-actions button.active,[data-theme-pref].active,
 [data-theme-pref][aria-pressed="true"]){
 background:var(--accent-soft)!important;border-color:var(--accent)!important;
 color:var(--fg)!important;
}
html body.xm-mkt-ui .xm-mkt-modal :is(select,input[type="text"],input[type="search"]){
 background:var(--raise)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui .xm-mkt-modal :is(.audio-pro-title small,.camera-background-note,.participant-audio-empty){
 color:var(--muted)!important;
}

/* 08 · Panel de administración a pantalla completa: siete secciones
   y todos sus formularios, reportes, tablas, diagnósticos y filtros */
html body.admin-open,
html body.admin-open #adminPanel.admin-v66{
 background:var(--ground)!important;background-image:none!important;color:var(--fg)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.admin-top,.admin-v66-nav,.card,
 .v66-metric,.v66-quick,.v66-note,.v66-two-col>div,.admin-security-card,
 .admin-persistence-box,.admin-report-stat,.admin-report-person,.admin-backup-row,
 .admin-table-wrap,.diag-meta-box,.diag-table-wrap,.admin-check,.sso-access-section){
 background:var(--glass-solid)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.admin-open #adminPanel.admin-v66>.admin-top{
 background:var(--ground)!important;border-bottom-color:var(--line)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.admin-v66-nav button,.admin-v66-subnav button,
 button:not(.danger):not(.warn):not(.bad):not(.primary),input:not([type="checkbox"]),select,textarea){
 background:var(--raise)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.admin-v66-nav button,.admin-v66-subnav button):is([aria-selected="true"],.active),
html body.admin-open #adminPanel.admin-v66 :is(.odoo-v55-tabs button,.wa16-tabs button)[aria-selected="true"]{
 background:var(--accent-soft)!important;border-color:var(--accent)!important;
 color:var(--fg)!important;box-shadow:inset 3px 0 var(--accent)!important;
}
html body.admin-open #adminPanel.admin-v66 button.primary:not(.danger):not(.warn):not(.bad),
html body.admin-open #adminPanel.admin-v66 :is(.v66-section-actions button.primary,.admin-backup-actions button.primary,
 .admin-migration-actions button.primary){
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 border-color:var(--accent)!important;color:var(--accent-ink)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(input,select,textarea):focus-visible{
 outline:2px solid var(--accent)!important;outline-offset:1px!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.admin-table,.admin-report-table,.diag-table,
 .diagnostics-table) th{
 background:var(--raise-2)!important;border-color:var(--line)!important;color:var(--fg)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.admin-table,.admin-report-table,.diag-table,
 .diagnostics-table) td{
 background:var(--glass-solid)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.admin-table,.admin-report-table,.diag-table,
 .diagnostics-table) tr:hover td{
 background:var(--raise-2)!important;
}
html body.admin-open #adminPanel.admin-v66 :is(.muted,.v66-metric small,.admin-v66-pane-head p,
 .v66-quick small,.admin-report-note,.admin-persistence-box small,.diag-sub,.admin-backup-row span){
 color:var(--muted)!important;
}
html body.admin-open #adminPanel.admin-v66 .admin-user-filters select.filter-active,
html body.admin-open #adminPanel.admin-v66 .admin-badge.adminperm{
 background:var(--accent-soft)!important;color:var(--fg)!important;
 border-color:var(--accent)!important;box-shadow:none!important;
}
html body.admin-open #adminPanel.admin-v66 #backOffice{
 background:var(--raise)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open #adminPanel.admin-v66 #backOffice:hover{
 background:var(--raise-2)!important;
}
html body.admin-open>.odoo-v47-panel>section{
 background:var(--glass-solid)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open>.odoo-v47-panel :is(input,select,textarea,button){
 background:var(--raise)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
/* No se alteran .good/.warn/.bad, usuarios online ni banderas de seguridad. */

/* 09 · Administración > Integraciones > WhatsApp (paleta independiente V16) */
html body.admin-open #adminPanel #waTenantV16,
html body .wa16-overlay .wa16-dialog{
 --wa16-bg:var(--ground);--wa16-panel:var(--glass-solid);--wa16-line:var(--line);
 --wa16-fg:var(--fg);--wa16-muted:var(--muted);
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open #adminPanel #waTenantV16 :is(.wa16-metric,.wa16-card,.wa16-people,.wa16-assign,
 .wa16-info,.wa16-steps,.wa16-step),
html body .wa16-overlay :is(.wa16-dialog,.wa16-method,.wa16-step,.wa16-review){
 background:var(--raise)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open #adminPanel #waTenantV16 :is(.wa16-tabs button,.wa16-secondary,.wa16-input),
html body .wa16-overlay :is(.wa16-secondary,.wa16-close,.wa16-input){
 background:var(--raise)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
html body.admin-open #adminPanel #waTenantV16 .wa16-tabs button.wa16-selected,
html body .wa16-overlay .wa16-method.selected{
 background:var(--accent-soft)!important;color:var(--fg)!important;border-color:var(--accent)!important;
}
html body.admin-open #adminPanel #waTenantV16 .wa16-primary,
html body .wa16-overlay .wa16-primary{
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;border-color:var(--accent)!important;
}

/* 10 · Espacio, paneles de mapa/constructor, menús contextuales, perfil */
html body.xm-mkt-ui #contextRail,
html body.xm-mkt-ui :is(.quick-profile-card,.profile-box,.meeting-room-box,.avatar-picker-box,
 .construction-bar,.construction-inspector,.construction-catalog,.construction-map-panel){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #contextRail :is(.near,.near-card,.room-banner,.private-room-controls),
html body.xm-mkt-ui :is(.quick-self-section,.profile-field,.construction-quick-control,.construction-menu-actions){
 background:var(--raise)!important;color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #app .map-navigation button,
html body.xm-mkt-ui :is(.construction-bar,.construction-inspector,.construction-catalog,.construction-map-panel)
 :is(button,.construction-toggle,.construction-select),
html body.xm-mkt-ui :is(.quick-profile-card,.profile-box,.meeting-room-box,.avatar-picker-box) button:not(.danger){
 background:var(--raise)!important;background-image:none!important;
 border-color:var(--line)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui :is(.construction-bar,.construction-inspector,.construction-catalog,.construction-map-panel)
 :is(button,.construction-toggle):is(.active,.selected,[aria-pressed="true"],[aria-selected="true"]),
html body.xm-mkt-ui :is(.quick-profile-card,.avatar-picker-box) button:is(.active,.selected,[aria-pressed="true"]){
 background:var(--accent-soft)!important;border-color:var(--accent)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui .desk-owner-tooltip{
 background:var(--tooltip)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
/* State selection in profile stays semantic: free/busy/call/meeting/DND. */

/* 11 · Modo pantalla completa y multimedia. No forzar colores en mute/off/on. */
html body.v67-fullscreen #stage.full :is(#fullscreenMediaControls button,
 #v67MiniBar .v67-mini-button,#v67MiniBar #fsViewMenuBtn,#v67MiniBar #maximize,#v67MiniBar #notificationBtn),
html body.xm-mkt-ui #app .fs-view-menu{
 background:var(--glass-solid)!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}
html body.v67-fullscreen #stage.full #fsViewMenu button:is(.active,[aria-selected="true"]){
 background:var(--accent-soft)!important;border-color:var(--accent)!important;color:var(--fg)!important;
}
html body.xm-mkt-ui #app .media-dock .media-toolbar :is(#xmMktGear,.media-action):hover:not(.danger){
 border-color:var(--accent)!important;
}
/* States: var(--st-free), busy, call, meet, dnd, off remain their official
   colors; Odoo var(--odoo), room calendar var(--st-call), danger var(--danger).
   Never apply general theme colors to video frames or world canvas. */

/* 12 · Light mode: every independent palette reads the same theme tokens. */
html[data-theme="light"] body.xm-mkt-ui,
html[data-theme="light"] body.admin-open{
 background-color:var(--ground)!important;color:var(--fg)!important;
}
html[data-theme="light"] body.admin-open #adminPanel.admin-v66{
 background:var(--ground)!important;color:var(--fg)!important;
}
html[data-theme="light"] body.xm-mkt-ui :is(.xm-mkt-more-menu,.presence-menu-list,#peopleRail,
 #chatRail.chat-v984,#calendarModal .calendar-box,#notificationPanel,.xm-mkt-dialog){
 background-color:var(--glass-solid)!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}
html[data-theme="light"] body.xm-mkt-ui #chatRail.chat-v984 :is(.chat-bubble-log,.chat-conversation-pane,.chat-modern-grid){
 color:var(--fg)!important;
}
html[data-theme="light"] body.xm-mkt-ui #chatRail.chat-v984 :is(.chat-mode-tabs button,.v984-person-row,.v984-channel-row){
 color:var(--fg)!important;
}

/* Estados oficiales: actualizar solo indicadores de estado reales,
   NO usar azules en botones ni quitar el azul legítimo de En comunicación. */
html body :is(.status-dot,.profile-status-dot,.directory-status-count .dot).disponible{
 background-color:var(--st-free)!important;
}
html body :is(.status-dot,.profile-status-dot,.directory-status-count .dot).ocupado{
 background-color:var(--st-busy)!important;
}
html body :is(.status-dot,.profile-status-dot,.directory-status-count .dot).reunion{
 background-color:var(--st-meet)!important;
}
html body :is(.status-dot,.profile-status-dot,.directory-status-count .dot).nodisturb{
 background-color:var(--st-dnd)!important;
}
html body :is(.status-dot,.profile-status-dot,.directory-status-count .dot).comunicacion,
html body #peopleRail .directory-status-count .dot.comunicacion{
 background-color:var(--st-call)!important;
}
html body :is(.status-dot,.profile-status-dot,.directory-status-count .dot).offline{
 background-color:var(--st-off)!important;
}
html body.xm-mkt-ui #peopleRail .directory-status-count.active:has(.dot.comunicacion){
 background:var(--accent-soft)!important;border-color:var(--accent)!important;
}
html body.xm-mkt-ui #peopleRail .directory-status-count .dot.comunicacion{
 box-shadow:0 0 0 2px rgba(79,159,242,.16)!important;
}
html body.xm-mkt-ui .odoo-v55-event{
 border-left:3px solid var(--odoo)!important;
}
html body.xm-mkt-ui :is(.odoo-v55-event,.calendar-event-odoo) .reservation-title{
 color:var(--odoo)!important;
}
/* El azul #4F9FF2 es oficial para reuniones/llamadas, NO para menús. */

/* Peligro oficial: salir, cortar llamada y micrófono apagado.
   No se toca la acción ni el estado, solo su señalización visual. */
html body.xm-mkt-ui :is(#xmMktBrandExit,.xm-mkt-end-call){
 background:var(--danger-soft)!important;background-image:none!important;
 color:var(--danger)!important;border-color:var(--danger)!important;
}
html body.xm-mkt-ui #app .media-dock #mic:is(.off,.muted,.xm-mkt-is-off){
 color:var(--danger)!important;border-color:var(--danger)!important;
}

/* 12b · Últimos controles con estilo heredado e interior de submenús. */
html body.xm-mkt-ui #chatRail.chat-v984 :is(#chatRailClose,#chatRailMaximize,#chatRailBubbleMinimize,
 #v984PickerClose,.rail-head-actions button,.v984-section-head button),
html body.xm-mkt-ui #messengerChatDock .messenger-chat-head-actions button{
 background:var(--raise)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(#chatRailClose,#chatRailMaximize,#chatRailBubbleMinimize,
 #v984PickerClose,.rail-head-actions button):hover{
 background:var(--raise-2)!important;
}
html body.xm-mkt-ui #peopleRail #directoryList :is(.directory-name>span,.directory-person){
 color:var(--fg)!important;
}
html body.xm-mkt-ui #peopleRail #directoryList .directory-status:not(.is-absent){
 color:var(--muted)!important;
}
html body.xm-mkt-ui #chatRail.chat-v984 :is(.v984-row-copy small,.chat-recent-time,.chat-msg-meta,.v984-channel-row small),
html body.xm-mkt-ui #chatRail.chat-v984.wa-lab-open :is(.wa-lab-list-preview,.wa-lab-list-time,.wa-lab-headstatus){
 color:var(--muted)!important;
}
html body.xm-mkt-ui #app .media-dock,
html body.xm-mkt-ui #app .media-dock :is(.media-toolbar,.media-settings),
html body.xm-mkt-ui #app :is(.fs-view-menu,.stage-controls){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui #app .media-dock .media-action:not(.danger):not(.off):not(.muted):not(.on):not(.active):not([aria-pressed="true"]){
 background:var(--raise)!important;border-color:var(--line)!important;color:var(--fg)!important;
}
/* Light: explicit legacy title colors cannot inherit lighter palette backgrounds. */
html[data-theme="light"] body.xm-mkt-ui #chatRail.chat-v984 :is(.chat-conversation-head b,
 .chat-title-wrap b,.v984-row-copy b,.v984-person-row b,.v984-channel-row b,
 .chat-mode-tabs button,.wa-lab-contact b,.wa-lab-list-name,.wa-lab-thread b){
 color:var(--fg)!important;
}
html[data-theme="light"] body.admin-open #adminPanel.admin-v66 :is(h2,h3,h4,
 .v66-metric b,.v66-quick b,.admin-v66-nav button,.admin-v66-pane-head h3,
 .v66-team-name b,.admin-persistence-box b,.admin-table th,.admin-report-table th){
 color:var(--fg)!important;
}
html[data-theme="light"] body.xm-mkt-ui :is(.profile-box,.meeting-room-box,.avatar-picker-box)
 :is(h2,h3,h4,label,.profile-detail,.muted){
 color:var(--fg)!important;
}

/* Menús secundarios de emojis, stickers, adjuntos y multimedia del chat. */
html body.xm-mkt-ui :is(#chatRail,#messengerChatDock)
 :is(.pc-fun-picker,.pc-fun-stickers,.pc-fun-sticker-grid,.pc-fun-emoji-grid,
 .pc-fun-picker-head,.pc-fun-sticker-head){
 background:var(--glass-solid)!important;background-image:none!important;
 color:var(--fg)!important;border-color:var(--line)!important;
}
html body.xm-mkt-ui :is(#chatRail,#messengerChatDock)
 :is(.pc-fun-picker button,.pc-fun-btn,.pc-fun-sticker-head button){
 background:var(--raise)!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}
html body.xm-mkt-ui :is(#chatRail,#messengerChatDock)
 :is(.pc-fun-picker button,.pc-fun-btn,.pc-fun-sticker-head button):hover{
 background:var(--raise-2)!important;
}
html body.xm-mkt-ui :is(#chatRail,#messengerChatDock)
 :is(.pc-fun-picker input,.pc-fun-picker select){
 background:var(--raise)!important;color:var(--fg)!important;
 border-color:var(--line)!important;
}
/* WhatsApp administración abre su diálogo fuera del panel principal. */
html body .wa16-overlay{
 background:rgba(13,15,15,.72)!important;
}

/* Ajuste localizado: restaurar el fondo original de la barra multimedia.
   El problema era el CONTORNO (borde/sombra) oscuro, no el relleno.
   NO cambiar ni los fondos individuales de los botones ni la PIP. */
html body.xm-mkt-ui #app .media-panel.media-dock{
 background:var(--glass-solid)!important;
 background-image:none!important;
 border-color:transparent!important;
 box-shadow:none!important;
}
/* Dimensiones, posición, radio, grupos de acciones y handlers originales. */

/* 13 · Login: mantener intactos el fondo aprobado y la lógica Authentik. */
html body.login-visible.xm-mkt-login-ui #login :is(#enter,.guest-enter-btn){
 background:linear-gradient(90deg,var(--accent-a),var(--accent-b))!important;
 color:var(--accent-ink)!important;
}
html body.login-visible.xm-mkt-login-ui #login :is(input,select):focus{
 border-color:var(--accent)!important;outline-color:var(--accent-soft)!important;
}


html[data-theme="light"] :where(input,textarea)::placeholder{color:var(--muted);opacity:1;}
