body {
    background-color: #000;
    color: #fff;
}
.btn-danger {
    background-color: #d80000;
    border-color: #d80000;
}

h1, p, label, div, span, a {
    color: white !important;
}

/* Modales con fondo claro: la regla anterior deja labels/p en blanco sobre bg-light */
body .modal .modal-body.bg-light label,
body .modal .modal-body.bg-light p {
    color: #212529 !important;
}

body .modal .modal-body.bg-light .text-muted {
    color: #6c757d !important;
}

/* Resumen fábrica (fondo oscuro): labels visibles frente al global label { color: white } */
.card.fabrica-resumen .stat-label,
.card.fabrica-resumen .stat-hint {
    color: #adb5bd !important;
}

.card.fabrica-resumen .stat-value {
    color: #fff !important;
}

.nav-tabs .nav-link.active {
  background-color: #d80000;  /* Rojo corporativo */
  color: white;
}

/* Hover sobre las pestañas */
.nav-tabs .nav-link:hover {
  background-color: #b30000;  /* Rojo más oscuro */
  color: white;
}

/* Pestañas inactivas */
.nav-tabs .nav-link {
  color: #f0f0f0;  /* Gris claro */
}

/* Contenedor del contenido de las pestañas */
.tab-content {
  background-color: #1a1a1a;  /* Fondo oscuro */
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #333;
}

/* Para que todo el texto quede blanco dentro del contenido */
.tab-content * {
  color: white;
}


/* Estilos para la tabla con encabezados fijos */
table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

thead th {
  position: sticky;
  top: 0;
  background-color: #111;
  z-index: 2;
  text-align: center;
}

/* Estilos para la Pantalla de Carga */
#loading-overlay {
    position: fixed; /* Se queda fijo en la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Fondo negro semitransparente */
    z-index: 9999; /* Se asegura de que esté por encima de todo */
    display: none; /* Oculto por defecto */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* El círculo de carga */
.loading-spinner {
    border: 8px solid rgba(255, 255, 255, 0.2); /* Borde claro */
    border-top: 8px solid #e60000; /* Rojo Huentelauquén */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}

/* Animación de giro */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

  .col-nombre-cuenta {
    white-space: nowrap;
    min-width: 350px;  /* ajusta según te acomode */
  }
  .btn-comentario {
    font-size: 0.75rem;

    
  }

    
/* Alertas adaptadas al tema oscuro (sobrescribe regla global div/span en blanco) */
.alert,
.alert *:not(.btn-close) {
    color: inherit !important;
}
.alert .btn-close {
    filter: invert(1);
    opacity: 0.85;
}
.alert-success {
    background-color: #14532d !important;
    color: #ecfdf5 !important;
    border-color: #22c55e !important;
}
.alert-info {
    background-color: #164e63 !important;
    color: #ecfeff !important;
    border-color: #22d3ee !important;
}
.alert-danger {
    background-color: #7f1d1d !important;
    color: #fef2f2 !important;
    border-color: #f87171 !important;
}
.alert-primary {
    background-color: #1e3a5f !important;
    color: #eff6ff !important;
    border-color: #60a5fa !important;
}
.alert-secondary {
    background-color: #374151 !important;
    color: #f3f4f6 !important;
    border-color: #9ca3af !important;
}
.alert-warning {
    background-color: #5a3d00 !important;   /* café/amarillo oscuro */
    color: #ffffff !important;             /* texto blanco */
    border-color: #ffc107 !important;      /* borde amarillo tipo warning */
}

.alert-warning a,
.alert-warning a:hover,
.alert-warning a:focus {
    color: #fff !important;
    text-decoration: underline;
}

/* inputs de porcentaje en tabla oscura */
.input-porcentaje-costanera {
    max-width: 100px;
}

/* asegurar texto claro en cards grises */
.card.bg-secondary {
    color: #fff;
}

/* # INICIO ESTILOS CALENDARIO RECOMPUESTOS # */

/* Fuerza las 7 columnas en cualquier pantalla */
.row-cols-7 > * {
    flex: 0 0 auto;
    width: 14.28571428%;
}

.celda-calendario {
    min-height: 110px; /* Altura para que quepan los 3 datos */
    border: 1px solid #333 !important;
    transition: background-color 0.2s;
}

.celda-calendario:hover {
    background-color: #222 !important;
}

.contenedor-datos-dia {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-top: 10px;
}

.val-principal {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.val-secundario {
    font-size: 0.85rem;
    color: #ffc107 !important; /* Ahora en amarillo para combinar */
    margin-top: 2px;
}

.val-rendimiento {
    font-size: 0.75rem;
    color: #0dcaf0;
    font-weight: bold;
}

.seccion-inventario {
    background-color: #f8f9fa;
    border-left: 4px solid #198754; /* Verde para indicar stock */
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .celda-calendario { min-height: 90px; }
    .val-principal { font-size: 1.1rem; }
    .val-secundario, .val-rendimiento { font-size: 0.7rem; }
}
/* # FIN ESTILOS CALENDARIO RECOMPUESTOS # */

/* =========================================
   ESTILOS PARA EDITOR DE ANUNCIOS (QUILL)
   ========================================= */
/* 1. Entradas de texto normales (Título, Fechas) */
#formAnuncio .form-control {
    background-color: #2b2b2b !important;
    color: #ffffff !important;
}
#formAnuncio .form-control:focus {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #0dcaf0 !important;
}

/* 2. Editor Quill - Área de escritura */
#editor {
    background-color: #ffffff !important;
}
.ql-editor {
    color: #000000 !important; /* Letra negra para escribir */
    font-size: 16px;
}
.ql-editor.ql-blank::before {
    color: #888888 !important; /* Texto fantasma visible */
}

/* 3. Barra de herramientas de Quill */
.ql-toolbar {
    background-color: #f8f9fa !important;
    border-color: #cccccc !important;
}
.ql-snow .ql-stroke { stroke: #333333 !important; }
.ql-snow .ql-fill { fill: #333333 !important; }

/* 4. Desplegable de Tamaños (El cuadro blanco rebelde) */
.ql-snow .ql-picker { color: #333333 !important; }
.ql-snow .ql-picker-options {
    background-color: #ffffff !important;
    border-color: #cccccc !important;
}
.ql-snow .ql-picker-item {
    color: #000000 !important;
}
.ql-snow .ql-picker-item:hover {
    color: #007bff !important;
}
.ql-snow .ql-picker-item.ql-selected {
    color: #007bff !important;
    font-weight: bold;
}
/* ====================================================
   ESCUDO ANTI "LETRAS BLANCAS" DENTRO DEL EDITOR
   ==================================================== */

/* 1. Fuerza letra negra al texto del menú desplegable (que son spans) */
.ql-toolbar span,
.ql-toolbar .ql-picker-label,
.ql-toolbar .ql-picker-label::before {
    color: #333333 !important;
}

/* 2. Fuerza letra negra a TODO lo que escribas dentro del cuadro blanco */
.ql-editor p, 
.ql-editor h1, 
.ql-editor h2, 
.ql-editor h3, 
.ql-editor span, 
.ql-editor li,
.ql-editor strong,
.ql-editor em {
    color: #000000 !important;
}

/* Hacer visible el icono del calendario en los selectores de fecha oscuros */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Ajuste global para mejorar la legibilidad del texto secundario en fondos oscuros */
.text-muted {
    color: #a0a0a0 !important; /* Un gris más claro y legible */
}

/* =========================================
   ESTILOS PARA CALENDARIO POP-UP
   ========================================= */
.calendar-table {
    table-layout: fixed;
    border-color: #444 !important;
}

.calendar-table th, .calendar-table td {
    text-align: center;
    vertical-align: middle;
    height: 60px;
    border-color: #444 !important;
}

.week-number-header {
    width: 50px;
    background-color: #333;
    font-style: italic;
}

.week-number {
    background-color: #222;
    font-weight: bold;
    color: #0dcaf0 !important; /* Cyan */
}

.day-cell {
    transition: background-color 0.2s;
}

.day-cell:hover {
    background-color: #3a3a3a;
}

.day-cell.other-month {
    color: #666 !important;
}

.day-cell.today {
    background-color: #d80000; /* Rojo corporativo */
    font-weight: bold;
    border: 2px solid #fff;
}

.day-cell.holiday {
    background-color: #004d00; /* Verde oscuro */
    color: #90ee90 !important; /* Verde claro */
    position: relative;
    cursor: help;
}

.day-cell.holiday::after {
    content: attr(title);
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    font-size: 0.6em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

/* =========================================
   NUEVOS ESTILOS DASHBOARD INTERACTIVO
   ========================================= */
.kpi-card-clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(13, 202, 240, 0.4) !important;
    border-color: #0dcaf0 !important;
}
.fila-semana-activa {
    background-color: rgba(13, 202, 240, 0.15) !important;
    border: 1px solid #0dcaf0;
}