:root {
    --bg-dark: #f8f9fb;
    --bg-card: #ffffff;
    --bg-secondary: #f1f3f6;
    --text-primary: #1a1d23;
    --text-secondary: #6b7280;

    --sidebar-bg: #ffffff;
    --sidebar-width: 260px;

    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;

    --danger: #dc2626;
    --success-bg: #f0fdf4;
    --success-text: #16a34a;
    --warning-bg: #fffbeb;
    --warning-text: #d97706;
    --border-color: #e5e7eb;

    --shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --font-family: 'Outfit', sans-serif;
    --radius-sm: 0.375rem;

    /* Sync themes */
    --sync-cost: #0284c7;
    --sync-price: #d97706;

    /* Design tokens — border radius */
    --radius-xs: 4px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 12px;

    /* Design tokens — z-index scale */
    --z-sticky: 20;
    --z-fixed: 50;
    --z-overlay: 100;
    --z-modal: 1000;
    --z-toast: 99999;

    /* Design tokens — overlay */
    --overlay-bg: rgba(0, 0, 0, 0.4);
}

/* --- PREMIUM MINIMALIST DASHBOARD --- */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    border-top: 3px solid var(--accent-color, var(--accent-primary));
}

.stat-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-feature-settings: "tnum" on, "lnum" on;
}

/* Accents */
.stat-blue {
    --accent-color: #3b82f6;
}

.stat-green {
    --accent-color: #10b981;
}

.stat-orange {
    --accent-color: #f59e0b;
}

.stat-sky {
    --accent-color: #0ea5e9;
}

.stat-purple {
    --accent-color: #8b5cf6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Utilities — .hidden defined below in utility section */

/* App Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #1e3a5f;
    border-radius: 0 0 0 0;
}

.sidebar-header img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
}

.nav-item a:hover {
    background-color: #f8f9fb;
    color: var(--text-primary);
}

.nav-item.active a {
    background: #eff6ff;
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden;
}

.top-bar {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #ffffff;
    z-index: 90;
}

.content-container {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* View Sections */
.view-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Dashboard & Simulator Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.grid-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}


/* Table Viewport Optimization */
.table-viewport-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fb;
    padding: 0.85rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f3f6;
    color: var(--text-primary);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

tr:hover td {
    background-color: #f8f9fb;
}

/* Semantic Colors for Prices — consolidated in PRODUCT TABLE SAAS section below */
.price-final-cost {
    color: var(--success-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.price-meli {
    color: #fbbf24;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Botones Minimalistas y Profesionales */
.btn-minimal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    min-width: 140px;
}

/* Temas Cromáticos */

.btn-minimal.cost-theme {
    background: rgba(14, 165, 233, 0.1);
    color: var(--sync-cost);
    border-color: rgba(14, 165, 233, 0.2);
}

.btn-minimal.cost-theme:hover:not(:disabled) {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

.btn-minimal.price-theme {
    background: rgba(245, 158, 11, 0.1);
    color: var(--sync-price);
    border-color: rgba(245, 158, 11, 0.2);
}

.btn-minimal.price-theme:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-minimal.ct-theme {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
}

.btn-minimal.ct-theme:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
}


.btn-minimal:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-minimal:active:not(:disabled) {
    transform: translateY(0);
}

.btn-minimal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-minimal.primary {
    background: rgba(14, 165, 233, 0.1);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.2);
}

.btn-minimal.primary:hover:not(:disabled) {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

.btn-minimal.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}

.btn-minimal.warning:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-minimal.success {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.2);
}

.btn-minimal i {
    font-size: 0.9rem;
}

/* Botones de Icono para Filas */
.btn-icon-minimal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-minimal:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
    transform: scale(1.01);
}

.btn-icon-minimal.primary {
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.2);
}

.btn-icon-minimal.warning {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}


/* Status Badges */
/* Status Badges */
.sync-status-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    border: 1px solid transparent;
}

.sync-status-badge.pending {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.06);
}

.sync-status-badge.cost-ok {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.2);
}

.sync-status-badge.price-ok {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}

.sync-status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.sync-status-badge.woo-ok {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.3);
}

.sync-status-badge.woo-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}



#meliVisualBar div {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-delete-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-ghost:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-icon-delete {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    /* Less aggressive defaults */
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.4;
    transition: all 0.2s;
}

.btn-icon-delete:hover {
    color: var(--danger);
    opacity: 1;
}

/* --- SETTINGS WORKSPACE (v9.0 PRO) --- */
.settings-workspace {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.provider-list-item {
    display: flex;
    flex-direction: row;
    /* Overriding previous column if any */
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.provider-list-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(5px);
}

.provider-list-item.active {
    background: #eff6ff;
    border-color: var(--accent-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.provider-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-box input {
    border-radius: 2rem;
    padding-left: 1rem;
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

.search-box input:focus {
    width: 100%;
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#brandFormDetailed {
    animation: slideDown 0.3s ease-out;
}

/* Scrollbars for list */
.interactive-list::-webkit-scrollbar {
    width: 4px;
}

.interactive-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

/* Cards & Components */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

input,
select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
}

input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

/* Pagination - Sticky bottom */
.pagination-container {
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.03);
}

.btn-edit:hover {
    background: var(--accent-primary);
    color: #fff;
}

.btn-remove:hover {
    background: var(--danger);
    color: #fff;
}

/* Modal Refinado - V2.0 Premium */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Campos de Formulario Rediseñados */
.styled-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.styled-form input,
.styled-form select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
}

.styled-form input:focus,
.styled-form select:focus {
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    outline: none;
}

.financial-breakdown span {
    font-variant-numeric: tabular-nums;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Compact Form Styles */
.form-row-compact {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-row-compact .form-group {
    margin-bottom: 0 !important;
    flex: 1;
    min-width: 150px;
}

.form-row-compact .form-group.expand {
    flex: 3;
    min-width: 250px;
}

.form-actions-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-actions-inline button {
    height: 42px;
}

/* Modern Large Modal */
.modal-overlay .modal-content.modal-large {
    max-width: 900px;
    width: 95%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 3rem;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
}

.modal-large .modal-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.modal-large .modal-header h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.btn-close-modal {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.btn-close-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    transform: rotate(90deg);
}

.styled-form .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-overlay .modal-content.modal-large input,
.modal-overlay .modal-content.modal-large select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border-radius: 0.75rem;
    transition: all 0.3s;
}

.modal-overlay .modal-content.modal-large input:focus,
.modal-overlay .modal-content.modal-large select:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.modal-large .btn-primary {
    height: 50px;
    padding: 0 2rem;
    font-size: 1rem;
    border-radius: 0.75rem;
}

.modal-large .btn-secondary {
    height: 50px;
    padding: 0 2rem;
    font-size: 1rem;
    border-radius: 0.75rem;
}

/* Badge Styles - MEJORADO */
.badge {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Textarea Premium Style */
.modal-overlay textarea:focus,
.styled-form textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

#publishResultsTable td {
    border-bottom: 1px solid #f1f3f6;
}

/* ========================================
   PRODUCTS TABLE — Columnas Rediseñadas
   ======================================== */

/* Layout de la tabla — table-layout: auto en .products-table */
#productsTable {
    width: 100%;
}

#productsTable td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
}

/* — SKU Column — */
.td-sku {
    width: 95px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.sku-code {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* — Product Name Column — */
.td-product {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
}

/* .product-name — defined in PRODUCT TABLE SAAS section below */

/* — Lista Column (Editable Price) — Limpia y funcional — */
.td-lista {
    text-align: center;
    padding: 0.35rem 0.4rem !important;
}

/* — Inline Edit Input (Precio Lista) — */
.inline-edit-input {
    width: 100% !important;
    max-width: 130px;
    padding: 0.5rem 0.6rem !important;
    font-size: 0.95rem;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary) !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-variant-numeric: tabular-nums;
    cursor: text;
    /* Ocultar spinners (flechas arriba/abajo) */
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Ocultar spinners en Chrome/Edge/Safari */
.inline-edit-input::-webkit-outer-spin-button,
.inline-edit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.inline-edit-input:hover {
    background: #f8f9fb !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.inline-edit-input:focus {
    background: #ffffff !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    color: var(--text-primary) !important;
    outline: none;
}

/* — Actions Column — */
.actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

/* ========================================
   PRODUCTS TOOLBAR — Filtros Rediseñados
   ======================================== */

.products-toolbar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0;
}

/* Fila Principal */
.toolbar-row-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* — Búsqueda Prominente — */
.toolbar-search {
    position: relative;
    flex: 1 1 280px;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.toolbar-search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.2s;
}

.toolbar-search input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar-search input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.toolbar-search input:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.toolbar-search input:focus~.toolbar-search-icon,
.toolbar-search:focus-within .toolbar-search-icon {
    color: var(--accent-primary);
}

.toolbar-search-hint {
    position: absolute;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    color: rgba(148, 163, 184, 0.5);
    font-family: inherit;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s;
}

.toolbar-search input:focus~.toolbar-search-hint {
    opacity: 0;
}

/* — Separador Vertical — */
.toolbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

/* — Filtros Inline — */
.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-wrap: wrap;
}

/* — Filter Pill (Selects) — */
.toolbar-filter-pill {
    position: relative;
    display: flex;
    align-items: center;
}

.toolbar-pill-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
    pointer-events: none;
    z-index: 1;
    transition: color 0.25s;
}

.toolbar-filter-pill select {
    padding: 0.55rem 2rem 0.55rem 2.1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 9px;
}

/* Opciones del dropdown — Tema Oscuro */
.toolbar-filter-pill select option {
    background: #ffffff;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.toolbar-filter-pill select option:checked {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    font-weight: 600;
}

.toolbar-filter-pill select option:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Placeholder (valor vacío) — más tenue */
.toolbar-filter-pill select option[value=""] {
    color: var(--text-secondary);
}

.toolbar-filter-pill select:hover {
    background-color: #f8f9fb;
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

.toolbar-filter-pill select:focus {
    border-color: var(--accent-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    outline: none;
}

.toolbar-filter-pill:focus-within .toolbar-pill-icon {
    color: var(--accent-primary);
}

/* — Caballito Toggle Pill — */
.toolbar-toggle-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.toolbar-toggle-pill input[type="checkbox"] {
    display: none;
}

.toolbar-toggle-label {
    font-size: 1.1rem;
    line-height: 1;
    filter: grayscale(0.6);
    transition: filter 0.2s, transform 0.2s;
}

.toolbar-toggle-pill:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

.toolbar-toggle-pill:hover .toolbar-toggle-label {
    filter: grayscale(0.2);
    transform: scale(1.01);
}

.toolbar-toggle-pill input[type="checkbox"]:checked~.toolbar-toggle-label {
    filter: grayscale(0);
    transform: scale(1.01);
}

.toolbar-toggle-pill:has(input[type="checkbox"]:checked) {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: none;
}

/* — Fila Meta (Contador) — */
.toolbar-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.toolbar-counter {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.toolbar-btn-danger {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* — Responsive — */
@media (max-width: 768px) {
    .toolbar-row-main {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-search {
        flex: 1 1 100%;
    }

    .toolbar-divider {
        display: none;
    }

    .toolbar-filters {
        justify-content: flex-start;
    }
}

/* ═══════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════ */

#login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: loginFadeIn 0.6s ease-out;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-logo-img {
    max-width: 180px;
    height: auto;
    filter: none;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Botón Google */
.login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-btn-google {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.login-btn-google:hover:not(:disabled) {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-btn-email {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.login-btn-email:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Divisor */
.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: #475569;
    font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}

/* Formulario Email */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-field input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.login-field input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    outline: none;
    background: #ffffff;
}

.login-field input::placeholder {
    color: #475569;
}

/* Error */
.login-error {
    display: none;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    text-align: center;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Spinner */
.login-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.login-spinner.hidden {
    display: none;
}

.spinner-ring {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(59, 130, 246, 0.15);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spinRing 0.8s linear infinite;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

/* Footer */
.login-footer {
    color: #334155;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* --- UTILITIES --- */
.mt-2 { margin-top: 2rem !important; }
.text-success { color: #4ade80 !important; }
.text-warning { color: #fbbf24 !important; }
.text-accent { color: #a855f7 !important; }
.font-bold { font-weight: bold !important; }

/* --- TABLE UTILS --- */
.w-40 { width: 40px !important; }
.text-center { text-align: center !important; }
.table-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- REFACTOR PHASE 3 --- */
.sidebar-logo-link {
    padding: 1rem;
    cursor: pointer;
    display: block;
}

.sidebar-logo-img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.sync-progress-label {
    color: #4ade80;
    font-weight: bold;
    display: none;
}

.pagination-controls {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.btn-pagination {
    margin: 0 !important;
    width: auto !important;
}

/* Modales Refinados */
.modal-header-gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.modal-header-info p {
    color: rgba(255,255,255,0.8);
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

.btn-close-circle {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-circle:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body-scroll {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer-dark {
    padding: 1.5rem;
    background: #f8f9fb;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label-white {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.total-value-green {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-text);
}

/* Modales Table Utils */
.modal-desglose-card {
    background: #ffffff;
    padding: 0;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-table-minimal {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

.uppercase-header {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* Utility Classes */
.w-100 { width: 100% !important; }
.w-80 { width: 80px !important; }
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 1rem !important; }
.mb-1 { margin-bottom: 1rem !important; }
.pt-1 { padding-top: 1rem !important; }
.hidden { display: none !important; }

.flex-gap-10 { display: flex; gap: 10px; }
.flex-column-gap-8 { display: flex; flex-direction: column; gap: 8px; }

.subtitle-small { font-size: 0.75rem; color: var(--text-secondary); }
.page-info-bold { color: var(--text-secondary); font-weight: 500; }
.border-top-light { border-top: 1px solid var(--border-color); }

.btn-pagination-fixed { margin: 0; width: auto; }
.btn-publish-export { border-color: #f59e0b; color: #f59e0b; padding: 0.5rem 1rem; width: auto; margin: 0; }

.publish-textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
    resize: vertical;
}

.publish-search-input {
    padding: 0.5rem;
    font-size: 0.9rem;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

/* Grid Layout Utils */
.grid-publish {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
}

.card-publish-main {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   PRODUCT TABLE SAAS ULTRA-MINIMAL (FASE 9)
   ═══════════════════════════════════════════ */

.table-viewport-container {
    width: 100%;
    margin: 1.5rem 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    position: relative;
}

.products-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    table-layout: auto !important; /* Asegura que el contenido mande el ancho */
}

.products-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8f9fb; /* Fondo sólido para legibilidad */
}

.products-table th {
    text-align: left;
    padding: 12px 16px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.products-table tr {
    border-bottom: 1px solid #f1f3f6;
}

.products-table tr:last-child {
    border-bottom: none;
}

.products-table tr:hover {
    background-color: #f8f9fb;
}

.products-table td {
    padding: 10px 16px;
    vertical-align: middle;
}

/* --- ELEMENTOS DE CELDA --- */

.provider-tag {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.8rem;
}

.sku-tag {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-name {
    color: var(--text-primary);
    font-weight: 400;
    white-space: nowrap;
    font-size: 0.9rem;
    display: block;
    min-width: 300px;
}

.brand-tag {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
}

/* --- PRECIOS Y EDICIÓN --- */

.input-price-edit {
    width: 130px;
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    transition: all 0.2s;
}

.input-price-edit:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    outline: none;
    background: #ffffff !important;
}

.price-display {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.price-cost      { color: var(--text-secondary); }
.price-wholesale { color: var(--text-primary); }
.price-cash      { color: var(--text-primary); }

.price-pvp {
    color: #2563eb !important;
    font-weight: 700;
    font-size: 0.95rem;
}

.pvp-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

/* --- ACCIONES --- */

.actions-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-action {
    background: transparent;
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
}

.btn-action:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.btn-action.delete:hover {
    background: rgba(244, 63, 94, 0.08);
    color: #f87171;
}
.table-body-container {
    padding: 0 1.5rem 1.5rem;
    background: #ffffff;
    border-radius: 0 0 1.25rem 1.25rem;
}

/* ═══════════════════════════════════════════
   MELI BREAKDOWN COMPONENT
   ═══════════════════════════════════════════ */
.meli-breakdown-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.9fr;
    gap: 2rem;
    align-items: start;
}
.meli-summary-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.meli-price-card {
    background: #f8f9fb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* .meli-price-label and .meli-price-value defined in product modal section below */
.meli-profit-box {
    background: rgba(16, 185, 129, 0.1);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.meli-profit-box .value { color: var(--success-text); font-weight: 800; font-size: 1.4rem; display: block; margin-bottom: 2px; }
.meli-profit-box .label { font-size: 0.7rem; color: var(--success-text); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.meli-margin-box {
    background: #f8f9fb;
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}
.meli-margin-box .value { color: var(--text-primary); font-weight: 800; font-size: 1.2rem; display: block; margin-bottom: 2px; }
.meli-margin-box .label { font-size: 0.7rem; color: var(--text-secondary); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.meli-warning-box {
    font-size: 0.7rem;
    color: var(--warning-text);
    background: var(--warning-bg);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    line-height: 1.4;
    text-align: center;
}
.meli-info-box {
    font-size: 0.7rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    line-height: 1.4;
    text-align: center;
}
.meli-detail-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.meli-section-header {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.meli-section-header .line {
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.06);
    margin-left: 15px;
}
.meli-detail-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.meli-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}
.meli-detail-row .label { color: var(--text-secondary); }
.meli-detail-row .value-danger { color: #f87171; font-weight: 600; }
.meli-detail-row .value-info { color: #60a5fa; }
.meli-detail-row .value-warning { color: var(--warning-text); font-weight: 600; }
.meli-detail-row .value-white { color: var(--text-primary); font-weight: 600; }
.meli-detail-row .value-success { color: var(--success-text); }
.meli-detail-row.small { font-size: 0.8rem; opacity: 0.8; }
.meli-detail-row.separator {
    border-top: 1px dashed var(--border-color);
    padding-top: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    margin-top: 2px;
}
.meli-footer-card {
    margin-top: 0.5rem;
    background: #f8f9fb;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}
.meli-footer-card .meli-detail-row { font-size: 0.8rem; color: var(--text-secondary); }
.meli-footer-total {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-weight: 900;
    font-size: 1.1rem;
}
.meli-footer-total .label { color: var(--success-text); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 1px; }
.meli-footer-total .value { color: var(--success-text); }

/* Additional classes for renderMeliBreakdownHTML() JS template */
.meli-breakdown-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.meli-breakdown-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.meli-breakdown-detail {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.meli-alert-warning {
    font-size: 0.7rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    line-height: 1.4;
    text-align: center;
}
.meli-alert-info {
    font-size: 0.7rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    line-height: 1.4;
    text-align: center;
}
.meli-exento-badge {
    font-size: 0.7em;
    color: #38bdf8;
    vertical-align: middle;
    cursor: help;
}

@media (max-width: 768px) {
    .meli-breakdown-grid { grid-template-columns: 1fr; }
}

/* Keyboard focus styles */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus-visible, .nav-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Responsive Sidebar */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 201;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
}

/* ── Phase 7: Sidebar extracted inline styles ── */

/* Contabilium logo inside nav item */
.nav-contabilium-logo {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    object-fit: contain;
}

/* "Datos" secondary nav section wrapper */
.sidebar-section {
    margin-top: 2rem;
    padding: 0 1rem;
}

/* "Datos" section label */
.sidebar-section-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Secondary nav list (no bullets) */
.sidebar-section-list {
    list-style: none;
}

/* Save DB link */
.nav-link-save {
    color: var(--success-text, #4ade80);
    position: relative;
}

/* Unsaved-changes dot indicator (display toggled by JS) */
.unsaved-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--danger, #ef4444);
    border-radius: 50%;
}

/* Load DB link */
.nav-link-load {
    color: var(--danger, #ef4444);
}

/* User info row in sidebar footer */
.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* User avatar (display toggled by JS) */
.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* User name label */
.sidebar-user-name {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer bottom row: version + logout */
.sidebar-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Version label */
.sidebar-version {
    margin: 0;
}

/* Logout button */
.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============================================================
   Phase 7: Dashboard extracted inline styles
   ============================================================ */

/* Stat card that acts as a clickable reset button */
.stat-card-clickable {
    cursor: pointer;
    position: relative;
}

/* Corner icon inside a stat card (e.g. recycle emoji) */
.stat-card-icon-corner {
    position: absolute;
    right: 15px;
    top: 15px;
}

/* Two-column grid for the dashboard table panels */
.dashboard-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Card variant with no bottom margin (used inside grids) */
.card-no-margin {
    margin-bottom: 0;
}

/* Constrained-height table container for dashboard panels */
.table-container-dashboard {
    max-height: 300px;
}

/* Table header cell — centred text */
.th-center {
    text-align: center;
}

/* Table header cell — right-aligned text */
.th-right {
    text-align: right;
}

/* Empty-state table cell */
.td-empty-state {
    text-align: center;
    opacity: 0.5;
    padding: 2rem;
}

/* Campaign list header bar */
.campaign-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Heading with no margin (used inside flex bars) */
.heading-no-margin {
    margin: 0;
}

/* ============================================================
   Phase 7 — Product Modal (#productModal) extracted styles
   ============================================================ */

/* Modal content overrides for the wide product modal */
.modal-product-content {
    width: 1150px;
    max-width: 95vw;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* Refined modal header */
.modal-product-header {
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modal title (h2) */
.modal-product-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--text-primary);
}

/* Coloured icon badge inside the title */
.modal-product-title-icon {
    background: var(--accent-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
}

/* Close button for the product modal */
.modal-product-close {
    background: rgba(0, 0, 0, 0.03);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.5rem;
}

/* Two-column layout wrapper */
.modal-product-layout {
    display: flex;
    min-height: 650px;
}

/* ── Left column: Clean Form (mf-*) ── */
.modal-product-form-col {
    flex: 1.1;
    padding: 2rem 2.5rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.modal-form-clean {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* Section block */
.mf-section {
    margin-bottom: 1.5rem;
}

.mf-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Two-column row */
.mf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Individual field */
.mf-field {
    margin-bottom: 0.75rem;
}

.mf-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.mf-field input[type="text"],
.mf-field input[type="number"],
.mf-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.mf-field input:focus,
.mf-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.mf-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Price row: input + caballito inline */
.mf-price-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

/* Compound price input */
.mf-price-input {
    flex: 1;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.mf-price-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f1f3f6;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    border-right: 1px solid var(--border-color);
}

.mf-price-input input[type="number"] {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0.6rem 0.75rem;
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    width: auto;
    min-width: 0;
}

.mf-price-input input[type="number"]:focus {
    outline: none;
    box-shadow: none;
}

/* IVA toggle inside price input */
.mf-iva-toggle {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: #f1f3f6;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    margin: 0 !important;
}

.mf-iva-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.mf-iva-toggle span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Caballito toggle */
.mf-caballito-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    margin: 0 !important;
    transition: background 0.2s;
}

.mf-caballito-toggle:hover {
    background: rgba(245, 158, 11, 0.12);
}

.mf-caballito-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d97706;
    cursor: pointer;
}

.mf-caballito-toggle span {
    font-size: 0.8rem;
    font-weight: 700;
    color: #d97706;
}

/* Shipping alert */
.mf-shipping-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}

.mf-shipping-icon {
    width: 40px;
    height: 40px;
    background: #e0f2fe;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mf-shipping-body {
    flex: 1;
}

.mf-shipping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mf-shipping-header strong {
    font-size: 0.85rem;
    color: #0369a1;
}

.mf-shipping-toggle {
    display: flex !important;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    background: #0ea5e9;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0 !important;
}

.mf-shipping-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #ffffff;
}

.mf-shipping-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Form actions */
.mf-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 1.5rem;
}

.mf-btn-save {
    flex: 1.5;
    height: 48px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    background: var(--accent-primary);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s;
}

.mf-btn-save:hover {
    background: var(--accent-hover);
}

.mf-btn-cancel {
    flex: 0.8;
    height: 48px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.mf-btn-cancel:hover {
    background: #f8f9fb;
    color: var(--text-primary);
}

/* ── Right column: MeLi Preview Panel (mp-*) ── */
.mp-panel {
    flex: 0.9;
    background: #f8f9fb;
    padding: 2rem 2rem;
    display: flex;
    flex-direction: column;
    border-bottom-right-radius: 12px;
}

.mp-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

/* Hero price */
.mp-price-hero {
    text-align: center;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.mp-price-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mp-price-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.mp-price-sign {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-secondary);
}

.mp-price-amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -1.5px;
}

/* KPI cards */
.mp-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mp-kpi {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
}

.mp-kpi-profit {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.mp-kpi-profit .mp-kpi-value {
    color: #16a34a;
}

.mp-kpi-profit .mp-kpi-label {
    color: #16a34a;
}

.mp-kpi-margin {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

.mp-kpi-margin .mp-kpi-value {
    color: var(--text-primary);
}

.mp-kpi-margin .mp-kpi-label {
    color: var(--text-secondary);
}

.mp-kpi-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.mp-kpi-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Breakdown sections */
.mp-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mp-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mp-group-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: var(--text-secondary);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2px;
}

.mp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mp-row-dim {
    opacity: 0.65;
}

.mp-row-subtotal {
    border-top: 1px dashed var(--border-color);
    padding-top: 6px;
    margin-top: 2px;
    font-weight: 700;
    color: var(--text-primary);
}

.mp-val-neg {
    color: #dc2626;
    font-weight: 600;
}

.mp-val-dim {
    color: #6b7280;
    font-weight: 500;
}

.mp-val-warn {
    color: #d97706;
    font-weight: 600;
}

.mp-val-bold {
    color: var(--text-primary);
    font-weight: 600;
}

/* Settlement card */
.mp-settlement {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.mp-settlement .mp-row {
    font-size: 0.82rem;
}

.mp-settlement-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 4px;
}

.mp-settlement-total span:first-child {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #16a34a;
}

.mp-settlement-profit {
    font-size: 1.3rem;
    font-weight: 800;
    color: #16a34a;
}

/* ── Phase 7: Utility classes ── */
.d-none { display: none; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-sm { font-size: 0.8rem; }
.fs-xs { font-size: 0.75rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 2rem; }
.mt-1-5 { margin-top: 1.5rem; }
.mt-2 { margin-top: 2rem; }
.p-0 { padding: 0; }
.p-1-5 { padding: 1.5rem; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.uppercase { text-transform: uppercase; }
.color-white { color: var(--text-primary); }
.color-muted { color: var(--text-secondary); }
.flex-wrap { flex-wrap: wrap; }
.min-h-0 { min-height: 0; }

/* Input wrapper with icon prefix (used in MeLi sim, settings, sync) */
.input-group-dark {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 0 15px;
}
.input-group-dark input {
    border: none;
    padding: 12px 0;
    width: 100%;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
}
.input-prefix { color: var(--text-secondary); margin-right: 10px; }
.input-suffix { color: var(--text-secondary); font-weight: 600; }

/* Checkbox row */
.checkbox-row { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.checkbox-md { width: 18px; height: 18px; }
.checkbox-sm { width: 16px; height: 16px; }

/* Modal overlay (fixed fullscreen) — used by info, CSV, detalle modals */
.modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Close button (small circle) — used in multiple modals */
.btn-close-circle-sm {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.08);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

/* Summary card header label (used in rentabilidad) */
.summary-card-label {
    font-size: 0.7rem;
    opacity: 0.7;
    letter-spacing: 0.05em;
}

/* Section heading in results area */
.section-heading {
    margin: 2rem 0 1rem;
}
.section-heading h2 {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Sync filter controls */
.sync-filter-controls {
    padding: 1.5rem;
    background: #f8f9fb;
    border-bottom: 1px solid var(--border-color);
}
.sync-filter-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: flex-end;
}
.sync-filter-group {
    flex: 1;
    min-width: 200px;
}
.sync-filter-group-fixed {
    flex: 0 0 200px;
}
.sync-filter-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}
.sync-select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.6rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.sync-search-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.sync-search-wrapper {
    position: relative;
}
.sync-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}
.sync-search-input {
    width: 100%;
    padding: 0.7rem 0.7rem 0.7rem 2.5rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sync-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.sync-divider {
    height: 24px;
    width: 1px;
    background: rgba(0,0,0,0.08);
    margin: 0 10px;
}
.sync-actions-label {
    color: #6366f1;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 5px;
}
.btn-sync-page {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(22, 163, 74, 0.2);
    background: rgba(22, 163, 74, 0.06);
    color: #16a34a;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-sync-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.2);
    background: rgba(124, 58, 237, 0.06);
    color: #7c3aed;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-sync-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-style: dashed;
    transition: all 0.3s;
}
.sync-status-bar {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

/* Icon size utility */
.icon-sm { font-size: 0.9rem; }

/* Contabilium header in sync view */
.sync-header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}
.sync-header-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Table header colored cells in sync */
.th-green { color: #16a34a; text-align: center; }
.th-yellow { color: #d97706; text-align: center; }
.th-purple { color: #7c3aed; text-align: center; }
.th-actions { width: 150px; text-align: center; }

/* Pagination button */
.btn-pagination-inline { margin: 0; width: auto; }
.page-info-text { color: var(--text-secondary); font-weight: 500; }

/* CSV export modal checkbox grid */
.csv-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.csv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Detalle factura modal layout */
.modal-detalle-content {
    background: var(--bg-card);
    padding: 0;
    border-radius: 1rem;
    width: 95%;
    max-width: 900px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.modal-detalle-header {
    padding: 1.5rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-detalle-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.modal-detalle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.modal-detalle-thead-row {
    background: #f8f9fb;
    border-bottom: 1px solid var(--border-color);
}
.modal-detalle-th {
    padding: 0.75rem;
    color: var(--text-secondary);
}
.modal-detalle-tfoot {
    background: #f8f9fb;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}

/* Rankings grid */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.ranking-card { padding: 1.25rem; }
.ranking-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ranking-title-green { color: #4ade80; }
.ranking-title-blue { color: #38bdf8; }
.ranking-title-yellow { color: #fbbf24; }

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 200;
        transition: transform 0.3s ease;
        height: 100vh;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .top-bar {
        padding-left: 3.5rem !important;
    }

    /* Dashboard grid responsive */
    .grid-publish {
        grid-template-columns: 1fr !important;
    }

    .stat-card { min-width: unset; }
}