/* =========================================================
   EDITAR ORDEN - BASE
========================================================= */
.x-edit-order-page {
    color: #eaf2ff;
}

.x-edit-order-head {
    margin-bottom: 18px;
}

.x-edit-order-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.02em;
}

.x-edit-order-subtitle {
    margin: 6px 0 0;
    color: #92a8c9;
    font-size: .95rem;
    line-height: 1.5;
}

/* =========================================================
   GRID GENERAL
========================================================= */
.x-edit-order-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.x-edit-order-span-2 {
    grid-column: span 2;
}

.x-edit-order-span-3 {
    grid-column: 1 / -1;
}

/* =========================================================
   CARD BASE
========================================================= */
.ventas-v3-card {
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 22px;
    /* background: */
    /* linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .012)), */
    /* rgba(6, 18, 48, .84); */
    box-shadow: 0 18px 45px rgba(0, 0, 0, .24);
    padding: 16px;
}

.ventas-v3-card__title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    color: #fff;
    font-size: .92rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.ventas-v3-card__title--between {
    justify-content: space-between;
}

/* =========================================================
   GRID INTERNO
========================================================= */
.x-eo-grid {
    display: grid;
    gap: 14px;
}

.x-eo-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.x-eo-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.x-eo-field {
    display: block;
}

.x-eo-field--full {
    grid-column: 1 / -1;
}

.x-eo-field label {
    display: block;
    margin-bottom: 7px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #8ea6c8;
    letter-spacing: .03em;
}

/* =========================================================
   INPUTS / SELECT / TEXTAREA
========================================================= */
.x-eo-input,
.x-eo-textarea {
    background: rgba(255, 255, 255, .03) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    color: #fff !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    transition: all .16s ease !important;
}

.x-eo-input {
    min-height: 46px;
}

.x-eo-input:focus,
.x-eo-textarea:focus {
    border-color: rgba(59, 130, 246, .34) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .10) !important;
}

.x-eo-input::placeholder,
.x-eo-textarea::placeholder {
    color: #7f93af !important;
}

.x-eo-textarea {
    min-height: 112px;
    resize: vertical;
    padding-top: 12px !important;
}

.x-eo-textarea--sm {
    min-height: 92px !important;
}

/* =========================================================
   BADGES / PILLS
========================================================= */
.x-eo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: .74rem;
    font-weight: 800;
    color: #d9e7ff;
    white-space: nowrap;
}

/* =========================================================
   EMPTY STATE
========================================================= */
.x-eo-empty {
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .025);
    border: 1px dashed rgba(255, 255, 255, .10);
    color: #8fa6c7;
    text-align: center;
    font-size: .92rem;
}

/* =========================================================
   ESTADO ACTUAL
========================================================= */
.x-eo-status-box {
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
}

.x-eo-status-box__badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.x-eo-status-box__meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.x-eo-status-box__meta div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.x-eo-status-box__meta span {
    color: #8ea6c8;
    font-size: .84rem;
}

.x-eo-status-box__meta strong {
    color: #fff;
    font-size: .88rem;
    text-align: right;
}

/* =========================================================
   ACCIONES RÁPIDAS
========================================================= */
.x-eo-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.x-action-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    color: #eaf2ff;
    font-weight: 800;
    font-size: .9rem;
    cursor: pointer;
    transition: all .15s ease;
}

.x-action-mini i {
    font-size: 1rem;
}

.x-action-mini:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .18);
}

.x-action-mini--primary {
    background: rgba(59, 130, 246, .12);
    border-color: rgba(59, 130, 246, .25);
}

.x-action-mini--whatsapp {
    background: rgba(34, 197, 94, .12);
    border-color: rgba(34, 197, 94, .25);
}

.x-action-mini--danger {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .30);
    color: #ffb4b4;
}

.x-action-mini--danger:hover {
    background: rgba(239, 68, 68, .18);
    border-color: rgba(239, 68, 68, .42);
}

.x-action-span-2 {
    grid-column: span 2;
}

/* =========================================================
   RESUMEN ECONÓMICO
========================================================= */
.x-eo-summary-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.x-eo-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
}

.x-eo-summary-item span {
    color: #8ea6c8;
    font-weight: 700;
    font-size: .9rem;
}

.x-eo-summary-item strong {
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
}

.x-eo-pay-progress__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    color: #dce8ff;
    font-size: .88rem;
}

.x-order-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    margin-bottom: 8px;
}

.x-order-progress__bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #22d3ee);
    transition: width .22s ease;
}

.x-order-progress__text {
    color: #92a8c9;
    font-size: .84rem;
}

.x-is-green {
    color: #34d399 !important;
}

.x-is-orange {
    color: #fb923c !important;
}

/* =========================================================
   GALERÍA EVIDENCIAS
========================================================= */
.x-eo-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-height: 180px;
}

.x-ord-media-card {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    text-decoration: none;
}

.x-ord-media-card__img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.x-ord-media-card__footer {
    padding: 10px 12px;
    color: #dce8ff;
    font-size: .8rem;
    font-weight: 700;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.x-ord-media-card--firma .x-ord-media-card__img {
    object-fit: contain;
    background: #fff;
}

/* =========================================================
   CHECKLIST EDITABLE
========================================================= */
.x-eo-check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    min-height: 160px;
}

.x-eo-check-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    transition: all .16s ease;
}

.x-eo-check-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .14);
}

.x-eo-check-tile__name {
    color: #f3f7ff;
    font-weight: 800;
    font-size: .92rem;
    line-height: 1.3;
}

.x-eo-check-tile__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 1.05rem;
}

.x-eo-check-tile.is-neutral .x-eo-check-tile__icon {
    background: #475569;
    color: #fff;
}

.x-eo-check-tile.is-ok .x-eo-check-tile__icon {
    background: #22c55e;
    color: #fff;
}

.x-eo-check-tile.is-bad .x-eo-check-tile__icon {
    background: #ef4444;
    color: #fff;
}

/* =========================================================
   HISTORIAL / TIMELINE
========================================================= */
.x-order-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
}

.x-order-time-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding-left: 12px;
}

.x-order-time-item__line {
    position: absolute;
    left: 18px;
    top: 18px;
    bottom: -18px;
    width: 2px;
    background: rgba(255, 255, 255, .08);
}

.x-order-time-item:last-child .x-order-time-item__line {
    display: none;
}

.x-order-time-item__dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    background: #60a5fa;
    margin-top: 8px;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, .12);
}

.x-order-time-item__content {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    border-radius: 16px;
    padding: 12px;
}

.x-order-time-item__top {
    margin-bottom: 8px;
}

.x-order-time-item__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.x-order-time-item__meta strong {
    color: #fff;
    font-size: .88rem;
}

.x-order-time-item__meta span {
    color: #8ea6c8;
    font-size: .78rem;
}

.x-order-time-item__note {
    color: #cfe0ff;
    font-size: .84rem;
    line-height: 1.45;
}

/* =========================================================
   REFACCIONES / ABONOS
========================================================= */
#editOrdenRefaccionesWrap,
#editOrdenAbonosWrap {
    min-height: 160px;
}

.x-ord-ref-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
}

.x-ord-ref-card+.x-ord-ref-card {
    margin-top: 12px;
}

.x-ord-ref-card__main {
    flex: 1;
}

.x-ord-ref-card__name {
    font-size: .98rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.x-ord-ref-card__meta {
    color: #9db1cf;
    font-size: .84rem;
    line-height: 1.45;
}

.x-ord-ref-card__totals {
    display: flex;
    gap: 18px;
    text-align: right;
}

.x-ord-ref-card__totals div {
    min-width: 90px;
}

.x-ord-ref-card__totals span {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    color: #92a8c9;
    font-weight: 800;
}

.x-ord-ref-card__totals strong {
    display: block;
    color: #fff;
    font-size: .95rem;
    margin-top: 2px;
}

/* =========================================================
   UTILIDADES
========================================================= */
.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1400px) {
    .x-eo-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .x-eo-check-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .x-edit-order-grid {
        grid-template-columns: 1fr;
    }

    .x-edit-order-span-2,
    .x-edit-order-span-3 {
        grid-column: auto;
    }

    .x-eo-grid--2,
    .x-eo-grid--4 {
        grid-template-columns: 1fr;
    }

    .x-eo-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .x-action-span-2 {
        grid-column: span 2;
    }

    .x-eo-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .x-eo-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .x-edit-order-page {
        padding: 1rem !important;
    }

    .x-edit-order-title {
        font-size: 1.7rem;
    }

    .x-eo-actions-grid {
        grid-template-columns: 1fr;
    }

    .x-action-span-2 {
        grid-column: auto;
    }

    .x-eo-check-grid,
    .x-eo-gallery {
        grid-template-columns: 1fr;
    }

    .x-ord-ref-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .x-ord-ref-card__totals {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }
}


/* BASE (mobile first) */
.x-edit-order-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    /* 📱 1 columna */
    gap: 18px;
    align-items: stretch;
}

/* 📱 Tablet (>= 768px) → 2 columnas */
@media (min-width: 768px) {
    .x-edit-order-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 💻 Desktop (>= 1200px) → 3 columnas */
@media (min-width: 1200px) {
    .x-edit-order-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .x-edit-order-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ordenes-v3-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ordenes-v3-card>*:last-child {
    flex: 1;
}

/* textarea con icono arriba */
.x-input-group--textarea {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
}

.x-input-group--textarea .x-input-icon {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.x-input-group--textarea textarea {
    width: 100%;
    min-height: 90px;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    resize: vertical;
    outline: none;
}

/* resumen tipo dashboard */
.x-eo-summary-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.x-eo-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
}

.x-eo-summary-item span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8ea6c8;
    font-weight: 800;
}

.x-eo-summary-item i {
    font-size: .9rem;
}

.x-eo-summary-item strong {
    font-size: 1.05rem;
    font-weight: 900;
}

/* .x-eo-summary-total {
    border-color: rgba(59, 130, 246, .25);
}

.x-eo-summary-abono {
    border-color: rgba(34, 197, 94, .25);
}

.x-eo-summary-pendiente {
    border-color: rgba(251, 146, 60, .25);
} */

/* progreso mejorado */
.x-eo-pay-progress {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
}




/* =========================================================
   EVIDENCIAS / GALERÍA MEJORADA
========================================================= */
.x-eo-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    min-height: 180px;
}

.x-eo-media-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    transition: all .18s ease;
}

.x-eo-media-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
}

.x-eo-media-card__preview {
    position: relative;
    height: 180px;
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
}

.x-eo-media-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.x-eo-media-card--firma .x-eo-media-card__preview {
    background: #fff;
}

.x-eo-media-card--firma .x-eo-media-card__preview img {
    object-fit: contain;
    padding: 8px;
}

.x-eo-media-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.x-eo-media-card__label {
    color: #eaf2ff;
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.3;
    word-break: break-word;
}

.x-eo-media-card__meta {
    color: #8ea6c8;
    font-size: .74rem;
}

.x-eo-media-card__delete {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 3;

    /* base glass neutro */
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255, 255, 255, .08);
    color: #fff;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, .25),
        inset 0 1px 0 rgba(255, 255, 255, .12);

    transition: all .16s ease;
}



.x-eo-media-card__delete:hover {
    background: linear-gradient(180deg,
            rgba(239, 68, 68, .95),
            rgba(220, 38, 38, .95));
}

.x-eo-media-card__delete:active {
    transform: scale(.96);
}

.x-eo-media-card:hover .x-eo-media-card__delete {
    opacity: 1;
}

.x-eo-media-card__delete {
    opacity: .92;
}



.x-eo-media-add {
    min-height: 236px;
    border-radius: 18px;
    border: 1px dashed rgba(59, 130, 246, .30);
    background: rgba(59, 130, 246, .06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 20px;
    cursor: pointer;
    transition: all .18s ease;
}

.x-eo-media-add:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, .46);
    background: rgba(59, 130, 246, .10);
}

.x-eo-media-add__icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, .16);
    color: #dce8ff;
    font-size: 1.2rem;
}

.x-eo-media-add__title {
    color: #fff;
    font-weight: 900;
    font-size: .95rem;
}

.x-eo-media-add__text {
    color: #8ea6c8;
    font-size: .84rem;
    max-width: 210px;
}

/* =========================================================
   MODAL VISOR / CARRUSEL
========================================================= */
.x-eo-viewer-modal {
    background: linear-gradient(180deg, rgba(10, 18, 40, .98), rgba(5, 12, 30, .98));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 22px;
    overflow: hidden;
}

.x-eo-viewer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.x-eo-viewer-top__title {
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
}

.x-eo-viewer-close {
    border: none;
    background: transparent;
    color: #dbe7ff;
    font-size: 1.8rem;
    line-height: 1;
}

.x-eo-viewer-body {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 10px;
    padding: 18px;
}

.x-eo-viewer-stage {
    min-height: 68vh;
    border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.x-eo-viewer-stage img {
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
}

.x-eo-viewer-nav {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.x-eo-viewer-nav:hover {
    background: rgba(255, 255, 255, .14);
}

.x-eo-viewer-footer {
    padding: 0 18px 16px;
    text-align: center;
    color: #9fb2d0;
    font-size: .86rem;
    font-weight: 700;
}

@media (max-width: 1200px) {
    .x-eo-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .x-eo-media-grid {
        grid-template-columns: 1fr;
    }

    .x-eo-viewer-body {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        padding: 12px;
    }

    .x-eo-viewer-stage {
        min-height: 50vh;
    }

    .x-eo-viewer-stage img {
        max-height: 50vh;
    }
}

.x-eo-media-card__index {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: .75rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    z-index: 2;
}

.x-eo-media-card__index {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .70);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: .74rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    z-index: 2;
    box-shadow:
        0 6px 18px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .10);
}

.x-eo-media-card--sortable {
    cursor: grab;
}

.x-eo-media-card--sortable:active {
    cursor: grabbing;
}

.x-eo-media-card--ghost {
    opacity: .35;
}

.x-eo-media-card--chosen {
    transform: scale(1.02);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .28);
}

.x-eo-media-card--drag {
    transform: rotate(1deg);
}

/* =========================================
   OVERLAY HOVER (VER IMAGEN) + ANIMACIÓN
========================================= */

.x-eo-media-card__preview {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.x-eo-media-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .28s ease, filter .28s ease;
}

/* overlay oscuro */
.x-eo-media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .26);
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);

    transition:
        opacity .22s ease,
        backdrop-filter .22s ease,
        -webkit-backdrop-filter .22s ease,
        background .22s ease;
}

/* botón ojo */
.x-eo-media-eye {
    width: 52px;
    height: 52px;
    border-radius: 999px;

    display: grid;
    place-items: center;

    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255, 255, 255, .10);
    color: #fff;
    font-size: 1.1rem;

    opacity: 0;
    transform: translateY(10px) scale(.86);
    transition:
        transform .24s cubic-bezier(.2, .8, .2, 1),
        opacity .24s ease,
        background .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;

    box-shadow:
        0 10px 28px rgba(0, 0, 0, .35),
        inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* hover general */
.x-eo-media-card__preview:hover img {
    transform: scale(1.04);
    filter: brightness(.88);
}

.x-eo-media-card__preview:hover .x-eo-media-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, .34);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.x-eo-media-card__preview:hover .x-eo-media-eye {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* hover del ojo */


.x-eo-media-eye i {
    opacity: .95;
    transform: translateY(1px);
}

/* Modal visor: animación suave */
#modalEvidenciasOrden .modal-dialog {
    transform: scale(.96);
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
}

#modalEvidenciasOrden.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.x-eo-viewer-stage img {
    animation: xEoViewerFade .22s ease;
}

@keyframes xEoViewerFade {
    from {
        opacity: 0;
        transform: scale(.985);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.x-eo-viewer-stage {
    position: relative;
}

.x-eo-viewer-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #dbe7ff;
    font-size: .95rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .02);
}

.x-eo-viewer-stage.is-loading::after {
    content: "Cargando imagen...";
    display: flex;
}

.x-eo-viewer-stage.is-error::after {
    content: "No se pudo cargar la imagen";
    display: flex;
}

/* =========================================
   MINIATURAS DEL VISOR
========================================= */
.x-eo-viewer-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 18px 18px;
    scrollbar-width: thin;
}

.x-eo-viewer-thumbs::-webkit-scrollbar {
    height: 8px;
}

.x-eo-viewer-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
}

.x-eo-viewer-thumb {
    width: 100px;
    min-width: 84px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    transition: all .16s ease;
    opacity: .72;
}

.x-eo-viewer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.x-eo-viewer-thumb:hover {
    opacity: 1;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .18);
}

.x-eo-viewer-thumb.is-active {
    opacity: 1;
    border-color: rgba(59, 130, 246, .7);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .18);
}

.x-eo-viewer-thumb--firma img {
    object-fit: contain;
    background: #fff;
}








/* =========================================================
   REFACCIONES - BUSCADOR TIPO VENTAS
========================================================= */
.x-ref-search-box {
    margin-bottom: 14px;
}

.x-ref-search-input {
    display: flex;
    align-items: center;
    min-height: 58px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(59, 130, 246, .22);
    overflow: hidden;
}

.x-ref-search-input:focus-within {
    border-color: rgba(59, 130, 246, .45);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .10);
}

.x-ref-search-icon {
    width: 58px;
    min-width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8ea6c8;
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.x-ref-search-input .form-control {
    height: 58px;
    border: none !important;
    background: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
    font-size: 1rem;
}

.x-ref-search-input .form-control::placeholder {
    color: #7f93af !important;
}

.x-ref-search-btn {
    width: 58px;
    min-width: 58px;
    height: 58px;
    border: none;
    background: rgba(255, 255, 255, .03);
    color: #dce8ff;
    border-left: 1px solid rgba(255, 255, 255, .06);
}

.x-ref-search-help {
    margin-top: 8px;
    color: #8ea6c8;
    font-size: .84rem;
}

.x-ref-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 12px;
    color: #dce8ff;
    font-size: .85rem;
    font-weight: 900;
    text-transform: uppercase;
}

.x-ref-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.x-ref-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 110px 140px 140px;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
}

.x-ref-card__img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-ref-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.x-ref-card__info {
    min-width: 0;
}

.x-ref-card__title {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 4px;
}

.x-ref-card__code {
    color: #8ea6c8;
    font-size: .86rem;
}

.x-ref-card__price {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    text-align: center;
}

.x-ref-card__stock {
    display: flex;
    justify-content: center;
}

.x-ref-stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-weight: 900;
    font-size: .9rem;
    border: 1px solid rgba(255, 255, 255, .08);
}

.x-ref-stock-pill--ok {
    background: rgba(16, 185, 129, .10);
    border-color: rgba(16, 185, 129, .25);
    color: #6ee7b7;
}

.x-ref-stock-pill--bad {
    background: rgba(239, 68, 68, .10);
    border-color: rgba(239, 68, 68, .25);
    color: #fca5a5;
}

.x-ref-card__action {
    display: flex;
    justify-content: flex-end;
}

.x-ref-add-btn {
    min-width: 130px;
    height: 42px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.x-ref-add-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 992px) {
    .x-ref-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .x-ref-card__price,
    .x-ref-card__stock,
    .x-ref-card__action {
        grid-column: 2;
        justify-content: flex-start;
        text-align: left;
    }
}




.x-ref-modal-grid {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: 18px;
    align-items: start;
}

.x-ref-left,
.x-ref-right {
    min-width: 0;
}

.x-ref-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
}

.x-ref-cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
}

.x-ref-cart-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 90px 120px 0px 0px;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
}

.x-ref-cart-remove {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #c81d4f, #991b3f);
    color: #fff;
    font-size: 1rem;
}

.x-ref-cart-info {
    min-width: 0;
}

.x-ref-cart-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 4px;
}

.x-ref-cart-meta {
    color: #8ea6c8;
    font-size: .84rem;
}

.x-ref-cart-box label {
    display: block;
    margin-bottom: 6px;
    font-size: .72rem;
    text-transform: uppercase;
    color: #8ea6c8;
    font-weight: 800;
}

.x-ref-cart-box input {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 14px;
    background: rgba(37, 99, 235, .18);
    color: #fff;
    text-align: center;
    font-weight: 900;
}

.x-ref-cart-subtotal {
    text-align: right;
}

.x-ref-cart-subtotal label {
    display: block;
    margin-bottom: 6px;
    font-size: .72rem;
    text-transform: uppercase;
    color: #8ea6c8;
    font-weight: 800;
}

.x-ref-cart-subtotal strong {
    display: block;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
}

.x-ref-total-box {
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(37, 99, 235, .12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.x-ref-total-box__label {
    color: #dce8ff;
    font-weight: 800;
}

.x-ref-total-box__value {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
}

@media (max-width: 1200px) {
    .x-ref-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .x-ref-cart-item {
        grid-template-columns: 1fr;
    }

    .x-ref-cart-subtotal {
        text-align: left;
    }
}


/* modal más grande para refacciones */
.x-ref-modal-dialog {
    width: min(96vw, 1500px);
    max-width: 1500px;
    margin: 1rem auto;
}

#modalRefaccionOrden .modal-content {
    min-height: 88vh;
    max-height: 92vh;
    border-radius: 24px;
    overflow: hidden;
}

/* más espacio interno */
/* #modalRefaccionOrden .p-3 {
    padding: 1.25rem 1.5rem !important;
} */

/* grid un poco más ancho */
.x-ref-modal-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 22px;
    align-items: start;
}

/* resultados y carrito más altos */
.x-ref-results {
    max-height: 62vh;
    overflow: auto;
}

.x-ref-cart-list {
    max-height: 62vh;
    overflow: auto;
}

/* modal responsive */
@media (max-width: 1200px) {
    .x-ref-modal-dialog {
        width: min(98vw, 1200px);
        max-width: 1200px;
    }

    .x-ref-modal-grid {
        grid-template-columns: 1fr;
    }

    #modalRefaccionOrden .modal-content {
        min-height: auto;
        max-height: 94vh;
    }

    .x-ref-results,
    .x-ref-cart-list {
        max-height: 42vh;
    }
}

@media (max-width: 768px) {
    .x-ref-modal-dialog {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
    }

    #modalRefaccionOrden .modal-content {
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    #modalRefaccionOrden .p-3 {
        padding: 1rem !important;
    }
}

.x-ord-ref-card--compact {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
}

.x-ord-ref-card__media {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.x-ord-ref-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.x-ord-ref-card__main {
    min-width: 0;
}

.x-ord-ref-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.x-ord-ref-card__name {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.15;
    word-break: break-word;
}

.x-ord-ref-card__meta {
    color: #9bb0cf;
    font-size: .95rem;
    line-height: 1.35;
}

.x-ord-ref-card__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.x-ord-ref-card__actions .btn {
    min-width: 46px;
    height: 46px;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .x-ord-ref-card--compact {
        grid-template-columns: 60px minmax(0, 1fr) auto;
        gap: 12px;
        padding: 14px;
    }

    .x-ord-ref-card__media {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .x-ord-ref-card__name {
        font-size: 1rem;
    }

    .x-ord-ref-card__meta {
        font-size: .88rem;
    }
}

.x-btn-delete-ref {
    width: 46px;
    height: 46px;
    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);

    color: #ff6b6b;

    transition: all .18s ease;
    backdrop-filter: blur(6px);
}

/* Hover elegante */
.x-btn-delete-ref:hover {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 80, 80, 0.25);
    color: #ff4d4d;

    transform: scale(1.05);
}

/* Click */
.x-btn-delete-ref:active {
    transform: scale(.92);
}

/* Icono */
.x-btn-delete-ref i {
    font-size: 15px;
    color: #fff;
}



.x-resumen-economico-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.x-resumen-economico-item {
    min-height: 56px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    border-radius: 18px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all .18s ease;
}

.x-resumen-economico-item__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #9fb1cc;
    font-weight: 800;
    font-size: .98rem;
}

.x-resumen-economico-item__left i {
    color: #8ea6c8;
    font-size: .92rem;
    flex-shrink: 0;
}

.x-resumen-economico-item__left span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.x-resumen-economico-item__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 110px;
}

.x-resumen-economico-item__value {
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    white-space: nowrap;
}

.x-resumen-economico-item__input {
    width: 130px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    text-align: right;
    padding: 0 12px;
    outline: none;
    box-shadow: none;
}

.x-resumen-economico-item__input:focus {
    border-color: rgba(59, 130, 246, .35);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .10);
}

.x-resumen-economico-item--editable {
    cursor: pointer;
}

.x-resumen-economico-item--editable:hover {
    border-color: rgba(59, 130, 246, .22);
    background: rgba(59, 130, 246, .06);
}

.x-resumen-economico-item.is-editing {
    border-color: rgba(59, 130, 246, .32);
    background: rgba(59, 130, 246, .08);
}

.x-resumen-total-final {
    min-height: 74px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    border-radius: 20px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.x-resumen-total-final span {
    color: #dce8ff;
    font-size: 1rem;
    font-weight: 800;
}

.x-resumen-total-final strong {
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

@media (max-width: 768px) {
    .x-resumen-economico-grid {
        grid-template-columns: 1fr;
    }

    .x-resumen-economico-item {
        min-height: 54px;
        padding: 0 14px;
    }

    .x-resumen-economico-item__input {
        width: 110px;
    }

    .x-resumen-total-final strong {
        font-size: 1.5rem;
    }
}


/* CONTENEDOR SCROLL */
.x-abonos-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;

    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, .35) transparent;
}

/* ===== SCROLL CHROME / EDGE / SAFARI ===== */
.x-abonos-scroll::-webkit-scrollbar {
    width: 8px;
}

.x-abonos-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.x-abonos-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
            rgba(59, 130, 246, .45),
            rgba(16, 185, 129, .45));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

/* HOVER (🔥 se siente premium) */
.x-abonos-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
            rgba(59, 130, 246, .75),
            rgba(16, 185, 129, .75));
}

/* SCROLL MÁS SUAVE */
.x-abonos-scroll {
    scroll-behavior: smooth;
}


.x-skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .06);
}

.x-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, .10),
            transparent);
    animation: xSkeletonMove 1.2s infinite;
}

@keyframes xSkeletonMove {
    100% {
        transform: translateX(100%);
    }
}

/* =========================================================
   HISTORIAL RESUMEN TOP
========================================================= */

.x-history-top-summary {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
    border-radius: 22px;
    border: 1px solid rgba(159, 176, 208, .10);
    background:
        radial-gradient(circle at top left, rgba(47, 107, 255, .08), transparent 32%),
        linear-gradient(180deg, rgba(11, 26, 54, .90), rgba(8, 19, 42, .96));
    overflow: hidden;
}

.x-history-top-summary__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    border-right: 1px solid rgba(159, 176, 208, .10);
}

.x-history-progress-ring {
    --progress: 0;
    width: 126px;
    height: 126px;
    border-radius: 50%;
    background:
        conic-gradient(#3b82f6 calc(var(--progress) * 1%), rgba(255, 255, 255, .06) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.x-history-progress-ring::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(10, 25, 54, .98), rgba(8, 19, 42, .98));
    border: 1px solid rgba(159, 176, 208, .08);
}

.x-history-progress-ring__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.x-history-progress-ring__inner strong {
    font-size: 20px;
    font-weight: 900;
    color: #F5F7FB;
    line-height: 1;
}

.x-history-progress-ring__inner span {
    margin-top: 6px;
    font-size: 12px;
    color: #9FB0D0;
    font-weight: 700;
}

.x-history-top-summary__timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 24px 22px;
}

.x-history-step {
    flex: 1;
    min-width: 0;
}

.x-history-step__head {
    display: flex;
    align-items: center;
    width: 106%;
    margin-left: 4px;
}

.x-history-step__icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(159, 176, 208, .12);
    color: #8FA3C4;
    font-size: 18px;
    position: relative;
    z-index: 2;
}

.x-history-step__line {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    margin-left: -2px;
    background: rgba(255, 255, 255, .08);
}

.x-history-step__body {
    margin-top: 12px;
}

.x-history-step__label {
    font-size: 15px;
    font-weight: 850;
    color: #D7E3F8;
}

.x-history-step__time {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #9FB0D0;
    line-height: 1.35;
}

.x-history-step.is-done .x-history-step__icon {
    background: rgba(59, 130, 246, .14);
    border-color: rgba(96, 165, 250, .30);
    color: #60A5FA;
}

.x-history-step.is-done .x-history-step__line {
    background: linear-gradient(90deg, #3b82f6, #22d3ee);
}

.x-history-step.is-current .x-history-step__icon {
    background: linear-gradient(180deg, #2F6BFF, #1D4ED8);
    border-color: rgba(147, 197, 253, .55);
    color: #fff;
    box-shadow:
        0 0 0 6px rgba(47, 107, 255, .12),
        0 0 24px rgba(47, 107, 255, .28);
}

.x-history-step.is-current .x-history-step__label {
    color: #60A5FA;
}

.x-history-step.is-pending .x-history-step__icon {
    color: #64748B;
    background: rgba(255, 255, 255, .035);
}

/* =========================================================
   HISTORIAL VERTICAL
========================================================= */

.x-history-v3 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.x-history-v3__item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    position: relative;
}

.x-history-v3__rail {
    position: relative;
    display: flex;
    justify-content: center;
}

.x-history-v3__rail::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: -16px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(59, 130, 246, .30), rgba(59, 130, 246, .08));
}

.x-history-v3__item:last-child .x-history-v3__rail::before {
    bottom: 50%;
}

.x-history-v3__dot {
    position: relative;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1E3A68;
    border: 1px solid rgba(96, 165, 250, .35);
    box-shadow: 0 0 0 5px rgba(96, 165, 250, .08);
}

.x-history-v3__dot i {
    font-size: 8px;
    color: #60A5FA;
}

.x-history-v3__dot.is-current {
    width: 24px;
    height: 24px;
    margin-top: 20px;
    background: linear-gradient(180deg, #2F6BFF, #1D4ED8);
    border-color: rgba(147, 197, 253, .55);
    box-shadow:
        0 0 0 8px rgba(47, 107, 255, .10),
        0 0 24px rgba(47, 107, 255, .24);
}

.x-history-v3__dot.is-current i {
    color: #fff;
    font-size: 10px;
}

.x-history-v3__card {
    border-radius: 22px;
    border: 1px solid rgba(159, 176, 208, .10);
    background:
        radial-gradient(circle at top left, rgba(47, 107, 255, .06), transparent 35%),
        linear-gradient(180deg, rgba(11, 26, 54, .90), rgba(8, 19, 42, .96));
    padding: 16px 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
    transition: .18s ease;
}

.x-history-v3__card.is-current {
    border-color: rgba(96, 165, 250, .34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .05),
        0 0 0 1px rgba(47, 107, 255, .05),
        0 10px 32px rgba(0, 0, 0, .16);
}

.x-history-v3__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.x-history-v3__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.x-history-v3__actual-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(47, 107, 255, .14);
    border: 1px solid rgba(96, 165, 250, .26);
    color: #9CC3FF;
    font-size: 12px;
    font-weight: 800;
}

.x-history-v3__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: #9FB0D0;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
}

.x-history-v3__meta strong {
    color: #F5F7FB;
    font-size: 14px;
    font-weight: 850;
}

.x-history-v3__note {
    color: #D7E3F8;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
}

.x-history-v3__note.is-muted {
    color: #8FA3C4;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 980px) {
    .x-history-top-summary {
        grid-template-columns: 1fr;
    }

    .x-history-top-summary__progress {
        border-right: 0;
        border-bottom: 1px solid rgba(159, 176, 208, .10);
    }

    .x-history-top-summary__timeline {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 18px;
    }

    .x-history-step {
        min-width: 180px;
    }
}



/* =========================================================
   COLORES FIJOS DEL TIMELINE SUPERIOR
========================================================= */

/* RECIBIDO = ROJO */
.x-history-step--recibido.is-done .x-history-step__icon,
.x-history-step--recibido.is-current .x-history-step__icon {
    background: rgba(239, 68, 68, .14);
    border-color: rgba(248, 113, 113, .34);
    color: #f87171;
}

.x-history-step--recibido.is-current .x-history-step__icon {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow:
        0 0 0 6px rgba(239, 68, 68, .10),
        0 0 24px rgba(239, 68, 68, .22);
}

.x-history-step--recibido.is-done .x-history-step__label,
.x-history-step--recibido.is-current .x-history-step__label {
    color: #f87171;
}

.x-history-step--recibido.is-done .x-history-step__line {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

/* DIAGNÓSTICO = MORADO */
.x-history-step--diagnostico.is-done .x-history-step__icon,
.x-history-step--diagnostico.is-current .x-history-step__icon {
    background: rgba(139, 92, 246, .16);
    border-color: rgba(167, 139, 250, .34);
    color: #a78bfa;
}

.x-history-step--diagnostico.is-current .x-history-step__icon {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
    color: #fff;
    box-shadow:
        0 0 0 6px rgba(139, 92, 246, .10),
        0 0 24px rgba(139, 92, 246, .24);
}

.x-history-step--diagnostico.is-done .x-history-step__label,
.x-history-step--diagnostico.is-current .x-history-step__label {
    color: #a78bfa;
}

.x-history-step--diagnostico.is-done .x-history-step__line {
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

/* REPARADO = AZUL */
.x-history-step--reparado.is-done .x-history-step__icon,
.x-history-step--reparado.is-current .x-history-step__icon {
    background: rgba(59, 130, 246, .16);
    border-color: rgba(96, 165, 250, .34);
    color: #60a5fa;
}

.x-history-step--reparado.is-current .x-history-step__icon {
    background: linear-gradient(180deg, #2F6BFF, #1D4ED8);
    color: #fff;
    box-shadow:
        0 0 0 6px rgba(47, 107, 255, .12),
        0 0 24px rgba(47, 107, 255, .28);
}

.x-history-step--reparado.is-done .x-history-step__label,
.x-history-step--reparado.is-current .x-history-step__label {
    color: #60a5fa;
}

.x-history-step--reparado.is-done .x-history-step__line {
    background: linear-gradient(90deg, #3b82f6, #22d3ee);
}

/* ENTREGADO = VERDE */
.x-history-step--entregado.is-done .x-history-step__icon,
.x-history-step--entregado.is-current .x-history-step__icon {
    background: rgba(16, 185, 129, .16);
    border-color: rgba(52, 211, 153, .34);
    color: #34d399;
}

.x-history-step--entregado.is-current .x-history-step__icon {
    background: linear-gradient(180deg, #10b981, #059669);
    color: #fff;
    box-shadow:
        0 0 0 6px rgba(16, 185, 129, .10),
        0 0 24px rgba(16, 185, 129, .24);
}

.x-history-step--entregado.is-done .x-history-step__label,
.x-history-step--entregado.is-current .x-history-step__label {
    color: #34d399;
}

/* =============================================
   HISTORIAL - SOLO 4 ITEMS VISIBLES + SCROLL
============================================= */

#editOrdenHistorialWrap {
    max-height: 620px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

/* Scroll estilo Xpertech */
#editOrdenHistorialWrap::-webkit-scrollbar {
    width: 7px;
}

#editOrdenHistorialWrap::-webkit-scrollbar-track {
    background: transparent;
}

#editOrdenHistorialWrap::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, .22);
    border-radius: 999px;
}

#editOrdenHistorialWrap::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, .38);
}

.x-history-status--diagnostico {
    background: rgba(139, 92, 246, .16) !important;
    color: #C4B5FD !important;
    border: 1px solid rgba(167, 139, 250, .28) !important;
}

.x-history-status--diagnostico i {
    color: #A78BFA !important;
}

/* =============================================
   SWAL CAMBIO ESTADO ORDEN
============================================= */

.x-sw-orden-popup {
    width: 640px !important;
    max-width: 94vw !important;
    border: 1px solid rgba(96, 165, 250, .14) !important;
    border-radius: 28px !important;
    overflow: hidden !important;
    background:
        radial-gradient(circle at top right, rgba(47, 107, 255, .22), transparent 28%),
        radial-gradient(circle at top left, rgba(14, 165, 233, .10), transparent 22%),
        linear-gradient(180deg, rgba(4, 15, 36, .96), rgba(3, 10, 24, .98)) !important;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .46),
        inset 0 1px 0 rgba(255, 255, 255, .04) !important;
    padding: 0 !important;
}

.x-sw-orden-html {
    margin: 0 !important;
    padding: 0 !important;
    color: #EAF2FF !important;
    text-align: left !important;
}

.x-sw-orden-shell {
    padding: 24px 24px 18px;
}

.x-sw-orden-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.x-sw-orden-head__icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, .32), transparent 55%),
        rgba(15, 23, 42, .88);
    border: 1px solid rgba(96, 165, 250, .18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.x-sw-orden-head__icon i {
    font-size: 22px;
    color: #60A5FA;
}

.x-sw-orden-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 900;
    color: #F8FBFF;
}

.x-sw-orden-subtitle {
    margin: 5px 0 0;
    color: #93A8C7;
    font-size: 13px;
    line-height: 1.45;
}

.x-sw-orden-meta {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.x-sw-orden-meta__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(10, 22, 48, .58);
    border: 1px solid rgba(148, 163, 184, .12);
}

.x-sw-orden-meta__item span {
    font-size: 12px;
    color: #97ACCA;
    font-weight: 700;
}

.x-sw-orden-meta__item strong {
    font-size: 13px;
    color: #F3F7FF;
    font-weight: 900;
}

.x-sw-orden-meta__alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 16px;
    background: rgba(245, 158, 11, .10);
    border: 1px solid rgba(245, 158, 11, .20);
    color: #FBBF24;
    font-size: 13px;
    font-weight: 800;
}

.x-sw-orden-section {
    margin-bottom: 14px;
}

.x-sw-orden-section--tight {
    margin-bottom: 12px;
}

.x-sw-label {
    display: block;
    margin-bottom: 8px;
    color: #E8F1FF;
    font-weight: 850;
    font-size: 14px;
}

.x-sw-label small {
    color: #97ACCA;
    font-weight: 600;
    margin-left: 4px;
}

.x-sw-required {
    color: #FB7185;
}

.x-sw-control {
    width: 100% !important;
    outline: none !important;
    border-radius: 16px !important;
    border: 1px solid rgba(96, 165, 250, .14) !important;
    background: rgba(6, 18, 40, .94) !important;
    color: #F5F9FF !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03) !important;
    transition: .18s ease;
}

.x-sw-control:focus {
    border-color: rgba(96, 165, 250, .42) !important;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, .12),
        inset 0 1px 0 rgba(255, 255, 255, .03) !important;
}

.x-sw-select {
    min-height: 52px !important;
    padding: 0 16px !important;
    font-size: 15px !important;
}

.x-sw-textarea {
    min-height: 120px !important;
    padding: 14px 16px !important;
    resize: vertical !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.x-sw-textarea--garantia {
    min-height: 110px !important;
}

.x-sw-garantia {
    margin-top: 16px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, .14);
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, .10), transparent 35%),
        rgba(8, 20, 45, .72);
}

.x-sw-garantia__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #F3F8FF;
    font-weight: 900;
    font-size: 14px;
}

.x-sw-garantia__head i {
    width: 30px;
    height: 30px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, .12);
    color: #34D399;
}

.x-sw-btn {
    min-width: 132px;
    height: 46px;
    border-radius: 16px;
    border: 0;
    font-weight: 900;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .16s ease;
    margin: 0 6px;
}

.x-sw-btn--primary {
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, .34), transparent 38%),
        linear-gradient(135deg, #2563EB, #3B82F6);
    box-shadow:
        0 10px 24px rgba(37, 99, 235, .28),
        inset 0 1px 0 rgba(255, 255, 255, .16);
}

.x-sw-btn--primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.x-sw-btn--ghost {
    color: #D8E3F8;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(148, 163, 184, .16);
}

.x-sw-btn--ghost:hover {
    background: rgba(255, 255, 255, .11);
}

.swal2-actions {
    margin: 0 !important;
    padding: 0 24px 22px !important;
    justify-content: center !important;
}

.swal2-validation-message {
    margin: 12px 24px 0 !important;
    border-radius: 14px !important;
    background: rgba(239, 68, 68, .10) !important;
    color: #FCA5A5 !important;
    border: 1px solid rgba(239, 68, 68, .15) !important;
}

/* Responsive */
@media (max-width: 640px) {
    .x-sw-orden-shell {
        padding: 18px 16px 14px;
    }

    .x-sw-orden-head {
        align-items: flex-start;
    }

    .x-sw-orden-head__icon {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .x-sw-orden-title {
        font-size: 24px;
    }

    .x-sw-btn {
        min-width: 120px;
        height: 44px;
    }

    .swal2-actions {
        padding: 0 16px 18px !important;
        flex-wrap: wrap !important;
    }
}