/* Tema oscuro suave: superficies azul pizarra, sin alterar los colores de turnos. */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#1b2635;
  --card:#263548;
  --card2:#2c3b50;
  --topbar:#243246;
  --text:#edf3fb;
  --ink:#edf3fb;
  --muted:#b2c1d2;
  --border:#43556d;
  --line:#43556d;
  --shadow:0 12px 30px rgba(7,15,29,.18);
  --mh-ink:#edf3fb;
  --mh-ink-soft:#b2c1d2;
  --mh-line:#43556d;
  --mh-paper:#263548;
  --mh-canvas:#1b2635;
  --mh-blue:#6ba4ff;
  --mh-blue-dark:#a9c8ff;
  --mh-blue-pale:#344963;
  --mh-shadow:0 12px 30px rgba(7,15,29,.18);
}
html[data-theme="dark"] body.mh-design-page{
  color:var(--text)!important;
  background:radial-gradient(75rem 30rem at 95% -14%,#2c405e 0%,transparent 59%),var(--bg)!important;
}
html[data-theme="dark"] .mh-design-page :is(.muted,.small){color:var(--muted)}
html[data-theme="dark"] .mh-design-page .topbar{background:rgba(35,49,68,.97);border-bottom-color:#3b4f68;box-shadow:0 5px 22px rgba(6,13,25,.12)}
html[data-theme="dark"] .mh-design-page .mh-company-logo{filter:brightness(0) invert(1);opacity:.94}
html[data-theme="dark"] .mh-design-page .mh-brand-label{border-left-color:#52637a;color:#c4d7f2}
html[data-theme="dark"] .mh-design-page .nav{background:#2b3b50;border-color:#42556d}
html[data-theme="dark"] .mh-design-page .nav>a,
html[data-theme="dark"] .mh-design-page .nav-dropbtn{color:#c2d0e0}
html[data-theme="dark"] .mh-design-page .nav>a:hover,
html[data-theme="dark"] .mh-design-page .nav-dropbtn:hover,
html[data-theme="dark"] .mh-design-page .nav-dropdown:focus-within .nav-dropbtn,
html[data-theme="dark"] .mh-design-page .nav .active{background:#3a506e;color:#fff}
html[data-theme="dark"] .mh-page-index .nav>a[href="index.html"],
html[data-theme="dark"] .mh-page-horarios .nav>a[href="horarios.html"],
html[data-theme="dark"] .mh-page-app .nav>a[href="app.html"],
html[data-theme="dark"] .mh-page-profile .nav-dropdown .nav-dropbtn,
html[data-theme="dark"] .mh-page-turnos .nav-dropdown .nav-dropbtn,
html[data-theme="dark"] .mh-page-personal .nav-dropdown .nav-dropbtn,
html[data-theme="dark"] .mh-page-cargos .nav-dropdown .nav-dropbtn,
html[data-theme="dark"] .mh-page-usuarios .nav-dropdown .nav-dropbtn,
html[data-theme="dark"] .mh-page-ver_turnos .nav-dropdown .nav-dropbtn{background:#3b5474;color:#fff;box-shadow:0 2px 8px rgba(5,15,29,.18)}
html[data-theme="dark"] .mh-design-page .nav-dropdown-menu,
html[data-theme="dark"] .mh-design-page .user-dropdown,
html[data-theme="dark"] .mh-design-page .mh-notif-dropdown{background:#2a394e;border-color:#485c75;box-shadow:0 20px 45px rgba(5,12,24,.28)}
html[data-theme="dark"] .mh-design-page .nav-dropdown-menu::before{color:#98adc6}
html[data-theme="dark"] .mh-design-page .nav-dropdown-menu a,
html[data-theme="dark"] .mh-design-page .user-dropdown .link{color:#e7eef8}
html[data-theme="dark"] .mh-design-page .nav-dropdown-menu a:hover,
html[data-theme="dark"] .mh-design-page .user-dropdown .link:hover{background:#3a506e;color:#fff}
html[data-theme="dark"] .mh-design-page .user-dropdown .meta{background:#34465e}
html[data-theme="dark"] .mh-design-page .version-badge{color:#9db0c7}
html[data-theme="dark"] .mh-design-page .navbtn{background:#2c3d53;border-color:#4a5d75;color:#e4edfa}
html[data-theme="dark"] .mh-design-page .navbtn:hover,
html[data-theme="dark"] .mh-design-page .mh-theme-toggle[aria-pressed="true"]{background:#385577;border-color:#6487b7;color:#fff}
html[data-theme="dark"] .mh-design-page .avatar{background:#3c5475}
html[data-theme="dark"] .mh-design-page .avatar::before,
html[data-theme="dark"] .mh-design-page .avatar::after{background:#dceaff}
html[data-theme="dark"] .mh-design-page .mh-notif-item{background:#304158;border-color:#4a5d75;color:#edf3fb}
html[data-theme="dark"] .mh-design-page .mh-notif-item:hover{background:#3a506b}
html[data-theme="dark"] .mh-design-page .mh-notif-meta,
html[data-theme="dark"] .mh-design-page .mh-notif-meta2,
html[data-theme="dark"] .mh-design-page .mh-notif-empty{color:#afbed1}
html[data-theme="dark"] .mh-design-page .mh-notif-mini{background:#34475f;border-color:#50647e;color:#eaf1fa}
html[data-theme="dark"] .mh-design-page .mh-drawer .mh-drawer-panel{background:#202d3d;color:#edf3fb}
html[data-theme="dark"] .mh-design-page .mh-drawer-head{background:linear-gradient(135deg,#263d65,#345781)}
html[data-theme="dark"] .mh-design-page .mh-drawer-link{color:#cbd9e9}
html[data-theme="dark"] .mh-design-page .mh-drawer-link:hover,
html[data-theme="dark"] .mh-design-page .mh-drawer-link.active{background:#344b68;color:#fff}
html[data-theme="dark"] .mh-design-page .mh-drawer-sub{border-color:#42546a}

/* Tarjetas, formularios y tablas de la aplicación. */
html[data-theme="dark"] body.mh-design-page:not(.mh-page-app) .card,
html[data-theme="dark"] .mh-design-page :is(.mh-surface,.turnos-panel,.mh-user-card,.vt-export-card){background:#263548;border-color:#42546d;box-shadow:var(--mh-shadow);color:#edf3fb}
html[data-theme="dark"] .mh-design-page :is(.btn,.btn-secondary,.infochip,.statebtn,.favorite-restore-btn){background:#31435a;border-color:#50637b;color:#e7f0fc;box-shadow:none}
html[data-theme="dark"] .mh-design-page :is(.btn,.btn-secondary,.infochip,.statebtn,.favorite-restore-btn):hover{background:#3b5370;border-color:#7899c1}
html[data-theme="dark"] .mh-design-page .btn-primary{background:linear-gradient(135deg,#3774dc,#285dbc);border-color:#4e86e7;color:#fff;box-shadow:0 8px 18px rgba(8,32,81,.2)}
html[data-theme="dark"] .mh-design-page :is(input,select:not(.mobile-day-select),textarea,.input,.inp){background:#202e40!important;border-color:#4a5e76!important;color:#eef4fc!important}
html[data-theme="dark"] .mh-design-page :is(input,textarea)::placeholder{color:#9aabc0!important}
html[data-theme="dark"] .mh-design-page select option{background:#263548;color:#edf3fb}
html[data-theme="dark"] .mh-design-page .table{background:#263548;border-color:#43556d;color:#e8f1fc}
html[data-theme="dark"] .mh-design-page .table th{background:#33465e;color:#c3d2e4;border-color:#4c5f77}
html[data-theme="dark"] .mh-design-page .table td{border-color:#405269;color:#e9f1fa}
html[data-theme="dark"] .mh-design-page .table tbody tr:hover{background:#2d4057}
html[data-theme="dark"] .mh-design-page .hr{background:#45576d}
html[data-theme="dark"] .mh-design-page :is(.pill,.codepill,.result-count,.favorite-count){background:#344a65;border-color:#526983;color:#d6e6fb}

/* Inicio y acceso. */
html[data-theme="dark"] .mh-page-index .hero-main{background:linear-gradient(128deg,#193a73,#2755a2 58%,#3265aa)!important;box-shadow:0 18px 38px rgba(4,18,44,.28)!important}
html[data-theme="dark"] .mh-page-index .hero-side{background:#263548}
html[data-theme="dark"] .mh-page-index .hero-side .kpi{background:transparent}
html[data-theme="dark"] .mh-page-index .hero-side .value,
html[data-theme="dark"] .mh-page-index .tile h3{color:#f1f6fd}
html[data-theme="dark"] .mh-page-index .hero-side .label{color:#aacbff}
html[data-theme="dark"] .mh-page-index .hero-side .p,
html[data-theme="dark"] .mh-page-index .tile p{color:#b4c3d6}
html[data-theme="dark"] .mh-page-index .hero-main .btn-primary{background:#f0f5ff;color:#173f80;border-color:#f0f5ff}
html[data-theme="dark"] .mh-page-index .hero-main .btn-secondary{background:#3e63a3;color:#fff;border-color:#7ba4e8}
html[data-theme="dark"] .mh-page-index .rules-note{background:#344964;border-color:#526d91;color:#d4e3f5}
html[data-theme="dark"] .mh-page-index .mh-tile-icon{background:#344e71;border-color:#4c6c97;color:#b8d5ff}
html[data-theme="dark"] .mh-page-index #tilePersonal .mh-tile-icon{background:#275446;border-color:#397861;color:#a7efd0}
html[data-theme="dark"] .mh-page-index #tileTurnos .mh-tile-icon{background:#5a432b;border-color:#8b6540;color:#ffd4a3}
html[data-theme="dark"] .mh-design-page main.page :is(h1,h2,h3){color:#f0f5fd}

/* Páginas de consulta, personal, áreas y usuarios. */
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-page-heading h1,
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-section-heading h2,
html[data-theme="dark"] .mh-design-page .turnos-heading h1{color:#f0f5fd}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-filter-panel,
html[data-theme="dark"] .mh-design-page .vt-export-filters{background:#223144;border-color:#40536b}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-field label,
html[data-theme="dark"] .mh-design-page .mh-admin-modal .mh-modal-field label,
html[data-theme="dark"] .mh-design-page .vt-export-field label{color:#bfcee0}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-status,
html[data-theme="dark"] .mh-design-page .mh-user-email,
html[data-theme="dark"] .mh-design-page .mh-user-detail-label{color:#adbed2}
html[data-theme="dark"] .mh-design-page .mh-users-page .mh-user-card-head,
html[data-theme="dark"] .mh-design-page .mh-users-page .mh-user-card-detail{border-color:#43556d}
html[data-theme="dark"] .mh-design-page .mh-users-page .mh-user-identity h3{color:#f0f5fd}
html[data-theme="dark"] .mh-design-page .mh-user-area{background:#344d6d;border-color:#5677a2;color:#d9eaff}
html[data-theme="dark"] .mh-design-page .mh-user-empty{background:#223144;border-color:#50637c;color:#c7d6e7}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-table-wrap{border-color:#43556d}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-data-table th{background:#34475f;color:#d0dced}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-data-table tbody tr:hover{background:#2f4259}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-state-pill.is-active{background:#244d3e;color:#b6efd0}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-state-pill.is-inactive{background:#3c4857;color:#d2deea}
html[data-theme="dark"] .mh-design-page .mh-workspace .mh-empty-notice{background:#563537;border-color:#986463;color:#ffe3e0}
html[data-theme="dark"] .mh-design-page .mh-admin-modal .modal{background:#263548;border-color:#51637a;color:#edf3fb}
html[data-theme="dark"] .mh-design-page .mh-admin-modal .mh-data-table tbody tr{background:#2d3d52;border-color:#4c6078}
html[data-theme="dark"] .mh-design-page .mh-admin-modal .mh-data-table td{border-color:#45576c}
html[data-theme="dark"] .mh-page-usuarios .danger-zone{background:#49343d;border-color:#8b5e69}
html[data-theme="dark"] .mh-page-usuarios .danger-zone .t{color:#ffb9bf}
html[data-theme="dark"] .mh-page-usuarios .btn-danger{background:#ad3542;border-color:#cc5763;color:#fff}
html[data-theme="dark"] .mh-page-usuarios .btn-danger:hover{background:#bd4050}

/* El calendario mantiene cada color de turno, atenuado para el entorno oscuro. */
html[data-theme="dark"] .mh-schedule-page .mh-month-calendar th{color:#bfd0e3}
html[data-theme="dark"] .mh-schedule-page .mh-calendar-cell{background:linear-gradient(rgba(19,30,43,.48),rgba(19,30,43,.48)),var(--mh-shift-color,#44546b);border-color:#50637b;box-shadow:none}
html[data-theme="dark"] .mh-schedule-page .mh-calendar-date{color:#fff}
html[data-theme="dark"] .mh-schedule-page .mh-calendar-shift{background:rgba(24,37,52,.73);border-color:#62758c;color:#f0f6fd}
html[data-theme="dark"] .mh-schedule-page .mh-calendar-cell.is-outside{background:#303d4d}
html[data-theme="dark"] .mh-schedule-page .mh-day-row{background:linear-gradient(rgba(19,30,43,.51),rgba(19,30,43,.51)),var(--mh-shift-color,#44546b)!important;border-color:#54677f;border-left-color:var(--mh-shift-color,#8496ad);color:#fff}
html[data-theme="dark"] .mh-schedule-page .mh-day-row.is-outside{background:linear-gradient(rgba(27,39,54,.8),rgba(27,39,54,.8)),var(--mh-shift-color,#44546b)!important;border-color:#45586f;border-left-color:var(--mh-shift-color,#8496ad)}
html[data-theme="dark"] .mh-schedule-page .mh-day-month{color:#d4e0ee}
html[data-theme="dark"] .mh-design-page .mh-schedule-result .mh-mobile-weeks .card-header{background:#30435a;border-color:#465970}

/* Turnos, favoritos y exportación. */
html[data-theme="dark"] .mh-page-turnos .tabs{background:#223144;border-color:#43566d}
html[data-theme="dark"] .mh-page-turnos .tabbtn{color:#b8c8db}
html[data-theme="dark"] .mh-page-turnos .tabbtn:hover,
html[data-theme="dark"] .mh-page-turnos .tabbtn.is-active{background:#39516f;color:#fff;border-color:#56718f}
html[data-theme="dark"] .mh-page-turnos :is(.item,.colorpop,.favorite-history-dialog,.toast){background:#2b3b50;border-color:#4b5f78;color:#edf3fb}
html[data-theme="dark"] .mh-page-turnos .item:hover{background:#344a63}
html[data-theme="dark"] .mh-page-turnos .sub,
html[data-theme="dark"] .mh-page-turnos .favorite-version small{color:#b0c1d5}
html[data-theme="dark"] .mh-page-turnos .favorite-history-head{background:#34475f;border-color:#4d6078}
html[data-theme="dark"] .mh-page-turnos .favorite-version{border-color:#4f637d}
html[data-theme="dark"] .mh-page-turnos .favorite-code{background:#36557d;color:#e3efff}
html[data-theme="dark"] .mh-page-turnos .starbtn{background:#34475e;border-color:#526981;color:#ffcb65}
html[data-theme="dark"] .mh-page-turnos .starbtn:hover{background:#4e4837}
html[data-theme="dark"] .mh-page-turnos .statebtn.on{background:#285342;color:#c2f1d6;border-color:#458665}
html[data-theme="dark"] .mh-page-turnos .statebtn.off{background:#3b4858;color:#cfdae8;border-color:#607085}
html[data-theme="dark"] .mh-page-ver_turnos .vt-export-icon{background:#354e71;border-color:#526d92;color:#c1dbff}
html[data-theme="dark"] .mh-page-ver_turnos .vt-export-heading h2{color:#f0f5fd}

/* Editor: paneles pizarra y casillas con sus colores originales. */
html[data-theme="dark"] .mh-page-app .appbar{background:#263548!important;border-color:#465a72;box-shadow:0 12px 30px rgba(6,13,25,.2)}
html[data-theme="dark"] .mh-page-app .app-brand h1,
html[data-theme="dark"] .mh-page-app .month-title{color:#f0f5fd}
html[data-theme="dark"] .mh-page-app .app-brand p,
html[data-theme="dark"] .mh-page-app .controls.controls-v2 .toolbar-center .field label{color:#b6c6d9}
html[data-theme="dark"] .mh-page-app .controls.controls-v2 .toolbar-center .field{background:#31445d;border-color:#4d617a}
html[data-theme="dark"] .mh-page-app #btnLoadCloud{background:#355780;border-color:#597eaf;color:#eff6ff}
html[data-theme="dark"] .mh-page-app #mainLayout>.panel .card,
html[data-theme="dark"] .mh-page-app #mainLayout>.right .card{border-color:#485b73;box-shadow:0 8px 22px rgba(7,14,27,.16)}
html[data-theme="dark"] .mh-page-app .week{border-color:#4b5f78}
html[data-theme="dark"] .mh-page-app .week-head{background:linear-gradient(105deg,#2c5688,#366caa)}
html[data-theme="dark"] .mh-page-app .sched th.lefthead,
html[data-theme="dark"] .mh-page-app .sched thead th.sub{background:#354962!important;color:#eaf2fb!important}
html[data-theme="dark"] .mh-page-app .sched td.role,
html[data-theme="dark"] .mh-page-app .sched td.name{background:#304056!important;color:#edf4fc!important}
html[data-theme="dark"] .mh-page-app .sched td.shiftcell[style*="#eef2f7"]{background:#3b4b60!important;color:#eaf2fb}
html[data-theme="dark"] .mh-page-app .sched td.shiftcell .cellselect{background:transparent!important;background-color:transparent!important;border-color:transparent!important;color:inherit!important}
html[data-theme="dark"] .mh-page-app .week-right-summary{background:#2b3b50;border-color:#495d76}
html[data-theme="dark"] .mh-page-app .edge-toggle{background:#344c69;color:#ecf4ff;border-color:#566f8d}
html[data-theme="dark"] .mh-page-app :is(.mobile-day-head,.mobile-day-tabs,.mobile-day-summary){background:#30435a;border-color:#4a5e76}
html[data-theme="dark"] .mh-page-app :is(.mobile-day-tab,.mobile-day-pill){background:#32465e;border-color:#526a85;color:#e8f1fc}
html[data-theme="dark"] .mh-page-app .mobile-day-tab.is-active{background:#376fce;border-color:#5b96f7;color:#fff}
html[data-theme="dark"] .mh-page-app .mobile-worker-name{color:#eef4fc}
html[data-theme="dark"] .mh-page-app .mobile-day-row{border-color:#455970}
html[data-theme="dark"] .mh-page-app .mobile-day-notice{background:#503a3d;border-color:#8a6265;color:#ffd1ce}
html[data-theme="dark"] .mh-page-app .mobile-day-select{background:var(--mh-mobile-shift-bg)!important;color:#0b1728!important;border-color:#596d84!important}
html[data-theme="dark"] .mh-page-app .mobile-day-select:is(.shift-V,.shift-F,.shift-I,.shift-LIC){color:#fff!important}
html[data-theme="dark"] .mh-page-app .mobile-day-select[style*="#eef2f7"]{background:#3b4b60!important;color:#eaf2fb!important}
html[data-theme="dark"] .mh-page-app .print-mode-box{background:#263548;border-color:#536780;color:#eaf2fb}
html[data-theme="dark"] .mh-page-app .print-mode-head{background:linear-gradient(135deg,#304c72,#38475c);border-color:#4f627b}
html[data-theme="dark"] .mh-page-app .print-mode-title{color:#f0f5fc}
html[data-theme="dark"] .mh-page-app :is(.print-mode-sub,.print-week-choice span){color:#bbcadc}
html[data-theme="dark"] .mh-page-app :is(.print-mode-close,.print-mode-option,.print-week-choice){background:#33475f;border-color:#51667f;color:#edf4fd}
html[data-theme="dark"] .mh-page-app .print-mode-option.is-primary{background:linear-gradient(135deg,#3774dc,#285dbc);border-color:#5c93ef;color:#fff}

@media(max-width:720px){
  html[data-theme="dark"] .mh-design-page .mh-brand-label{color:#b7cae4}
  html[data-theme="dark"] .mh-design-page .mh-workspace .mh-data-table tbody tr{background:#2b3b50;border-color:#4a5e76}
  html[data-theme="dark"] .mh-design-page .mh-workspace .mh-data-table td{border-color:#46586e}
  html[data-theme="dark"] .mh-design-page .mh-workspace .mh-data-table td::before{color:#bbcbde}
}
@media print{
  html[data-theme="dark"] body.mh-design-page{background:#fff!important;color:#111827!important}
}
