/* =====================================================================
   FacturaPRO Venezuela — Hoja de estilos complementaria a Tailwind
   ===================================================================== */

/* Reset y base */
[x-cloak] { display: none !important; }

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Sidebar scroll */
aside nav::-webkit-scrollbar-track { background: transparent; }
aside nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* Animaciones */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.4s ease-out; }
.animate-slide-in-left { animation: slideInLeft 0.4s ease-out; }

/* Cards con elevación sutil */
.card-hover { transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04); }

/* Tablas Modernas y Compactas */
.table-facturapro {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem; /* 13px */
}
.table-facturapro thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    font-size: 0.6875rem; /* 11px */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}
.table-facturapro tbody td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
.table-facturapro tbody tr {
    transition: background-color 0.15s ease;
}
.table-facturapro tbody tr:hover { 
    background: #f8fafc; 
}
.table-facturapro tbody tr:last-child td {
    border-bottom: none;
}

/* Badges de estado modernos */
.badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 0.35rem; 
    padding: 0.15rem 0.55rem; 
    border-radius: 9999px; 
    font-size: 0.6875rem; /* 11px */
    font-weight: 600; 
    line-height: 1.25;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.badge-neutral { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.badge-purple  { background: #faf5ff; color: #6b21a8; border-color: #e9d5ff; }

/* Inputs y Selects personalizados */
.input-facturapro,
.select-facturapro,
select.input-facturapro {
    width: 100%;
    padding: 0.48rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.8125rem; /* 13px */
    line-height: 1.25rem;
    color: #1e293b;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease-in-out;
}

/* Estilo dedicado y elegante para <select> con flecha SVG */
.select-facturapro,
select.input-facturapro,
select.select-facturapro {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.65rem center;
    background-repeat: no-repeat;
    background-size: 1.2rem 1.2rem;
    padding-right: 2.2rem !important;
    cursor: pointer;
}

.input-facturapro:hover,
.select-facturapro:hover,
select.input-facturapro:hover {
    border-color: #94a3b8;
}

.input-facturapro:focus,
.select-facturapro:focus,
select.input-facturapro:focus {
    outline: none;
    border-color: #1878b5;
    box-shadow: 0 0 0 3px rgba(24, 120, 181, 0.15);
}

.select-facturapro:focus,
select.input-facturapro:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%231878b5' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

.input-facturapro::placeholder {
    color: #94a3b8;
    font-size: 0.8125rem;
}

.input-facturapro.error,
.select-facturapro.error,
select.input-facturapro.error { 
    border-color: #ef4444; 
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.label-facturapro {
    display: block;
    font-size: 0.75rem; /* 12px */
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}

/* Botones base refinados */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.375rem; 
    padding: 0.45rem 0.875rem; 
    border-radius: 0.5rem; 
    font-size: 0.8125rem; /* 13px */
    font-weight: 600; 
    line-height: 1.25rem;
    transition: all 0.15s ease-in-out; 
    cursor: pointer; 
    border: 1px solid transparent; 
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn:active {
    transform: scale(0.98);
}
.btn-primary { 
    background: #1878b5; 
    color: #ffffff; 
    border-color: #166ba1;
}
.btn-primary:hover { 
    background: #146294; 
    box-shadow: 0 4px 6px -1px rgba(24, 120, 181, 0.25);
}
.btn-secondary { 
    background: #f1f5f9; 
    color: #334155; 
    border-color: #e2e8f0;
}
.btn-secondary:hover { 
    background: #e2e8f0; 
    color: #0f172a;
}
.btn-danger { 
    background: #ef4444; 
    color: #ffffff; 
    border-color: #dc2626;
}
.btn-danger:hover { 
    background: #dc2626; 
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.25);
}
.btn-success { 
    background: #10b981; 
    color: #ffffff; 
    border-color: #059669;
}
.btn-success:hover { 
    background: #059669; 
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25);
}
.btn-outline { 
    background: #ffffff; 
    border-color: #cbd5e1; 
    color: #475569; 
}
.btn-outline:hover { 
    background: #f8fafc; 
    border-color: #94a3b8; 
    color: #1e293b;
}

/* Botones de Acción en Tablas (Consistentes y Ultra Modernos para todo el sistema) */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem; /* ~29px */
    height: 1.85rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.btn-action:hover {
    transform: translateY(-1.5px) scale(1.04);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}
.btn-action:active {
    transform: scale(0.94);
}
.btn-action-view {
    background-color: #f0f9ff;
    border-color: #bae6fd;
    color: #0284c7;
}
.btn-action-view:hover {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}
.btn-action-edit {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}
.btn-action-edit:hover {
    background-color: #d97706;
    border-color: #d97706;
    color: #ffffff;
}
.btn-action-delete {
    background-color: #fff1f2;
    border-color: #fecdd3;
    color: #e11d48;
}
.btn-action-delete:hover {
    background-color: #e11d48;
    border-color: #e11d48;
    color: #ffffff;
}
.btn-action-print {
    background-color: #f5f3ff;
    border-color: #ddd6fe;
    color: #7c3aed;
}
.btn-action-print:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
}

/* Stepper del wizard */
.stepper { display: flex; align-items: center; width: 100%; }
.stepper-step { display: flex; align-items: center; flex: 1; position: relative; }
.stepper-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.5rem;
}
.stepper-step.active:not(:last-child)::after { background: #1878b5; }
.stepper-step.completed:not(:last-child)::after { background: #22c55e; }
.stepper-circle {
    width: 2.25rem; height: 2.25rem; border-radius: 9999px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; font-weight: 700;
    background: #e2e8f0; color: #64748b; flex-shrink: 0;
    transition: all 0.2s;
}
.stepper-step.active .stepper-circle { background: #1878b5; color: #fff; }
.stepper-step.completed .stepper-circle { background: #22c55e; color: #fff; }

/* Landing page */
.hero-gradient {
    background: linear-gradient(135deg, #143850 0%, #1878b5 50%, #1a96dd 100%);
}
.feature-card { transition: transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(20,56,80,0.12); }

/* Print styles */
@media print {
    .no-print { display: none !important; }
    aside, header { display: none !important; }
    main { padding: 0 !important; }
}

/* Empty state Moderno y Refinado */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.25rem 1.5rem;
    color: #64748b;
}
.empty-state > i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background-color: #f1f5f9;
    color: #94a3b8;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}
.empty-state p {
    font-size: 0.8125rem; /* 13px */
    font-weight: 500;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}
.empty-state .btn,
.empty-state a.btn {
    margin-top: 0.75rem !important;
    font-size: 0.75rem !important; /* 12px */
    padding: 0.4rem 0.85rem !important;
    border-radius: 0.5rem;
    font-weight: 600;
}
.empty-state .btn i,
.empty-state a.btn i {
    font-size: 0.75rem !important;
    margin: 0 0.35rem 0 0 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    color: inherit !important;
}

/* Loading spinner */
.spinner {
    width: 1.25rem; height: 1.25rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
