/* ==========================================================================
   BLACK MARKET / MERCADO NEGRO — CSS v1.0
   Tema: Dark criminal con acentos púrpura/rojo
   Basado en el design system de Chile RP (main.css)
   ========================================================================== */

/* ── Variables del Mercado Negro ── */
:root {
    --bm-accent: #a855f7;
    --bm-accent-hover: #c084fc;
    --bm-danger: #ef4444;
    --bm-danger-hover: #f87171;
    --bm-success: #22c55e;
    --bm-warning: #f59e0b;
    --bm-surface: #13111c;
    --bm-surface-2: #1c1a2e;
    --bm-surface-3: #252338;
    --bm-border: #2d2b3d;
    --bm-text: #e2e0f0;
    --bm-text-dim: #8b89a3;
    --bm-lime: #84cc16;
    --bm-cyan: #06b6d4;
    --bm-pink: #ec4899;
}

/* ── Page Base ── */
.bm-page {
    background: var(--bm-surface);
    color: var(--bm-text);
    min-height: 100vh;
}

/* ── Background ── */
.bm-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.bm-bg-gradient {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 100%, rgba(239, 68, 68, 0.05) 0%, transparent 50%);
}
.bm-bg-noise {
    position: absolute; inset: 0; opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Container ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Topbar ── */
.bm-topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(19, 17, 28, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--bm-border);
}
.bm-topbar-inner {
    display: flex; align-items: center; gap: 1rem;
    height: 60px;
}
.bm-brand {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none; color: var(--bm-text); font-weight: 700;
    font-size: 0.84rem;
    letter-spacing: 0.06em;
}

.bm-brand span {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

.bm-nav {
    display: flex; gap: 0.25rem; margin-left: auto;
}
.bm-nav-item {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: 8px;
    background: transparent; border: none; color: var(--bm-text-dim);
    cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
    font-family: inherit;
}
.bm-nav-item:hover { color: var(--bm-text); background: var(--bm-surface-2); }
.bm-nav-item.is-active {
    color: var(--bm-accent); background: rgba(168, 85, 247, 0.12);
}
.bm-nav-item i { font-size: 1.1rem; }

.bm-top-actions {
    display: flex; align-items: center; gap: 0.5rem; margin-left: 1rem;
}
.bm-action-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--bm-surface-2); border: 1px solid var(--bm-border);
    color: var(--bm-text-dim); cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.2s;
    text-decoration: none; position: relative;
}
.bm-action-btn:hover { color: var(--bm-text); border-color: var(--bm-accent); }

.bm-cart-btn { position: relative; }
.bm-cart-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--bm-danger); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.bm-user-pill {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    border-radius: 999px;
    background: var(--bm-surface-2); border: 1px solid var(--bm-border);
}

/* ── Main ── */
.bm-main {
    position: relative; z-index: 1;
    padding: 2rem 0 4rem;
}

/* ── Views ── */
.bm-view { display: none; }
.bm-view.is-active { display: block; animation: bmFadeIn 0.3s ease; }

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

/* ── Balance Row ── */
.bm-balance-row {
    display: flex; gap: 1rem; margin-bottom: 1.5rem;
}
.bm-balance-card {
    flex: 1; display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.25rem; border-radius: 12px;
    background: var(--bm-surface-2); border: 1px solid var(--bm-border);
}
.bm-balance-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.bm-balance--limpio .bm-balance-icon { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.bm-balance--sucio .bm-balance-icon { background: rgba(239, 68, 68, 0.15); color: var(--bm-danger); }
.bm-balance-label { font-size: 0.75rem; color: var(--bm-text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.bm-balance-value { font-size: 1.3rem; font-weight: 700; font-family: var(--font-display, 'Teko', sans-serif); }
.bm-balance--sucio .bm-balance-value { color: var(--bm-danger); }
.bm-balance-info { display: flex; flex-direction: column; }

/* ── Category Nav ── */
.bm-category-nav {
    display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.bm-cat-btn {
    padding: 0.5rem 1rem; border-radius: 8px;
    background: var(--bm-surface-2); border: 1px solid var(--bm-border);
    color: var(--bm-text-dim); cursor: pointer;
    font-size: 0.82rem; font-family: inherit; transition: all 0.2s;
    display: flex; align-items: center; gap: 0.4rem;
}
.bm-cat-btn:hover { border-color: var(--bm-accent); color: var(--bm-text); }
.bm-cat-btn.active {
    background: rgba(168, 85, 247, 0.15); border-color: var(--bm-accent);
    color: var(--bm-accent);
}

/* ── Product Grid ── */
.bm-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.bm-product-card {
    background: var(--bm-surface-2);
    border: 1px solid var(--bm-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s;
    display: flex; flex-direction: column;
}
.bm-product-card:hover {
    border-color: var(--bm-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.1);
}
.bm-product-img {
    width: 100%; aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    background: var(--bm-surface-3);
    padding: 1rem;
}
.bm-product-img img {
    max-width: 80%; max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.bm-product-info {
    padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.bm-product-name {
    font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.bm-product-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.bm-add-cart-btn {
    padding: 0.35rem 0.75rem; border-radius: 6px;
    background: var(--bm-accent); border: none;
    color: #fff; font-size: 0.72rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    font-family: inherit; text-transform: uppercase;
}
.bm-add-cart-btn:hover { background: var(--bm-accent-hover); transform: scale(1.03); }
.bm-product-price {
    font-size: 0.85rem; font-weight: 700;
    color: var(--bm-lime); font-family: var(--font-display, 'Teko', sans-serif);
}

/* ── Cart Sidebar ── */
.bm-cart-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.bm-cart-overlay.is-open {
    opacity: 1; pointer-events: all;
}
.bm-cart-panel {
    position: absolute; top: 0; right: -420px; bottom: 0;
    width: 400px; max-width: 90vw;
    background: var(--bm-surface-2);
    border-left: 1px solid var(--bm-border);
    display: flex; flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.bm-cart-overlay.is-open .bm-cart-panel {
    right: 0;
}
.bm-cart-header {
    padding: 1.25rem; border-bottom: 1px solid var(--bm-border);
    position: relative;
}
.bm-cart-title {
    display: flex; align-items: center; gap: 0.5rem;
}
.bm-cart-title i { font-size: 1.3rem; color: var(--bm-accent); }
.bm-cart-title h3 {
    font-family: var(--font-display, 'Teko', sans-serif);
    font-size: 1.4rem; font-weight: 700; margin: 0;
}
.bm-cart-subtitle { font-size: 0.78rem; color: var(--bm-text-dim); }
.bm-cart-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: var(--bm-text-dim);
    font-size: 1.5rem; cursor: pointer; transition: color 0.2s;
}
.bm-cart-close:hover { color: var(--bm-text); }

.bm-cart-items {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: 0.75rem;
}
.bm-cart-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem; border-radius: 10px;
    background: var(--bm-surface-3);
    border: 1px solid var(--bm-border);
}
.bm-cart-item-img {
    width: 50px; height: 50px; object-fit: contain;
    border-radius: 8px; background: var(--bm-surface);
    padding: 4px;
}
.bm-cart-item-info { flex: 1; min-width: 0; }
.bm-cart-item-name {
    display: block; font-size: 0.82rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-cart-item-price { font-size: 0.78rem; color: var(--bm-lime); font-weight: 600; }

.bm-cart-item-controls {
    display: flex; align-items: center; gap: 0.3rem;
}
.bm-qty-btn {
    width: 24px; height: 24px; border-radius: 6px;
    background: var(--bm-surface-2); border: 1px solid var(--bm-border);
    color: var(--bm-text); cursor: pointer; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.bm-qty-btn:hover { border-color: var(--bm-accent); }
.bm-qty-val { font-size: 0.78rem; min-width: 24px; text-align: center; }

.bm-cart-remove {
    background: none; border: none; color: var(--bm-text-dim);
    cursor: pointer; font-size: 1rem; padding: 4px; transition: color 0.2s;
}
.bm-cart-remove:hover { color: var(--bm-danger); }

.bm-cart-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: var(--bm-text-dim); gap: 0.5rem;
}
.bm-cart-empty i { font-size: 3rem; opacity: 0.3; }

.bm-cart-footer {
    padding: 1.25rem; border-top: 1px solid var(--bm-border);
}
.bm-cart-total {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem;
}
.bm-cart-total span { color: var(--bm-text-dim); font-size: 0.9rem; }
.bm-cart-total strong {
    font-size: 1.6rem; font-family: var(--font-display, 'Teko', sans-serif);
    color: var(--bm-lime); font-weight: 700;
}
.bm-cart-actions { display: flex; gap: 0.5rem; }
.bm-pay-btn {
    flex: 1; padding: 0.7rem; border-radius: 10px;
    border: none; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    font-family: inherit;
}
.bm-pay--limpio { background: var(--bm-accent); color: #fff; }
.bm-pay--limpio:hover { background: var(--bm-accent-hover); }
.bm-pay--sucio { background: var(--bm-pink); color: #fff; }
.bm-pay--sucio:hover { background: #f472b6; }

/* ── Section Headers ── */
.bm-section-header { margin-bottom: 1.5rem; }
.bm-section-header h2 {
    font-family: var(--font-display, 'Teko', sans-serif);
    font-size: 1.6rem; font-weight: 700;
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0 0 0.25rem;
}
.bm-section-header h2 i { color: var(--bm-accent); }
.bm-section-desc { font-size: 0.85rem; color: var(--bm-text-dim); margin: 0; }

.bm-state-safe { color: var(--bm-success); font-weight: 600; }
.bm-state-danger { color: var(--bm-danger); font-weight: 600; }

/* ── Inventory Grid ── */
.bm-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.bm-inv-card {
    background: var(--bm-surface-2);
    border: 1px solid var(--bm-border);
    border-radius: 12px; padding: 1rem;
    transition: all 0.2s;
}
.bm-inv-card:hover { border-color: var(--bm-border); }
.bm-inv-card.is-locked {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}
.bm-inv-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.75rem;
}
.bm-inv-name { font-weight: 600; font-size: 0.95rem; }
.bm-inv-qty {
    font-size: 0.8rem; color: var(--bm-accent);
    background: rgba(168, 85, 247, 0.12); padding: 2px 8px;
    border-radius: 6px; font-weight: 600;
}
.bm-inv-state {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.75rem; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600;
    margin-bottom: 0.75rem;
}
.bm-state--safe { background: rgba(34, 197, 94, 0.12); color: var(--bm-success); }
.bm-state--danger { background: rgba(239, 68, 68, 0.12); color: var(--bm-danger); }

.bm-inv-actions { display: flex; gap: 0.5rem; }
.bm-inv-btn {
    padding: 0.4rem 0.8rem; border-radius: 8px;
    border: 1px solid var(--bm-border); background: var(--bm-surface-3);
    color: var(--bm-text); cursor: pointer;
    font-size: 0.78rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.3rem;
    transition: all 0.2s; font-family: inherit;
}
.bm-inv-btn--sell:hover { border-color: var(--bm-lime); color: var(--bm-lime); }
.bm-inv-btn--cook:hover { border-color: var(--bm-warning); color: var(--bm-warning); }

/* ── Empty States ── */
.bm-empty-state, .bm-op-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 4rem 2rem;
    color: var(--bm-text-dim); text-align: center; gap: 0.5rem;
}
.bm-empty-state i, .bm-op-empty i { font-size: 3.5rem; opacity: 0.3; margin-bottom: 0.5rem; }
.bm-op-empty span { font-size: 0.82rem; }

/* ── Operation Card ── */
.bm-op-card {
    max-width: 500px; margin: 0 auto;
    background: var(--bm-surface-2);
    border: 1px solid var(--bm-border);
    border-radius: 16px; padding: 1.5rem;
    text-align: center;
}
.bm-op-header {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    margin-bottom: 1.5rem;
}
.bm-op-type {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 1rem; border-radius: 8px;
    background: rgba(168, 85, 247, 0.15); color: var(--bm-accent);
    font-size: 0.85rem; font-weight: 600;
}
.bm-op-drug {
    font-size: 1.2rem; font-weight: 700;
    font-family: var(--font-display, 'Teko', sans-serif);
}

/* Timer Ring */
.bm-op-timer-wrap {
    display: flex; justify-content: center; margin-bottom: 1.5rem;
}
.bm-op-timer-ring {
    position: relative; width: 140px; height: 140px;
}
.bm-op-timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.bm-timer-bg {
    fill: none; stroke: var(--bm-surface-3); stroke-width: 8;
}
.bm-timer-fill {
    fill: none; stroke: var(--bm-accent); stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}
.bm-timer-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 700;
    font-family: var(--font-display, 'Teko', sans-serif);
    letter-spacing: 2px;
}

.bm-op-details {
    display: flex; flex-direction: column; gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.bm-op-detail {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--bm-border);
    font-size: 0.85rem;
}
.bm-op-detail span { color: var(--bm-text-dim); }
.bm-op-detail strong { color: var(--bm-text); }

.bm-text-green { color: var(--bm-success) !important; }
.bm-text-red { color: var(--bm-danger) !important; }

.bm-op-warning {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.75rem; border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    margin-bottom: 1.25rem; text-align: left;
    font-size: 0.78rem; color: var(--bm-warning);
}
.bm-op-warning i { font-size: 1.1rem; margin-top: 1px; }

.bm-op-complete-btn {
    width: 100%; padding: 0.85rem;
    border-radius: 10px; border: none;
    background: var(--bm-surface-3); color: var(--bm-text-dim);
    font-size: 0.9rem; font-weight: 600; cursor: not-allowed;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    transition: all 0.3s; font-family: inherit;
}
.bm-op-complete-btn.is-ready {
    background: var(--bm-success); color: #fff; cursor: pointer;
    animation: bmPulse 2s infinite;
}
.bm-op-complete-btn.is-ready:hover { filter: brightness(1.1); }

@keyframes bmPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

/* ── History ── */
.bm-history-list {
    display: flex; flex-direction: column; gap: 0.5rem;
}
.bm-history-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1rem; border-radius: 10px;
    background: var(--bm-surface-2);
    border: 1px solid var(--bm-border);
    transition: border-color 0.2s;
}
.bm-history-row:hover { border-color: var(--bm-accent); }
.bm-history-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--bm-surface-3);
    display: flex; align-items: center; justify-content: center;
    color: var(--bm-accent); font-size: 1.1rem;
}
.bm-history-info { flex: 1; min-width: 0; }
.bm-history-desc {
    display: block; font-size: 0.85rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-history-date { font-size: 0.72rem; color: var(--bm-text-dim); }
.bm-history-amount {
    font-weight: 700; font-size: 0.9rem;
    font-family: var(--font-display, 'Teko', sans-serif);
    white-space: nowrap;
}

/* ── Modals ── */
.bm-modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.bm-modal {
    background: var(--bm-surface-2);
    border: 1px solid var(--bm-border);
    border-radius: 16px; width: 100%; max-width: 480px;
    overflow: hidden; animation: bmModalIn 0.25s ease;
}
@keyframes bmModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.bm-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem; border-bottom: 1px solid var(--bm-border);
}
.bm-modal-header h3 {
    margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem;
}
.bm-modal-header h3 i { color: var(--bm-accent); }
.bm-modal-close {
    background: none; border: none; color: var(--bm-text-dim);
    font-size: 1.5rem; cursor: pointer;
}
.bm-modal-close:hover { color: var(--bm-text); }

.bm-modal-body { padding: 1.25rem; }
.bm-modal-body p { margin: 0 0 1rem; font-size: 0.88rem; color: var(--bm-text-dim); }

.bm-modal-field {
    margin-bottom: 1rem;
}
.bm-modal-field label {
    display: block; font-size: 0.78rem; color: var(--bm-text-dim);
    margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.bm-select, .bm-input {
    width: 100%; padding: 0.65rem 0.85rem; border-radius: 8px;
    background: var(--bm-surface-3); border: 1px solid var(--bm-border);
    color: var(--bm-text); font-size: 0.88rem; font-family: inherit;
    transition: border-color 0.2s; box-sizing: border-box;
}
.bm-select:focus, .bm-input:focus {
    outline: none; border-color: var(--bm-accent);
}
.bm-select option { background: var(--bm-surface-2); }

.bm-modal-info {
    display: flex; flex-direction: column; gap: 0.3rem;
    padding: 0.75rem; border-radius: 8px;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.15);
    font-size: 0.82rem; color: var(--bm-text-dim);
}
.bm-modal-info strong { color: var(--bm-lime); }

.bm-cook-warning {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 1rem; border-radius: 10px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-bottom: 1rem;
}
.bm-cook-warning i { font-size: 1.5rem; color: var(--bm-danger); margin-top: 2px; }
.bm-cook-warning strong { color: var(--bm-danger); }
.bm-cook-warning p { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--bm-text-dim); }

.bm-modal-footer {
    display: flex; gap: 0.5rem; padding: 1.25rem;
    border-top: 1px solid var(--bm-border);
}
.bm-btn {
    flex: 1; padding: 0.65rem; border-radius: 8px;
    border: none; font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 0.3rem;
    font-family: inherit;
}
.bm-btn--cancel { background: var(--bm-surface-3); color: var(--bm-text-dim); }
.bm-btn--cancel:hover { color: var(--bm-text); }
.bm-btn--confirm { background: var(--bm-accent); color: #fff; }
.bm-btn--confirm:hover { background: var(--bm-accent-hover); }
.bm-btn--danger { background: var(--bm-danger); color: #fff; }
.bm-btn--danger:hover { background: var(--bm-danger-hover); }

/* ── Toast ── */
.bm-toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
    z-index: 500; padding: 0.85rem 1.5rem; border-radius: 12px;
    background: var(--bm-surface-2); border: 1px solid var(--bm-border);
    color: var(--bm-text); font-size: 0.85rem;
    display: flex; align-items: center; gap: 0.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bm-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.bm-toast--success i { color: var(--bm-success); }
.bm-toast--error i { color: var(--bm-danger); }
.bm-toast--info i { color: var(--bm-accent); }

/* ═══════════════════════════
   PIEZAS DE DESGUACE
   ═══════════════════════════ */
.bm-piezas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.bm-pieza-card {
    background: var(--bm-surface);
    border: 1px solid var(--bm-border);
    border-radius: 14px;
    padding: 1.2rem;
    transition: all 0.3s ease;
}
.bm-pieza-card:hover {
    border-color: rgba(220, 38, 38, 0.3);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.08);
}
.bm-pieza-header {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.8rem;
}
.bm-pieza-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #dc2626; flex-shrink: 0;
}
.bm-pieza-info { flex: 1; min-width: 0; }
.bm-pieza-name {
    display: block; font-size: 0.88rem; font-weight: 700;
    color: var(--bm-text); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.bm-pieza-comp {
    font-size: 0.72rem; color: var(--bm-text-dim);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.bm-pieza-qty {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bm-text-dim); font-size: 0.75rem; font-weight: 700;
    padding: 3px 8px; border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.08);
}
.bm-pieza-details {
    display: flex; gap: 0.5rem; margin-bottom: 0.8rem; flex-wrap: wrap;
}
.bm-pieza-detail {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; color: var(--bm-text-dim);
    padding: 3px 8px; border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.06);
}
.bm-pieza-detail i { font-size: 0.85rem; }
.bm-pieza-dur { margin-bottom: 0.8rem; }
.bm-pieza-dur-label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.72rem; color: var(--bm-text-dim); margin-bottom: 4px;
}
.bm-pieza-dur-bar {
    height: 5px; border-radius: 3px;
    background: rgba(255, 255, 255, 0.06); overflow: hidden;
}
.bm-pieza-dur-fill {
    height: 100%; border-radius: 3px; transition: width 0.4s ease;
}
.bm-pieza-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(148, 163, 184, 0.06);
}
.bm-pieza-price {
    font-size: 1rem; font-weight: 800; color: var(--bm-lime);
}
.bm-pieza-sell-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 16px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff; font-size: 0.82rem; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: all 0.2s;
}
.bm-pieza-sell-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .bm-topbar-inner { flex-wrap: wrap; height: auto; padding: 0.5rem 1rem; }
    .bm-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 0.5rem; }
    .bm-nav-item span { display: none; }
    .bm-nav-item { padding: 0.5rem 0.75rem; }
    .bm-balance-row { flex-direction: column; }
    .bm-shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .bm-cart-panel { width: 100%; max-width: 100%; }
    .bm-inventory-grid { grid-template-columns: 1fr; }
    .bm-piezas-grid { grid-template-columns: 1fr; }
}

