/* Estilos principales del sistema ERP */

/* General */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding-top: 70px;
}

/* Tablas */
.table {
    background-color: white;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table-sm td, .table-sm th {
    padding: 0.5rem;
}

/* Tarjetas */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #007bff;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
}

/* Botones */
.btn {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Formularios */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required::after {
    content: " *";
    color: #dc3545;
}

/* Alertas */
.alert {
    border: none;
    border-radius: 0.375rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge-pill {
    border-radius: 50rem;
}

/* Navegación */
.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    background-color: transparent;
}

/* Progress bars */
.progress {
    height: 0.75rem;
    border-radius: 0.375rem;
}

.progress-bar {
    border-radius: 0.375rem;
}

/* Modal */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: #007bff;
    color: white;
}

/* Paginación */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Tooltips */
.tooltip {
    font-size: 0.875rem;
}

/* List group */
.list-group-item {
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.list-group-item-action:hover {
    background-color: #f8f9fa;
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.text-small {
    font-size: 0.875rem;
}

.text-tiny {
    font-size: 0.75rem;
}

.font-weight-bold {
    font-weight: 600 !important;
}

.border-dashed {
    border-style: dashed !important;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-down {
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos específicos para el sistema */

/* Logo */
.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: #007bff;
}

.logo-small {
    font-weight: 700;
    font-size: 1rem;
}

/* Stats cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-change {
    font-size: 0.75rem;
}

.stat-card .stat-change.positive {
    color: #28a745;
}

.stat-card .stat-change.negative {
    color: #dc3545;
}

/* Product card */
.product-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-card .product-image {
    height: 150px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #dee2e6;
}

.product-card .product-code {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Sale item */
.sale-item {
    border-left: 3px solid #007bff;
    padding-left: 1rem;
}

.sale-item.anulada {
    border-left-color: #dc3545;
    opacity: 0.7;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        background-color: white;
    }
    
    .card {
        border: none;
        box-shadow: none;
        margin-bottom: 0;
    }
    
    .table {
        page-break-inside: avoid;
    }
}

/* Loading spinner */
.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 3rem;
    height: 3rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Search box */
.search-box {
    position: relative;
}

.search-box input {
    padding-right: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-active {
    background-color: #28a745;
}

.status-inactive {
    background-color: #dc3545;
}

.status-pending {
    background-color: #ffc107;
}

/* Media queries */
@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .card-header {
        padding: 0.5rem 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 2rem;
    }
}