/* --- Migrado desde styles.css: reglas UTXO y variantes --- */
.utxo-list-section {
    margin-top: 8px;
}
.utxo-list-container {
    max-height: 440px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 12px;
    margin-top: 8px;
    padding: 2px 2px 4px 2px;
}
/* .utxo-result-modal block removed as duplicate; already defined above */
.utxo-balance {
    color: #f7931a;
    font-weight: bold;
    font-size: 20px;
}
.utxo-result-modal {
    text-align: left;
    max-width: 100%;
}
.utxo-card {
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(82, 18, 26, 0.88) 0%, rgba(44, 10, 16, 0.96) 100%);
    border: 1px solid rgba(247, 147, 26, 0.28);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}
.utxo-card:hover {
    transform: translateY(-2px);
    border-color: #f7931a;
    box-shadow: 0 6px 18px rgba(247, 147, 26, 0.24);
}
.utxo-card-details {
    min-width: 0;
    flex: 1 1 auto;
}
.utxo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.utxo-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #f7931a;
    background: rgba(247, 147, 26, 0.15);
    border: 1px solid rgba(247, 147, 26, 0.35);
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: 0.5px;
}
.utxo-card-amount {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}
.utxo-card-address {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.76rem;
    color: #d1d5db;
    font-family: 'Consolas', monospace;
    margin-top: 4px;
}
.utxo-card-meta {
    margin-top: 4px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Consolas', monospace;
}
.utxo-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.utxo-consult-row {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    color: #aaaaaa;
    text-align: right;
}
.utxo-consult-row strong {
    color: #f7931a;
}
.burn-btn {
    background-color: #d32f2f !important;
    color: #fff !important;
    border: none !important;
}
.coincontrol-utxo-row .utxo-checkbox {
    flex: 0 0 auto !important;
    width: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    height: 15px !important;
    box-sizing: content-box !important;
    display: inline-block !important;
    margin-right: 8px;
}
.coincontrol-utxo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    background-color: rgb(40, 167, 69);
    margin-bottom: 6px;
}
.coincontrol-utxo-row label.utxo-meta {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.coincontrol-utxo-row.coinbase-utxo {
  background-color: orange !important;
}
.utxo-select-list {
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 0;
}
.utxo-card-actions .utxo-copy-btn {
    font-size: 0.75em;
    padding: 4px 10px;
    min-width: 60px;
    height: 26px;
    border-radius: 6px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.utxo-card-actions .utxo-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#transactionForm #amountInput[readonly] {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 0.95;
}

/* ==========================================================================
   WINERY STOCK CONTROL & DISCRETE NETWORK STATUS STYLES (ADR-003)
   ========================================================================== */

/* Indicador Discreto de Red en Hero Subheader */
.network-badge-discrete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(46, 204, 113, 0.35);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    color: #e2e8f0;
    margin-left: 4px;
}

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

.network-dot.online {
    background-color: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.8);
    animation: networkPulse 2s infinite ease-in-out;
}

@keyframes networkPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.network-tx-pill {
    background: rgba(243, 156, 18, 0.2);
    border: 1px solid rgba(243, 156, 18, 0.4);
    color: #f39c12;
    padding: 0 5px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* Card 1 Destacada (Stock Operativo) */
.winery-kpi-card.winery-kpi-card-featured {
    border-color: rgba(243, 156, 18, 0.45) !important;
    background: linear-gradient(145deg, rgba(45, 12, 17, 0.95) 0%, rgba(22, 6, 9, 0.98) 100%) !important;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.12);
}

.winery-kpi-card.winery-kpi-card-featured:hover {
    border-color: #f39c12 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(243, 156, 18, 0.22);
}

/* Holgura y anchura optimizada para el Modal de Inventario y Despacho */
#loteModal .modal-content {
    max-width: 880px !important;
    width: min(94vw, 880px) !important;
    padding: 28px 32px !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 24px rgba(247, 147, 26, 0.22) !important;
    box-sizing: border-box !important;
}

/* Modal de Inventario Operativo */
.winery-inventory-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.inventory-summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    background: rgba(25, 6, 10, 0.65);
    border: 1px solid rgba(243, 156, 18, 0.25);
    border-radius: 12px;
    padding: 14px 18px;
    box-sizing: border-box;
}

.summary-stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.summary-stat-box .stat-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: #a0aec0;
    letter-spacing: 0.5px;
}

.summary-stat-box .stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.summary-stat-box .stat-value.text-gold {
    color: #f6ad55;
}

.summary-stat-box .stat-value.text-green {
    color: #48bb78;
}

.inventory-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 8px;
    margin-top: 2px;
    font-size: 1.02rem;
    font-weight: 600;
    color: #edf2f7;
}

.inventory-hint {
    font-size: 0.8rem;
    font-weight: 400;
    color: #cbd5e0;
}

.magnum-inventory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    box-sizing: border-box;
}

/* Tarjeta individual de Magnum en el Inventario */
.magnum-stock-card {
    background: linear-gradient(135deg, rgba(50, 12, 17, 0.88) 0%, rgba(28, 7, 10, 0.94) 100%);
    border: 1px solid rgba(243, 156, 18, 0.25);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.magnum-stock-card:hover {
    border-color: rgba(243, 156, 18, 0.65);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
    transform: translateY(-1px);
}

.magnum-stock-card.is-pending {
    opacity: 0.65;
    background: rgba(30, 20, 22, 0.7);
    border-style: dashed;
}

.magnum-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.magnum-bottle-icon-wrap {
    width: 50px;
    height: 64px;
    border-radius: 10px;
    background: rgba(22, 6, 10, 0.55);
    border: 1px solid rgba(243, 156, 18, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 3px;
    box-sizing: border-box;
}

.magnum-bottle-img {
    height: 56px;
    width: auto;
    max-width: 42px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}

.magnum-meta-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

.magnum-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.magnum-name-label {
    font-size: 1.06rem;
    font-weight: 700;
    color: #f7fafc;
}

.magnum-vintage-tag {
    font-size: 0.78rem;
    color: #d69e2e;
    background: rgba(214, 158, 46, 0.14);
    padding: 2px 8px;
    border-radius: 4px;
}

.magnum-value-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.magnum-value-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ecc94b;
    background: rgba(236, 201, 75, 0.12);
    border: 1px solid rgba(236, 201, 75, 0.28);
    padding: 2px 9px;
    border-radius: 6px;
    line-height: 1.25;
}

.magnum-status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.magnum-status-pill.pill-ready {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.35);
}

.magnum-status-pill.pill-pending {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.35);
}

.magnum-tech-accordion {
    margin-top: 4px;
    font-size: 0.75rem;
}

.magnum-tech-toggle {
    cursor: pointer;
    color: #a0aec0;
    font-size: 0.74rem;
    user-select: none;
    transition: color 0.15s ease;
}

.magnum-tech-toggle:hover {
    color: #cbd5e0;
}

.magnum-tech-panel {
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: 'Consolas', monospace;
    font-size: 0.73rem;
    color: #cbd5e0;
    max-width: 100%;
    box-sizing: border-box;
}

.magnum-tech-panel .tech-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-copy-tech-txid {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #edf2f7 !important;
    padding: 2px 8px !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    border-radius: 4px !important;
    font-size: 0.7rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-copy-tech-txid:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.magnum-card-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-quick-dispatch {
    padding: 10px 20px !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 132px !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
}

.btn-disabled-mempool {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #a0aec0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* Opción A: Despacho Rápido de 1 Botella (Contextual Drawer / Form) */
.quick-dispatch-flow {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.dispatch-selected-bottle-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(60, 16, 22, 0.95) 0%, rgba(30, 8, 11, 0.98) 100%);
    border: 1px solid rgba(243, 156, 18, 0.4);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.dispatch-bottle-icon-wrap {
    width: 56px;
    height: 72px;
    border-radius: 12px;
    background: rgba(22, 6, 10, 0.55);
    border: 1px solid rgba(243, 156, 18, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    box-sizing: border-box;
}

.dispatch-bottle-img {
    height: 62px;
    width: auto;
    max-width: 46px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.65));
}

.dispatch-badge-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #f6ad55;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dispatch-bottle-title {
    margin: 4px 0 6px 0;
    font-size: 1.28rem;
    font-weight: 700;
    color: #ffffff;
}

.dispatch-bottle-sub {
    margin: 0 0 6px 0;
    font-size: 0.85rem;
    color: #cbd5e0;
}

.dispatch-value-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(243, 156, 18, 0.14);
    border: 1px solid rgba(243, 156, 18, 0.35);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #ecc94b;
}

.quick-dispatch-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group-winery {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label-winery {
    font-size: 0.9rem;
    font-weight: 600;
    color: #edf2f7;
}

.form-input-winery {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(10, 10, 14, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.98rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.form-input-winery:focus {
    border-color: #f39c12;
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.25);
}

.form-hint-winery {
    font-size: 0.74rem;
    color: #a0aec0;
}

.dispatch-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Preflight Modal de Confirmación de Gobernanza */
.preflight-confirm-box {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preflight-item-card {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preflight-item-title {
    font-size: 1.05rem;
    color: #ffffff;
}

.preflight-item-details {
    font-size: 0.8rem;
    color: #cbd5e0;
}

.preflight-item-value {
    font-size: 0.9rem;
    color: #ecc94b;
    margin-top: 4px;
}

.preflight-recipient-row {
    margin: 4px 0;
    font-size: 0.88rem;
    color: #edf2f7;
}

.preflight-address {
    display: block;
    margin-top: 4px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.82rem;
    color: #63b3ed;
    word-break: break-all;
}

.preflight-irreversible-warning {
    background: rgba(229, 62, 62, 0.12);
    border: 1px solid rgba(229, 62, 62, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    color: #feb2b2;
    font-size: 0.8rem;
    line-height: 1.4;
}

.success-tx-summary {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    text-align: left;
    font-size: 0.85rem;
}

/* ==========================================================================
   RESPONSIVE MOBILE VIEWPORT OPTIMIZATION FOR BOTTLE INVENTORY MODAL
   ========================================================================== */
@media (max-width: 700px) {
    #loteModal {
        padding: 8px !important;
        box-sizing: border-box !important;
    }

    #loteModal .modal-content {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-height: 90vh !important;
        margin: auto !important;
        padding: 16px 12px !important;
        border-radius: 14px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    #loteModal #modalTitle {
        font-size: 1.15rem !important;
        margin: 0 0 10px 0 !important;
        padding: 0 34px 6px 0 !important;
        text-align: left !important;
        line-height: 1.25 !important;
    }

    #loteModal #modalBody {
        margin-top: 6px !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .winery-inventory-modal {
        gap: 12px;
    }

    .inventory-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .summary-stat-box .stat-label {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .summary-stat-box .stat-value {
        font-size: 1.02rem;
    }

    .inventory-section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 0.92rem;
        padding-bottom: 6px;
    }

    .inventory-hint {
        font-size: 0.74rem;
    }

    .magnum-inventory-list {
        max-height: 58vh;
        padding-right: 2px;
        gap: 10px;
    }

    .magnum-stock-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 10px;
    }

    .magnum-card-left {
        gap: 12px;
        width: 100%;
    }

    .magnum-bottle-icon-wrap {
        width: 44px;
        height: 58px;
    }

    .magnum-bottle-img {
        height: 50px;
        max-width: 36px;
    }

    .magnum-title-row {
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }

    .magnum-name-label {
        font-size: 0.98rem;
    }

    .magnum-value-amount {
        font-size: 0.92rem;
        padding: 2px 8px;
    }

    .magnum-card-right {
        width: 100%;
        justify-content: stretch;
    }

    .magnum-card-right .btn-quick-dispatch,
    .magnum-card-right .btn-disabled-mempool {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 9px 12px !important;
        font-size: 0.84rem !important;
        text-align: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .dispatch-selected-bottle-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .dispatch-bottle-title {
        font-size: 1.1rem;
    }

    .dispatch-actions-row {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .dispatch-actions-row .dashboard-btn {
        width: 100% !important;
        margin: 0 !important;
    }
}
