/* CARIPVCARD 34 · contraste global de backoffice + editor en modo oscuro */

/* =========================================================
   BASE GLOBAL DEL PANEL
   ========================================================= */
html[data-theme="dark"]{
  --bg:#090e15;
  --panel:#111823;
  --panel-2:#171f2b;
  --text:#f4f7fb;
  --muted:#a6b1c0;
  --line:#2b3544;
  --primary-soft:#282242;
  --shadow:0 18px 50px rgba(0,0,0,.28);
  color-scheme:dark;
}
html[data-theme="dark"] body.admin-body,
html[data-theme="dark"] .main-area,
html[data-theme="dark"] .content-wrap{background:var(--bg)!important;color:var(--text)!important}
html[data-theme="dark"] .topbar{border-color:var(--line)!important;background:rgba(9,14,21,.9)!important}
html[data-theme="dark"] .topbar-title strong,
html[data-theme="dark"] .page-head h1,
html[data-theme="dark"] .page-hero h1{color:var(--text)!important}
html[data-theme="dark"] .topbar-title small,
html[data-theme="dark"] .page-head p,
html[data-theme="dark"] .page-hero p{color:var(--muted)!important}

/* Contenedores administrativos comunes que en hojas antiguas quedaron fijos en blanco. */
html[data-theme="dark"] .content-wrap .panel,
html[data-theme="dark"] .content-wrap .metric-card,
html[data-theme="dark"] .content-wrap .client-summary-card,
html[data-theme="dark"] .content-wrap .account-plan-strip,
html[data-theme="dark"] .content-wrap .profile-manager-card,
html[data-theme="dark"] .content-wrap .subscription-status-hero,
html[data-theme="dark"] .content-wrap .payment-history-item,
html[data-theme="dark"] .content-wrap .media-admin-card,
html[data-theme="dark"] .content-wrap .document-admin-list>article,
html[data-theme="dark"] .content-wrap .company-readonly-card,
html[data-theme="dark"] .modal-card{
  background:#111823!important;
  border-color:#2b3544!important;
  color:#f4f7fb!important;
  box-shadow:0 16px 44px rgba(0,0,0,.2)!important;
}
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-actions{border-color:#2b3544!important}

/* Formularios generales */
html[data-theme="dark"] .content-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
html[data-theme="dark"] .content-wrap select,
html[data-theme="dark"] .content-wrap textarea,
html[data-theme="dark"] .modal-card input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
html[data-theme="dark"] .modal-card select,
html[data-theme="dark"] .modal-card textarea,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .slug-input,
html[data-theme="dark"] .money-input,
html[data-theme="dark"] .color-control{
  background:#0c121b!important;
  border-color:#344052!important;
  color:#f3f6fb!important;
  -webkit-text-fill-color:#f3f6fb!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#748197!important;-webkit-text-fill-color:#748197!important}
html[data-theme="dark"] select option{background:#111823!important;color:#f4f7fb!important}

/* =========================================================
   EDITOR DE PERFIL · APARIENCIA
   ========================================================= */
html[data-theme="dark"] .profile-editor-shell .editor-section-nav,
html[data-theme="dark"] .profile-editor-shell .editor-section{
  background:#111823!important;
  border-color:#2b3544!important;
  color:#f4f7fb!important;
}
html[data-theme="dark"] .profile-editor-shell .editor-profile-mini{border-color:#2b3544!important}
html[data-theme="dark"] .profile-editor-shell .editor-profile-mini strong,
html[data-theme="dark"] .profile-editor-shell .editor-section-head h2,
html[data-theme="dark"] .profile-editor-shell .field-title,
html[data-theme="dark"] .profile-editor-shell .editor-form label{color:#f4f7fb!important}
html[data-theme="dark"] .profile-editor-shell .editor-profile-mini span,
html[data-theme="dark"] .profile-editor-shell .editor-section-head p,
html[data-theme="dark"] .profile-editor-shell .editor-save-row>span{color:#a3afbf!important}
html[data-theme="dark"] .profile-editor-shell .section-number{color:#354052!important}
html[data-theme="dark"] .profile-editor-shell .editor-save-row{border-color:#2b3544!important}

/* Recomendaciones de carga: se conservan los tres tonos, pero correctamente oscuros. */
html[data-theme="dark"] .profile-editor-shell .upload-spec-card,
html[data-theme="dark"] .profile-editor-shell .upload-guidance{
  background:#151d29!important;
  border-color:#344052!important;
  color:#f4f7fb!important;
}
html[data-theme="dark"] .profile-editor-shell .upload-profile-tone{background:linear-gradient(135deg,#0d1c29,#112436)!important;border-color:#245278!important;border-left-color:#3595e8!important}
html[data-theme="dark"] .profile-editor-shell .upload-cover-tone{background:linear-gradient(135deg,#181329,#22183a)!important;border-color:#513c7e!important;border-left-color:#8d6cff!important}
html[data-theme="dark"] .profile-editor-shell .upload-background-tone{background:linear-gradient(135deg,#0d201d,#102923)!important;border-color:#285e53!important;border-left-color:#26b999!important}
html[data-theme="dark"] .profile-editor-shell .upload-spec-card strong{color:#f4f7fb!important}
html[data-theme="dark"] .profile-editor-shell .upload-spec-card span,
html[data-theme="dark"] .profile-editor-shell .upload-spec-card small:not(.spec-kicker){color:#aab5c4!important}
html[data-theme="dark"] .profile-editor-shell .upload-guidance>i{background:#20293a!important;border-color:#38465a!important;color:#b9adff!important}

/* Upload real: evita nuevamente tarjetas blancas en Multimedia/Brochure/Diseño. */
html[data-theme="dark"] .profile-editor-shell .modern-file .file-drop,
html[data-theme="dark"] .modal-card .modern-file .file-drop{
  background:#0f1621!important;
  border-color:#3a4659!important;
  color:#f4f7fb!important;
}
html[data-theme="dark"] .profile-editor-shell .modern-file .file-drop:hover,
html[data-theme="dark"] .modal-card .modern-file .file-drop:hover{background:#151e2d!important;border-color:#7b68f4!important}
html[data-theme="dark"] .modern-file .file-drop strong{color:#f4f7fb!important}
html[data-theme="dark"] .modern-file .file-drop small{color:#9eabbc!important}
html[data-theme="dark"] .modern-file .file-drop em{background:#1b2432!important;border-color:#364255!important;color:#d5dce6!important}
html[data-theme="dark"] .modern-file .file-icon{background:#292348!important;color:#b9adff!important}

/* Selector de forma del avatar. */
html[data-theme="dark"] .avatar-shape-options label{
  background:#151d29!important;
  border-color:#344052!important;
  color:#c9d2df!important;
}
html[data-theme="dark"] .avatar-shape-options label b{color:#dfe5ee!important}
html[data-theme="dark"] .avatar-shape-options label:hover{background:#1a2432!important;border-color:#526078!important}
html[data-theme="dark"] .avatar-shape-options label:has(input:checked){background:#211d3c!important;border-color:#8d76ff!important;box-shadow:0 0 0 3px rgba(141,118,255,.14)!important;color:#e3dcff!important}
html[data-theme="dark"] .avatar-shape-options .shape-demo{background:#2a244b!important;color:#c0b4ff!important}

/* Plantillas */
html[data-theme="dark"] .template-library,
html[data-theme="dark"] .template-library>summary,
html[data-theme="dark"] .template-library-body{
  background:#0f1621!important;
  border-color:#303b4c!important;
  color:#f4f7fb!important;
}
html[data-theme="dark"] .template-library>summary{background:linear-gradient(180deg,#141c28,#101720)!important}
html[data-theme="dark"] .template-library-body{border-top-color:#303b4c!important}
html[data-theme="dark"] .template-library summary strong,
html[data-theme="dark"] .template-choice strong{color:#f4f7fb!important}
html[data-theme="dark"] .template-library summary small,
html[data-theme="dark"] .template-choice small{color:#9ca8b8!important}
html[data-theme="dark"] .template-library-note{background:#1d2635!important;border-color:#354258!important;color:#cbd4e0!important}
html[data-theme="dark"] .template-library-note span{color:#cbd4e0!important}
html[data-theme="dark"] .template-choice{background:#151d29!important;border-color:#344052!important;color:#f4f7fb!important}
html[data-theme="dark"] .template-choice:hover,
html[data-theme="dark"] .template-choice.selected{border-color:#8d76ff!important;box-shadow:0 0 0 3px rgba(141,118,255,.14)!important}
html[data-theme="dark"] .template-guidance-switch{background:#151d29!important;border-color:#344052!important;color:#f4f7fb!important}
html[data-theme="dark"] .template-search-box input{background:#0c121b!important;border-color:#344052!important;color:#f4f7fb!important}

/* Multimedia, servicios, redes y documentos */
html[data-theme="dark"] .profile-editor-shell .editor-list-item,
html[data-theme="dark"] .profile-editor-shell .social-editor-card,
html[data-theme="dark"] .profile-editor-shell .media-admin-card,
html[data-theme="dark"] .profile-editor-shell .document-admin-list>article,
html[data-theme="dark"] .profile-editor-shell .document-spec{
  background:#151d29!important;
  border-color:#344052!important;
  color:#f4f7fb!important;
}
html[data-theme="dark"] .profile-editor-shell .editor-list-main strong,
html[data-theme="dark"] .profile-editor-shell .social-editor-card strong,
html[data-theme="dark"] .profile-editor-shell .media-admin-card strong,
html[data-theme="dark"] .profile-editor-shell .document-admin-list strong{color:#f4f7fb!important}
html[data-theme="dark"] .profile-editor-shell .editor-list-main p,
html[data-theme="dark"] .profile-editor-shell .editor-list-main small,
html[data-theme="dark"] .profile-editor-shell .social-editor-card small,
html[data-theme="dark"] .profile-editor-shell .media-admin-card small,
html[data-theme="dark"] .profile-editor-shell .document-admin-list small{color:#9ca8b8!important}
html[data-theme="dark"] .profile-editor-shell .compact-empty{background:#0f1621!important;border-color:#3a4659!important;color:#9ca8b8!important}
html[data-theme="dark"] .profile-editor-shell .document-spec>i,
html[data-theme="dark"] .profile-editor-shell .document-admin-icon{background:#351d25!important;color:#ff8294!important}

/* Orden del perfil: era uno de los bloques que permanecía blanco. */
html[data-theme="dark"] .section-sort-item{background:#151d29!important;border-color:#344052!important;color:#f4f7fb!important}
html[data-theme="dark"] .section-sort-item strong{color:#f4f7fb!important}
html[data-theme="dark"] .section-sort-item small{color:#9ca8b8!important}
html[data-theme="dark"] .section-sort-icon{background:#292348!important;color:#c0b4ff!important}
html[data-theme="dark"] .section-drag{color:#778397!important}
html[data-theme="dark"] .section-mobile-move button{background:#101720!important;border-color:#3a4659!important;color:#dce3ec!important}
html[data-theme="dark"] .section-mobile-move button:hover{background:#202b3a!important;border-color:#7765e9!important;color:#fff!important}
html[data-theme="dark"] .mini-switch{color:#dce3ec!important}
html[data-theme="dark"] .mini-switch span{color:#dce3ec!important}
html[data-theme="dark"] .mini-switch i{background:#3a4555!important}
html[data-theme="dark"] .mini-switch input:checked+i{background:#7459ff!important}

/* QR / Compartir */
html[data-theme="dark"] .qr-preview-card,
html[data-theme="dark"] .share-settings-card{background:#151d29!important;border-color:#344052!important;color:#f4f7fb!important}
html[data-theme="dark"] .qr-preview-card>strong,
html[data-theme="dark"] .share-settings-card h3,
html[data-theme="dark"] .modern-switch-row strong{color:#f4f7fb!important}
html[data-theme="dark"] .qr-preview-card>span,
html[data-theme="dark"] .share-settings-card>p,
html[data-theme="dark"] .modern-switch-row small{color:#9ca8b8!important}
/* El cuadro del QR permanece blanco intencionalmente para garantizar contraste y lectura. */
html[data-theme="dark"] .qr-box{background:#fff!important;border-color:#dfe4ec!important}
html[data-theme="dark"] .social-share-preview{background:#101720!important;border-color:#344052!important}
html[data-theme="dark"] .social-share-preview .share-preview-label{background:#0b1119!important;color:#9ca8b8!important}
html[data-theme="dark"] .social-share-preview strong{color:#f4f7fb!important}
html[data-theme="dark"] .social-share-preview>div>span,
html[data-theme="dark"] .social-share-preview small{color:#9ca8b8!important}
html[data-theme="dark"] .qr-settings-form{border-color:#344052!important}

/* Calidad del perfil y checks */
html[data-theme="dark"] .profile-completion-card{background:linear-gradient(135deg,#141c27,#0f151e)!important;border-color:#2f3a4a!important;color:#f4f7fb!important}
html[data-theme="dark"] .profile-completion-card .completion-ring:before{background:#111823!important}
html[data-theme="dark"] .profile-completion-card .completion-ring strong,
html[data-theme="dark"] .profile-completion-card .completion-copy h3{color:#f4f7fb!important}
html[data-theme="dark"] .profile-completion-card .completion-ring span,
html[data-theme="dark"] .profile-completion-card .completion-copy p{color:#a6b1c0!important}
html[data-theme="dark"] .completion-status-chip.is-done{background:#102f27!important;border-color:#265744!important;color:#9ae8c8!important}
html[data-theme="dark"] .completion-status-chip.is-done i{background:#19a56f!important;color:#fff!important}
html[data-theme="dark"] .completion-status-chip.is-pending{background:#1d2633!important;border-color:#344052!important;color:#c1cad6!important}
html[data-theme="dark"] .completion-status-chip.is-pending i{color:#7c8899!important}

/* Estado de publicación */
html[data-theme="dark"] .publication-status strong{color:#f4f7fb!important}
html[data-theme="dark"] .publication-status span{color:#9ca8b8!important}
html[data-theme="dark"] .publication-status.published>i{background:#102f27!important;color:#5bd5a4!important}
html[data-theme="dark"] .publication-status.hidden>i{background:#202936!important;color:#aab4c2!important}

/* Tarjetas de cuenta/suscripción fuera del editor */
html[data-theme="dark"] .client-summary-card strong,
html[data-theme="dark"] .account-plan-strip strong,
html[data-theme="dark"] .profile-manager-card strong,
html[data-theme="dark"] .subscription-status-hero strong,
html[data-theme="dark"] .payment-history-item strong,
html[data-theme="dark"] .company-readonly-card strong{color:#f4f7fb!important}
html[data-theme="dark"] .client-summary-card small,
html[data-theme="dark"] .account-plan-strip small,
html[data-theme="dark"] .profile-manager-card small,
html[data-theme="dark"] .subscription-status-hero small,
html[data-theme="dark"] .payment-history-item small,
html[data-theme="dark"] .company-readonly-card small{color:#9ca8b8!important}

/* Acciones y estados */
html[data-theme="dark"] .ghost-btn,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .icon-action{background:#151d29!important;border-color:#344052!important;color:#edf2f8!important}
html[data-theme="dark"] .ghost-btn:hover,
html[data-theme="dark"] .icon-btn:hover,
html[data-theme="dark"] .icon-action:hover{background:#202a39!important;border-color:#7361e9!important;color:#fff!important}
html[data-theme="dark"] .status-badge.neutral{background:#222b38!important;color:#c2cad5!important}
html[data-theme="dark"] .soft-tag,
html[data-theme="dark"] .number-pill{background:#282242!important;color:#c7bbff!important}

/* Toasts / confirmaciones */
html[data-theme="dark"] .toast{background:#151d29!important;border-color:#344052!important;color:#f4f7fb!important}
html[data-theme="dark"] .confirm-card p{color:#a6b1c0!important}
html[data-theme="dark"] .credential-value{background:#0f1621!important;border-color:#344052!important;color:#eef3f8!important}
html[data-theme="dark"] .credential-value button{background:#1a2432!important;border-color:#3a4659!important;color:#ddd5ff!important}

/* El teléfono de vista previa representa el perfil del cliente y no hereda el tema del backoffice. */
html[data-theme="dark"] .live-profile-preview{background:#0d141d!important;border-color:#2b3544!important}
html[data-theme="dark"] .live-profile-preview .preview-phone{color:#1b2030}

@media(max-width:720px){
  html[data-theme="dark"] .section-sort-item{box-shadow:none!important}
}

/* =========================================================
   PERFIL PÚBLICO · compartir respeta la forma elegida
   ========================================================= */
.public-share-modal .share-avatar.avatar-shape-square,
.public-share-modal .share-avatar.avatar-shape-square img{border-radius:7px!important}
.public-share-modal .share-avatar.avatar-shape-rounded,
.public-share-modal .share-avatar.avatar-shape-rounded img{border-radius:18px!important}
.public-share-modal .share-avatar.avatar-shape-circle,
.public-share-modal .share-avatar.avatar-shape-circle img{border-radius:50%!important}
