/**
 * panel.css — complementos al stack Tailwind CDN
 * No reemplaza clases Tailwind, solo añade utilidades que el CDN no procesa.
 */

/* Reset */
* { box-sizing: border-box; }

/* Safe area iOS notch */
.safe-area {
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}
.pb-safe {
    padding-bottom: calc(env(safe-area-inset-bottom, 0) + 1rem);
}
.pt-safe {
    padding-top: env(safe-area-inset-top, 0);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn .35s ease-out; }

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-slideUp { animation: slideUp .35s ease-out; }

@keyframes slideUpFromBottom {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ─── IMPRESIÓN (Descargar PDF) ─── */
@media print {
    body * { visibility: hidden !important; }
    #facturaPrintable, #facturaPrintable *,
    #contratoBox, #contratoBox * { visibility: visible !important; }
    #facturaPrintable, #contratoBox {
        position: absolute !important;
        left: 0 !important; top: 0 !important;
        width: 100% !important; max-width: 100% !important;
        background: white !important; color: black !important;
        border-radius: 0 !important; box-shadow: none !important;
        padding: 10mm !important;
    }
    .no-print, header, nav, #splash, #updateBanner,
    #offlineBanner, #installPromptCard,
    #swUpdatePrompt, #swUpdateOverlay {
        display: none !important; visibility: hidden !important;
    }
    html, body { background: white !important; color: black !important; }
    @page { margin: 1cm; size: auto; }
}

@keyframes slideDownFromTop {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scalePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}
.animate-scalePulse { animation: scalePulse 2s ease-in-out infinite; }

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 0.5rem;
}

/* Scrollbar oculta manteniendo scroll */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Bottom nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgb(55, 65, 81);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 56px;
    color: rgb(156, 163, 175);
    font-size: 10px;
    transition: color .15s;
    cursor: pointer;
    user-select: none;
}
.nav-item:active { transform: scale(0.95); }
.nav-item.active i { color: rgb(192, 132, 252); }
.nav-item.active span { color: rgb(192, 132, 252); }

/* Pull-to-refresh placeholder (Sprint 1) */
.ptr-visual {
    height: 0;
    overflow: hidden;
    transition: height .2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(156, 163, 175);
    font-size: 12px;
}

/* Focus ring consistente */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Input type=date dark fix */
input[type="date"] {
    color-scheme: dark;
}

/* Sombras extra */
.shadow-panel {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3), 0 4px 10px -2px rgba(0,0,0,0.15);
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-top-color: rgb(139, 92, 246);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Prevenir selección en botones */
button { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }

/* Iframe embebido (report) */
.embed-frame {
    width: 100%;
    min-height: 70vh;
    border: 0;
    border-radius: 12px;
    background: #111827;
}
