/* CARIPVCARD 15.0 · corrección visual dark mode y controles de archivos */

/* =========================================================
   INPUT FILE: nunca mostrar el control nativo sobre el diseño
   ========================================================= */
.modern-file{position:relative!important;min-width:0!important}
.modern-file-input,
.modern-file input[type="file"],
input.modern-file-input[type="file"]{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  min-height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
  border:0!important;
  opacity:0!important;
  pointer-events:none!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.modern-file .file-drop{
  width:100%!important;
  min-width:0!important;
  min-height:72px!important;
  display:flex!important;
  align-items:center!important;
  gap:13px!important;
  padding:13px 15px!important;
  border-radius:15px!important;
  border:1.5px dashed #c9c4e9!important;
  background:#fbfaff!important;
  cursor:pointer!important;
  overflow:hidden!important;
}
.modern-file .file-drop .file-icon{flex:0 0 42px!important;width:42px!important;height:42px!important;border-radius:12px!important;background:#eeeaff!important;color:#6951ec!important;display:grid!important;place-items:center!important}
.modern-file .file-drop>span:nth-child(2){min-width:0!important;flex:1!important}
.modern-file .file-drop strong{display:block!important;color:#202638!important;font-size:11px!important;line-height:1.3!important}
.modern-file .file-drop small{display:block!important;color:#858da1!important;font-size:8.5px!important;line-height:1.4!important;margin-top:3px!important;white-space:normal!important;overflow-wrap:anywhere!important}
.modern-file .file-drop em{flex:none!important;font-style:normal!important;font-size:8px!important;font-weight:800!important;padding:7px 9px!important;border:1px solid #e1def3!important;border-radius:9px!important;background:#fff!important;color:#5c6375!important}
.modern-file .file-preview{margin-top:10px!important}

/* =========================================================
   DARK MODE: superficies que en versiones anteriores quedaban blancas
   ========================================================= */
html[data-theme="dark"]{
  --v15-bg:#0b0f19;
  --v15-surface:#121827;
  --v15-surface-2:#171e30;
  --v15-surface-3:#1c2438;
  --v15-border:#303a54;
  --v15-text:#f7f9ff;
  --v15-muted:#aeb9d2;
  --v15-soft:#8693b2;
}

html[data-theme="dark"] .chart-panel,
html[data-theme="dark"] .company-admin-card,
html[data-theme="dark"] .company-card-content,
html[data-theme="dark"] .subscription-status-hero,
html[data-theme="dark"] .subscription-period-card,
html[data-theme="dark"] .v10-renewal-card,
html[data-theme="dark"] .subscription-payment-chart,
html[data-theme="dark"] .subscription-payment-list,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .smart-note,
html[data-theme="dark"] .activity-item,
html[data-theme="dark"] .profile-manager-card,
html[data-theme="dark"] .client-summary-card,
html[data-theme="dark"] .subscription-mini-panel{
  background:var(--v15-surface)!important;
  border-color:var(--v15-border)!important;
  color:var(--v15-text)!important;
}

/* Dashboard */
html[data-theme="dark"] .chart-panel-head h3,
html[data-theme="dark"] .chart-panel-head strong,
html[data-theme="dark"] .chart-empty strong{color:var(--v15-text)!important}
html[data-theme="dark"] .chart-panel-head span,
html[data-theme="dark"] .chart-empty,
html[data-theme="dark"] .chart-empty span{color:var(--v15-muted)!important}
html[data-theme="dark"] .chart-panel-head>i{background:#222947!important;color:#8f7cff!important}

/* Suscripción */
html[data-theme="dark"] .subscription-status-hero.health-active{background:linear-gradient(135deg,#121827,#12271f)!important}
html[data-theme="dark"] .subscription-status-hero.health-warning{background:linear-gradient(135deg,#121827,#292113)!important}
html[data-theme="dark"] .subscription-status-hero.health-danger{background:linear-gradient(135deg,#121827,#2a171d)!important}
html[data-theme="dark"] .subscription-status-hero:after{opacity:.15!important}
html[data-theme="dark"] .subscription-status-copy h2,
html[data-theme="dark"] .subscription-status-copy strong,
html[data-theme="dark"] .subscription-card-heading h3,
html[data-theme="dark"] .payment-summary-mini strong,
html[data-theme="dark"] .payment-history-main strong,
html[data-theme="dark"] .payment-history-amount strong{color:var(--v15-text)!important}
html[data-theme="dark"] .subscription-plan-type,
html[data-theme="dark"] .subscription-status-copy p,
html[data-theme="dark"] .subscription-card-heading small,
html[data-theme="dark"] .payment-summary-mini span,
html[data-theme="dark"] .payment-history-main span,
html[data-theme="dark"] .payment-history-amount span{color:var(--v15-muted)!important}
html[data-theme="dark"] .subscription-date-grid article,
html[data-theme="dark"] .payment-history-item{
  background:var(--v15-surface-2)!important;
  border-color:var(--v15-border)!important;
}
html[data-theme="dark"] .subscription-date-grid article span,
html[data-theme="dark"] .subscription-date-grid article small{color:var(--v15-muted)!important}
html[data-theme="dark"] .subscription-date-grid article strong{color:#fff!important}
html[data-theme="dark"] .v10-renewal-card p{color:var(--v15-muted)!important}

/* Empresas */
html[data-theme="dark"] .company-admin-card.v4-company-card{background:var(--v15-surface)!important;border-color:var(--v15-border)!important}
html[data-theme="dark"] .company-card-cover{background:linear-gradient(135deg,#252044,#5339b4)!important}
html[data-theme="dark"] .company-card-avatar{border-color:var(--v15-surface)!important;background:#0e1422!important}
html[data-theme="dark"] .company-card-content h3{color:#fff!important}
html[data-theme="dark"] .company-card-content>p,
html[data-theme="dark"] .company-admin-name,
html[data-theme="dark"] .company-activity-line{color:var(--v15-muted)!important}
html[data-theme="dark"] .company-stats.v4-stats span{background:#1a2134!important;color:var(--v15-muted)!important}
html[data-theme="dark"] .company-stats.v4-stats b{color:#fff!important}
html[data-theme="dark"] .company-activity-line{border-color:var(--v15-border)!important}

/* Notas informativas / banners */
html[data-theme="dark"] .smart-note{
  background:linear-gradient(135deg,#171f37,#19243e)!important;
  color:#dce4f8!important;
  border:1px solid #33405f!important;
}
html[data-theme="dark"] .smart-note i{color:#8b7cff!important}
html[data-theme="dark"] .smart-note span,
html[data-theme="dark"] .smart-note strong{color:#dce4f8!important}
html[data-theme="dark"] .danger-note{background:linear-gradient(135deg,#281920,#24161d)!important;border-color:#5b2e3a!important}

/* Formularios */
html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] .settings-section label,
html[data-theme="dark"] .modal-form label,
html[data-theme="dark"] .standalone-label{color:#d8def0!important}
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .settings-section input,
html[data-theme="dark"] .settings-section select,
html[data-theme="dark"] .settings-section textarea,
html[data-theme="dark"] .modal-form input:not([type="file"]),
html[data-theme="dark"] .modal-form select,
html[data-theme="dark"] .modal-form textarea{
  background:var(--v15-surface-2)!important;
  border-color:#35405d!important;
  color:#f7f9ff!important;
  -webkit-text-fill-color:#f7f9ff!important;
  opacity:1!important;
}
html[data-theme="dark"] .form-grid input:disabled,
html[data-theme="dark"] .form-grid input[readonly],
html[data-theme="dark"] .settings-section input:disabled,
html[data-theme="dark"] .settings-section input[readonly]{
  background:#20283b!important;
  color:#cfd7eb!important;
  -webkit-text-fill-color:#cfd7eb!important;
}
html[data-theme="dark"] select option{background:#171e30!important;color:#f7f9ff!important}

/* File upload oscuro: mantiene el diseño propio y NO revive el input nativo */
html[data-theme="dark"] .modern-file .file-drop{
  background:#151c2d!important;
  border-color:#465171!important;
  color:#fff!important;
}
html[data-theme="dark"] .modern-file .file-drop:hover{background:#192137!important;border-color:#7866ef!important}
html[data-theme="dark"] .modern-file .file-drop .file-icon{background:#292245!important;color:#9c8cff!important}
html[data-theme="dark"] .modern-file .file-drop strong{color:#fff!important}
html[data-theme="dark"] .modern-file .file-drop small{color:#aeb9d2!important}
html[data-theme="dark"] .modern-file .file-drop em{background:#101625!important;border-color:#35405c!important;color:#d3daf0!important}
html[data-theme="dark"] .modern-file-input{opacity:0!important}

/* Iconos y botones sobre superficies oscuras */
html[data-theme="dark"] .icon-action,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .ghost-btn{background:#151c2c!important;border-color:#35405a!important;color:#f3f6ff!important}
html[data-theme="dark"] .icon-action:hover,
html[data-theme="dark"] .icon-btn:hover,
html[data-theme="dark"] .ghost-btn:hover{background:#202944!important;border-color:#6757d9!important}

/* Tablas */
html[data-theme="dark"] .modern-table th{background:#141b2b!important;color:#aeb8cf!important;border-color:#303a54!important}
html[data-theme="dark"] .modern-table td{color:#eaf0ff!important;border-color:#28324b!important}
html[data-theme="dark"] .modern-table tbody tr:hover{background:#121a2a!important}

/* Responsive de uploads y tarjetas */
@media(max-width:760px){
  .modern-file .file-drop{min-height:68px!important;padding:12px!important}
  .modern-file .file-drop em{display:none!important}
  .company-admin-grid.v4-company-grid{grid-template-columns:1fr!important}
  .subscription-status-hero{min-height:auto!important}
}
