/* Variables globales */
:root {
    --primary-blue: #3b82f6;
    --accent-dark: #2563eb;
    --text-gray: #4b5563;
    --bg-dark: #f0f2f5;
    --bg-darker: #ffffff;
    --text-light: #1a1b1e;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --danger-red: #ef4444;
}

/* Estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    min-height: 100vh;
    background-color: var(--bg-dark);
    overflow-x: hidden;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-darker);
    height: 60px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: sticky;
    top: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo {
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.2rem;
}

.search-bar {
    flex: 1;
    margin: 0 2rem;
    max-width: 400px;
}

.search-bar input {
    padding: 0.8rem;
    border: none;
    border-radius: 20px;
    width: 100%;
    background: var(--bg-dark);
    color: var(--text-light);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Filtros */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-darker);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-gray);
}

.filter-group select {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    color: var(--text-light);
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-refresh,
.btn-export,
.btn-consulta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-refresh {
    background-color: var(--primary-blue);
    color: white;
}

.btn-refresh:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-export {
    background-color: var(--success-green);
    color: white;
}

.btn-export:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-consulta {
    background-color: #8b5cf6;
    color: white;
}

.btn-consulta:hover {
    background-color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Contenedor principal */
.app-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    padding-bottom: 70px;
}

/* Estadísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.stat-info p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Lista de clientes */
.content-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.clientes-list {
    padding: 1rem;
}

.cliente-card {
    background-color: var(--bg-dark);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.cliente-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cliente-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cliente-header:hover {
    background: linear-gradient(135deg, var(--accent-dark), #1e40af);
}

.cliente-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.cliente-icon {
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.cliente-details h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.cliente-details p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.cliente-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-weight: 600;
}

.btn-generate-word {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-generate-word:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-generate-word i {
    font-size: 1rem;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Lista de artículos */
.articulos-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
}

.articulos-list.expanded {
    max-height: 800px;
    overflow-y: auto;
    overflow-x: auto;
    transition: max-height 0.5s ease-in;
}

/* Buscador de artículos por cliente */
.cliente-search-bar {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: white;
    border-bottom: 2px solid var(--bg-dark);
    gap: 0.8rem;
}

.cliente-search-bar i {
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.cliente-search-input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.cliente-search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cliente-search-input::placeholder {
    color: #9ca3af;
}

/* Scrollbar para la lista de artículos */
.articulos-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.articulos-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.articulos-list::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.articulos-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

.articulos-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.articulos-table thead {
    background-color: var(--bg-dark);
}

.articulos-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-gray);
    border-bottom: 2px solid #e5e7eb;
}

.articulos-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-light);
}

.articulos-table tbody tr {
    transition: background-color 0.2s ease;
}

.articulos-table tbody tr:hover {
    background-color: var(--bg-dark);
}

.precio-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--success-green);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.tipo-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background-color: #e5e7eb;
    color: var(--text-gray);
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes highlightNew {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    }
}

.loading-overlay p {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* Hamburger menu */
.hamburger-menu {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 1000;
}

.hamburger-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-dark));
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.hamburger-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.dropdown-menu {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    overflow: hidden;
}

.hamburger-menu:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}

.dropdown-item:hover {
    background-color: var(--bg-dark);
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

/* Navigation bar */
.navigation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 5px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-item {
    color: var(--text-gray);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-blue);
}

.nav-item i {
    font-size: 1.5em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    max-width: 700px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

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

.close {
    color: var(--text-gray);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-light);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-gray);
}

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

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
}

/* ============================================================================ */
/* MODALES PERSONALIZADOS */
/* ============================================================================ */

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.custom-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

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

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.custom-modal-header {
    padding: 2rem;
    text-align: center;
    color: white;
}

.custom-modal-header i {
    font-size: 3.5rem;
}

.custom-modal-body {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
}

.custom-modal-body p {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.6;
}

.custom-modal-footer {
    padding: 1rem 2rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.custom-modal-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.custom-modal-btn {
    background-color: var(--primary-blue);
    color: white;
}

.custom-modal-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.custom-modal-btn-secondary {
    background-color: #e5e7eb;
    color: var(--text-gray);
}

.custom-modal-btn-secondary:hover {
    background-color: #d1d5db;
}

/* Toast notifications */
.sync-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sync-toast.success {
    background-color: #10b981;
    color: white;
}

.sync-toast.error {
    background-color: #ef4444;
    color: white;
}

.sync-toast.info {
    background-color: #3b82f6;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem;
    }

    .search-bar {
        order: 3;
        margin: 1rem 0 0 0;
        max-width: 100%;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
        justify-content: space-between;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .articulos-list.expanded {
        max-height: 400px;
    }

    .articulos-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .articulos-table thead,
    .articulos-table tbody,
    .articulos-table tr,
    .articulos-table th,
    .articulos-table td {
        display: block;
    }

    .articulos-table thead {
        display: none;
    }

    .articulos-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
        background: white;
        white-space: normal;
    }

    .articulos-table td {
        text-align: right;
        padding: 0.5rem 0;
        border: none;
        position: relative;
        padding-left: 50%;
        min-height: 30px;
    }

    .articulos-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
        color: var(--text-gray);
    }

    .cliente-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hamburger-menu {
        bottom: 60px;
    }

    .app-container {
        padding: 1rem;
    }

    .cliente-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .articulos-list.expanded {
        max-height: 350px;
    }

    .articulos-table td {
        font-size: 0.8rem;
        padding: 0.4rem 0;
        padding-left: 45%;
    }

    .articulos-table td::before {
        font-size: 0.75rem;
    }

    .precio-badge,
    .precio-base,
    .tipo-badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Estilos para precios base */
.precio-base {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: #e5e7eb;
    color: var(--text-gray);
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Estilos para tipos de precio */
.tipo-especial {
    background-color: #3b82f6;
    color: white;
}

.tipo-descuento {
    background-color: #10b981;
    color: white;
}

.tipo-aumento {
    background-color: #f59e0b;
    color: white;
}

/* Estilos para diferencias */
.diferencia-negativa {
    color: #10b981;
    font-weight: 600;
    font-size: 1rem;
}

.diferencia-positiva {
    color: #f59e0b;
    font-weight: 600;
    font-size: 1rem;
}

/* Ajustar ancho de columnas en tabla */
.articulos-table th:nth-child(1),
.articulos-table td:nth-child(1) {
    width: 12%;
}

.articulos-table th:nth-child(2),
.articulos-table td:nth-child(2) {
    width: 30%;
}

.articulos-table th:nth-child(3),
.articulos-table td:nth-child(3),
.articulos-table th:nth-child(6),
.articulos-table td:nth-child(6) {
    width: 12%;
}

.articulos-table th:nth-child(4),
.articulos-table td:nth-child(4) {
    width: 15%;
}

.articulos-table th:nth-child(5),
.articulos-table td:nth-child(5) {
    width: 12%;
    text-align: center;
}

/* Contenedor de búsqueda con autocompletado */
.search-select-container {
    position: relative;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: -1px;
}

.search-result-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--bg-dark);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item.no-results {
    cursor: default;
    color: var(--text-gray);
    text-align: center;
    font-style: italic;
}

.search-result-item.no-results:hover {
    background-color: white;
}

.result-code {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.2rem;
}

.result-name {
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.result-detail {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.selected-item {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--primary-blue);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.selected-text {
    flex: 1;
    color: var(--text-light);
}

.selected-text strong {
    color: var(--primary-blue);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--danger-red);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-clear:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Estilos del formulario */
.precio-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group select:disabled,
.form-group input:disabled,
.form-group textarea:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-gray);
    font-size: 0.85rem;
}

.articulo-info {
    margin-top: 0.8rem;
    padding: 0.8rem;
    background-color: var(--bg-dark);
    border-radius: 8px;
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.articulo-info span {
    color: var(--text-gray);
}

.articulo-info strong {
    color: var(--text-light);
}

.form-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.form-preview h3 {
    margin-bottom: 0.8rem;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.form-preview p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.precio-final-preview {
    color: var(--primary-blue);
    font-size: 1.2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: #e5e7eb;
    color: var(--text-gray);
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

/* Botón flotante para añadir */
.btn-add-float {
    position: fixed;
    bottom: 130px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success-green), #059669);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999;
}

.btn-add-float:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Ajustar posición en móvil para evitar superposición */
@media (max-width: 768px) {
    .btn-add-float {
        bottom: 140px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .cliente-header {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .btn-generate-word {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .btn-generate-word span {
        font-size: 0.85rem;
    }

    .toggle-icon {
        order: 2;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions button {
        width: 100%;
        justify-content: center;
    }

    .articulo-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .actions-cell {
        display: flex;
        gap: 0.3rem;
        justify-content: center;
    }

    .btn-icon {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .search-results {
        max-height: 200px;
    }

    .result-code,
    .result-name {
        font-size: 0.9rem;
    }

    .result-detail {
        font-size: 0.75rem;
    }
    
    .hamburger-menu {
        bottom: 60px;
    }
}

@media (max-width: 480px) {
    .btn-add-float {
        bottom: 130px;
        right: 10px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Botones de acción en tabla */
.btn-icon {
    padding: 0.5rem 0.7rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 0.2rem;
    font-size: 0.9rem;
}

.btn-edit {
    background-color: var(--primary-blue);
    color: white;
}

.btn-edit:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-delete {
    background-color: var(--danger-red);
    color: white;
}

.btn-delete:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

/* Ajustar ancho de columna de acciones */
.articulos-table th:nth-child(7),
.articulos-table td:nth-child(7) {
    width: 100px;
    text-align: center;
}

.actions-cell {
    white-space: nowrap;
}

/* Modal más ancho para el formulario */
.modal-content {
    max-width: 800px;
}

/* Scrollbar personalizado para resultados de búsqueda */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

/* ============================================================================ */
/* ESTILOS PARA MODAL DE CONSULTA DE PRECIO MAYORISTA */
/* ============================================================================ */

.mayorista-search-container {
    margin: 1.5rem 0;
}

.mayorista-info-container {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease-in;
}

.mayorista-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: white;
}

.mayorista-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 1.5rem;
}

.mayorista-header h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.mayorista-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.mayorista-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.detail-row:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.detail-row.highlight {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1.2rem 1rem;
}

.detail-row.highlight:hover {
    background: rgba(255, 255, 255, 0.25);
}

.detail-label {
    font-weight: 500;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label i {
    font-size: 1.1rem;
}

.detail-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.detail-value.precio-mayorista {
    font-size: 1.5rem;
    color: #fbbf24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.detail-value.precio-unidad {
    font-size: 1.3rem;
    color: #34d399;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-text {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--text-gray);
}

.loading-text i {
    margin-right: 0.5rem;
    color: var(--primary-blue);
}

.error-message {
    text-align: center;
    padding: 2rem;
    background-color: #fee;
    border-radius: 12px;
    color: var(--danger-red);
    font-weight: 500;
}

.error-message i {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

/* Responsive para modal mayorista */
@media (max-width: 768px) {
    .mayorista-card {
        padding: 1.5rem;
    }

    .mayorista-header h3 {
        font-size: 1.5rem;
    }

    .mayorista-header p {
        font-size: 0.95rem;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .detail-value.precio-mayorista {
        font-size: 1.8rem;
    }

    .detail-value.precio-unidad {
        font-size: 1.5rem;
    }
}

.info-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.info-note i {
    color: #fbbf24;
    font-size: 1.1rem;
}

.info-note small {
    line-height: 1.4;
}