/* ===========================
   LANDING SCREEN
=========================== */

.landing-screen {
    position: fixed;
    inset: 0;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity .6s ease, visibility .6s ease;
    opacity: 1;
}

.landing-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.landing-content {
    text-align: center;
    animation: landingFadeIn 1s ease forwards;
}

.landing-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 16px;
    animation: landingLogoPulse 1.5s ease-in-out infinite;
}

.landing-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.landing-tagline {
    font-size: .95rem;
    color: #94a3b8;
    font-weight: 500;
}

@keyframes landingFadeIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes landingLogoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

body.dark .landing-screen {
    background: #111;
}

body.dark .landing-name {
    color: #e0e0e0;
}

body.dark .landing-tagline {
    color: #777;
}

/* ===========================
   MAIN APP FADE IN
=========================== */

.fade-in {
    animation: fadeIn .5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   GENERAL
=========================== */

:root {
    --radius: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
    --shadow-hover: 0 8px 30px rgba(0,0,0,.1);
    --transition: .2s ease;
}

body {
    background: #eef1f6;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    transition: background .3s, color .3s;
    line-height: 1.5;
}

/* ===========================
   HEADER
=========================== */

.app-header {
    background: white;
    border-radius: var(--radius);
    padding: 16px 22px;
    box-shadow: var(--shadow);
    transition: background .3s, box-shadow .3s;
}

.app-logo-img {
    height: 36px;
    width: auto;
    border-radius: 8px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 0 14px;
    gap: 8px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.search-box i { color: #94a3b8; }

.search-box input {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: .92rem;
    outline: none;
    width: 200px;
    color: inherit;
}

.page-size-select {
    width: 72px;
    padding: 8px 6px;
    font-size: .85rem;
    font-weight: 600;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    background: white;
    color: #334155;
    transition: var(--transition);
}

.page-size-select:focus { border-color: #3b82f6; outline: none; }

/* ===========================
   FILTERS BAR
=========================== */

.filters-bar {
    background: white;
    border-radius: var(--radius);
    padding: 14px 22px;
    box-shadow: var(--shadow);
    transition: background .3s, box-shadow .3s;
}

.filter-tag {
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: .82rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}

.filter-tag:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }

.filter-tag.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59,130,246,.25);
}

/* ===========================
   PRICE RANGE FILTER
=========================== */

.price-range-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
}

.price-range-label {
    font-size: .72rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    min-width: 80px;
}

.price-range-sliders {
    position: relative;
    width: 120px;
    height: 20px;
}

.price-range-sliders input[type="range"] {
    position: absolute;
    width: 100%;
    height: 20px;
    top: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    margin: 0;
    pointer-events: none;
    z-index: 2;
}

.price-range-sliders input.price-range-min {
    z-index: 3;
}

.price-range-sliders input[type="range"].dragging {
    z-index: 5 !important;
}

.price-range-sliders input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    margin-top: 8px;
    border-radius: 2px;
    pointer-events: none;
    background: transparent;
}

.price-range-sliders input.price-range-min::-webkit-slider-runnable-track {
    background: transparent;
}

.price-range-sliders input.price-range-max::-webkit-slider-runnable-track {
    background: #e2e8f0;
}

.price-range-sliders input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
    margin-top: -6px;
    position: relative;
    z-index: 4;
}

.price-range-sliders input.price-range-max::-webkit-slider-thumb {
    z-index: 2;
}

.price-range-sliders input[type="range"]::-moz-range-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    pointer-events: none;
}

.price-range-sliders input.price-range-min::-moz-range-track {
    background: transparent;
}

.price-range-sliders input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
    position: relative;
    z-index: 4;
}

.price-range-sliders input.price-range-max::-moz-range-thumb {
    z-index: 2;
}

.price-range-sliders input[type="range"]::-moz-range-progress {
    background: transparent;
    height: 4px;
    border-radius: 2px;
}

body.dark .price-range-filter {
    background: #1e1e1e;
    border-color: #2a2a2a;
}

body.dark .price-range-label {
    color: #aaa;
}

body.dark .price-range-sliders input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
}

body.dark .price-range-sliders input.price-range-max::-webkit-slider-runnable-track {
    background: #333;
}

body.dark .price-range-sliders input[type="range"]::-moz-range-track {
    background: transparent;
}

body.dark .price-range-sliders input.price-range-min::-moz-range-track {
    background: transparent;
}

/* ===========================
   RESULTS / VIEW TOGGLE
=========================== */

.results-count { font-size: .82rem; font-weight: 600; color: #64748b; white-space: nowrap; }

.view-toggle { display: flex; background: #f1f5f9; border-radius: 10px; padding: 3px; }

.view-btn {
    border: none;
    background: transparent;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 1rem;
    transition: var(--transition);
}

.view-btn:hover { color: #3b82f6; background: rgba(59,130,246,.08); }
.view-btn.active { background: #3b82f6; color: white; box-shadow: 0 2px 8px rgba(59,130,246,.3); }

/* ===========================
   BUTTONS
=========================== */

.btn-icon {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover { background: #3b82f6; color: white; box-shadow: 0 2px 8px rgba(59,130,246,.25); }

/* ===========================
   PRODUCT CARDS
=========================== */

/* PRODUCT CARDS */
.product-card{border:1px solid #f1f5f9;border-radius:var(--radius);box-shadow:var(--shadow);transition:var(--transition);overflow:hidden;background:white;position:relative}
.product-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-hover)}

.card-store-strip{position:absolute;bottom:0;left:0;width:100%;height:4px;z-index:5}
.card-store-strip[data-store="elflorido"]{background:var(--blue)}
.card-store-strip[data-store="calimax"]{background:var(--orange)}
.card-store-strip[data-store="bodega"]{background:#eab308}
.card-store-strip[data-store="soriana"]{background:#dc2626}
.card-store-strip[data-store="walmart"]{background:#0ea5e9}

.card-img-wrapper{position:relative;background:#f8fafc;height:140px;display:flex;align-items:center;justify-content:center;padding:8px;overflow:hidden;border-bottom:1px solid #f1f5f9}
.product-image{max-width:100%;max-height:100%;object-fit:contain}

.promo-badge{position:absolute;top:6px;right:6px;background:linear-gradient(135deg,#ef4444,#dc2626);color:white;font-size:.55rem;font-weight:700;padding:2px 6px;border-radius:4px;letter-spacing:.5px;box-shadow:0 2px 6px rgba(239,68,68,.3);z-index:3}

.cross-store-badge{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;gap:2px;background:transparent;z-index:4}
.cross-store-badge .store-icon{width:16px;height:16px;border-radius:50%;font-size:.5rem;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.card-img-wrapper.has-cross.has-promo .promo-badge{top:26px}
.card-img-wrapper.has-cross .cross-store-badge{top:6px}

.product-card .card-body{padding:12px;display:flex;flex-direction:column}

.product-name{font-weight:700;font-size:.82rem;color:#1e293b;min-height:32px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:6px;line-height:1.3}

.card-price-col{display:flex;flex-direction:row;align-items:baseline;justify-content:flex-end;gap:6px;margin-top:auto;flex-wrap:wrap}
.card-price{font-weight:800;color:#16a34a;font-size:1rem}
.card-original-price{font-size:.72rem;color:#94a3b8;text-decoration:line-through}
.card-unit-price{font-size:.68rem;font-weight:600;color:#0891b2;width:100%;text-align:right}
.card-weight{font-size:.65rem;color:#64748b;width:100%;text-align:right}

.card-actions{display:flex;align-items:center;gap:6px;margin-top:6px}
.card-actions .btn-list-add{margin-top:0}
.card-actions .btn-monitor{margin-top:0;margin-left:auto}

.btn-list-add{width:34px;height:34px;border:none;border-radius:8px;background:#f1f5f9;color:#64748b;font-size:.9rem;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;margin-top:6px}
.btn-list-add:hover{background:var(--blue);color:white}
.btn-list-add.in-list{background:var(--green);color:white}

.btn-monitor{width:34px;height:34px;border:none;border-radius:8px;background:#f1f5f9;color:#64748b;font-size:.9rem;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;margin-top:6px}
.btn-monitor:hover{background:var(--violet,#8b5cf6);color:white}
.btn-monitor.active{background:var(--violet,#8b5cf6);color:white}

.cart-monitor-btn{width:28px;height:28px;border:none;border-radius:6px;background:#f1f5f9;color:#64748b;font-size:.75rem;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0}
.cart-monitor-btn:hover{background:#8b5cf6;color:white}
.cart-monitor-btn.active{background:#8b5cf6;color:white}

#btnMonitorPopup .cart-badge{top:-4px;right:-4px}
.monitor-item-row,.monitor-item{border-radius:8px}
#monitorItemsModal .modal-body{max-height:60vh;overflow-y:auto}

/* ===========================
   STORE BADGES
=========================== */

.store-badge-wrapper {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
}

.store-badge-wrapper-inline {
    display: inline-block;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: .3px;
    white-space: nowrap;
}

.store-elflorido {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 6px rgba(59,130,246,.3);
}

.store-calimax {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    box-shadow: 0 2px 6px rgba(249,115,22,.3);
}

.store-bodega {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: white;
    box-shadow: 0 2px 6px rgba(234,179,8,.3);
}

.store-soriana {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 2px 6px rgba(220,38,38,.3);
}

.store-walmart {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    box-shadow: 0 2px 6px rgba(14,165,233,.3);
}

.src-pending {
    font-size: .6em;
    font-weight: 600;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ===========================
   CROSS-STORE BADGE
=========================== */

@keyframes crossStorePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .8; }
}

.cross-store-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .65rem;
    font-weight: 600;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

/* ===========================
   CROSS-STORE COMPARISON (Modal)
=========================== */

.cross-store-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.cross-store-title {
    font-size: .78rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cross-store-item {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.cross-store-item.cheaper {
    border-color: #22c55e;
    background: #f0fdf4;
}

.cross-store-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.cross-store-sim {
    font-size: .65rem;
    color: #94a3b8;
    font-weight: 600;
}

.cross-store-item-name {
    font-size: .78rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.cross-store-item-prices {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cross-store-price {
    font-size: .88rem;
    font-weight: 800;
    color: #16a34a;
}

.cross-store-unit {
    font-size: .72rem;
    font-weight: 600;
    color: #0891b2;
}

.cross-store-saving {
    font-size: .68rem;
    font-weight: 700;
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 6px;
    border-radius: 4px;
}

.cross-store-unit-diff {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.cross-store-unit-more {
    font-size: .68rem;
    font-weight: 600;
    color: #dc2626;
}

.cross-store-unit-less {
    font-size: .68rem;
    font-weight: 600;
    color: #16a34a;
}

.cross-store-unit-same {
    font-size: .68rem;
    font-weight: 600;
    color: #94a3b8;
}

/* ===========================
   MATCH BADGES
=========================== */

.match-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .58rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.match-name {
    background: #dcfce7;
    color: #166534;
}

.match-category {
    background: #fef3c7;
    color: #92400e;
}

.match-desc {
    background: #e0f2fe;
    color: #075985;
}

.match-brand {
    background: #f3e8ff;
    color: #6b21a8;
}

.match-other {
    background: #f1f5f9;
    color: #64748b;
}

body.dark .match-name { background: #14532d; color: #4ade80; }
body.dark .match-category { background: #422006; color: #fbbf24; }
body.dark .match-desc { background: #0c4a6e; color: #7dd3fc; }
body.dark .match-brand { background: #3b0764; color: #c084fc; }
body.dark .match-other { background: #1e1e1e; color: #888; }

/* ===========================
   GRAMMAGE BADGE
=========================== */

.grammage-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: .6rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* ===========================
   UNIT PRICE
=========================== */

.unit-price {
    font-size: .62rem;
    font-weight: 700;
    color: #0891b2;
    white-space: nowrap;
}

.table-unitprice {
    font-size: .8rem;
    font-weight: 600;
    color: #0891b2;
}

.store-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: white;
    font-size: .85rem;
}

.store-icon-elflorido {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 6px rgba(59,130,246,.3);
}

.store-icon-calimax {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 2px 6px rgba(249,115,22,.3);
}

.store-icon-bodega {
    background: linear-gradient(135deg, #eab308, #ca8a04);
    box-shadow: 0 2px 6px rgba(234,179,8,.3);
}
.store-icon-soriana { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.store-icon-walmart  { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.table-grammage { font-size: .78rem; color: #64748b; }

/* ===========================
   TABLE
=========================== */

.table-responsive {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.table { margin: 0; background: white; }
.table thead { background: #f8fafc; }

.table th {
    font-size: .75rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
    user-select: none;
    padding: 12px 14px;
}

.table th.sortable { cursor: pointer; transition: background .15s; }
.table th.sortable:hover { background: #f1f5f9; }
.table th.sort-asc, .table th.sort-desc { background: #eff6ff !important; color: #2563eb; border-bottom-color: #3b82f6; }

.sort-icon { font-size: .62rem; opacity: .3; margin-left: 4px; transition: opacity .15s; }
.table th.sort-asc .sort-icon, .table th.sort-desc .sort-icon { opacity: 1; }

.table td { font-size: .84rem; vertical-align: middle; padding: 11px 14px; border-color: #f1f5f9; color: #334155; }
.table-row-clickable { cursor: pointer; transition: background .1s; }
.table-row-clickable:hover { background: #f8fafc !important; }

.table-image { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #f8fafc; padding: 3px; border: 1px solid #f1f5f9; }
.table-name { font-weight: 600; color: #1e293b; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===========================
   EMPTY STATE
=========================== */

.empty-state { text-align: center; padding: 60px 20px; background: white; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #f1f5f9; }
.empty-state i { font-size: 3.5rem; color: #cbd5e1; }
.empty-state p { margin: 16px 0 6px; font-weight: 600; color: #334155; }
.empty-state small { color: #94a3b8; }

/* ===========================
   MODAL
=========================== */

.modal-content { border: none; border-radius: var(--radius); overflow: hidden; }
.modal-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 16px 22px; }
.modal-title { font-weight: 700; font-size: 1.05rem; color: #1e293b; }
.modal-body { padding: 24px; }

.product-detail { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.detail-image { background: #f8fafc; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; min-height: 240px; border: 1px solid #f1f5f9; gap: 12px; }
.detail-image img { max-width: 100%; max-height: 220px; object-fit: contain; }
.detail-image-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.detail-image-actions .btn { font-size: .72rem; padding: 4px 10px; border-radius: 6px; }
.detail-name { font-weight: 700; font-size: 1.2rem; color: #1e293b; margin-bottom: 10px; }
.detail-badges .badge { font-size: .72rem; margin-right: 5px; }
.detail-prices { display: flex; flex-direction: column; gap: 8px; }
.detail-price-main, .detail-price-promo, .detail-price-original { display: flex; align-items: center; gap: 12px; }
.detail-label { font-size: .75rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; min-width: 65px; }
.detail-value { font-size: 1rem; font-weight: 700; color: #1e293b; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: #475569; }
.detail-specs { display: flex; flex-direction: column; gap: 6px; }
.spec-row { font-size: .84rem; padding: 8px 12px; background: #f8fafc; border-radius: 8px; border: 1px solid #f1f5f9; }
.spec-label { font-weight: 600; color: #64748b; }
.spec-value { color: #1e293b; }
.detail-json pre { font-size: .75rem; background: #0f172a; color: #93c5fd; padding: 16px; border-radius: 10px; max-height: 280px; overflow: auto; margin: 0; }

/* ===========================
   TOAST
=========================== */

.toast-msg { position: fixed; bottom: 20px; right: 20px; padding: 12px 24px; border-radius: 10px; color: white; font-weight: 600; font-size: .88rem; z-index: 9999; transform: translateY(16px); opacity: 0; transition: .3s ease; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast-msg.show { transform: translateY(0); opacity: 1; }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-success { background: linear-gradient(135deg, #22c55e, #16a34a); }
.toast-info { background: linear-gradient(135deg, #3b82f6, #2563eb); }

/* ===========================
   SCROLLBAR
=========================== */

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 992px) {
    .product-detail { grid-template-columns: 1fr; }
    .detail-image { min-height: 180px; }
    .search-box input { width: 150px; }
}

@media (max-width: 768px) {
    .app-header { padding: 12px 14px; }
    .filters-bar { padding: 10px 14px; }
    .search-box input { width: 120px; }
}

/* ==================================================
   DARK MODE
================================================== */

body.dark {
    background: #0a0a0a !important;
    color: #d4d4d4;
}

body.dark .app-header {
    background: #161616;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

body.dark .search-box {
    background: #1e1e1e;
    border-color: #2a2a2a;
}

body.dark .search-box:focus-within {
    background: #1e1e1e;
    border-color: #444;
}

body.dark .search-box input { color: #e0e0e0; }
body.dark .search-box i { color: #666; }

body.dark .page-size-select {
    background: #1e1e1e;
    color: #d4d4d4;
    border-color: #2a2a2a;
}

body.dark .page-size-select:focus { border-color: #444; }

body.dark .filters-bar {
    background: #161616;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

body.dark .filter-tag {
    background: #1e1e1e;
    border-color: #2a2a2a;
    color: #888;
}

body.dark .filter-tag:hover {
    background: #252525;
    border-color: #444;
    color: #ccc;
}

body.dark .filter-tag.active {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #0a0a0a;
}

body.dark .view-toggle { background: #1e1e1e; }
body.dark .view-btn { color: #666; }
body.dark .view-btn:hover { background: #2a2a2a; color: #ddd; }
body.dark .view-btn.active { background: #e0e0e0; color: #0a0a0a; }

body.dark .btn-icon { background: #1e1e1e; color: #888; }
body.dark .btn-icon:hover { background: #e0e0e0; color: #0a0a0a; }

body.dark .results-count { color: #777; }

body.dark .product-card {
    background: #161616;
    border-color: #222;
}

body.dark .product-card:hover {
    border-color: #333;
    box-shadow: 0 8px 30px rgba(0,0,0,.6);
}

body.dark .card-img-wrapper {
    background: #111;
    border-color: #222;
}

body.dark .product-name { color: #e0e0e0; }
body.dark .price { color: #4ade80; }
body.dark .promo { color: #f87171; }
body.dark .rating, body.dark .stock { color: #777; }

body.dark .badge.bg-primary-subtle { background: rgba(255,255,255,.08) !important; color: #ccc !important; }
body.dark .badge.bg-secondary-subtle { background: rgba(255,255,255,.05) !important; color: #999 !important; }

body.dark .table-responsive {
    background: #161616 !important;
    border-color: #222 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

body.dark .table { background: #161616 !important; color: #d4d4d4 !important; }
body.dark .table thead { background: #111 !important; }

body.dark .table th {
    color: #888 !important;
    border-color: #222 !important;
    background: #111 !important;
}

body.dark .table th.sortable:hover { background: #1e1e1e !important; }

body.dark .table th.sort-asc,
body.dark .table th.sort-desc {
    background: rgba(255,255,255,.05) !important;
    color: #e0e0e0 !important;
    border-color: #333 !important;
}

body.dark .table td {
    color: #ccc !important;
    border-color: #1e1e1e !important;
    background: #161616 !important;
}

body.dark .table-row-clickable:hover { background: #1e1e1e !important; }

body.dark .table-image {
    background: #111 !important;
    border-color: #222 !important;
}

body.dark .table-name { color: #e0e0e0 !important; }

body.dark .empty-state {
    background: #161616;
    border-color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

body.dark .empty-state i { color: #2a2a2a; }
body.dark .empty-state p { color: #888; }
body.dark .empty-state small { color: #555; }

body.dark .modal-content {
    background: #161616;
    box-shadow: 0 20px 60px rgba(0,0,0,.8);
}

body.dark .modal-header {
    background: #111;
    border-color: #222;
}

body.dark .modal-title { color: #e0e0e0; }
body.dark .btn-close { filter: invert(1); }

body.dark .detail-image {
    background: #111;
    border-color: #222;
}

body.dark .detail-name { color: #e0e0e0; }
body.dark .detail-value { color: #e0e0e0; }

body.dark .spec-row {
    background: #1a1a1a;
    border-color: #333;
}

body.dark .detail-extra {
    background: #1a1a1a;
    padding: 16px;
    border-radius: 10px;
}

body.dark .spec-label { color: #777; }
body.dark .spec-value { color: #d4d4d4; }
body.dark .detail-json pre { background: #050505; }

body.dark .meta-item { color: #888; }

body.dark ::-webkit-scrollbar-thumb { background: #2a2a2a; }
body.dark ::-webkit-scrollbar-track { background: #111; }

body.dark .form-control,
body.dark .form-select {
    background: #1e1e1e;
    color: #d4d4d4;
    border-color: #2a2a2a;
}

body.dark .form-control:focus,
body.dark .form-select:focus {
    background: #1e1e1e;
    color: #d4d4d4;
    border-color: #444;
}

body.dark hr { border-color: #222; }

body.dark .text-muted { color: #666 !important; }
body.dark .text-success { color: #4ade80 !important; }
body.dark .text-danger { color: #f87171 !important; }
body.dark .text-warning { color: #fbbf24 !important; }
body.dark .text-primary { color: #e0e0e0 !important; }
body.dark .bg-white { background-color: #161616 !important; }
body.dark .bg-body-tertiary { background-color: #0a0a0a !important; }

body.dark .modal-backdrop.show { background: rgba(0,0,0,.8); }
body.dark .modal-backdrop { background: rgba(0,0,0,.7); }

body.dark .store-elflorido {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

body.dark .store-calimax {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: white;
}

body.dark .store-bodega {
    background: linear-gradient(135deg, #ca8a04, #a16207);
    color: white;
}

body.dark .grammage-badge {
    background: #1e1e1e;
    color: #aaa;
    border-color: #2a2a2a;
}

body.dark .unit-price {
    color: #22d3ee;
}

body.dark .table-unitprice {
    color: #22d3ee;
}

body.dark .table-grammage {
    color: #777;
}

body.dark .card-meta { color: #aaa; }

/* ===========================
   BRAND
=========================== */

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -.3px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: .7rem;
    color: #94a3b8;
    font-weight: 500;
}

body.dark .brand-name { color: #e0e0e0; }
body.dark .brand-tagline { color: #666; }

/* ===========================
   SETTINGS DROPDOWN
=========================== */

.settings-dropdown {
    min-width: 240px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.settings-page-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
}

.settings-page-header .brand-tagline {
    display: block;
    font-size: .72rem;
    color: #64748b;
}

.settings-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 16px;
}

.settings-card-title {
    font-size: .95rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

body.dark .settings-page-header { border-color: #2a2a2a; }
body.dark .settings-page-header .brand-tagline { color: #888; }
body.dark .settings-card { background: #171717; border-color: #2a2a2a; }
body.dark .settings-card-title { color: #e5e7eb; }


.settings-section { margin-bottom: 8px; }

.settings-section-title {
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 8px;
}

.settings-source-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .15s;
}
.settings-radio:hover { background: #f1f5f9; }
.settings-radio input:checked + span { color: #3b82f6; }
.settings-radio input { accent-color: #3b82f6; }

.settings-label {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 8px 0 4px;
}

.monitor-lists {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}

.monitor-status {
    font-size: .72rem;
    color: #64748b;
    margin-top: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    line-height: 1.4;
}
.monitor-status.ok { color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; }
.monitor-status.err { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }

body.dark .monitor-status { background: #1a1a1a; color: #aaa; }
body.dark .monitor-status.ok { color: #4ade80; background: #0a1a0a; border-color: #166534; }
body.dark .monitor-status.err { color: #f87171; background: #1a0a0a; border-color: #7f1d1d; }
body.dark .monitor-lists { border-color: #2a2a2a; }

body.dark .settings-dropdown {
    background: #161616;
    border-color: #2a2a2a;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}

body.dark .settings-section-title { color: #666; }

body.dark .settings-radio { color: #aaa; }
body.dark .settings-radio:hover { background: #1e1e1e; }
body.dark .settings-radio input:checked + span { color: #e0e0e0; }
body.dark .settings-radio input { accent-color: #e0e0e0; }

/* ===========================
   SUMMARY BAR - Action Chips
=========================== */

.summary-bar {
    background: white;
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    transition: background .3s;
}

.summary-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.summary-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.summary-stat {
    font-size: .78rem;
    font-weight: 600;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-elflorido { background: #3b82f6; }
.dot-calimax { background: #f97316; }

.summary-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: 1.5px solid transparent;
}

.summary-store-badge.store-elflorido {
    color: #3b82f6;
    border-color: #3b82f6;
    background: transparent;
}

.summary-store-badge.store-elflorido.active {
    color: white;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: transparent;
}

.summary-store-badge.store-calimax {
    color: #f97316;
    border-color: #f97316;
    background: transparent;
}

.summary-store-badge.store-calimax.active {
    color: white;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: transparent;
}

.summary-store-badge.store-bodega {
    color: #ca8a04;
    border-color: #ca8a04;
    background: transparent;
}

.summary-store-badge.store-bodega.active {
    color: white;
    background: linear-gradient(135deg, #eab308, #ca8a04);
    border-color: transparent;
}
.summary-store-badge.store-soriana {
    color: #b91c1c;
    border-color: #dc2626;
    background: transparent;
}

.summary-store-badge.store-soriana.active {
    color: white;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: transparent;
}

.summary-store-badge.store-walmart {
    color: #0369a1;
    border-color: #0ea5e9;
    background: transparent;
}

.summary-store-badge.store-walmart.active {
    color: white;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border-color: transparent;
}

/* Chips con 0 resultados: siempre visibles pero atenuados */
.summary-store-badge.zero {
    opacity: .45;
}
.summary-store-badge.zero:hover {
    opacity: .75;
}

/* Tienda todavia buscando: late mientras responde su fetch. */
.summary-store-badge.pending {
    opacity: 1;
    animation: storeBadgePulse 1.1s ease-in-out infinite;
}
@keyframes storeBadgePulse {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}

.summary-store-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.summary-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.summary-chip {
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: .75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    user-select: none;
}

.summary-chip:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }

.summary-chip.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 6px rgba(59,130,246,.25);
}

.summary-chip-more {
    border: none;
    background: #f1f5f9;
    padding: 5px 8px;
}
.summary-chip-more:hover { background: #e2e8f0; color: #475569; }

.summary-expanded {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.summary-expanded-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-smart {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    background: #fefce8;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid #fde68a;
}

.summary-smart-label {
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    font-size: .65rem;
    letter-spacing: .5px;
}

.summary-smart-name {
    font-weight: 600;
    color: #1e293b;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-smart-price {
    font-weight: 800;
    color: #16a34a;
}

.smart-picks-list {
    width: 100%;
}

.smart-picks-header {
    font-size: .78rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.smart-pick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    font-size: .78rem;
}

.smart-pick-item:hover {
    background: #f1f5f9;
}

.smart-pick-rank {
    font-weight: 800;
    color: #94a3b8;
    min-width: 24px;
    font-size: .72rem;
}

.smart-pick-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.smart-pick-price {
    font-weight: 700;
    color: #16a34a;
    white-space: nowrap;
}

.smart-pick-unitprice {
    font-weight: 600;
    color: #0891b2;
    font-size: .72rem;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}

body.dark .summary-bar {
    background: #161616;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

body.dark .summary-stat { color: #888; }

body.dark .summary-chip {
    background: #1e1e1e;
    border-color: #2a2a2a;
    color: #888;
}
body.dark .summary-chip:hover {
    background: #252525;
    border-color: #444;
    color: #ccc;
}
body.dark .summary-chip.active {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #0a0a0a;
    box-shadow: 0 2px 6px rgba(255,255,255,.1);
}
body.dark .summary-chip-more { background: #1e1e1e; }
body.dark .summary-chip-more:hover { background: #2a2a2a; color: #aaa; }

body.dark .summary-expanded {
    border-color: #2a2a2a;
}

body.dark .summary-smart { background: #1a1500; border-color: #332b00; }
body.dark .summary-smart-label { color: #fbbf24; }
body.dark .summary-smart-name { color: #d4d4d4; }
body.dark .summary-smart-price { color: #4ade80; }

body.dark .smart-picks-header { color: #fbbf24; }
body.dark .smart-pick-item:hover { background: #1e1e1e; }
body.dark .smart-pick-rank { color: #555; }
body.dark .smart-pick-name { color: #d4d4d4; }
body.dark .smart-pick-price { color: #4ade80; }
body.dark .smart-pick-unitprice { color: #22d3ee; }

/* ===========================
   LISTS BADGE
=========================== */

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: .6rem;
    font-weight: 700;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(239,68,68,.3);
}

/* ===========================
   LIST ADD BUTTON
=========================== */

.btn-list-add {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
}

.btn-list-add:hover { background: #3b82f6; color: white; }
.btn-list-add.in-list { background: #22c55e; color: white; }
.btn-list-add.in-list:hover { background: #dc2626; color: white; }

/* ===========================
   LIST CARD (Offcanvas)
=========================== */

.list-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .15s ease;
}

.list-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,.15);
}

.list-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(59,130,246,.2);
}

.list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.list-card-name {
    font-weight: 700;
    font-size: .9rem;
    color: #1e293b;
}

.list-card-count {
    font-size: .72rem;
    font-weight: 600;
    color: #94a3b8;
}

.list-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-card-total {
    font-size: .88rem;
    font-weight: 800;
    color: #16a34a;
}

.list-card-actions {
    display: flex;
    gap: 4px;
}

.list-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .1s;
}

.list-action-btn:hover { background: #e2e8f0; color: #475569; }
.list-action-btn[data-action="delete"]:hover { background: #fee2e2; color: #dc2626; }

/* ===========================
   LIST DETAIL MODAL
=========================== */

.list-detail-store {
    margin-bottom: 16px;
}

.list-detail-store-header {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 6px 0 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.list-detail-store-total {
    color: #16a34a;
    font-weight: 800;
}

.list-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    margin-bottom: 6px;
}

.list-detail-item-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 2px;
    border: 1px solid #e2e8f0;
}

.list-detail-item-info { flex: 1; min-width: 0; }

.list-detail-item-name {
    font-size: .78rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-detail-item-meta {
    font-size: .65rem;
    color: #94a3b8;
    margin-top: 1px;
}

.list-detail-item-price {
    font-size: .82rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: 2px;
}

.list-detail-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-detail-grand-total {
    text-align: right;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding: 12px 0 4px;
    border-top: 2px solid #e2e8f0;
    margin-top: 8px;
}

/* ===========================
   QUOTE RESULT
=========================== */

.quote-result {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.quote-header {
    font-size: .85rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quote-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    color: #334155;
}

.quote-current { font-weight: 700; }
.quote-other { font-weight: 700; }

.quote-divider {
    border-top: 1px solid #bbf7d0;
    margin: 4px 0;
}

.quote-total {
    font-weight: 700;
    font-size: .92rem;
}

.quote-match-info {
    font-size: .72rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 4px;
}

/* ===========================
   LIST OFFCANVAS
=========================== */

.offcanvas-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.cart-empty i { font-size: 3rem; color: #cbd5e1; }
.cart-empty p { margin: 12px 0 4px; font-weight: 600; color: #64748b; }
.cart-empty small { font-size: .78rem; }

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-store-group { margin-bottom: 16px; }

.cart-store-header {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 6px 0 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.cart-store-total { color: #16a34a; font-weight: 800; }

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    margin-bottom: 6px;
}

.cart-item-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 2px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
    font-size: .78rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    font-size: .65rem;
    color: #94a3b8;
    margin-top: 1px;
}

.cart-item-price {
    font-size: .82rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: 2px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .1s;
    line-height: 1;
}

.cart-qty-btn:hover { background: #3b82f6; color: white; border-color: #3b82f6; }

.cart-qty-val {
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 18px;
    text-align: center;
}

.cart-remove-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .1s;
}

.cart-remove-btn:hover { background: #fee2e2; color: #dc2626; }

.cart-grand-total {
    text-align: right;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding: 12px 0 4px;
    border-top: 2px solid #e2e8f0;
    margin-top: 8px;
}

/* ===========================
   OFFCANVAS TOOLBAR
=========================== */

.offcanvas-toolbar {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #475569;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.toolbar-btn i { font-size: .85rem; }

body.dark .offcanvas-toolbar {
    background: #111;
    border-color: #222;
}

body.dark .toolbar-btn {
    background: #1e1e1e;
    border-color: #2a2a2a;
    color: #aaa;
}

body.dark .toolbar-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #1a2030;
}

body.dark .offcanvas { background: #161616; }
body.dark .offcanvas-header { background: #111; border-color: #222; }
body.dark .offcanvas-title { color: #e0e0e0; }
body.dark .offcanvas-footer { background: #111; border-color: #222; }

body.dark .list-card { background: #1a1a1a; border-color: #2a2a2a; }
body.dark .list-card:hover { border-color: #444; }
body.dark .list-card.active { background: #1a2030; border-color: #3b82f6; }
body.dark .list-card-name { color: #e0e0e0; }
body.dark .list-card-count { color: #666; }
body.dark .list-card-total { color: #4ade80; }
body.dark .list-action-btn { color: #666; }
body.dark .list-action-btn:hover { background: #2a2a2a; color: #aaa; }

body.dark .cart-empty i { color: #2a2a2a; }
body.dark .cart-empty p { color: #888; }
body.dark .cart-empty small { color: #555; }

body.dark .cart-store-header { color: #888; border-color: #2a2a2a; }
body.dark .cart-store-total { color: #4ade80; }
body.dark .cart-item { background: #1a1a1a; border-color: #2a2a2a; }
body.dark .cart-item-img { background: #111; border-color: #2a2a2a; }
body.dark .cart-item-name { color: #d4d4d4; }
body.dark .cart-item-meta { color: #666; }
body.dark .cart-item-price { color: #4ade80; }
body.dark .cart-qty-btn { background: #1e1e1e; border-color: #333; color: #aaa; }
body.dark .cart-qty-btn:hover { background: #3b82f6; border-color: #3b82f6; color: white; }
body.dark .cart-qty-val { color: #d4d4d4; }
body.dark .cart-remove-btn { color: #666; }
body.dark .cart-remove-btn:hover { background: #3a1111; color: #f87171; }
body.dark .cart-grand-total { color: #d4d4d4; border-color: #2a2a2a; }

/* ===========================
   CART QTY / REMOVE (reused)
=========================== */

.cart-qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .1s;
    line-height: 1;
}

.cart-qty-btn:hover { background: #3b82f6; color: white; border-color: #3b82f6; }

.cart-qty-val {
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 18px;
    text-align: center;
}

.cart-remove-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .1s;
}

.cart-remove-btn:hover { background: #fee2e2; color: #dc2626; }

body.dark .cart-qty-btn { background: #1e1e1e; border-color: #333; color: #aaa; }
body.dark .cart-qty-btn:hover { background: #3b82f6; border-color: #3b82f6; color: white; }
body.dark .cart-qty-val { color: #d4d4d4; }
body.dark .cart-remove-btn { color: #666; }
body.dark .cart-remove-btn:hover { background: #3a1111; color: #f87171; }

body.dark .list-detail-item { background: #1a1a1a; border-color: #2a2a2a; }
body.dark .list-detail-item-img { background: #111; border-color: #2a2a2a; }
body.dark .list-detail-item-name { color: #d4d4d4; }
body.dark .list-detail-item-meta { color: #666; }
body.dark .list-detail-item-price { color: #4ade80; }
body.dark .list-detail-store-header { color: #888; border-color: #2a2a2a; }
body.dark .list-detail-store-total { color: #4ade80; }
body.dark .list-detail-grand-total { color: #d4d4d4; border-color: #2a2a2a; }

body.dark .cross-store-section { background: #1a1a1a; border-color: #2a2a2a; }
body.dark .cross-store-title { color: #a78bfa; }
body.dark .cross-store-item { background: #161616; border-color: #2a2a2a; }
body.dark .cross-store-item.cheaper { background: #0a1a0a; border-color: #166534; }
body.dark .cross-store-item-name { color: #d4d4d4; }
body.dark .cross-store-price { color: #4ade80; }
body.dark .cross-store-saving { background: #14532d; color: #4ade80; }
body.dark .cross-store-unit-more { color: #f87171; }
body.dark .cross-store-unit-less { color: #4ade80; }
body.dark .cross-store-unit-same { color: #666; }
body.dark .cross-store-tag { background: #1a1530; color: #a78bfa; }

body.dark .quote-result { background: #0a1a0a; border-color: #166534; }
body.dark .quote-header { color: #4ade80; }
body.dark .quote-row { color: #d4d4d4; }

/* ===========================
   IMAGE LIGHTBOX
=========================== */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    animation: fadeIn .2s ease;
}

.lightbox-overlay.d-none {
    display: none;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,.3);
}

/* ===========================
   TABLE CART BUTTON
=========================== */

.table-cart-btn { width: 40px; text-align: center; }
.table-cart-btn .btn-list-add { width: 30px; height: 30px; font-size: .8rem; border-radius: 6px; }
.table-cart-btn .btn-monitor { width: 30px; height: 30px; font-size: .8rem; border-radius: 6px; }

/* ===========================
   TABLE STORE STRIP (franja de tienda)
=========================== */

.table-row-clickable[data-store="elflorido"] { border-left: 3px solid var(--blue); }
.table-row-clickable[data-store="calimax"] { border-left: 3px solid var(--orange); }
.table-row-clickable[data-store="bodega"] { border-left: 3px solid #eab308; }
.table-row-clickable[data-store="soriana"] { border-left: 3px solid #dc2626; }
.table-row-clickable[data-store="walmart"] { border-left: 3px solid #0ea5e9; }

.table-name-cell .table-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
    font-size: .82rem;
    color: #1e293b;
    line-height: 1.3;
}
.table-name-cell { min-width: 0; }

/* ===========================
   PRODUCT MODAL - AREA DINAMICA
=========================== */

.modal-json-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 8px;
    font-size: .72rem;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 0;
}
#productDynamicArea {
    max-height: 260px;
    overflow: auto;
    font-size: .8rem;
}
#productActionBar .btn { white-space: nowrap; }

/* ===========================
   FAB MENU - flotante expandible
=========================== */

.fab {
    position: fixed;
    right: 18px;
    bottom: 84px;
    z-index: 1090;
    display: none;
    flex-direction: column;
    align-items: flex-end;
}

.fab-main {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(59,130,246,.45);
    cursor: pointer;
    transition: transform .2s;
}
.fab-main i { transition: transform .25s; }
.fab-main.open i { transform: rotate(45deg); }

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    align-items: flex-end;
}

.fab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: white;
    color: #334155;
    font-size: .8rem;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.fab-item:hover { background: #3b82f6; color: white; }
.fab-item i { font-size: 1rem; }

/* ===========================
   PAGINA DE NOTIFICACIONES
   =========================== */
.notif-alert {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .88rem;
    margin-bottom: 16px;
    line-height: 1.45;
}
.notif-alert code { background: rgba(0,0,0,.08); padding: 1px 5px; border-radius: 4px; }
.notif-alert-ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.notif-alert-warn{ background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notif-alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

.notif-hours { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 6px 0 4px; }
.notif-hour {
    border: 1px solid #d4d4d8; background: #fff; border-radius: 6px;
    padding: 5px 0; font-size: .74rem; font-weight: 600; color: #52525b; cursor: pointer;
    transition: all .12s;
}
.notif-hour:hover { border-color: #3b82f6; }
.notif-hour.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.notif-preview { font-size: .78rem; color: #71717a; line-height: 1.5; }

.notif-digest-preview {
    margin-top: 10px; padding: 12px; border-radius: 8px; font-size: .74rem;
    background: #0f172a; color: #e2e8f0; white-space: pre-wrap; word-break: break-word;
    max-height: 340px; overflow: auto; line-height: 1.5;
}

.notif-items { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
    display: flex; gap: 10px; align-items: center; padding: 9px 10px;
    border: 1px solid #e4e4e7; border-radius: 10px; background: #fafafa;
}
.notif-item.muted { opacity: .55; }
.notif-item.no-daily { border-style: dashed; }
.notif-item-img { width: 42px; height: 42px; object-fit: contain; border-radius: 6px; background: #fff; flex-shrink: 0; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-name { font-size: .86rem; font-weight: 600; line-height: 1.25; }
.notif-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .76rem; color: #71717a; margin-top: 2px; }
.notif-item-rules { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.notif-chip {
    font-size: .66rem; padding: 1px 7px; border-radius: 999px;
    background: #e4e4e7; color: #3f3f46; white-space: nowrap;
}
.notif-chip.muted { background: #fee2e2; color: #b91c1c; }
.notif-price { font-weight: 700; color: #18181b; }
.notif-delta.down { color: #15803d; font-weight: 700; }
.notif-delta.up { color: #b91c1c; font-weight: 700; }
.notif-unit { color: #6d28d9; }
.notif-promo { background: #ffedd5; color: #c2410c; font-size: .62rem; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.notif-store { font-size: .66rem; padding: 1px 6px; border-radius: 4px; }
.notif-store.store-elflorido { background: #dbeafe; color: #1d4ed8; }
.notif-store.store-calimax  { background: #ffedd5; color: #c2410c; }
.notif-store.store-bodega    { background: #fef9c3; color: #a16207; }
.notif-store.store-soriana   { background: #fee2e2; color: #b91c1c; }
.notif-store.store-walmart   { background: #e0f2fe; color: #0369a1; }
.notif-item-edit { flex-shrink: 0; }

.notif-empty { text-align: center; padding: 26px 12px; color: #a1a1aa; }
.notif-empty i { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.notif-empty p { margin: 0 0 4px; }

.notif-history { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.notif-hist { display: flex; gap: 8px; align-items: center; font-size: .76rem; padding: 5px 8px; border-radius: 6px; background: #fafafa; }
.notif-hist.err { background: #fef2f2; }
.notif-hist-kind { font-size: .64rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #3b82f6; color: #fff; flex-shrink: 0; }
.notif-hist-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3f3f46; }
.notif-hist-when { color: #a1a1aa; font-size: .68rem; flex-shrink: 0; }

.notif-rule-editor {
    position: fixed; top: 0; right: 0; height: 100%; width: 320px; max-width: 90vw;
    background: #fff; border-left: 1px solid #e4e4e7; z-index: 1080;
    padding: 16px; overflow-y: auto; box-shadow: -8px 0 24px rgba(0,0,0,.08);
}
.notif-rule-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.notif-rule-editor-head strong { font-size: .9rem; line-height: 1.25; }
.btn-icon-sm { width: 26px; height: 26px; font-size: .8rem; }

/* Campana de notificaciones: solo se enciende con avisos sin ver */
.cart-badge-alert { animation: notifPulse 2.4s ease-in-out infinite; }
@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
#btnMonitorPopup.cart-badge-alert { color: #fff; }

/* ===========================
   NOTIFICACIONES - 1920px
   A 1400px+ el contenido se reparte en dos columnas: en una pantalla
   ancha una sola columna de 660px dejaba la pagina vacia por los lados.
=========================== */

.notif-wide { max-width: 1780px; }

.notif-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 1200px) {
    .notif-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    /* El salto a la watchlist ocupa todas las columnas. */
    .notif-grid > .notif-span-2 { grid-column: 1 / -1; }
}
/* Pantalla ancha: las cuatro tarjetas en fila, sin scroll lateral. */
@media (min-width: 1600px) {
    .notif-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1900px) {
    .notif-grid { gap: 20px; }
    .settings-card { padding: 18px 20px; }
}
.notif-grid > .settings-card { margin-bottom: 0 !important; }
.notif-footer { max-width: 1780px; }

.notif-pairing {
    border: 1px solid #e2e8f0;
    border-left: 3px solid #3b82f6;
    border-radius: 10px;
    padding: 12px;
}
.notif-pairing-steps { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; color: #334155; margin-bottom: 10px; }
.notif-step { display: flex; align-items: center; gap: 8px; }
.notif-step-n {
    width: 20px; height: 20px; flex-shrink: 0;
    border-radius: 50%; background: #3b82f6; color: #fff;
    font-size: .68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.notif-waiting { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .82rem; color: #0369a1; }
.notif-jump {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 14px 16px; text-decoration: none; color: inherit;
    background: #fff;
}
.notif-jump:hover { border-color: #3b82f6; background: #f8fafc; }
.notif-jump-icon {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
    background: #eff6ff; color: #2563eb;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.notif-jump-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notif-jump-body strong { font-size: .92rem; }

/* ===========================
   PAGINA DE WATCHLIST
=========================== */

.wl-container { max-width: 1860px; }
.wl-header { border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; }
.wl-brand-tagline { display: block; font-size: .72rem; color: #64748b; }

.wl-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1200px) { .wl-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (min-width: 1700px) { .wl-grid { grid-template-columns: minmax(0, 1fr) 420px; } }

.wl-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
}
.wl-panel-alert { border-color: #fecaca; background: #fffbeb; }
.wl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.wl-panel-title { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 0; display: flex; align-items: center; gap: 8px; }
.wl-hint { font-size: .76rem; color: #64748b; }

.wl-unread { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.wl-unread-item {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid #fde68a; border-radius: 10px;
    padding: 8px 10px;
}
.wl-unread-kind {
    font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    background: #dc2626; color: #fff; border-radius: 999px; padding: 2px 8px; flex-shrink: 0;
}
.wl-unread-body { flex: 1; min-width: 0; }
.wl-unread-title { font-size: .86rem; font-weight: 600; color: #1f2937; }
.wl-unread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .72rem; color: #64748b; margin-top: 2px; }
.wl-unread-time { margin-left: auto; }
.wl-unread-price { font-weight: 700; color: #0f172a; white-space: nowrap; }
.wl-unread-price s { color: #94a3b8; font-weight: 400; margin-right: 4px; }
.wl-empty-compact {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px; color: #64748b; font-size: .84rem;
}

.wl-search { width: 240px; }
.wl-filter { width: auto; min-width: 150px; }

.wl-bulkbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
    padding: 8px 10px; margin-bottom: 10px;
}

.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-item {
    display: flex; align-items: flex-start; gap: 10px;
    border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px;
    background: #fff;
}
.wl-item.selected { border-color: #3b82f6; background: #f8fbff; }
.wl-item.muted { opacity: .62; background: #fafafa; }
.wl-check { display: inline-flex; align-items: center; padding-top: 22px; }
.wl-item-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid #f1f5f9; flex-shrink: 0; }
.wl-item-main { flex: 1; min-width: 0; }
.wl-item-name { font-size: .9rem; font-weight: 600; color: #0f172a; line-height: 1.25; }
.wl-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: #64748b; margin-top: 3px; }
.wl-item-price { font-weight: 700; color: #18181b; }
.wl-item-check { color: #94a3b8; font-size: .7rem; }
.wl-item-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.wl-item-remove { flex-shrink: 0; }

.wl-inline {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e8f0;
}
.wl-switch { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: #334155; cursor: pointer; margin: 0; }
.wl-switch input { margin: 0; cursor: pointer; }
.wl-inline-inputs { display: flex; gap: 10px; flex-wrap: wrap; }
.wl-mini {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .74rem; color: #64748b; margin: 0;
}
.wl-mini input {
    width: 74px; padding: 3px 6px; font-size: .78rem;
    border: 1px solid #cbd5e1; border-radius: 6px;
}
.wl-mini input:focus { outline: 2px solid #93c5fd; outline-offset: 1px; }
.wl-reset { margin-left: auto; }

.wl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wl-stat {
    display: flex; flex-direction: column; gap: 2px;
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px;
}
.wl-stat-value { font-size: 1.2rem; font-weight: 700; color: #0f172a; line-height: 1; }
.wl-stat-value.ok { color: #15803d; }
.wl-stat-value.off { color: #b91c1c; }
.wl-stat-value.promo { color: #c2410c; }
.wl-stat-value.warn { color: #b45309; }
.wl-stat-label { font-size: .68rem; color: #64748b; }

.wl-history { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.wl-hist-row { display: flex; align-items: center; gap: 8px; font-size: .74rem; padding: 5px 6px; border-radius: 6px; }
.wl-hist-row:nth-child(odd) { background: #f8fafc; }
.wl-hist-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.wl-hist-time { color: #94a3b8; font-size: .68rem; flex-shrink: 0; }

.wl-toast {
    position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
    background: #18181b; color: #fff; font-size: .84rem;
    padding: 10px 16px; border-radius: 10px; z-index: 1080;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
    max-width: min(90vw, 520px);
}
.wl-toast.show { opacity: 1; transform: translate(-50%, 0); }
.wl-toast-success { background: #15803d; }
.wl-toast-error { background: #b91c1c; }
.wl-toast-info { background: #1d4ed8; }

body.dark .wl-panel { background: #171717; border-color: #2a2a2a; }
body.dark .wl-panel-alert { background: #201a06; border-color: #4a3a10; }
body.dark .wl-panel-title, body.dark .wl-item-name, body.dark .wl-unread-title,
body.dark .wl-stat-value, body.dark .wl-item-price, body.dark .wl-unread-price { color: #e5e5e5; }
body.dark .wl-header, body.dark .wl-item, body.dark .wl-stat, body.dark .wl-mini input { border-color: #2a2a2a; }
body.dark .wl-item-img { background: #1f1f1f; border-color: #2a2a2a; }
body.dark .wl-item.muted { background: #141414; }
body.dark .wl-item.selected { background: #101a2e; border-color: #2563eb; }
body.dark .wl-bulkbar { background: #101a2e; border-color: #1e40af; }
body.dark .wl-inline { border-top-color: #2a2a2a; }
body.dark .wl-switch { color: #cbd5e1; }
body.dark .wl-hist-row:nth-child(odd) { background: #141414; }
body.dark .wl-hist-title { color: #cbd5e1; }
body.dark .notif-pairing { background: #141414; border-color: #2a2a2a; border-left-color: #3b82f6; }
body.dark .notif-pairing-steps { color: #cbd5e1; }
body.dark .notif-waiting { color: #7dd3fc; }
body.dark .notif-jump { background: #171717; border-color: #2a2a2a; }
body.dark .notif-jump:hover { background: #1f1f1f; border-color: #3b82f6; }
body.dark .notif-jump-icon { background: #16233f; }
body.dark .wl-unread-item { background: #171717; border-color: #4a3a10; }
body.dark .wl-unread-meta, body.dark .wl-stat-label, body.dark .wl-hint,
body.dark .wl-item-meta, body.dark .wl-mini, body.dark .wl-empty-compact { color: #a8a8a8; }

/* ===========================
   VINCULACION POR CODIGO + PRUEBAS
=========================== */

.notif-codebox {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #0f172a; border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}
.notif-code {
    font-size: 1.35rem; font-weight: 800; letter-spacing: .18em;
    color: #4ade80; background: none; border: 0; padding: 0; user-select: all;
}
.notif-code-cmd {
    font-size: .86rem; color: #e2e8f0; background: #1e293b;
    border: 1px dashed #475569; border-radius: 6px; padding: 3px 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.notif-codebox .btn { border-color: #475569; color: #e2e8f0; }
.notif-codebox .btn:hover { background: #334155; color: #fff; }

.notif-foreign {
    margin-top: 10px; font-size: .84rem; color: #92400e;
    background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 10px;
    padding: 9px 11px;
}
.notif-foreign i { color: #d97706; }

.notif-linkstate {
    margin-top: 12px; font-size: .86rem; color: #166534;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
    padding: 9px 11px;
}
.notif-linkstate i { color: #16a34a; }

/* Vinculo recuperado solo, sin que el usuario tuviera que hacer nada. */
.notif-auto {
    margin-top: 12px; font-size: .86rem; color: #1e3a8a;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
    padding: 9px 11px;
}
.notif-auto i { color: #2563eb; }

.notif-tests { border-top: 1px solid #e2e8f0; padding-top: 12px; }
/* Combo + un boton en lugar de seis botones de prueba. */
.notif-test-row { display: flex; align-items: center; gap: 6px; }
.notif-test-row .form-select { max-width: 200px; }
.notif-test-send { flex: 0 0 auto; padding-inline: 10px; line-height: 1; }
.notif-code-input {
    max-width: 220px; text-transform: uppercase; letter-spacing: .14em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.notif-code-input::placeholder { text-transform: none; letter-spacing: 0; }

body.dark .notif-codebox { background: #0b1220; border: 1px solid #1e293b; }
body.dark .notif-code { color: #4ade80; }
body.dark .notif-foreign { background: #1c1405; border-color: #78350f; color: #fbbf24; }
body.dark .notif-linkstate { background: #0a1a10; border-color: #14532d; color: #86efac; }
body.dark .notif-auto { background: #0a1220; border-color: #1e3a8a; color: #93c5fd; }
body.dark .notif-tests { border-top-color: #2a2a2a; }


/* ===========================
   PAGINA DE SETTINGS (desktop / 1920x1080)
   =========================== */

.settings-page {
    max-width: 1560px;
    margin: 0 auto;
    padding-top: 26px;
    padding-bottom: 60px;
}

.settings-page-header {
    margin-bottom: 22px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.settings-card-wide {
    grid-column: 1 / -1;
}

.settings-card {
    padding: 20px 22px;
    margin-bottom: 0;
}

.settings-card-hint {
    font-size: .82rem;
    color: #64748b;
    margin-bottom: 12px;
}

.settings-card .dropdown-divider {
    margin: 14px 0;
    opacity: .8;
}

.settings-card .settings-section {
    margin-bottom: 0;
}

.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-footer {
    display: flex;
    justify-content: center;
    padding: 14px;
}

/* Toggles de tienda */
.store-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 10px;
}

.store-toggle {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
    margin: 0;
}

.store-toggle:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.store-toggle.on {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 1px 6px rgba(59, 130, 246, .12);
}

.store-toggle-check {
    position: relative;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: 1px;
}

.store-toggle-check input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.store-toggle-check i {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: transparent;
    font-size: .95rem;
    transition: all .15s ease;
}

.store-toggle-check input:checked + i {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.store-toggle-check input:focus-visible + i {
    outline: 2px solid rgba(59, 130, 246, .45);
    outline-offset: 2px;
}

.store-toggle-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.store-toggle-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: .88rem;
    font-weight: 700;
    color: #0f172a;
}

.store-toggle-desc {
    font-size: .74rem;
    color: #64748b;
}

.store-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 9px;
    display: inline-block;
}

.store-toggle-state {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 1px 6px;
    border-radius: 999px;
}

.store-toggle-state.state-live {
    background: #dcfce7;
    color: #15803d;
}

.store-toggle-state.state-pending {
    background: #fef3c7;
    color: #b45309;
}

/* Pantallas anchas (1920x1080): mas aire, las tarjetas cortas van parejas */
@media (min-width: 1600px) {
    .settings-page {
        max-width: 1640px;
        padding-top: 34px;
    }

    .settings-grid {
        gap: 24px;
    }

    .settings-card {
        padding: 24px 26px;
    }

    .settings-card-title {
        font-size: 1.02rem;
        margin-bottom: 14px;
    }

    .store-toggles {
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    }
}

/* Pantallas angostas: una sola columna */
@media (max-width: 1100px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .store-toggles {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   CUENTA (alias + clave)
=========================== */

.auth-wrap { max-width: 980px; }
.auth-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .auth-grid { grid-template-columns: 1fr 1fr; } }
.auth-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}
.auth-title { font-weight: 800; margin-bottom: 14px; font-size: 1rem; }
.auth-foot { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cuenta (alias + clave): una sola fila, sin robarle sitio a la tarjeta. */
.acct-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px;
    background: #f8fafc;
}
.acct-who { font-size: .86rem; color: #334155; }
body.dark .acct-row { background: #141414; border-color: #2a2a2a; }
body.dark .acct-who { color: #d4d4d4; }

/* "Lo tengo": tilde en cada item de la lista de compras. */
.cart-got-btn {
    flex: 0 0 auto; align-self: center; margin-right: 6px;
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: #94a3b8; font-size: 1.05rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .15s ease, transform .15s ease;
}
.cart-got-btn:hover:not(:disabled) { color: #16a34a; transform: scale(1.12); }
.cart-got-btn.active { color: #16a34a; }
.cart-got-btn:disabled { opacity: .35; cursor: not-allowed; }
.cart-item.acquired .cart-item-name { text-decoration: line-through; color: #94a3b8; }
.cart-item.acquired .cart-item-price,
.cart-item.acquired .cart-item-meta { opacity: .6; }
.cart-item.acquired .cart-item-img { filter: grayscale(.7) opacity(.7); }
body.dark .cart-item.acquired .cart-item-name { color: #8a8a8a; }

/* /lista: version movil de la lista de compras. */
.lista-page { max-width: 560px; margin: 0 auto; padding: 12px 12px 96px; }
.lista-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lista-pick { display: flex; gap: 8px; margin-bottom: 8px; }
.lista-pick .form-select { flex: 1; }
.lista-name-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.lista-name-row .form-control { flex: 1; }
.lista-status {
    flex: 0 0 auto; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    padding: 3px 8px; border-radius: 999px; background: #dcfce7; color: #15803d;
}
.lista-status.draft { background: #fef3c7; color: #b45309; }
body.dark .lista-status { background: #14361f; color: #86efac; }
body.dark .lista-status.draft { background: #3a2a0c; color: #fbbf24; }
.lista-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; margin-bottom: 10px; font-size: .86rem;
}
.lista-hide { display: flex; align-items: center; gap: 6px; color: #475569; font-size: .82rem; }
body.dark .lista-hide { color: #a8a8a8; }
.lista-items .cart-item { margin-bottom: 6px; }
.lista-empty { text-align: center; padding: 28px 0; color: #94a3b8; }
.lista-empty i { font-size: 1.8rem; }
.lista-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.lista-fab {
    position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 30;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; border-radius: 999px; background: #2563eb; color: #fff;
    font-weight: 600; text-decoration: none; box-shadow: 0 8px 20px rgba(37,99,235,.35);
}
.lista-fab:hover { background: #1d4ed8; color: #fff; }
