/* ══════════════════════════════════════════════════════════════════════
   TECLADO NUMÉRICO VIRTUAL - PANEL LATERAL
   ══════════════════════════════════════════════════════════════════════ */

/* Toggle button (cuando está cerrado) */
.numpad-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background: #80bd01;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(128, 189, 1, 0.3);
    transition: all .3s;
    z-index: 1000;
}

.numpad-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(128, 189, 1, 0.4);
}

.numpad-toggle.hidden {
    display: none;
}

/* Panel principal */
.numpad-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform .3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.numpad-panel.active {
    transform: translateY(0);
}

/* Header */
.numpad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.numpad-header span {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.numpad-close {
    background: transparent;
    border: none;
    font-size: 32px;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all .2s;
}

.numpad-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Display */
.numpad-display {
    padding: 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.numpad-display input {
    width: 100%;
    background: white;
    border: 2px solid #80bd01;
    border-radius: 8px;
    padding: 16px;
    font-size: 36px;
    font-weight: 600;
    text-align: right;
    color: #1f2937;
    font-family: 'Courier New', monospace;
}

.numpad-display input:focus {
    outline: none;
    border-color: #6da001;
}

/* Context info */
.numpad-context {
    padding: 12px 20px;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
    text-align: center;
}

.numpad-context small {
    color: #92400e;
    font-weight: 500;
    font-size: 13px;
}

/* Keypad */
.numpad-keys {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    flex: 1;
}

.numpad-keys button {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all .15s;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.numpad-keys button:hover {
    background: #80bd01;
    color: white;
    border-color: #80bd01;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(128, 189, 1, 0.2);
}

.numpad-keys button:active {
    transform: scale(0.95);
    box-shadow: none;
}

.numpad-keys button.key-special {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.numpad-keys button.key-special:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* Quick actions */
.numpad-quick {
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.numpad-quick button {
    background: #dbeafe;
    border: 2px solid #bfdbfe;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1e40af;
    cursor: pointer;
    transition: all .15s;
    height: 45px;
}

.numpad-quick button:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

.numpad-quick button:active {
    transform: scale(0.95);
}

/* Actions */
.numpad-actions {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
}

.numpad-actions button {
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: 2px solid transparent;
}

.btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.btn-cancel:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-confirm {
    background: #80bd01;
    color: white;
}

.btn-confirm:hover {
    background: #6da001;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(128, 189, 1, 0.3);
}

.btn-confirm:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .numpad-panel {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
    
    .numpad-keys button {
        height: 60px;
        font-size: 24px;
    }
    
    .numpad-display input {
        font-size: 32px;
    }
}

@media (min-width: 769px) {
    .numpad-panel {
        max-width: 500px;
    }
}

/* Overlay cuando está abierto */
.numpad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    z-index: 999;
}

.numpad-overlay.active {
    opacity: 1;
    visibility: visible;
}