/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #9cc0fa;
    --primary-dark: #2563eb;
    --text: #334155;
    --text-light: #64748b;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.05);
    --panel-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    background-color: #f8fafc;
    color: var(--text);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #1e293b;
    color: white;
    padding: 20px 0;
    height: 100vh;
    position: fixed;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
}

.nav-item:hover {
    background-color: #334155;
}

.nav-item.active {
    background-color: var(--primary);
    color: #1e293b;
    border-left: 4px solid #fff;
}

.nav-item span {
    margin-right: 10px;
    font-size: 16px;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 250px;
    margin-right: 10px;
    padding: 30px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 600;
}

.header p {
    color: var(--text-light);
}

/* Stats cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* Tables dashboard layout */
.tables-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
}

.table-container:hover {
    box-shadow: var(--shadow-hover);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h2 {
    font-size: 1.3rem;
    color: #1e293b;
    font-weight: 600;
}

.btn {
    padding: 10px 18px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
    font-size: 14px;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.export-btn {
    background-color: #10b981;
}

.export-btn:hover {
    background-color: #059669;
}

.search-input {
    padding: 5px 5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-right: 5px;
    width: 250px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    padding: 12px 15px;
    text-align: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: #475569;
}

table tr:hover {
    background-color: var(--bg-light);
}

.action-btn {
    padding: 6px 8px;
    margin: 0 3px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    background-color: #e5e8ec;
    color: var(--text-light);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.action-btn i {
    font-size: 12px;
}

.action-btn:hover {
    transform: scale(1.1);
}

.view-btn {
    background-color: #e5e8ec;
}

.view-btn:hover {
    background-color: var(--primary);
}

.edit-btn:hover {
    background-color: #fbd89d;
}

.delete-btn:hover {
    background-color: #f9b9b9;
}

/* Logos de clientes en tablas */
.client-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
}

.product-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
}

/* Supermarkets grid */
.supermarkets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.supermarket-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
}

.supermarket-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.supermarket-img {
    height: 160px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    overflow: hidden;
}

.supermarket-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.supermarket-card:hover .supermarket-img img {
    transform: scale(1.05);
}

.supermarket-info {
    padding: 20px;
}

.supermarket-info h3 {
    margin-bottom: 12px;
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 600;
}

.info-with-icon {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 14px;
}

.info-with-icon span {
    margin-right: 8px;
    font-size: 14px;
}

.supermarket-info p {
    margin-bottom: 5px;
    color: var(--text-light);
    font-size: 14px;
}

/* Acciones en tarjetas */
.card-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

.card-actions .action-btn {
    margin-right: 4;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.page-btn {
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.page-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.page-info {
    font-weight: 500;
    color: var(--text-light);
}

/* ===== ESTILOS MEJORADOS PARA PANELES MODALES ===== */

.slide-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: white;
    box-shadow: var(--panel-shadow);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.slide-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.panel-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text);
    transform: rotate(90deg);
}

.panel-content {
    padding: 30px;
    background-color: #ffffff;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

/* Mejoras para formularios */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background-color: #fafafa;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 10px;
    color: #9ca3af;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1.4rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.form-group label i {
    margin-right: 8px;
    color: #9ca3af;
    width: 18px;
    text-align: center;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #9cc0fa;
    box-shadow: 0 0 0 3px rgba(156, 192, 250, 0.2);
    transform: translateY(-1px);
}

/* Select múltiple mejorado */
.multi-select-container {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.multi-select-search {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.multi-select-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
}

.multi-select-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.multi-select-option:hover {
    background-color: #f3f4f6;
}

.multi-select-option input {
    margin-right: 10px;
    width: auto;
}

.multi-select-option.selected {
    background-color: #e0f2fe;
}

/* Previsualización de imágenes mejorada */
.image-preview {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background-color: #fafafa;
    transition: var(--transition);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview:hover {
    border-color: #9cc0fa;
    background-color: #f8fafc;
}

.image-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-preview .no-image {
    color: #9ca3af;
    font-size: 3rem;
}

/* Botones de formulario mejorados */
.form-actions {
    margin-top: 10px;
    margin-bottom: 30px;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-actions .btn-cancel {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.form-actions .btn-cancel:hover {
    background-color: #f1f5f9;
    color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-actions .btn-primary {
    background-color: #9cc0fa;
    color: white;
    border: none;
}

.form-actions .btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* Mejoras para los detalles */
.detail-content {
    padding: 25px 30px;
}

.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.detail-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title {
    flex: 1;
}

.detail-title h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.detail-badges {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: #10b981;
    color: white;
}

.status-badge.inactive {
    background-color: #64748b;
    color: white;
}

.info-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.detail-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background-color: #fafafa;
    border: 1px solid #f0f0f0;
}

.detail-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.detail-section h3 i {
    margin-right: 10px;
    color: #9ca3af;
}

.detail-list {
    list-style: none;
}

.detail-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-list li:last-child {
    border-bottom: none;
}

.detail-list li span:first-child {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
}

.detail-list li span:first-child i {
    margin-right: 10px;
    color: #9ca3af;
    width: 18px;
    text-align: center;
}

.detail-list li span:last-child {
    color: #6b7280;
    text-align: right;
}

.detail-additional {
    background-color: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.detail-additional h5 {
    margin-bottom: 10px;
    color: #475569;
}

.detail-additional p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.detail-date {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .tables-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .slide-panel {
        width: 400px;
        right: -400px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    .stats-container {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .search-input {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .btn {
        width: 100%;
        margin-top: 10px;
    }
    .supermarkets-grid {
        grid-template-columns: 1fr;
    }
    .form-actions {
        flex-direction: column;
    }
    .form-actions button {
        width: 100%;
    }
    .slide-panel {
        width: 100%;
        right: -100%;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.client-list {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.info-with-icon {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 14px;
}

.info-with-icon span:first-child {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* Estilos para notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    max-width: 400px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification:not(.show) {
    transform: translateX(100%);
    opacity: 0;
}

.notification.success {
    background-color: #10B981;
}

.notification.error {
    background-color: #EF4444;
}

.notification.info {
    background-color: #3B82F6;
}

.number {
    transition: all 0.3s ease;
    font-variant-numeric: tabular-nums; /* Para que los números no "salten" al cambiar */
}

.number.animating {
    transform: scale(1.05);
    color: var(--primary-dark);
}

/* Loading states mejorados */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading, .no-data, .error {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: var(--text-light);
}

.error {
    color: #ef4444;
}

/* Estilos para el módulo de Toma de Precios */
.badge {
    background-color: #e2e8f0;
    color: #475569;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-card small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 0.8rem;
}

/* Mejorar las tablas del módulo de precios */
#recent-stores-table td,
#updated-clients-table td {
    vertical-align: middle;
}

#recent-stores-table strong,
#updated-clients-table strong {
    color: #1e293b;
}

#recent-stores-table small,
#updated-clients-table small {
    color: #64748b;
    font-size: 0.85rem;
}

/* Estilos para el botón de ver fotos en supermercados */
.btn-view-photos {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.btn-view-photos:hover {
    background: white;
    color: #9cc0fa;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.supermarket-img {
    position: relative;
}

/* Estilos para el grid de fotos en el modal */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.photo-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.photo-group {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.photo-group h3 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .btn-view-photos {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }
}

/* Estilos mejorados para el modal de fotos */
.btn-delete-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 20;
}

.btn-delete-photo:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.photo-item:hover .btn-delete-photo {
    opacity: 1;
}

.btn-delete-photo:disabled {
    background: rgba(156, 163, 175, 0.7);
    cursor: not-allowed;
    transform: none;
}

/* Efectos de eliminación */
.photo-item.deleting {
    opacity: 0.5;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* Estados vacíos */
.no-photos {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.no-photos i {
    margin-bottom: 15px;
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .btn-delete-photo {
        width: 28px;
        height: 28px;
        font-size: 14px;
        opacity: 0.8; /* Siempre visible en móvil */
    }
    
    .photo-item:hover .btn-delete-photo {
        opacity: 0.8;
    }
}

/* Animaciones para feedback visual */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.photo-item.fade-out {
    animation: fadeOut 0.3s ease forwards;
}
/* Estilos para la información de fotos en las tarjetas */
.photos-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.photos-info.today {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

.photos-info.recent {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.photos-info.older {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.photos-info.no-photos {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.photos-info i {
    font-size: 12px;
}

.photos-text {
    font-weight: 500;
}

.last-update {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: auto;
}

/* Contador de fotos en el botón */
.btn-view-photos .photo-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Selector de ordenamiento */
.sort-select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-right: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Indicadores visuales para supermercados con fotos recientes */
.supermarket-card:has(.photos-info.today) {
    border-left: 4px solid #3b82f6;
}

.supermarket-card:has(.photos-info.recent) {
    border-left: 4px solid #10b981;
}

.supermarket-card:has(.photos-info.older) {
    border-left: 4px solid #f59e0b;
}

.supermarket-card:has(.photos-info.no-photos) {
    border-left: 4px solid #94a3b8;
}

/* Mejoras responsive */
@media (max-width: 768px) {
    .sort-select {
        width: 100%;
        margin: 10px 0;
    }
    
    .photos-info {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .last-update {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}
/* Estilos para las descripciones en el modal de fotos */
.description-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(59, 130, 246, 0.9);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
}

.description-indicator:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.1);
}

.description-tooltip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 6px 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 5;
}

.photo-item:hover .description-tooltip {
    opacity: 1;
}

/* Mejora para el modal de imagen ampliada */
.modal-image-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .description-tooltip {
        font-size: 9px;
        padding: 3px;
    }
    
    .description-indicator {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
}

/* Estilos para álbumes en el modal de fotos */
.album-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.album-group:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.album-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.album-count {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.album-description {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    margin-top: 10px;
    font-style: italic;
    color: #475569;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Responsive para álbumes */
@media (max-width: 768px) {
    .album-group {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .album-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .album-count {
        align-self: flex-start;
    }
}
/* Estilos para el botón de editar comentario */
.btn-edit-comment {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-edit-comment:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Estilos para el textarea en el modal de edición */
#album-comment-edit:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Estilos para los botones del modal */
.btn-cancel:hover {
    background: #f1f5f9;
    color: #475569;
}

.btn-save-comment:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-save-comment:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* --- NUEVOS ESTILOS PARA LA LISTA DE PRECIOS --- */

/* Miniaturas de productos */
.product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Badge de precios */
.price-badge {
    background: #f0f9ff;
    color: #0369a1;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #bae6fd;
}

/* Estados de la tabla */
#prices-table tr:hover {
    background-color: #f8fafc;
}

#prices-table .loading,
#prices-table .no-data,
#prices-table .error {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #64748b;
}

/* Responsive para la tabla de precios */
@media (max-width: 768px) {
    #prices-table {
        font-size: 0.85rem;
    }
    
    .product-thumb {
        width: 30px;
        height: 30px;
    }
    
    .price-badge {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
}

/* Mejoras visuales para los detalles */
.detail-section {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
}

.text-muted {
    color: #6b7280 !important;
}

/* --- NUEVOS ESTILOS PARA LA VISTA DE PRECIOS POR FECHA --- */

.date-section {
    transition: all 0.3s ease;
}

.date-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.date-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Mejoras para la tabla interna */
.date-content table {
    font-size: 0.9rem;
}

.date-content th {
    font-weight: 600;
    color: #374151;
    background: #f8fafc;
}

.date-content tr:hover {
    background-color: #fafafa;
}

/* Badge mejorado */
.badge {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive para el modal grande */
@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        padding: 15px !important;
    }
    
    .date-content table {
        font-size: 0.8rem;
    }
    
    .date-content th,
    .date-content td {
        padding: 8px !important;
    }
}

/* Scroll suave para el modal */
.modal-content {
    scroll-behavior: smooth;
}
/* --- NUEVOS ESTILOS PARA LOS FILTROS Y EDICIÓN --- */

/* Filtros */
.filter-container {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

/* Campos de edición */
.edit-input {
    width: 100px;
    padding: 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.edit-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.edit-textarea {
    width: 150px;
    padding: 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    resize: vertical;
    height: 40px;
    font-size: 0.9rem;
}

.edit-select {
    padding: 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Estados de las filas editadas */
tr.modified {
    background-color: #fff7ed !important;
}

tr.saved {
    background-color: #f0f9f4 !important;
}

/* Botones de acción en tabla */
.action-btn.save-btn {
    background-color: #10b981;
    color: white;
}

.action-btn.save-btn:hover {
    background-color: #059669;
}

/* Responsive para filtros */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-container {
        padding: 10px;
    }
    
    .edit-input, .edit-textarea, .edit-select {
        width: 100%;
    }
}

/* ===== MEJORAS RESPONSIVAS PARA MÓVILES ===== */

@media (max-width: 768px) {
    /* Sidebar móvil */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 10px 0;
    }
    
    .sidebar-header {
        padding: 0 15px 10px;
        text-align: center;
    }
    
    .nav-items-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        padding: 0 10px;
    }
    
    .nav-item {
        flex: 1;
        min-width: 120px;
        padding: 10px 5px;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        margin: 2px;
        border-radius: 6px;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid #fff;
    }
    
    .nav-item span {
        margin-right: 5px;
        font-size: 14px;
    }
    
    /* Main content móvil */
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    /* Controles de búsqueda y filtros móvil */
    .header > div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input, 
    .sort-select,
    .filter-select {
        width: 100% !important;
        margin: 5px 0 !important;
    }
    
    /* Botones en header móvil */
    .header-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        margin: 2px 0;
        text-align: center;
    }
    
    /* Stats cards móvil */
    .stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .number {
        font-size: 2rem;
    }
    
    /* Tablas móviles */
    .table-container {
        padding: 15px;
        overflow-x: auto;
    }
    
    table {
        min-width: 600px; /* Permite scroll horizontal en tablas grandes */
    }
    
    table th, 
    table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    /* Grid de supermercados móvil */
    .supermarkets-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .supermarket-card {
        margin-bottom: 10px;
    }
    
    .supermarket-info {
        padding: 15px;
    }
    
    /* Acciones en tarjetas móvil */
    .card-actions {
        justify-content: center;
        gap: 5px;
    }
    
    .action-btn {
        padding: 8px;
        margin: 0 2px;
    }
    
    /* Paneles móviles */
    .slide-panel {
        width: 100%;
        right: -100%;
    }
    
    .panel-header {
        padding: 20px;
    }
    
    .panel-content {
        padding: 20px;
    }
    
    /* Formularios móviles */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Paginación móvil */
    .pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .page-info {
        order: -1;
    }
    
    /* Módulo de precios - filtros móvil */
    .filter-container {
        padding: 10px;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Selectores múltiples desplegables */
    .multi-select-container {
        position: relative;
    }
    
    .multi-select-options {
        max-height: 150px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        z-index: 100;
        border: 1px solid #d1d5db;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        display: none;
    }
    
    .multi-select-container.expanded .multi-select-options {
        display: block;
    }
    
    .multi-select-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        background: white;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .multi-select-container {
        position: relative;
        height: auto !important;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .multi-select-options {
        display: block !important;
        position: static !important;
        max-height: 150px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        margin-top: 5px;
    }
    
    .multi-select-toggle {
        display: none !important;
    }
    
    .multi-select-search {
        display: block !important;
    }
    
    .multi-select-wrapper {
        display: block !important;
    }
    
    /* Asegurar que las opciones sean visibles */
    .multi-select-option {
        display: flex !important;
        padding: 10px 12px;
    }
    
    .multi-select-option:hover {
        background-color: #f3f4f6;
    }
}

/* Ocultar el toggle en todas las vistas */
.multi-select-toggle {
    display: none;
}

/* Estilos para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 20px;
    }
    
    .supermarkets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mejoras específicas para pantallas muy pequeñas */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .table-container {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-card .number {
        font-size: 1.8rem;
    }
    
    /* Botones más compactos */
    .btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Iconos más pequeños en acciones */
    .action-btn i {
        font-size: 11px;
    }
}

/* Clase helper para elementos que deben ocultarse en móvil */
.mobile-hidden {
    display: none;
}

@media (min-width: 769px) {
    .mobile-hidden {
        display: block;
    }
    
    .mobile-only {
        display: none;
    }
}

/* Selectores desplegables mejorados */
.multi-select-wrapper {
    position: relative;
}

.multi-select-toggle {
    display: none;
}

@media (max-width: 768px) {
    .multi-select-toggle {
        display: flex;
    }
    
    .multi-select-search {
        display: none;
    }
    
    .multi-select-container:not(.expanded) .multi-select-options {
        display: none;
    }
}

/* Mejoras para el módulo de precios en móvil */
.price-filters-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-group-mobile {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group-mobile label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}
/* ===== MEJORAS PARA LOS BADGES DE CADENAS EN DETALLES ===== */

.detail-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.info-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #bae6fd;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.info-badge:hover {
    background-color: #bae6fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(3, 105, 161, 0.2);
}

/* Contenedor específico para cadenas en detalles de producto */
.chains-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

/* Mejora para el listado de detalles */
.detail-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Cambiado de center a flex-start */
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.detail-list li:last-child {
    border-bottom: none;
}

.detail-list li span:first-child {
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: flex-start;
    min-width: 120px;
    flex-shrink: 0;
}

.detail-list li span:last-child {
    color: #6b7280;
    text-align: right;
    flex: 1;
    min-width: 200px;
}

/* Estilos específicos para el ítem de cadenas */
.detail-list li .chains-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
}

/* Responsive para badges */
@media (max-width: 768px) {
    .detail-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .detail-list li span:first-child {
        min-width: auto;
    }
    
    .detail-list li span:last-child {
        text-align: left;
        min-width: auto;
        width: 100%;
    }
    
    .detail-list li .chains-content {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }
    
    .info-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .detail-badges,
    .chains-container {
        gap: 6px;
    }
}

/* Estado cuando no hay cadenas */
.no-chains {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.9rem;
}

/* Loading States */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #64748b;
    font-size: 1.1rem;
}

.loading-state i {
    font-size: 1.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Lazy Loading */
.lazy-image {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card small {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 8px;
        min-height: 80px;
    }
    
    .stat-card .number {
        font-size: 1.5rem;
    }
    
    .stat-card h3 {
        font-size: 0.8rem;
    }
}
/* ===== SOLUCIÓN DEFINITIVA PARA FILTROS EN MÓVIL ===== */
@media (max-width: 768px) {
    /* OVERRIDE: Header en fila en lugar de columna */
    .header > div {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 8px !important;
        align-items: center;
    }
    
    /* OVERRIDE: Búsqueda compacta */
    .search-input {
        width: auto !important;
        flex: 1 1 150px !important;
        min-width: 120px;
        margin: 0 !important;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    /* OVERRIDE: Botones compactos */
    .btn {
        width: auto !important;
        flex: 0 1 auto !important;
        margin: 0 !important;
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Selectores compactos */
    .sort-select,
    .filter-select,
    #filter-client-supermarket {
        flex: 0 1 100px;
        padding: 8px;
        font-size: 0.8rem;
        margin: 0 !important;
    }
    
    /* Botón limpiar solo ícono */
    .btn-clear {
        flex: 0 0 36px;
        width: 36px;
        padding: 8px;
        min-width: auto;
    }
    
    .btn-clear i {
        margin: 0;
    }
    
    /* Específico para sección de supermercados */
    #supermarkets .header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    #supermarkets .search-input {
        flex: 1 1 140px;
    }
    
    #supermarkets .sort-select {
        flex: 0 1 90px;
    }
    
    #supermarkets #add-supermarket-btn {
        flex: 1 1 120px;
    }
    
    #supermarkets .export-btn {
        flex: 0 1 80px;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .header > div {
        gap: 4px !important;
    }
    
    .search-input {
        flex: 1 1 120px !important;
        min-width: 100px;
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .sort-select,
    .filter-select {
        flex: 0 1 80px;
        font-size: 0.75rem;
        padding: 6px;
    }
}
/* Estilos para imágenes de productos - FONDO BLANCO PARA PNG */
/* Fuerza el fondo blanco incluso en áreas transparentes */
.product-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
    background-color: white !important;
    /* Fuerza el renderizado */
    image-rendering: pixelated;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* Para Firefox */
@-moz-document url-prefix() {
    .product-image {
        background-color: white;
        opacity: 0.999; /* Truco para Firefox */
    }
}

/* Para imágenes lazy loading */
.lazy-image {
    background-color: white; /* Fondo blanco también durante carga */
    padding: 2px;
    border: 1px solid #e2e8f0;
}

/* En el panel de detalles también */
.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Cambiado de 'cover' a 'contain' para ver imagen completa */
    background-color: white;
    padding: 5px;
    border-radius: 8px;
}

/* Para la previsualización en formularios */
.image-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white; /* Fondo blanco aquí también */
    padding: 5px;
    object-fit: contain;
}
/* ===== ESTILOS MEJORADOS PARA LOGOS CLICKABLES ===== */

.client-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.client-logo:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(156, 192, 250, 0.3);
}

/* Placeholder para clientes sin logo */
.no-logo-placeholder {
    width: 30px;
    height: 30px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #94a3b8;
}

.no-logo-placeholder:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

/* Indicador visual de que es clickeable */
.logo-container {
    position: relative;
    display: inline-block;
}

.click-indicator {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo-container:hover .click-indicator {
    opacity: 1;
}
/* Estilos para la paginación de precios */
#stores-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

#stores-pagination .page-info {
    font-weight: 500;
    color: #475569;
    min-width: 200px;
    text-align: center;
}

.loading-cache {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

.loading-cache i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

#tomas-chart {
  width: 100% !important;
  max-height: 300px;
  min-height: 250px; /* 🔥 clave: altura mínima visible */
  display: block;
}


/* Estilos para el dashboard */
.stat-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.stat-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 12px;
}

.stat-info {
    flex: 1;
}

.stat-numbers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.stat-count {
    font-weight: bold;
    color: #333;
}

.stat-percent {
    color: #6c757d;
    font-size: 0.9em;
}

.location-stats .stat-card {
    margin-bottom: 0;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.price-stats table {
    font-size: 0.9em;
}

.price-stats .badge {
    font-size: 0.75em;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-numbers {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-percent {
        margin-top: 2px;
    }
}

/* Botón de exportación a Excel */
.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white;
    border: none;
    font-weight: 500;
}

.export-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Modal de exportación mejorado */
.modal-content {
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mejorar el filter-row */
.filter-row {
    align-items: end !important;
}

.filter-row .form-group {
    flex: 1;
    min-width: 150px;
}

/* Estilos para la comparativa multi-producto */
.tabs-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-btn:hover:not(.active) {
    color: #374151;
    background: #f8fafc;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.base-price-input {
    margin-bottom: 0;
}

.chain-analysis-card {
    background: white;
    transition: transform 0.2s ease;
}

.chain-analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Mejoras para selects múltiples */
select[multiple] {
    min-height: 120px;
}

select[multiple] option {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

select[multiple] option:hover {
    background: #3b82f6;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .form-group {
        flex: 1 0 100% !important;
    }
    
    .tabs-header {
        flex-direction: column;
    }
}
/* Agrega estos estilos al final de tu CSS */

/* Contenedor de filtros mejorado */
.filters-container {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 12px !important;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}

/* Botones de filtro mejorados */
.filter-btn {
    background: #3b82f6 !important;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}



/* Responsive para filtros */
@media (max-width: 1200px) {
    .filters-container {
        gap: 10px !important;
    }
    
    .filter-group {
        min-width: 130px;
    }
    
    .search-input {
        width: 130px !important;
    }
}

@media (max-width: 992px) {
    .filters-container {
        flex-wrap: wrap;
    }
    
    .filter-group {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 120px;
    }
    
    .filter-actions {
        flex: 1 1 100%;
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .filters-container {
        padding: 12px;
        gap: 8px !important;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 8px);
        min-width: 100px;
    }
    
    .search-input {
        width: 100% !important;
        font-size: 0.85rem;
    }
    
    .filter-actions {
        flex-wrap: wrap;
    }
    
    .filter-btn, .btn-cancel, .export-btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .filter-group {
        flex: 1 1 100%;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-btn, .btn-cancel, .export-btn {
        width: 100%;
    }
}

/* Estilos para el botón de logout */
.nav-item[style*="margin-top: auto"] {
    margin-top: auto !important;
    border-top: 1px solid #334155 !important;
    padding-top: 15px !important;
}

.nav-item[style*="margin-top: auto"]:hover {
    background-color: #dc2626 !important;
    color: white !important;
}