/* Admin action buttons - fixed size */
.admin-action-btn {
    min-height: 42px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-action-btn:active {
    transform: none !important;
    box-shadow: none !important;
}


a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Login Section */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-logo img {
    max-width: 100%;
    height: auto;
}

/* Optimización del formulario de login */
.login-card .form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    height: auto;
    min-height: 38px;
}

/* Corrección para input-group con botones */
.input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .btn {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.input-group > .btn:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.login-card .input-group {
    margin-bottom: 0;
}

.login-card .input-group-text {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.login-card .mb-3 {
    margin-bottom: 1rem !important;
}

.login-card .d-grid {
    /* Evitar desalineación tras carga/animaciones: usar flex vertical estable */
    display: grid !important;
    gap: 0.75rem !important;
    margin-top: 1.5rem !important;
}

.login-card .d-grid > .btn {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 42px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Essential for ripple effect */
    overflow: hidden; /* Essential for ripple effect */
}

/* Estabilizar tamaño de los botones de Login (evitar crecimiento en clics repetidos) */
.login-card .d-grid > .btn,
.login-card .d-grid > a.btn {
    box-sizing: border-box;
    transform: none !important;
    will-change: auto;
    /* position:relative y overflow:hidden ya definidos globalmente arriba */
}
.login-card .d-grid > .btn:active,
.login-card .d-grid > .btn:focus,
.login-card .d-grid > a.btn:active,
.login-card .d-grid > a.btn:focus {
    transform: none !important;
    box-shadow: none !important;
}

.login-card .btn i {
    font-size: 0.85rem;
}

/* Botón de toggle password específico */
.login-card #togglePassword {
    padding: 0.5rem 0.75rem;
    border-left: none;
    background-color: #f8f9fa;
}

.login-card #togglePassword:hover {
    background-color: #e9ecef;
}

/* Evitar que el botón de mostrar contraseña se expanda a todo el ancho */
.login-card .input-group > .btn {
    width: auto;
    min-width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--dark) 0%, #422667 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 0.75rem;
}

.sidebar-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-toggle {
    position: absolute;
    right: 1rem;
    top: 1.25rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-item {
    margin: 0.25rem 0;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.sidebar-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-item.active a {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-left: 4px solid var(--secondary);
}

.sidebar-item i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.75rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    width: calc(100% - 280px);
    transition: var(--transition);
}

/* Admin Navbar */
.admin-navbar {
    background-color: var(--white);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    height: 64px;
}

/* Typography reductions (admin-only, buttons unaffected) */
#adminPanel .navbar-left h4 { font-size: 1rem; }
#adminPanel .section-header h2 { font-size: 1.1rem; }
#adminPanel .section-header p { font-size: 0.9rem; }
#adminPanel .card-body { font-size: 0.95rem; }
#adminPanel .table { font-size: 0.92rem; }
#adminPanel .table th, #adminPanel .table td { font-size: 0.92rem; }
#adminPanel .modal-title { font-size: 1rem; }
#adminPanel .modal-body { font-size: 0.95rem; }
#adminPanel .form-label { font-size: 0.9rem; }
#adminPanel .form-text { font-size: 0.85rem; }
#adminPanel .input-group-text { font-size: 0.95rem; }
#adminPanel .sidebar-item a span { font-size: 0.95rem; }

/* ============================================================
   CORRECCION GLOBAL DE BOTONES en Admin
   ============================================================ */
/* Evitar que ripple (animations.js) desplace contenido sin animations.css */
.btn {
    position: relative;
    overflow: hidden;
}
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: ripple 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes ripple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}
button:active, .btn:active, button:focus, .btn:focus,
.btn-primary:active, .btn-secondary:active, .btn-success:active, .btn-danger:active,
.btn-warning:active, .btn-info:active, .btn-light:active, .btn-dark:active,
.btn-outline-primary:active, .btn-outline-secondary:active,
.btn-outline-warning:active, .btn-outline-info:active, .btn-outline-success:active,
.btn-outline-danger:active, .btn-outline-light:active, .btn-outline-dark:active,
input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active {
    transform: none !important;
    box-shadow: none !important;
}

/* Estándar de botones de acción en secciones (Nuevo / Importar) */
.admin-action-btn {
    min-height: 42px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.admin-action-btn i { font-size: 1rem; }

/* Barra de progreso para click-and-hold dentro de botones */
.admin-action-btn .hold-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.25);
}
.admin-action-btn.btn-outline-primary .hold-progress { background: rgba(13,110,253,0.15); }
.admin-action-btn.btn-danger .hold-progress { background: rgba(220,53,69,0.15); }
.admin-action-btn .hold-progress-bar {
    width: 0%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    transition: width 0.05s linear;
}
.admin-action-btn.btn-outline-primary .hold-progress-bar { background: #0d6efd; }
.admin-action-btn.btn-danger .hold-progress-bar { background: #dc3545; }

/* Controles de toolbar con altura uniforme */
.toolbar-control {
    min-height: 42px;
}
#itemsPerPageSelect, #inventoryItemsPerPageSelect { min-height: 42px; }

.navbar-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    margin-right: 1rem;
    cursor: pointer;
    display: none;
}

.navbar-left h4 {
    margin: 0;
    font-weight: 600;
    color: var(--dark);
}

.navbar-right {
    display: flex;
    align-items: center;
}

/* Banner sutil de estado de conexión (solo admin) */
.cloud-conn-banner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray);
    margin-right: 1rem;
    opacity: 0.9;
}
.cloud-conn-banner.idle { color: #6c757d; }
.cloud-conn-banner.testing { color: #856404; }
.cloud-conn-banner.ok { color: #198754; }
.cloud-conn-banner.error { color: #dc3545; }

.user-dropdown {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    color: var(--gray);
    font-weight: 500;
}

.user-dropdown i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Content Wrapper */
.content-wrapper {
    padding: 1.5rem;
}

.content-section {
    display: none;
}

/* Personalización: Grid de 2 columnas (admin) */
#customizationSection .customization-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

/* Garantizar que las cards ocupen el alto completo del grid-item */
#customizationSection .grid-item .card {
  height: 100%;
}

/* Responsive breakpoints coherentes */
@media (max-width: 767.98px) {
  #customizationSection .customization-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  #customizationSection .customization-grid {
    gap: 0.75rem;
  }
}

/* Miniatura del logo (admin) */
.logo-preview-container {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: visible;
}

.logo-preview-container .logo-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-preview-container .btn#removeLogo {
  width: 24px;
  height: 24px;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
}
.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0.25rem;
    font-weight: 700;
    color: var(--dark);
}

.section-header p {
    color: var(--gray);
    margin: 0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
}

.card-header h5 {
    font-weight: 600;
    margin: 0;
    color: var(--dark);
}

/* Dashboard Stats */
.stats-cards {
    margin-bottom: 1.5rem;
}

.stats-card {
    border-radius: var(--border-radius);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stats-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.stats-info p {
    margin: 0;
    opacity: 0.9;
}

/* Recent Products */
.recent-products {
    max-height: 400px;
    overflow-y: auto;
}

.recent-product-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.recent-product-item:hover {
    background-color: var(--light-gray);
}

.recent-product-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
}

.recent-product-info {
    flex: 1;
    min-width: 0;
}

.recent-product-title {
    margin: 0;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-product-price {
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    font-size: 0.875rem;
}

/* Products List */
.table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.table .product-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.status-deal {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.status-sold {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.condition-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem;
    font-weight: 600;
}

.condition-new {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
}

.condition-seminew {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.condition-used {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

.action-btn {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 1rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--primary);
}

.action-btn.view:hover {
    color: var(--primary);
}

.action-btn.edit:hover {
    color: var(--info);
}

.action-btn.delete:hover {
    color: var(--danger);
}

.action-btn.mark-sold:hover {
    color: var(--success);
}

/* Product Editor */
.product-images-container {
    min-height: 100px;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

/* Evitar superposición con el editor de descripción */
.product-form-container #editorContainer {
    margin-bottom: 36px;
    height: 400px;
    overflow-y: auto;
}

/* Estilos para CKEditor 5 */
.product-form-container #editorContainer .ck-editor {
    height: auto;
    min-height: 400px;
}

.product-form-container #editorContainer .ck-editor .ck-editor__top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

.product-form-container #editorContainer .ck-editor .ck-editor__editable {
    height: 350px;
    overflow-y: auto;
}

/* Separación adicional para el bloque de Imágenes que sigue a Descripción */
.product-form-container .mb-3 + .mb-3 .form-label {
    margin-top: 8px;
}

.product-images-container.dragging {
    background-color: rgba(58, 92, 212, 0.05);
    border-color: var(--primary);
}

/* Drop zone para subir imágenes (pestaña "Subir Archivos") */
.upload-dropzone {
    border: 2px dashed #c5c9d2;
    border-radius: 0.5rem;
    background-color: #f8f9fb;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.upload-dropzone:hover {
    background-color: #f0f3f8;
    border-color: #8b93a5;
}

.upload-dropzone.dragging {
    background-color: rgba(58, 92, 212, 0.08);
    border-color: var(--primary);
    border-style: solid;
    transform: scale(1.01);
}

.upload-dropzone i {
    color: #6c757d;
}

.upload-dropzone.dragging i {
    color: var(--primary);
}

#productImagePreviews {
    width: 100%;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 0.25rem;
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-view {
    position: absolute;
    bottom: 0.25rem;
    left: 0.25rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-preview-view:hover {
    background-color: rgba(58, 92, 212, 0.8);
}

.image-preview-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-preview-remove:hover {
    background-color: rgba(220, 53, 69, 0.8);
}

.image-upload-placeholder {
    width: 80px;
    height: 80px;
    border: 1px dashed #dee2e6;
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-upload-placeholder:hover {
    background-color: rgba(58, 92, 212, 0.05);
    border-color: var(--primary);
}

.image-upload-placeholder i {
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 0.25rem;
}

.image-upload-placeholder span {
    font-size: 0.75rem;
    color: var(--gray);
}


/* Product Form Container with Scroll */
.product-form-container {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden; /* Eliminar barra de desplazamiento horizontal */
    padding-right: 0.5rem;
    margin-right: -0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.product-form-container::-webkit-scrollbar {
    width: 6px;
}

.product-form-container::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.product-form-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.product-form-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Alternative Payment Methods */
#alternativePaymentMethods {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
}

/* Delivery Fields - hidden by TagManager */
#deliveryPoints {
    min-height: 80px;
    resize: vertical;
}

#deliverySchedule {
    font-family: inherit;
}

#paymentMethodsField {
    font-family: inherit;
}

/* Notifications System (Toastify handles visual toasts; history panel styles remain elsewhere) */

/* Notification Bell */
.notification-bell {
    position: relative;
    margin-right: 15px;
}

.notification-bell button {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 1.25rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-badge.show {
    opacity: 1;
    transform: scale(1);
}

/* Notification History Panel */
.notification-history-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    display: none;
    flex-direction: column;
    max-height: calc(100vh - 100px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.notification-history-panel.show {
    display: flex;
}

.notification-header {
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h5 {
    margin: 0;
    font-weight: 600;
}

.notification-list {
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notification-item .notification-icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

.notification-item.success .notification-icon { color: var(--success); }
.notification-item.error .notification-icon { color: var(--danger); }
.notification-item.info .notification-icon { color: var(--info); }
.notification-item.warning .notification-icon { color: var(--warning); }

/* Fix Product Modal Width - Increase by ~30% relative to default modal-lg (800px) */
#productModal .modal-dialog {
    max-width: 80vw !important;
    width: 80vw;
}

#productModal .modal-content {
    height: 90vh;
}

#productModal .modal-body {
    overflow-y: auto;
}



/* Preview modal */
#productPreviewModal .preview-carousel-inner {
    border-radius: 0.5rem;
    overflow: hidden;
}
#productPreviewModal .preview-carousel-inner img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    background: #f0f0f0;
}
#productPreviewModal .thumb-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 6px;
    margin-top: 8px;
}
#productPreviewModal .thumb-item {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
}
#productPreviewModal .thumb-item.active {
    border-color: var(--bs-primary);
}
#productPreviewModal .thumb-item img {
    width: 100%;
    height: 48px;
    object-fit: cover;
    display: block;
}
#productPreviewModal .product-preview-desc {
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}
#productPreviewModal .product-preview-desc p {
    margin-bottom: 0.5rem;
}
#productPreviewModal .product-preview-desc br {
    display: block;
    content: '';
    margin-bottom: 0.25rem;
}

.emoji-picker-instance {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    width: 280px;
    max-height: 320px;
    overflow: hidden;
}
.emoji-picker-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-bottom: 1px solid #eee;
}
.emoji-picker-tab {
    border: none;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.emoji-picker-tab.active { background: #e9ecef; }
.emoji-picker-search { padding: 6px; }
.emoji-picker-search input { width: 100%; }
.emoji-picker-content { padding: 6px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-item { display: inline-flex; align-items: center; justify-content: center; height: 28px; width: 28px; font-size: 1rem; cursor: pointer; border-radius: 4px; }
.emoji-item:hover { background: #f1f3f5; }

/* Suprimir borde rojo nativo de :invalid dentro del formulario producto */
#productForm[novalidate] :where(input, select, textarea):invalid {
    border-color: inherit;
    box-shadow: none;
}

/* Sidebar expandable submenu */
.sidebar-parent a {
    display: flex;
    align-items: center;
}

.sidebar-arrow {
    margin-left: auto;
    margin-right: 0;
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.sidebar-parent.expanded .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-parent.expanded .sidebar-submenu {
    max-height: 600px;
}

.sidebar-sub-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.625rem 1.5rem 0.625rem 2.5rem;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    gap: 0.5rem;
}

.sidebar-sub-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-sub-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
    border-left: 3px solid var(--secondary);
}

.sidebar-sub-link i {
    font-size: 1rem;
    width: 1rem;
    margin-right: 0;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-sub-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.06);
    margin: 0.25rem 1.5rem 0.25rem 2.5rem;
}

/* Tab content inside settings section */
#settingsSection .tab-content > .tab-pane {
    display: none;
}

#settingsSection .tab-content > .tab-pane.active {
    display: block;
}

/* Theme Selector */
#themeSelector .theme-card {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    position: relative;
}

#themeSelector .theme-card:hover {
    border-color: var(--primary, #8b5cf6);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#themeSelector .theme-card.active {
    border-color: var(--primary, #8b5cf6);
    box-shadow: 0 0 0 2px var(--primary, #8b5cf6);
}

.theme-preview-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

.theme-info {
    padding: 0.75rem;
}

.theme-name {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.theme-description {
    margin: 0;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.3;
}

.theme-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary, #8b5cf6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.theme-preview-frame {
    width: 100%;
    height: 500px;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    transition: all 0.3s ease;
}

#themePreviewContainer.preview-tablet {
    max-width: 768px;
    margin: 0 auto;
}

#themePreviewContainer.preview-mobile {
    max-width: 375px;
    margin: 0 auto;
}

.theme-preview-content {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.theme-preview-placeholder {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

/* Security Dashboard */
#securityDashboardSection .card .display-6 i {
    font-size: 2.5rem;
}
#securityDashboardSection .table-sm td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#securityDashboardSection .table-sm code {
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}
#securityDashboardSection .badge {
    font-size: 0.8rem;
}
