/* ===== DARK MODE PARA MÓVILES - SOLO COLORES ===== */
/* IMPORTANTE: Solo cambia colores (background, color, border-color) */
/* NO modifica: padding, margin, border-radius, width, height, display, position, etc. */
/* Solo se aplica en dispositivos móviles (max-width: 767px) para no afectar PC */

@media (prefers-color-scheme: dark) and (max-width: 767px) {
  /* Fondo principal - SOLO COLOR */
  body {
    background-color: #0f172a !important;
    color: #f8fafc !important;
  }
  
  /* Contenido - SOLO COLOR */
  .content {
    background: #0f172a !important;
    color: #f8fafc !important;
  }
  
  /* Textos - SOLO COLOR */
  .text-muted,
  .text-secondary,
  .small,
  small {
    color: #94a3b8 !important;
  }
  
  .hint {
    color: #94a3b8 !important;
  }
  
  /* Tarjetas - SOLO COLORES */
  .card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .card-header {
    background: #334155 !important;
    border-bottom-color: #475569 !important;
    color: #f8fafc !important;
  }
  
  .card-body {
    background: #1e293b !important;
    color: #f8fafc !important;
  }
  
  /* Cards con fondo blanco hardcodeado - SOLO COLOR */
  .card[style*="background:#fff"],
  .card[style*="background: #fff"],
  .card[style*="background:white"],
  .card[style*="background: white"] {
    background: #1e293b !important;
    color: #f8fafc !important;
  }
  
  /* Items de productos - SOLO COLORES */
  .product-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  
  .product-item.selected {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
  }
  
  /* Items de usuarios - SOLO COLORES */
  .usuario-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  
  /* Display de stock - SOLO COLORES */
  .stock-display {
    background: #334155 !important;
    color: #f1f5f9 !important;
  }
  
  /* Display de cantidad - SOLO COLORES */
  #cantidadDisplay,
  .cantidad-display,
  [id*="cantidad"][id*="Display"],
  [style*="background-color: #f8f9fa"],
  [style*="background-color:#f8f9fa"] {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
  }
  
  /* Badges - SOLO COLORES (mantener colores originales) */
  .badge-success,
  .bg-success {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
  }
  
  .badge-danger,
  .bg-danger {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
  }
  
  .badge-warning,
  .bg-warning {
    background: rgba(245, 158, 11, 0.35) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
  }
  
  .badge-info,
  .bg-info {
    background: rgba(59, 130, 246, 0.25) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
  }
  
  .badge-primary,
  .bg-primary {
    background: rgba(37, 99, 235, 0.4) !important;
    color: #93c5fd !important;
    border-color: rgba(37, 99, 235, 0.6) !important;
  }
  
  .rounded-pill.bg-primary {
    background: rgba(37, 99, 235, 0.4) !important;
    color: #93c5fd !important;
  }
  
  .rounded-pill.bg-warning {
    background: rgba(245, 158, 11, 0.35) !important;
    color: #fcd34d !important;
  }
  
  .rounded-pill.bg-success {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #6ee7b7 !important;
  }
  
  .rounded-pill.bg-danger {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
  }
  
  /* Formularios - SOLO COLORES */
  .form-control,
  .form-select {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
  }
  
  .form-control:focus,
  .form-select:focus {
    background: #1e293b !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    color: #f8fafc !important;
  }
  
  .form-control::placeholder {
    color: #64748b !important;
    opacity: 0.8;
  }
  
  /* Inputs con fondo blanco hardcodeado - SOLO COLOR */
  input[style*="background:#fff"],
  input[style*="background: #fff"],
  input[style*="background:white"],
  input[style*="background: white"] {
    background: #1e293b !important;
    color: #f8fafc !important;
  }
  
  /* Labels - SOLO COLOR */
  .form-label,
  label {
    color: #e2e8f0 !important;
  }
  
  .form-check-label {
    color: #e2e8f0 !important;
  }
  
  /* Botones outline - SOLO COLORES */
  .btn-outline-primary {
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
  }
  
  .btn-outline-primary:hover {
    background: #3b82f6 !important;
    color: white !important;
  }
  
  .btn-outline-secondary {
    border-color: #64748b !important;
    color: #94a3b8 !important;
  }
  
  .btn-outline-secondary:hover {
    background: #64748b !important;
    color: #f1f5f9 !important;
  }
  
  /* Navegación móvil - SOLO COLORES */
  .mobile-nav {
    background: #1e293b !important;
    border-top-color: #334155 !important;
  }
  
  .mobile-nav a {
    color: #cbd5e1 !important;
  }
  
  .mobile-nav a.active {
    color: #3b82f6 !important;
  }
  
  /* Safe area bottom - SOLO COLOR */
  .mobile-safe-bottom {
    background: #0f172a !important;
  }
  
  /* Alertas - SOLO COLORES */
  .alert-success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
  }
  
  .alert-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
  }
  
  .alert-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
  }
  
  .alert-info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
  }
  
  /* Textos - SOLO COLORES */
  h1, h2, h3, h4, h5, h6 {
    color: #f8fafc !important;
  }
  
  h5, h6 {
    color: #f1f5f9 !important;
  }
  
  p, span, div, li {
    color: #e2e8f0 !important;
  }
  
  /* Textos con colores específicos - SOLO COLOR */
  .text-primary {
    color: #60a5fa !important;
  }
  
  .text-success {
    color: #34d399 !important;
  }
  
  .text-danger {
    color: #f87171 !important;
  }
  
  .text-warning {
    color: #fbbf24 !important;
  }
  
  .text-info {
    color: #60a5fa !important;
  }
  
  /* Iconos - SOLO COLOR */
  .text-success i,
  i.text-success {
    color: #34d399 !important;
  }
  
  .text-primary i,
  i.text-primary {
    color: #60a5fa !important;
  }
  
  .text-danger i,
  i.text-danger {
    color: #f87171 !important;
  }
  
  .text-warning i,
  i.text-warning {
    color: #fbbf24 !important;
  }
  
  /* Tablas - SOLO COLORES */
  .table {
    background: #1e293b !important;
    color: #e2e8f0 !important;
  }
  
  .table th {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-bottom-color: #475569 !important;
  }
  
  .table td {
    color: #e2e8f0 !important;
    border-bottom-color: #334155 !important;
  }
  
  .table tbody tr:hover {
    background: #334155 !important;
  }
  
  /* Inputs - SOLO COLORES */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  input[type="search"],
  textarea,
  select {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
  }
  
  input[type="text"]:focus,
  input[type="number"]:focus,
  input[type="email"]:focus,
  input[type="password"]:focus,
  input[type="date"]:focus,
  input[type="time"]:focus,
  input[type="search"]:focus,
  textarea:focus,
  select:focus {
    background: #1e293b !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    color: #f8fafc !important;
  }
  
  /* Autocompletado - SOLO COLOR */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc !important;
    -webkit-box-shadow: 0 0 0px 1000px #1e293b inset !important;
    box-shadow: 0 0 0px 1000px #1e293b inset !important;
  }
  
  /* Checkboxes y radios - SOLO COLOR */
  input[type="checkbox"],
  input[type="radio"] {
    accent-color: #3b82f6;
  }
  
  /* Links - SOLO COLOR */
  a {
    color: #60a5fa !important;
  }
  
  a:hover {
    color: #93c5fd !important;
  }
  
  /* Modales - SOLO COLORES */
  .modal-content {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  
  .modal-header {
    background: #334155 !important;
    border-bottom-color: #475569 !important;
    color: #f1f5f9 !important;
  }
  
  .modal-body {
    background: #1e293b !important;
    color: #e2e8f0 !important;
  }
  
  .modal-footer {
    background: #334155 !important;
    border-top-color: #475569 !important;
  }
  
  .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
  }
  
  /* Elementos específicos - SOLO COLORES */
  .kpi {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .kpi .val {
    color: #f8fafc !important;
  }
  
  .list-producto {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .list-producto:hover {
    background: #334155 !important;
    border-color: #475569 !important;
  }
  
  /* Sidebar - SOLO COLORES */
  .sidebar {
    background: #0f172a !important;
    color: #cbd5e1 !important;
  }
  
  .sidebar a {
    color: #cbd5e1 !important;
  }
  
  .sidebar a:hover,
  .sidebar a.active {
    background: #1e293b !important;
    color: #f8fafc !important;
  }
  
  .sidebar .brand {
    color: #93c5fd !important;
  }
  
  /* Toggle password - SOLO COLOR */
  .toggle-pass {
    color: #94a3b8 !important;
  }
  
  .toggle-pass:hover {
    color: #cbd5e1 !important;
  }
  
  /* Form check switches - SOLO COLORES */
  .form-check-input {
    background-color: #334155 !important;
    border-color: #475569 !important;
  }
  
  .form-check-input:checked {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
  }
  
  /* Botones - SOLO COLORES */
  .btn-primary {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: white !important;
  }
  
  .btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
  }
  
  /* Cards de productos en listas - SOLO COLORES */
  .card-row {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .card-row:hover {
    background: #334155 !important;
    border-color: #475569 !important;
  }
  
  .card-row .fw-semibold {
    color: #f8fafc !important;
  }
  
  .card-row .text-muted {
    color: #94a3b8 !important;
  }
  
  /* Pills de filtros - SOLO COLORES */
  .pill {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
  }
  
  .pill:hover {
    background: #334155 !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
  }
  
  .pill.active {
    background: rgba(37, 99, 235, 0.4) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
  }
  
  /* Input group - SOLO COLORES */
  .input-group .form-control {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
  }
  
  .input-group .btn {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
  }
  
  .input-group .btn:hover {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
  }
  
  /* Listas - SOLO COLORES */
  .list-group-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .list-group-item:hover {
    background: #334155 !important;
  }
  
  .list-group-item-action {
    color: #e2e8f0 !important;
  }
  
  .list-group-item-action:hover {
    background: #334155 !important;
    color: #f8fafc !important;
  }
  
  /* Contenedores con fondo claro hardcodeado - SOLO COLOR */
  [style*="background:#f8fafc"],
  [style*="background: #f8fafc"],
  [style*="background:#fff"],
  [style*="background: #fff"],
  [style*="background:white"],
  [style*="background: white"] {
    background: #1e293b !important;
    color: #f8fafc !important;
  }
  
  /* Product cards en reportes - SOLO COLORES */
  .product-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .product-card:active {
    background: #334155 !important;
  }
  
  /* Sugerencias de búsqueda - SOLO COLORES */
  .sugerencias {
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  
  .sugerencia-item {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .sugerencia-item:hover,
  .sugerencia-item:active {
    background: #334155 !important;
  }
  
  /* Display de cantidad - SOLO COLORES */
  .qty-display {
    background: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
  }
  
  /* Option cards en maestro - SOLO COLORES */
  .option-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .option-card:active {
    background: #334155 !important;
  }
  
  .option-card i {
    color: #60a5fa !important;
  }
  
  /* Pedido items en lista - SOLO COLORES */
  .pedido-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .pedido-item.en-curso {
    border-left-color: #3b82f6 !important;
  }
  
  .pedido-item.completado {
    border-left-color: #10b981 !important;
  }
  
  /* User items en maestro - SOLO COLORES (alias de usuario-item) */
  .user-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .user-item:active {
    background: #334155 !important;
  }
  
  .user-item.text-dark {
    color: #f8fafc !important;
  }
  
  .user-item .fw-semibold {
    color: #f8fafc !important;
  }
  
  .user-item .text-muted {
    color: #94a3b8 !important;
  }
  
  /* Movimiento items en auditoría - SOLO COLORES */
  .movimiento-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .movimiento-item .fw-semibold {
    color: #f8fafc !important;
  }
  
  .movimiento-item .text-muted {
    color: #94a3b8 !important;
  }
  
  /* Badge secondary - SOLO COLORES */
  .badge-secondary {
    background: rgba(100, 116, 139, 0.25) !important;
    color: #cbd5e1 !important;
    border-color: rgba(100, 116, 139, 0.4) !important;
  }
  
  .badge-role {
    background: rgba(100, 116, 139, 0.25) !important;
    color: #cbd5e1 !important;
    border-color: rgba(100, 116, 139, 0.4) !important;
  }
  
  /* Producto items en fichas - SOLO COLORES */
  .producto-item {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  
  .producto-item .fw-semibold {
    color: #f8fafc !important;
  }
  
  .producto-item .text-muted {
    color: #94a3b8 !important;
  }
  
  .producto-item code {
    background: #334155 !important;
    color: #93c5fd !important;
    border-color: #475569 !important;
  }
  
  /* Proveedor badge - SOLO COLORES */
  .proveedor-badge {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
  }
}
