/* styles.css - Diseño Bancario Moderno */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF4338;
    --primary-dark: #D32F2F;
    --primary-light: #FF6B6B;
    --secondary: #FF5252;
    --accent: #ffd7d7;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1a1a2e;
    --dark-light: #2d2d44;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* ==================== TEMAS DE COLOR ==================== */
/* Tema Rubí (por defecto - ya definido en :root) */
[data-color-theme="rubi"] {
    --primary: #FF4338;
    --primary-dark: #D32F2F;
    --primary-light: #FF6B6B;
    --secondary: #FF5252;
    --accent: #ffd7d7;
}

/* Tema Zafiro (Azul) */
[data-color-theme="zafiro"] {
    --primary: #2196F3;
    --primary-dark: #1565C0;
    --primary-light: #64B5F6;
    --secondary: #42A5F5;
    --accent: #BBDEFB;
}

/* Tema Esmeralda (Verde) */
[data-color-theme="esmeralda"] {
    --primary: #4CAF50;
    --primary-dark: #2E7D32;
    --primary-light: #81C784;
    --secondary: #66BB6A;
    --accent: #C8E6C9;
}

/* Tema Amatista (Púrpura) */
[data-color-theme="amatista"] {
    --primary: #9C27B0;
    --primary-dark: #6A1B9A;
    --primary-light: #BA68C8;
    --secondary: #AB47BC;
    --accent: #E1BEE7;
}

/* Tema Ámbar (Naranja) */
[data-color-theme="ambar"] {
    --primary: #FF9800;
    --primary-dark: #E65100;
    --primary-light: #FFB74D;
    --secondary: #FFA726;
    --accent: #FFE0B2;
}

/* Tema Grafito (Gris) */
[data-color-theme="grafito"] {
    --primary: #607D8B;
    --primary-dark: #37474F;
    --primary-light: #90A4AE;
    --secondary: #78909C;
    --accent: #CFD8DC;
}

/* Asegurar que los temas de color funcionen con dark mode */
[data-theme="dark"][data-color-theme="rubi"] {
    --accent: #4a1e1e;
}

[data-theme="dark"][data-color-theme="zafiro"] {
    --accent: #1a3a5c;
}

[data-theme="dark"][data-color-theme="esmeralda"] {
    --accent: #1b3d1f;
}

[data-theme="dark"][data-color-theme="amatista"] {
    --accent: #3d1a45;
}

[data-theme="dark"][data-color-theme="ambar"] {
    --accent: #4a2e00;
}

[data-theme="dark"][data-color-theme="grafito"] {
    --accent: #263238;
}

/* ==================== MODO OSCURO ==================== */
[data-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --border: #475569;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    --accent: #4a1e1e;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] .filters {
    background: var(--bg-primary);
}

[data-theme="dark"] select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Tabla */
[data-theme="dark"] table {
    background: var(--bg-primary);
}

[data-theme="dark"] thead {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

[data-theme="dark"] th {
    color: var(--text-primary);
    border-bottom-color: var(--border);
}

[data-theme="dark"] td {
    border-bottom-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] tbody tr {
    background: var(--bg-primary);
}

[data-theme="dark"] tbody tr:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

[data-theme="dark"] tbody tr:nth-child(even):hover {
    background: var(--bg-tertiary);
}

/* Table container */
[data-theme="dark"] .table-container {
    background: var(--bg-primary);
}

/* Modales */
[data-theme="dark"] .modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .detail-modal .modal-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .detail-item {
    border-color: var(--border);
}

[data-theme="dark"] .detail-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .detail-value {
    color: var(--text-primary);
}

[data-theme="dark"] .detail-imagenes {
    background: var(--bg-secondary);
}

[data-theme="dark"] .detail-packaging-section {
    background: var(--bg-secondary);
    border-color: var(--border);
}

/* Carrito modal */
[data-theme="dark"] #carrito-modal .modal-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .carrito-item {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .quantity-modal-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .quantity-modal-body {
    background: var(--bg-primary);
}

[data-theme="dark"] .quantity-product-info {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .quantity-detail-item {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="dark"] .quantity-detail-item strong {
    color: var(--text-primary);
}

[data-theme="dark"] .quantity-btn {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .quantity-btn:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .quantity-input {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .quantity-package-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .quantity-package-btn {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .quantity-btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .quantity-modal {
    background: var(--bg-primary);
}

/* Cards (móvil) */
[data-theme="dark"] .stock-card {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .stock-card-header {
    border-color: var(--border);
}

/* Dropdown y menú */
[data-theme="dark"] .dropdown-content {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .menu-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .menu-section-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .menu-dropdown {
    background: var(--bg-primary) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

[data-theme="dark"] .menu-dropdown .menu-section {
    border-color: var(--border);
}

[data-theme="dark"] .menu-dropdown .menu-section-title {
    color: var(--text-secondary);
}

[data-theme="dark"] .menu-dropdown .menu-item {
    color: var(--text-primary);
}

[data-theme="dark"] .menu-dropdown .menu-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .menu-dropdown .menu-item.danger {
    color: #ff6b6b;
}

[data-theme="dark"] .menu-dropdown .menu-item.danger:hover {
    background: rgba(220, 53, 69, 0.15);
}

/* Badges */
[data-theme="dark"] .badge {
    border: 1px solid var(--border);
}

/* Modal overlay */
[data-theme="dark"] .modal-overlay .modal-content {
    background: var(--bg-primary);
}

/* Inquiry form inputs */
[data-theme="dark"] .modal-overlay input,
[data-theme="dark"] .modal-overlay textarea {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: var(--text-secondary);
}

/* ==================== PÁGINAS DE ADMINISTRACIÓN - MODO OSCURO ==================== */

/* Contenedores principales */
[data-theme="dark"] .proposals-container,
[data-theme="dark"] .users-container,
[data-theme="dark"] .email-config-container,
[data-theme="dark"] .params-container,
[data-theme="dark"] .inquiries-container {
    background: var(--bg-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Contenido */
[data-theme="dark"] .proposals-content,
[data-theme="dark"] .users-content,
[data-theme="dark"] .email-config-content,
[data-theme="dark"] .params-content,
[data-theme="dark"] .inquiries-content {
    background: var(--bg-primary);
}

/* Tablas de administración */
[data-theme="dark"] .proposals-table th,
[data-theme="dark"] .users-table th,
[data-theme="dark"] .inquiries-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .proposals-table td,
[data-theme="dark"] .users-table td,
[data-theme="dark"] .inquiries-table td {
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .proposals-table tbody tr:hover,
[data-theme="dark"] .users-table tbody tr:hover,
[data-theme="dark"] .inquiries-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Badges de estado */
[data-theme="dark"] .status-badge {
    border: 1px solid var(--border);
}

[data-theme="dark"] .status-enviada {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

[data-theme="dark"] .status-procesada {
    background: rgba(40, 167, 69, 0.2);
    color: #4caf50;
    border-color: rgba(40, 167, 69, 0.4);
}

[data-theme="dark"] .status-cancelada {
    background: rgba(220, 53, 69, 0.2);
    color: #f44336;
    border-color: rgba(220, 53, 69, 0.4);
}

/* Tarjetas móviles */
[data-theme="dark"] .proposal-card,
[data-theme="dark"] .user-card,
[data-theme="dark"] .inquiry-card {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .proposal-card-header,
[data-theme="dark"] .user-card-header,
[data-theme="dark"] .inquiry-card-header {
    border-color: var(--border);
}

/* Consultas - Estilos específicos */
[data-theme="dark"] .inquiry-section {
    background: var(--bg-secondary);
}

[data-theme="dark"] .inquiry-section h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .inquiry-field label {
    color: var(--text-secondary);
}

[data-theme="dark"] .inquiry-field span {
    color: var(--text-primary);
}

[data-theme="dark"] .inquiry-message {
    background: rgba(255, 152, 0, 0.15);
    border-left-color: #ff9800;
}

[data-theme="dark"] .inquiry-message h4 {
    color: #ffb74d;
}

[data-theme="dark"] .inquiry-message p {
    color: var(--text-primary);
}

[data-theme="dark"] .inquiry-response {
    background: rgba(76, 175, 80, 0.15);
    border-left-color: #4caf50;
}

[data-theme="dark"] .inquiry-response h4 {
    color: #81c784;
}

[data-theme="dark"] .inquiry-response p {
    color: var(--text-primary);
}

[data-theme="dark"] .response-form {
    background: rgba(33, 150, 243, 0.15);
}

[data-theme="dark"] .response-form h4 {
    color: #64b5f6;
}

[data-theme="dark"] .response-form textarea {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .client-info .name {
    color: var(--text-primary);
}

[data-theme="dark"] .client-info .email {
    color: var(--text-secondary);
}

[data-theme="dark"] .inquiry-card-message {
    color: var(--text-secondary);
}

[data-theme="dark"] .inquiry-card-date {
    color: var(--text-secondary);
}

[data-theme="dark"] #inquiry-detail-modal .modal-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .inquiry-detail-content {
    background: var(--bg-primary);
}

/* Contenedor de filtros */
[data-theme="dark"] .filters-container {
    background: var(--bg-primary) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .filter-group label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .proposal-card-body,
[data-theme="dark"] .user-card-body {
    color: var(--text-primary);
}

[data-theme="dark"] .proposal-card-body .label,
[data-theme="dark"] .user-card-body .label {
    color: var(--text-secondary);
}

/* Formularios de administración */
[data-theme="dark"] .config-card,
[data-theme="dark"] .param-card,
[data-theme="dark"] .param-item {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .config-card-header,
[data-theme="dark"] .param-header {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .config-card-body,
[data-theme="dark"] .param-body {
    background: var(--bg-primary);
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--text-secondary);
}

/* Modales de administración */
[data-theme="dark"] .modal-admin,
[data-theme="dark"] .user-modal-content,
[data-theme="dark"] .detail-modal-content {
    background: var(--bg-primary);
}

[data-theme="dark"] .modal-admin-header {
    border-color: var(--border);
}

[data-theme="dark"] .modal-admin-body {
    color: var(--text-primary);
}

/* Filtros */
[data-theme="dark"] .filters-section,
[data-theme="dark"] .filter-group {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .filter-group label {
    color: var(--text-primary);
}

/* Mensajes vacíos */
[data-theme="dark"] .no-data,
[data-theme="dark"] .empty-message {
    color: var(--text-secondary);
}

/* Lista de configs email */
[data-theme="dark"] .config-list-item {
    background: var(--bg-primary);
    border-color: var(--border);
}

[data-theme="dark"] .config-list-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .config-list-item.active {
    border-color: #4CAF50;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-left: auto;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle .switch {
    pointer-events: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ==================== HEADER MODERNO ==================== */
header {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 24px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

h1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Usuario Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.user-info span {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.user-info strong {
    color: var(--primary);
    font-weight: 600;
}

.btn-logout {
    padding: 8px 16px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-logout:hover {
    background: var(--dark-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* ==================== FILTROS MODERNOS ==================== */
.main-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.filters {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.filters h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
}

input:hover, select:hover {
    border-color: var(--primary-light);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    background: white;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-clear {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-clear:hover {
    background: var(--bg-secondary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ==================== TABLA MODERNA ==================== */
.table-container {
    overflow-x: auto;
    padding: 24px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
}

tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

tbody tr:hover {
    background: #fafafa;
    transform: translateX(2px);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.badge-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ==================== ESTADOS ==================== */
.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 16px;
    opacity: 0.3;
    filter: grayscale(100%);
}

.empty-state h3 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
    font-size: 0.9375rem;
}

.error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 20px 24px;
    border-left: 4px solid #dc2626;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ==================== MODAL MODERNO ==================== */
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.modal-close {
    background: var(--bg-secondary);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.detail-grid {
    display: grid;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.detail-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.detail-label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
}

/* ==================== TARJETAS MÓVIL ==================== */
.cards-container {
    display: none;
}

.stock-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stock-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow);
}

.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.stock-card-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9375rem;
    flex: 1;
    padding-right: 12px;
    line-height: 1.4;
}

.stock-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.stock-card-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-card-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.stock-card-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
}

.stock-card-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ==================== CARRITO FLOTANTE ==================== */
.carrito-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carrito-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4);
}

.carrito-btn:active {
    transform: scale(0.95);
}

.carrito-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 3px solid white;
    box-shadow: var(--shadow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* ==================== MODAL DEL CARRITO ==================== */
#carrito-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#carrito-modal .modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 0;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

#carrito-modal .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

#carrito-modal .modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

#carrito-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

#carrito-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#carrito-content {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.carrito-items {
    margin: 0 0 24px 0;
}

.carrito-item {
    display: grid;
    grid-template-columns: 3fr 1.5fr auto;
    gap: 24px;
    padding: 20px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
}

.carrito-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.carrito-item-info {
    font-size: 0.9375rem;
    line-height: 1.6;
}

.carrito-item-info strong {
    color: var(--primary);
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.carrito-item-info small {
    color: var(--text-secondary);
    display: block;
    margin-top: 6px;
    font-weight: 500;
}

.carrito-item-cantidad {
    text-align: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.carrito-item-cantidad strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.cantidad-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.carrito-item-actions button {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.carrito-footer {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border);
}

.carrito-footer button {
    flex: 1;
}

/* Carrito vacío */
.carrito-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.carrito-empty-icon {
    font-size: 5rem;
    margin-bottom: 24px;
    opacity: 0.3;
    filter: grayscale(100%);
}

.carrito-empty h3 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.carrito-empty p {
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* Formulario de envío */
.envio-form {
    padding: 0;
}

.envio-form h3 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
}

.envio-form p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
    font-weight: 500;
}

.envio-form .form-group {
    margin-bottom: 24px;
}

.envio-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.envio-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
    min-height: 120px;
}

.envio-form textarea:hover {
    border-color: var(--primary-light);
}

.envio-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    background: var(--bg-primary);
}

[data-theme="dark"] .envio-form textarea {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .envio-form textarea:focus {
    background: var(--bg-primary);
}

/* Checkbox para formulario de envío */
.checkbox-group {
    margin-top: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

[data-theme="dark"] .checkbox-label {
    color: var(--text-primary);
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ==================== RESPONSIVE MÓVIL ==================== */
@media (max-width: 768px) {
    body {
        background: var(--bg-primary);
    }
    
    .container {
        padding: 12px;
    }
    
    header {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
        text-align: center;
        margin-bottom: 16px;
    }
    
    .logo {
        height: 36px;
        margin: 0 auto;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    .subtitle {
        font-size: 0.8125rem;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
        padding: 12px;
        gap: 10px;
    }
    
    .btn-logout {
        width: 100%;
    }
    
    .filters {
        padding: 16px;
    }
    
    .filters h2 {
        font-size: 1rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    input, select {
        padding: 10px 14px;
        font-size: 0.875rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
    
    .table-container {
        padding: 12px;
    }
    
    .table-container table {
        display: none !important;
    }
    
    .cards-container {
        display: block !important;
    }
    
    .modal-content {
        padding: 24px;
        width: 95%;
        border-radius: var(--radius-lg);
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 6px;
    }
    
    /* Carrito móvil */
    .carrito-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .carrito-badge {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    #carrito-modal .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    #carrito-modal .modal-header {
        padding: 20px;
    }
    
    #carrito-modal .modal-header h2 {
        font-size: 1.25rem;
    }
    
    #carrito-content {
        padding: 20px;
    }
    
    .carrito-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }
    
    .carrito-item-cantidad {
        margin: 0 auto;
        max-width: 200px;
    }
    
    .carrito-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .carrito-footer button {
        width: 100%;
    }
}

@media (max-width: 375px) {
    h1 {
        font-size: 1.125rem;
    }
    
    .logo {
        height: 32px;
    }
    
    .filters h2 {
        font-size: 0.9375rem;
    }
    
    .carrito-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* ==================== SECCIÓN DE EMPAQUETADO ==================== */

.detail-packaging-section {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail-packaging-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.detail-packaging-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-packaging-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.detail-packaging-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.detail-packaging-icon {
    font-size: 2em;
    line-height: 1;
}

.detail-packaging-info {
    flex: 1;
}

.detail-packaging-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-packaging-value {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==================== GALERÍA DE IMÁGENES ==================== */

.detail-imagenes {
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.detail-imagenes-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.detail-imagenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    width: 100%;
}

.detail-imagen-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.detail-imagen-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.detail-imagen-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-no-imagenes {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 15px;
}

.detail-actions {
    width: 100%;
    padding: 20px 0 10px;
    margin-top: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

/* Modal para ampliar imagen */
.imagen-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: pointer;
}

.imagen-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.imagen-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.imagen-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.imagen-modal-close:hover {
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .detail-imagenes-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .imagen-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 40px;
        height: 40px;
    }

    .detail-packaging-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .detail-packaging-section {
        padding: 15px;
    }

    .detail-packaging-item {
        padding: 12px;
    }
}

/* ==================== SELECTOR DE IDIOMA ==================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-selector-wrapper {
    display: flex;
    align-items: center;
}

.lang-selector {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 70px;
}

.lang-selector:hover {
    border-color: var(--primary-light);
    background: var(--bg-primary);
}

.lang-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* Selector fijo para login/register/verify */
.lang-selector-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

/* Selector de idioma en headers con fondo oscuro/rojo */
.lang-selector-header {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: white !important;
}

.lang-selector-header option {
    background: #333;
    color: white;
}

/* Estilos para headers de páginas de administración */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}

.page-header .logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header .logo {
    height: 48px;
    filter: brightness(0) invert(1);
}

.page-header h1 {
    color: white !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: white !important;
    background-clip: unset !important;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header .header-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-header .subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.page-header .header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header .back-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.page-header .back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 16px;
    }

    .page-header .logo-section {
        flex-direction: column;
        gap: 10px;
    }

    .page-header .logo {
        height: 36px;
    }

    .page-header h1 {
        font-size: 1.1rem;
    }

    .page-header .subtitle {
        font-size: 0.75rem;
    }

    .page-header .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .page-header .back-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .lang-selector-wrapper {
        width: 100%;
    }

    .lang-selector {
        width: 100%;
        text-align: center;
    }

    .lang-selector-fixed {
        top: 10px;
        right: 10px;
    }

    .lang-selector-fixed .lang-selector {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

/* ==================== MODAL DE CANTIDAD CON BOTONES +/- ==================== */

.quantity-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.quantity-modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.quantity-modal-header {
    padding: 24px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.quantity-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-modal-close:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: rotate(90deg);
}

.quantity-modal-body {
    padding: 24px;
}

.quantity-product-info {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.quantity-product-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.quantity-product-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.quantity-detail-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.quantity-detail-item strong {
    color: var(--text-primary);
}

.quantity-stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.quantity-stock-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.quantity-stock-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.quantity-input-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quantity-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quantity-control {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}

.quantity-control:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.quantity-btn {
    background: white;
    border: 2px solid var(--border);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.quantity-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn-minus {
    color: var(--text-secondary);
}

.quantity-btn-minus:hover {
    background: #fee2e2;
    border-color: #dc3545;
    color: #dc3545;
}

.quantity-btn-plus {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary);
    color: white;
}

.quantity-btn-plus:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    color: white;
    box-shadow: var(--shadow-sm);
}

.quantity-input {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 12px;
    background: white;
    outline: none;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-quick-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quantity-package-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.quantity-package-group:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.quantity-package-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.quantity-package-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.quantity-package-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.quantity-package-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
    transform: scale(1.05);
}

.quantity-package-btn:active {
    transform: scale(0.95);
}

.quantity-package-btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary);
    color: white;
}

.quantity-package-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    color: white;
    box-shadow: var(--shadow-sm);
}

.quantity-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.quantity-btn-cancel {
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-btn-cancel:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.quantity-btn-confirm {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.quantity-btn-confirm:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quantity-btn-confirm:active {
    transform: translateY(0);
}

/* Responsive para modal de cantidad */
@media (max-width: 768px) {
    .quantity-modal {
        width: 95%;
        max-width: none;
    }

    .quantity-modal-header {
        padding: 20px;
    }

    .quantity-modal-header h3 {
        font-size: 1.125rem;
    }

    .quantity-modal-body {
        padding: 20px;
    }

    .quantity-product-title {
        font-size: 1rem;
    }

    .quantity-product-details {
        flex-direction: column;
        gap: 8px;
    }

    .quantity-package-group {
        padding: 10px 14px;
    }

    .quantity-package-label {
        font-size: 0.875rem;
    }

    .quantity-package-btn {
        width: 28px;
        height: 28px;
    }

    .quantity-modal-footer {
        padding: 16px 20px;
        flex-direction: column-reverse;
    }

    .quantity-btn-cancel,
    .quantity-btn-confirm {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 375px) {
    .quantity-modal-header h3 {
        font-size: 1rem;
    }

    .quantity-product-title {
        font-size: 0.9375rem;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
    }

    .quantity-input {
        font-size: 1.125rem;
    }
}

/* ==================== MODAL DE CONSULTA ==================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1500;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay .modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-overlay .modal-header {
    position: relative;
}

.modal-overlay .modal-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-overlay .modal-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Botones de consulta en detalle */
.btn-inquiry:hover {
    background: #1976D2 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-whatsapp:hover {
    background: #128C7E !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

@media (max-width: 768px) {
    .modal-overlay .modal-content {
        width: 95%;
        max-height: 85vh;
    }
}

/* ==================== PÁGINA DE LOGIN ==================== */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
}

.login-sidebar {
    flex: 1;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid #e5e7eb;
}

.login-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 179, 66, 0.08) 0%, transparent 70%);
    animation: loginPulse 15s ease-in-out infinite;
}

@keyframes loginPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.sidebar-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.sidebar-logo {
    height: 140px;
    margin-bottom: 32px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.sidebar-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: #1B4332;
}

.sidebar-content p {
    font-size: 1.125rem;
    color: #4a5568;
    font-weight: 500;
    line-height: 1.6;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-box {
    background: white;
    padding: 48px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 440px;
    width: 100%;
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.mobile-logo {
    display: none;
    height: 80px;
    margin: 0 auto 24px;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: var(--text-primary);
    background-clip: unset;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-login {
    background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%);
    color: white;
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    box-shadow: var(--shadow);
}

.btn-login:hover {
    background: linear-gradient(135deg, #689F38 0%, #33691E 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    background: var(--bg-tertiary);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.login-link a {
    color: #558B2F;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

.loading-spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

/* Modal cambio de contraseña */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.password-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-modal-header {
    background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%);
    color: white;
    padding: 24px 32px;
}

.password-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.password-modal-body {
    padding: 32px;
}

.password-modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

#change-password-form .form-group {
    margin-bottom: 20px;
}

#change-password-form .btn-login {
    width: 100%;
    margin-top: 8px;
}

#password-alert-container .alert {
    margin-bottom: 20px;
}

/* Login responsive */
@media (max-width: 1024px) {
    .login-sidebar {
        display: none;
    }

    .login-container {
        flex: 1;
        background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 20px;
    }

    .login-box {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .mobile-logo {
        display: block;
    }

    .btn-login {
        padding: 14px;
        font-size: 1rem;
    }
}

/* ==================== CONFIG OPTIONS (empresa-logo) ==================== */
.config-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.config-option-info {
    flex: 1;
    padding-right: 20px;
}

.config-option-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.config-option-desc {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(255, 67, 56, 0.2);
}

/* Dark mode para config options */
[data-theme="dark"] .config-option {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

[data-theme="dark"] .toggle-slider {
    background-color: var(--bg-secondary);
}