/* Estilos complementarios y modernos para el Monitor de Termómetro MeatMeet Pro */

.offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.offline-badge.badge-online {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.offline-badge.badge-offline {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    animation: pulse 1.5s infinite;
}

.offline-badge.badge-syncing {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.wakelock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background-color: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
    cursor: default;
    transition: all 0.3s ease;
}

.wakelock-badge.is-active {
    background-color: #fef08a;
    color: #713f12;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.45);
}

.wakelock-badge.is-disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #cbd5e1;
}

/* Modal de Configuración */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    width: 90%;
    max-width: 580px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.is-open .modal-card {
    transform: translateY(0);
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
}
.modal-close-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.modal-body {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-text-help {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

.modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Tarjeta de Contexto de Producción (Lote / Masa / Carro) */
.production-context-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-left: 5px solid #0284c7;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.production-context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.production-context-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.production-context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

/* Banner de alerta offline / sincronización pendiente */
.sync-alert-banner {
    display: none;
    background: #fffbeb;
    border: 1px solid #fef08a;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sync-alert-banner.is-visible {
    display: flex;
}

/* Botón de configuración en cabecera */
.btn-config {
    background: #475569;
    color: white;
    font-weight: 600;
    padding: 0.65rem 1.1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}
.btn-config:hover {
    background: #334155;
}

#btn-install-pwa {
    background: #f0fdf4 !important;
    border: 1.5px solid #22c55e !important;
    color: #15803d !important;
    font-weight: 700 !important;
}
#btn-install-pwa:hover {
    background: #dcfce7 !important;
    border-color: #16a34a !important;
}

#btn-download-apk {
    background: #eff6ff !important;
    border: 1.5px solid #3b82f6 !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}
#btn-download-apk:hover {
    background: #dbeafe !important;
    border-color: #2563eb !important;
}


.btn-secondary {
    background: #94a3b8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
}
.btn-secondary:hover {
    background: #64748b;
}

.btn-sync-now {
    background: #f59e0b;
    color: #ffffff;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}
.btn-sync-now:hover {
    background: #d97706;
}

/* Insignias de datos en tabla */
.badge-lote {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
}
.badge-masa {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
}
.badge-carro {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #334155;
}

/* -------------------------------------------------------------
 * ESTILOS DE ALARMA DE TEMPERATURA CRÍTICA (ZONA 1)
 * ------------------------------------------------------------- */
@keyframes alarmCardFlash {
    0% {
        background-color: #ef4444;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.9);
        border-color: #b91c1c;
        color: #ffffff;
    }
    100% {
        background-color: #7f1d1d;
        box-shadow: 0 0 35px rgba(220, 38, 38, 1);
        border-color: #f87171;
        color: #fef2f2;
    }
}

.card.card-alarm-trigger {
    animation: alarmCardFlash 0.5s infinite alternate !important;
    border: 3px solid #ef4444 !important;
}

.card.card-alarm-trigger .temp-value {
    color: #ffffff !important;
    font-weight: 900 !important;
}

.card.card-alarm-trigger h3 {
    color: #fee2e2 !important;
}

/* Banner de Alerta Crítica Flotante */
.alarm-fullscreen-banner {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 700px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #ffffff;
    border: 3px solid #fecaca;
    border-radius: 14px;
    padding: 16px 24px;
    box-shadow: 0 20px 35px rgba(185, 28, 28, 0.6), 0 0 40px rgba(239, 68, 68, 0.5);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: bounceAlarm 0.6s infinite alternate ease-in-out;
}

.alarm-fullscreen-banner.is-active {
    display: flex;
}

@keyframes bounceAlarm {
    0% {
        transform: translateX(-50%) scale(1);
    }
    100% {
        transform: translateX(-50%) scale(1.02);
    }
}

.alarm-banner-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.alarm-banner-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.alarm-banner-text h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.alarm-banner-text p {
    margin: 4px 0 0 0;
    font-size: 0.95rem;
    color: #fecaca;
}

.btn-silence-alarm {
    background: #ffffff;
    color: #b91c1c;
    border: none;
    font-size: 1.05rem;
    font-weight: 800;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: transform 0.15s, background-color 0.15s;
}

.btn-silence-alarm:hover {
    background: #fee2e2;
    transform: scale(1.05);
}

.alarm-pill-badge {
    display: inline-block;
    background: #fecaca;
    color: #991b1b;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* -------------------------------------------------------------
 * CONTROL DE HORNOS Y HORNEADOS SIMULTÁNEOS
 * ------------------------------------------------------------- */
.btn-comenzar-horneado {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #ffffff;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
    height: 38px;
}
.btn-comenzar-horneado:hover {
    background: linear-gradient(135deg, #c2410c, #9a3412);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.45);
}

.baking-monitor-section {
    background: #fffaf5;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 10px;
    margin-bottom: 16px;
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.05);
}

.baking-monitor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #fdba74;
}

.baking-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.baking-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.baking-card.is-idle {
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
}

.baking-card.is-active {
    background: #ffffff;
    border: 2px solid #ea580c;
    border-left: 6px solid #ea580c;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.18);
    position: relative;
}

.baking-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.baking-card-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.baking-status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

.baking-status-pill.status-free {
    background: #dcfce7;
    color: #166534;
}

.baking-status-pill.status-busy {
    background: #ffedd5;
    color: #9a3412;
    animation: pulse 1.5s infinite;
}

.baking-timer {
    font-size: 1.35rem;
    font-weight: 800;
    color: #c2410c;
    font-family: monospace;
    margin: 6px 0;
}

.baking-info-row {
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-finalize-bake {
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    transition: background 0.2s ease;
}
.btn-finalize-bake:hover {
    background: #b91c1c;
}

/* Badge de Termómetro / Sensor asignado al horno */
.baking-sensor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #ffedd5;
    border-radius: 6px;
    font-size: 0.78rem;
    padding: 3px 8px;
    margin-bottom: 8px;
}
.baking-sensor-badge.is-matching {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* Tabla de Gestión de Asignaciones Horno - Termómetro */
.termometros-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-top: 8px;
}
.termometros-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
}
.termometros-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.termometros-table tr:hover td {
    background: #fafaf9;
}
.sensor-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-link-ble {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-link-ble:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.btn-save-sensor {
    background: #ea580c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-save-sensor:hover {
    background: #c2410c;
}

/* Badge de batería en el Header */
.badge-battery-header {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

/* Rediseño de Tarjetas de Hornos Compactas (Permite visualizar 4 simultáneamente) */
.baking-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 1100px) {
    .baking-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .baking-cards-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.baking-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.baking-card.is-idle {
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
}

.baking-card.is-active {
    background: #ffffff;
    border: 2px solid #ea580c;
    border-left: 5px solid #ea580c;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.14);
    position: relative;
}

/* Estado de Alarma Crítica en el Horno (Modo Base) */
.baking-card.horno-alarm-active {
    border-color: #ef4444 !important;
    border-left: 8px solid #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.75), inset 0 0 15px rgba(239, 68, 68, 0.2) !important;
    animation: hornoPulseAlarm 0.8s infinite alternate ease-in-out !important;
    position: relative;
    z-index: 10 !important;
}

@keyframes hornoPulseAlarm {
    from {
        border-color: #ef4444;
        box-shadow: 0 0 14px rgba(239, 68, 68, 0.5), inset 0 0 10px rgba(239, 68, 68, 0.15);
        transform: scale(1);
    }
    to {
        border-color: #b91c1c;
        box-shadow: 0 0 35px rgba(220, 38, 38, 0.95), inset 0 0 20px rgba(220, 38, 38, 0.35);
        transform: scale(1.015);
    }
}

/* Panel Integrado de Temperaturas dentro del Cuadro Compacto del Horno */
.horno-temp-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.baking-card.is-active .horno-temp-panel {
    background: #fff7ed;
    border-color: #fed7aa;
}

.horno-temp-main {
    display: flex;
    flex-direction: column;
}

.horno-temp-main-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.horno-temp-main-val {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.05;
    color: #ea580c;
    font-family: monospace;
}

.horno-temp-main-val.is-cold {
    color: #0284c7;
}

.horno-temp-main-val.is-alarm {
    color: #dc2626;
    animation: pulse 1s infinite;
}

.horno-temp-sub-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.horno-temp-sub-item {
    font-size: 11px;
    color: #475569;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 6px;
}

/* Indicador de Punto de Alarma en el Cuadro del Horno */
.horno-alarm-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    white-space: nowrap;
}

.horno-alarm-badge-hit {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    animation: pulse 1s infinite;
}

/* ─────────────────────────────────────────────────────────────
   SECCIÓN DE GRÁFICAS SEPARADAS PARA HORNOS EN COCCIÓN
   ───────────────────────────────────────────────────────────── */
.baking-charts-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.baking-charts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.baking-charts-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.baking-charts-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 2px;
}

.baking-charts-pill {
    font-size: 11px;
    font-weight: 700;
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
    padding: 3px 8px;
    border-radius: 12px;
}

.baking-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

@media (max-width: 600px) {
    .baking-charts-grid {
        grid-template-columns: 1fr;
    }
}

.baking-chart-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.baking-chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
}

.baking-chart-card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.baking-chart-card-meta {
    font-size: 11px;
    color: #475569;
    font-weight: 600;
}

.baking-chart-canvas-box {
    height: 200px;
    position: relative;
    width: 100%;
}

.baking-charts-empty {
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
    padding: 24px 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    margin-top: 10px;
}

/* ─────────────────────────────────────────────────────────────
   NUEVA SECCIÓN: CONEXIÓN Y DISPOSITIVOS DISPONIBLES EN MODAL
   ───────────────────────────────────────────────────────────── */
.termometro-connect-action-card {
    background: #f8fafc;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.termometros-seccion-disponibles {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.badge-disponibles-pill {
    font-size: 11px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.dispositivos-disponibles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.dispositivo-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}

.dispositivo-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.dispositivo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.dispositivo-name {
    font-size: 0.92rem;
    font-weight: 800;
    font-family: monospace;
    color: #0f172a;
}

.dispositivo-status-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.dispositivo-status-connected {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.dispositivo-status-paired {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.dispositivo-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.btn-assign-device {
    background: #ea580c;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
    flex: 1;
    justify-content: center;
}

.btn-assign-device:hover {
    background: #c2410c;
}

.btn-disconnect-device {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-disconnect-device:hover {
    background: #fca5a5;
}

.btn-unassign-sensor {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-unassign-sensor:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.dispositivos-empty-message {
    text-align: center;
    padding: 16px;
    color: #64748b;
    font-size: 0.86rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
}

/* ==========================================================================
   BOTÓN MODO HORNEANDO (CABECERA)
   ========================================================================== */
.btn-modo-horneando {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #ffffff;
    border: 1px solid #9a3412;
    border-radius: 8px;
    padding: 7px 15px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-modo-horneando:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.5);
}

.btn-modo-horneando.is-active-baking {
    animation: pulse-horneando-btn 2s infinite;
    border-color: #ffedd5;
}

@keyframes pulse-horneando-btn {
    0% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(234, 88, 12, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
    }
}

.badge-horneando-count {
    background: #ffffff;
    color: #ea580c;
    border-radius: 12px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 800;
}

/* ==========================================================================
   FORMULARIO A PANTALLA COMPLETA: MODO HORNEANDO
   Solo aparecen las mediciones y estado de los hornos
   ========================================================================== */
body.modo-horneando-fullscreen {
    overflow: hidden !important;
    background: #090d16 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
}

/* Ocultar todos los demás bloques y controles */
body.modo-horneando-fullscreen .header,
body.modo-horneando-fullscreen .production-context-bar,
body.modo-horneando-fullscreen #baking-charts-section,
body.modo-horneando-fullscreen .db-controls-section,
body.modo-horneando-fullscreen .log-section,
body.modo-horneando-fullscreen #sync-banner {
    display: none !important;
}

/* El monitor de hornos se expande al 100% de la ventana sin scroll */
body.modo-horneando-fullscreen #baking-monitor-section {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: none !important;
    border-radius: 0 !important;
    background: radial-gradient(circle at 50% 15%, #172554 0%, #090d16 85%) !important;
    color: #f8fafc !important;
    z-index: 99990 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
}

/* Ocultar la cabecera estándar del monitor en pantalla completa */
body.modo-horneando-fullscreen #baking-monitor-section .baking-monitor-header {
    display: none !important;
}

/* Barra superior compacta del formulario a pantalla completa */
body.modo-horneando-fullscreen #fullscreen-horneando-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    margin-bottom: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    flex: 0 0 auto !important;
}

.fullscreen-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fullscreen-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.fullscreen-live-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink-live-dot 1.2s infinite ease-in-out;
}

@keyframes blink-live-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.75); }
}

.fullscreen-title-box {
    display: flex;
    flex-direction: column;
}

.fullscreen-kiosk-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #fdba74;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.fullscreen-heading {
    margin: 0;
    font-size: clamp(0.95rem, 1.4vw, 1.2rem);
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.fullscreen-stat-pill {
    background: rgba(234, 88, 12, 0.25);
    border: 1px solid rgba(234, 88, 12, 0.5);
    color: #fed7aa;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 700;
}

.fullscreen-clock-pill {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #38bdf8;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.fullscreen-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fullscreen-tool {
    background: rgba(51, 65, 85, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-fullscreen-tool:hover {
    background: rgba(71, 85, 105, 0.9);
    color: #ffffff;
}

.btn-volver-modo-visualizacion {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: 1px solid #38bdf8;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-volver-modo-visualizacion:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.6);
}

/* Disposición de cuadrícula de tarjetas de hornos en pantalla completa: Auto-ajuste para 4 hornos SIN scroll */
body.modo-horneando-fullscreen .baking-cards-grid {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    display: grid !important;
    gap: 8px !important;
    margin-top: 0 !important;
    align-content: stretch !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Modo Horizontal (Landscape >= 960px): 4 hornos en 1 sola fila de 4 columnas, ocupando 100% del alto */
@media (orientation: landscape) and (min-width: 960px) {
    body.modo-horneando-fullscreen .baking-cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: 100% !important;
    }
}

/* Modo Horizontal estrecho (< 960px): 4 hornos en 2 columnas x 2 filas */
@media (orientation: landscape) and (max-width: 959px) {
    body.modo-horneando-fullscreen .baking-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Modo Vertical (Portrait): 4 hornos en 2 columnas x 2 filas exactas, ocupando 100% del alto */
@media (orientation: portrait) {
    body.modo-horneando-fullscreen .baking-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Tarjeta individual en pantalla completa: elástica y auto-dimensionada */
body.modo-horneando-fullscreen .baking-card {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.modo-horneando-fullscreen .baking-card > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body.modo-horneando-fullscreen .baking-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6) !important;
}

body.modo-horneando-fullscreen .baking-card.is-active {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    border: 2px solid #ea580c !important;
    border-left: 6px solid #ea580c !important;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.25) !important;
}

body.modo-horneando-fullscreen .baking-card.is-idle {
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    border-left: 5px solid #475569 !important;
}

body.modo-horneando-fullscreen .baking-card-title {
    margin-bottom: 3px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Nombre del horno ampliado para lectura nítida a metros de distancia */
body.modo-horneando-fullscreen .baking-card-title h4 {
    color: #ffffff !important;
    font-size: clamp(1.25rem, 2.2vw, 1.85rem) !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

body.modo-horneando-fullscreen .baking-sensor-badge {
    font-size: clamp(0.75rem, 1.1vh, 0.9rem) !important;
    padding: 3px 8px !important;
    margin-bottom: 2px !important;
}

body.modo-horneando-fullscreen .horno-alarm-indicator {
    font-size: clamp(0.72rem, 1vh, 0.85rem) !important;
    padding: 3px 8px !important;
}

body.modo-horneando-fullscreen .baking-status-pill {
    font-size: clamp(0.72rem, 1vh, 0.85rem) !important;
    padding: 3px 8px !important;
}

body.modo-horneando-fullscreen .horno-temp-panel {
    background: rgba(2, 6, 23, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    margin: 4px 0 !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    overflow: hidden !important;
}

body.modo-horneando-fullscreen .horno-temp-main {
    text-align: center;
}

body.modo-horneando-fullscreen .horno-temp-main-val {
    font-size: clamp(2rem, 4.5vh, 3.4rem) !important;
    font-weight: 900 !important;
    color: #fb923c !important;
    line-height: 1 !important;
    text-shadow: 0 0 16px rgba(251, 146, 60, 0.35) !important;
}

body.modo-horneando-fullscreen .horno-temp-main-val.is-alarm {
    color: #ef4444 !important;
    text-shadow: 0 0 24px rgba(239, 68, 68, 0.8) !important;
    animation: pulse-temp-alarm 1s infinite alternate;
}

body.modo-horneando-fullscreen .horno-temp-main-label {
    color: #94a3b8 !important;
    font-size: clamp(0.68rem, 1vh, 0.82rem) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

body.modo-horneando-fullscreen .horno-temp-sub-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: clamp(0.75rem, 1.1vh, 0.88rem) !important;
}

body.modo-horneando-fullscreen .baking-timer {
    font-size: clamp(1.1rem, 2vh, 1.45rem) !important;
    font-weight: 900 !important;
    color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    text-align: center !important;
    margin: 4px 0 !important;
    letter-spacing: 1px !important;
}

/* =============================================================
 * BLOQUE DESTACADO DE LOTE, MASA, CARRO Y PRODUCTO
 * Máxima legibilidad y contraste para visión de operarios a distancia
 * ============================================================= */
.baking-batch-highlight {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 6px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.baking-batch-top-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    justify-content: space-between;
}

.baking-badge-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
    min-width: 0;
}

.badge-masa-box {
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.badge-carro-box {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.batch-mini-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1;
    margin-bottom: 2px;
}

.badge-masa-box .batch-mini-label { color: #b45309; }
.badge-carro-box .batch-mini-label { color: #15803d; }

.batch-main-val {
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.val-masa {
    font-size: 1.6rem;
    color: #78350f;
}

.val-carro {
    font-size: 1.6rem;
    color: #14532d;
}

.baking-art-title {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 2px 0;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.baking-time-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #64748b;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    padding-top: 5px;
    margin-top: 3px;
    gap: 8px;
    flex-wrap: wrap;
}

.baking-time-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Esquina inferior derecha para el Lote completo */
.baking-lote-corner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e0e7ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 3px 8px;
    margin-left: auto;
    white-space: nowrap;
}

.baking-lote-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: #4338ca;
    text-transform: uppercase;
}

.baking-lote-val {
    font-size: 0.95rem;
    font-weight: 900;
    color: #1e1b4b;
    letter-spacing: 0.5px;
}

.baking-idle-info-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 6px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.baking-idle-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0284c7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.baking-idle-desc {
    font-size: 0.8rem;
    color: #64748b;
}

/* Modos Pantalla Completa: Ampliación de tamaño de fuentes para Lote, Masa, Carro y Producto */
body.modo-horneando-fullscreen .baking-batch-highlight {
    background: rgba(2, 6, 23, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    padding: 8px 12px !important;
    margin: 6px 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

body.modo-horneando-fullscreen .baking-badge-item {
    padding: 8px 14px !important;
    border-radius: 10px !important;
}

body.modo-horneando-fullscreen .badge-masa-box {
    background: linear-gradient(135deg, #78350f 0%, #451a03 100%) !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
}

body.modo-horneando-fullscreen .badge-carro-box {
    background: linear-gradient(135deg, #065f46 0%, #022c22 100%) !important;
    border: 2px solid #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

body.modo-horneando-fullscreen .badge-masa-box .batch-mini-label {
    color: #fde68a !important;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem) !important;
    letter-spacing: 1px !important;
}

body.modo-horneando-fullscreen .badge-carro-box .batch-mini-label {
    color: #a7f3d0 !important;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem) !important;
    letter-spacing: 1px !important;
}

/* Números de MASA y CARRO masivos para legibilidad total a distancia */
body.modo-horneando-fullscreen .val-masa {
    font-size: clamp(1.8rem, 3.6vw, 2.7rem) !important;
    font-weight: 900 !important;
    color: #fbbf24 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

body.modo-horneando-fullscreen .val-carro {
    font-size: clamp(1.8rem, 3.6vw, 2.7rem) !important;
    font-weight: 900 !important;
    color: #34d399 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

body.modo-horneando-fullscreen .baking-art-title {
    color: #ffffff !important;
    font-size: clamp(0.95rem, 1.7vw, 1.35rem) !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    margin: 4px 0 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

/* Fila inferior: inicio a la izquierda y LOTE completo en la esquina derecha */
body.modo-horneando-fullscreen .baking-time-details {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.15) !important;
    padding-top: 5px !important;
    margin-top: 3px !important;
    font-size: clamp(0.78rem, 1.2vw, 0.95rem) !important;
    color: #cbd5e1 !important;
}

body.modo-horneando-fullscreen .baking-time-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

body.modo-horneando-fullscreen .baking-lote-corner {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%) !important;
    border: 1px solid #3b82f6 !important;
    border-radius: 6px !important;
    padding: 3px 10px !important;
    margin-left: auto !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

body.modo-horneando-fullscreen .baking-lote-tag {
    color: #93c5fd !important;
    font-size: clamp(0.72rem, 1.1vw, 0.88rem) !important;
    font-weight: 800 !important;
}

body.modo-horneando-fullscreen .baking-lote-val {
    color: #ffffff !important;
    font-size: clamp(0.95rem, 1.5vw, 1.25rem) !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px !important;
}

body.modo-horneando-fullscreen .baking-time-details strong {
    color: #f1f5f9 !important;
}

body.modo-horneando-fullscreen .baking-idle-info-box {
    background: rgba(2, 6, 23, 0.65) !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
    padding: 14px 16px !important;
}

body.modo-horneando-fullscreen .baking-idle-title {
    font-size: clamp(1rem, 1.5vw, 1.25rem) !important;
    color: #38bdf8 !important;
}

body.modo-horneando-fullscreen .baking-idle-desc {
    font-size: clamp(0.8rem, 1.2vw, 0.95rem) !important;
    color: #94a3b8 !important;
}

body.modo-horneando-fullscreen .btn-finalize-bake,
body.modo-horneando-fullscreen .baking-card button {
    font-size: clamp(0.85rem, 1.3vh, 1rem) !important;
    padding: 8px 12px !important;
    margin-top: 4px !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
}

/* =============================================================
 * DIFERENCIACIÓN VISUAL TOTAL DEL HORNO EN ALARMA CRÍTICA
 * Destaca de forma rotunda el horno que alcanza el punto de alarma
 * frente a los otros hornos que permanecen en estado normal
 * ============================================================= */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active {
    background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%) !important;
    border: 3px solid #ef4444 !important;
    border-left: 10px solid #ef4444 !important;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.95), 0 0 60px rgba(220, 38, 38, 0.5), inset 0 0 25px rgba(239, 68, 68, 0.35) !important;
    animation: hornoFullscreenAlarmFlash 0.7s infinite alternate ease-in-out !important;
    z-index: 25 !important;
    position: relative !important;
}

@keyframes hornoFullscreenAlarmFlash {
    0% {
        border-color: #ef4444;
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.75), inset 0 0 15px rgba(239, 68, 68, 0.25);
        transform: scale(1);
    }
    100% {
        border-color: #fca5a5;
        box-shadow: 0 0 55px rgba(239, 68, 68, 1), 0 0 80px rgba(220, 38, 38, 0.8), inset 0 0 35px rgba(239, 68, 68, 0.5);
        transform: scale(1.02);
    }
}

/* Título del Horno en Alarma */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active .baking-card-title h4 {
    color: #fef2f2 !important;
    text-shadow: 0 0 15px rgba(239, 68, 68, 1), 0 0 30px rgba(220, 38, 38, 0.9) !important;
    animation: textAlarmFlash 0.7s infinite alternate ease-in-out !important;
}

@keyframes textAlarmFlash {
    0% { color: #fef2f2; }
    100% { color: #fecaca; }
}

/* Indicador de Alarma Alcanzada en la Cabecera de la Tarjeta */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active .horno-alarm-badge-hit,
.baking-card.horno-alarm-active .horno-alarm-badge-hit {
    font-size: clamp(0.78rem, 1.3vw, 1rem) !important;
    padding: 4px 10px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 2px solid #fecaca !important;
    border-radius: 8px !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.9) !important;
    animation: badgeAlarmBounce 0.6s infinite alternate ease-in-out !important;
}

@keyframes badgeAlarmBounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); background: #dc2626; }
}

/* Panel de Temperatura del Horno en Alarma */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active .horno-temp-panel {
    background: rgba(69, 10, 10, 0.95) !important;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(239, 68, 68, 0.3) !important;
}

/* Valor de Temperatura en Alarma */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active .horno-temp-main-val {
    color: #fee2e2 !important;
    text-shadow: 0 0 25px rgba(239, 68, 68, 1), 0 0 45px rgba(220, 38, 38, 0.9) !important;
    animation: pulse-temp-alarm 0.5s infinite alternate ease-in-out !important;
}

/* Bloque de Lote/Masa/Carro cuando el horno entra en Alarma */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active .baking-batch-highlight {
    background: rgba(69, 10, 10, 0.85) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
}

/* Botón de Finalizar en Alarma */
body.modo-horneando-fullscreen .baking-card.horno-alarm-active .btn-finalize-bake,
.baking-card.horno-alarm-active .btn-finalize-bake {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    border: 2px solid #fecaca !important;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.85) !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px !important;
    animation: btnAlarmFlash 0.7s infinite alternate ease-in-out !important;
}

@keyframes btnAlarmFlash {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(239, 68, 68, 0.7); }
    100% { transform: scale(1.02); box-shadow: 0 0 30px rgba(239, 68, 68, 1); }
}

/* Modal Prompt Elevado para Asignación sobre otros Modales */
.modal-prompt-elevated {
    z-index: 10050 !important;
}

.modal-prompt-elevated.is-open {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
}

.modal-prompt-elevated.is-open .modal-card {
    transform: translateY(0) !important;
}




