/* ========================================
   ESTILOS PARA PANTALLAS DE ARQUEO DE CAJA
   ======================================== */

/* Pantalla de Apertura de Caja */
#apertura-caja-screen,
#cierre-caja-screen {
    overflow-y: auto;
    padding: 1rem;
}

.apertura-container,
.cierre-container {
    max-width: 500px;
    margin: 0.5rem auto;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.apertura-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.cierre-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.apertura-header h1,
.cierre-header h1 {
    color: #1e40af;
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.apertura-header .subtitle,
.cierre-header .subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.monto-display {
    text-align: center;
    margin-bottom: 0.75rem;
}

.monto-display label {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.monto-input-large {
    font-size: 2rem;
    font-weight: bold;
    color: #1e40af;
    padding: 0.5rem;
    background: #f3f4f6;
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e5e7eb;
}

/* Teclado Numérico de Apertura/Cierre - overlay centrado */
.apertura-numpad,
.cierre-numpad {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 280px;
}

.apertura-numpad.active,
.cierre-numpad.active {
    display: grid;
}

/* Backdrop overlay cuando el numpad está activo */
.numpad-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.numpad-backdrop.active {
    display: block;
}

.apertura-key,
.cierre-key {
    padding: 0.8rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Hacer el monto clickeable para abrir numpad */
.monto-input-large {
    cursor: pointer;
}
.monto-input-large:hover {
    border-color: #2563eb;
}

.apertura-key:hover,
.cierre-key:hover {
    background: #f3f4f6;
    border-color: #2563eb;
}

.apertura-key:active,
.cierre-key:active {
    transform: scale(0.95);
    background: #e5e7eb;
}

.apertura-clear,
.cierre-clear {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.apertura-clear:hover,
.cierre-clear:hover {
    background: #fca5a5;
    border-color: #dc2626;
}

.apertura-decimal,
.cierre-decimal {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.apertura-observaciones,
.cierre-observaciones {
    margin-bottom: 1rem;
}

.apertura-observaciones label,
.cierre-observaciones label {
    display: block;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Pantalla de Cierre de Caja */
.cierre-resumen {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.cierre-resumen h3 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 1rem;
}

.resumen-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.resumen-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resumen-item span {
    font-size: 0.85rem;
    color: #6b7280;
}

.resumen-item strong {
    font-size: 1.1rem;
    color: #111827;
}

.resumen-item.highlight {
    grid-column: 1 / -1;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    text-align: center;
}

.resumen-item.highlight strong {
    font-size: 1.5rem;
    color: #059669;
}

.cierre-conteo {
    margin-bottom: 1.5rem;
}

.cierre-conteo h3 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 1rem;
}

.conteo-info {
    background: #fffbeb;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border: 1px solid #fcd34d;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item span {
    font-size: 0.9rem;
    color: #78350f;
}

.info-item strong {
    font-size: 1.2rem;
    color: #92400e;
}

.cierre-conteo label {
    display: block;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.diferencia-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diferencia-box.positiva {
    background: #d1fae5;
    border: 2px solid #10b981;
}

.diferencia-box.negativa {
    background: #fee2e2;
    border: 2px solid #ef4444;
}

.diferencia-box.exacta {
    background: #dbeafe;
    border: 2px solid #3b82f6;
}

.diferencia-box span {
    font-size: 1rem;
    font-weight: 500;
}

.diferencia-box strong {
    font-size: 1.5rem;
}

.diferencia-box.positiva strong {
    color: #059669;
}

.diferencia-box.negativa strong {
    color: #dc2626;
}

.diferencia-box.exacta strong {
    color: #2563eb;
}

.cierre-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    #apertura-caja-screen,
    #cierre-caja-screen {
        padding: 0.5rem;
    }

    .apertura-container,
    .cierre-container {
        padding: 1rem;
        max-width: 100%;
        margin: 1rem auto;
    }

    .apertura-header h1,
    .cierre-header h1 {
        font-size: 1.5rem;
    }

    .monto-input-large {
        font-size: 2rem;
        min-height: 60px;
    }

    .apertura-key,
    .cierre-key {
        padding: 1rem;
        font-size: 1.2rem;
    }

    .resumen-grid {
        grid-template-columns: 1fr;
    }

    .cierre-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #apertura-caja-screen,
    #cierre-caja-screen {
        padding: 0.25rem;
    }

    .apertura-container,
    .cierre-container {
        margin: 0.5rem auto;
        padding: 0.75rem;
    }

    .apertura-header,
    .cierre-header {
        margin-bottom: 1rem;
    }

    .apertura-header h1,
    .cierre-header h1 {
        font-size: 1.25rem;
    }

    .monto-display {
        margin-bottom: 1rem;
    }

    .monto-input-large {
        font-size: 1.75rem;
        padding: 0.75rem;
        min-height: 50px;
    }

    .apertura-numpad,
    .cierre-numpad {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .apertura-key,
    .cierre-key {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .apertura-observaciones,
    .cierre-observaciones {
        margin-bottom: 1rem;
    }
}
