/* ─── /refs — Pegar referencias ─────────────────────────────── */
.refs-paste-root {
    max-width: 900px;
    margin: 0 auto 2rem;
}
.refs-paste-input {
    width: 100%;
    padding: .85rem 1rem;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: .9rem;
    line-height: 1.4;
    box-sizing: border-box;
    resize: vertical;
}
.refs-paste-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .15);
}
.refs-paste-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: .75rem;
}
.refs-paste-detect {
    padding: .65rem 1.25rem;
    background: #2ea043;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.refs-paste-detect:hover { background: #258a37; }
.refs-paste-detect:disabled { background: #aaa; cursor: not-allowed; }

.refs-paste-result {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    animation: refsFadeIn .15s ease-out;
}
@keyframes refsFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.refs-paste-spinner { color: #666; text-align: center; padding: 1rem; }
.refs-paste-error   { color: #c00; }
.refs-paste-info    { color: #666; }

/* Modelo detectado (caso unique / no_model) */
.refs-detected-model {
    background: #e8f5e9;
    border: 1px solid #2ea043;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.refs-detected-model.no-model {
    background: #fff8e1;
    border-color: #ffa726;
}
.refs-detected-model-emoji { font-size: 2rem; }
.refs-detected-model-title { font-weight: 700; font-size: 1rem; }
.refs-detected-model-sub   { font-size: .85rem; color: #555; }

/* Tarjetas de candidates (caso ambiguous) */
.refs-candidates-question { font-weight: 700; margin-bottom: .75rem; }
.refs-candidates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.refs-candidate {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    padding: 1rem .75rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.refs-candidate:hover { border-color: #d4af37; transform: translateY(-2px); }
.refs-candidate-emoji  { font-size: 2.25rem; }
.refs-candidate-title  { font-weight: 700; margin: .35rem 0; }
.refs-candidate-badge  {
    display: inline-block;
    background: #2ea043;
    color: #fff;
    padding: .15rem .65rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}
.refs-candidate-badge.secondary { background: #999; }

/* Modelos nuevos propuestos (status unknown_model_detected) */
.refs-proposals {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-bottom: 1rem;
}
.refs-proposal {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .85rem;
    align-items: center;
    background: #fff8e1;
    border: 2px solid #ffa726;
    border-radius: 10px;
    padding: .85rem 1rem;
    transition: border-color .15s, transform .15s;
}
.refs-proposal:hover { border-color: #fb8c00; transform: translateY(-1px); }
.refs-proposal-emoji { font-size: 2rem; }
.refs-proposal-title { font-weight: 700; font-size: 1rem; }
.refs-proposal-sub   { font-size: .78rem; color: #665b3b; }
.refs-proposal-accept {
    padding: .55rem 1rem;
    border-radius: 8px;
    border: none;
    background: #fb8c00;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: .85rem;
    transition: background .15s;
}
.refs-proposal-accept:hover    { background: #ef6c00; }
.refs-proposal-accept:disabled { background: #aaa; cursor: not-allowed; }

.refs-paste-skip-as-free {
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #555;
    font-size: .85rem;
    cursor: pointer;
}
.refs-paste-skip-as-free:hover { background: #f5f5f5; }

/* Alternativas (modelos extra cuando la pieza es multi-compatible) */
.refs-alternatives {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #d0d0d0;
}
.refs-alternatives-title {
    font-size: .82rem;
    color: #555;
    margin: 0 0 .5rem;
}
.refs-proposals-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.refs-proposals-row .refs-proposal {
    grid-template-columns: auto 1fr auto;
    padding: .55rem .75rem;
    flex: 1 1 calc(50% - .25rem);
    min-width: 200px;
}
.refs-proposals-row .refs-proposal-title { font-size: .9rem; }
.refs-proposals-row .refs-proposal-sub { font-size: .7rem; }
.refs-proposals-row .refs-proposal-accept {
    padding: .35rem .65rem;
    font-size: 1rem;
}

/* Listado de piezas detectadas */
.refs-parts {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin: .75rem 0;
}
.refs-part {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    gap: .65rem;
    align-items: center;
    padding: .55rem .65rem;
    background: #fafafa;
    border-radius: 6px;
    font-size: .85rem;
}
.refs-part-img {
    width: 36px; height: 36px;
    border-radius: 6px;
    background: #eee;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.refs-part-img img { width: 100%; height: 100%; object-fit: cover; }
.refs-part-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    margin-bottom: .2rem;
}
.refs-part-badges:empty { display: none; }
.refs-part-name { font-weight: 600; }
.refs-part-meta { font-size: .7rem; color: #888; }
.refs-part-type-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1f6feb;
    padding: .05rem .45rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 600;
    margin-right: .2rem;
}
.refs-part-price { font-weight: 700; color: #1f6feb; }
.refs-part-stock-ok   { background: #2ea043; color: #fff; padding: .1rem .5rem; border-radius: 99px; font-size: .7rem; }
.refs-part-stock-no   { background: #c00;    color: #fff; padding: .1rem .5rem; border-radius: 99px; font-size: .7rem; }
.refs-part-stock-warn { background: #aaa;    color: #fff; padding: .1rem .5rem; border-radius: 99px; font-size: .7rem; }

/* Warnings y avisos */
.refs-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: .55rem .85rem;
    border-radius: 4px;
    font-size: .85rem;
    margin: .5rem 0;
}
.refs-error {
    background: #fde5e5;
    border-left: 4px solid #c00;
    padding: .65rem .85rem;
    border-radius: 4px;
    margin: .5rem 0;
}
.refs-result-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    gap: .5rem;
}
.refs-paste-continue, .refs-paste-sync {
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #d4af37;
    background: #d4af37;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: .9rem;
}
.refs-paste-sync { background: #fff; color: #d4af37; }

@media (max-width: 600px) {
    .refs-part { grid-template-columns: 36px 1fr; }
    .refs-part-price, .refs-part-stock-ok, .refs-part-stock-no, .refs-part-stock-warn {
        grid-column: 2; justify-self: start;
    }
}
